Skip to content

Commit 4a50793

Browse files
Stabilized v1.3.4
2 parents cae5b1d + eb55b61 commit 4a50793

File tree

9 files changed

+911
-662
lines changed

9 files changed

+911
-662
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ If you have problems with starting installer.sh, you should try to use `dos2unix
169169

170170

171171
# Tasks to complete before new release
172-
- [ ] CLI rework (more fancy and user-friendly)
172+
- [x] CLI rework (more fancy and user-friendly)
173173
- [ ] Report storage database rework (more information to store)
174174
- [ ] HTML report rework (modern style and look; functionality expansion)
175175

datagather_modules/data_assembler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def data_gathering(self, short_domain, url, report_file_type, pagesearch_flag, k
121121
total_links_counter = accessed_links_counter = "No results because PageSearch does not gather these categories"
122122
print(Fore.LIGHTMAGENTA_EX + "[ENDED EXTENDED DOMAIN SCAN WITH PAGESEARCH]\n" + Style.RESET_ALL)
123123
else:
124-
print(Fore.RED + "Cant start PageSearch because no subdomains were detected")
124+
print(Fore.RED + "Cant start PageSearch because no subdomains were detected\n")
125125
accessible_subdomains = files_counter = cookies_counter = api_keys_counter = website_elements_counter = exposed_passwords_counter = total_links_counter = accessed_links_counter = emails_amount = 'No results because no subdomains were found'
126126
ps_emails_return = ""
127127
pass
@@ -215,7 +215,7 @@ def data_gathering(self, short_domain, url, report_file_type, pagesearch_flag, k
215215
keywords_messages_list = ['No keywords were found']
216216
print(Fore.LIGHTMAGENTA_EX + "[ENDED EXTENDED DOMAIN SCAN WITH PAGESEARCH]\n" + Style.RESET_ALL)
217217
else:
218-
print(Fore.RED + "Cant start PageSearch because no subdomains were detected")
218+
print(Fore.RED + "Cant start PageSearch because no subdomains were detected\n")
219219
ps_emails_return = ""
220220
accessible_subdomains = files_counter = cookies_counter = api_keys_counter = website_elements_counter = exposed_passwords_counter = total_links_counter = accessed_links_counter = emails_amount = 'No results because no subdomains were found'
221221
ps_string = 'No PageSearch listing provided because no subdomains were found'

dpulse.py

Lines changed: 424 additions & 308 deletions
Large diffs are not rendered by default.

poetry.lock

Lines changed: 398 additions & 331 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "dpulse"
7-
version = "1.3.3"
7+
version = "1.3.4"
88
description = "Convenient,fast and user-friendly collector of domain information from Open-Sources"
99
authors = ["OSINT-TECHNOLOGIES <osint.technologies@gmail.com>"]
1010
readme = "README.md"

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ MechanicalSoup==1.3.0
99
builtwith==1.3.4
1010
dnspython==2.6.1
1111
openpyxl==3.1.2
12-
PyMuPDF==1.24.7
12+
PyMuPDF==1.26.6
1313
selenium==4.28.1
1414
webdriver-manager==4.0.2
1515
undetected_chromedriver==3.5.5
16+
setuptools==80.9.0

service/cli_init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def welcome_menu(self):
3131
Text.assemble(
3232
(fig.renderText('DPULSE'), preview_style),
3333
("\n", ""),
34-
("DPULSE-CLI - v1.3.3 stable - OSINT-TECHNOLOGIES\n\n", "magenta bold"),
34+
("DPULSE-CLI - v1.3.4 stable - OSINT-TECHNOLOGIES\n\n", "magenta bold"),
3535
("Visit our pages:\n", "white"),
3636
("GitHub: ", "white"), ("https://github.com/OSINT-TECHNOLOGIES\n", "blue underline"),
3737
("PyPi: ", "white"), ("https://pypi.org/project/dpulse/\n", "blue underline"),

service/config_processing.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ def create_config():
3030
config['HTML_REPORTING'] = {'template': 'modern', 'delete_txt_files': 'n'}
3131
config['LOGGING'] = {'log_level': 'info'}
3232
config['CLI VISUAL'] = {'preview_color': 'red', 'font': 'slant'}
33-
config['DORKING'] = {'dorking_delay (secs)': '2', 'delay_step': '5', 'full_path_to_browser': r'path\to\browser\for\dorking', 'browser_mode': 'nonheadless'}
34-
config['SNAPSHOTTING'] = {'installed_browser': 'firefox', 'opera_browser_path': 'None', 'wayback_retries': '3', 'wayback_req_pause': '2'}
33+
config['DORKING'] = {'dorking_delay (secs)': '2', 'delay_step': '5',
34+
'full_path_to_browser': r'path\to\browser\for\dorking', 'browser_mode': 'nonheadless'}
35+
config['SNAPSHOTTING'] = {'installed_browser': 'firefox', 'opera_browser_path': 'None', 'wayback_retries': '3',
36+
'wayback_req_pause': '2'}
3537
config['USER-AGENTS'] = {}
3638
for i, agent in enumerate(basic_user_agents):
3739
config['USER-AGENTS'][f'agent_{i + 1}'] = agent
@@ -45,8 +47,18 @@ def check_cfg_presence():
4547
return cfg_presence
4648

4749
def read_config():
50+
if not check_cfg_presence():
51+
create_config()
52+
4853
config = configparser.ConfigParser()
4954
config.read('service//config.ini')
55+
56+
if not config.has_section('LOGGING'):
57+
config.add_section('LOGGING')
58+
config.set('LOGGING', 'log_level', 'info')
59+
with open('service//config.ini', 'w') as configfile:
60+
config.write(configfile)
61+
5062
log_level = config.get('LOGGING', 'log_level')
5163
cli_preview_color = config.get('CLI VISUAL', 'preview_color')
5264
wm_font = config.get('CLI VISUAL', 'font')
@@ -84,6 +96,8 @@ def read_config():
8496
return config_values
8597

8698
def print_and_return_config():
99+
if not check_cfg_presence():
100+
create_config()
87101
config = configparser.ConfigParser()
88102
config.read('service//config.ini')
89103
print(Fore.LIGHTMAGENTA_EX + "\n[CURRENT CONFIG CONTENT START]" + Style.RESET_ALL)

service/db_processing.py

Lines changed: 66 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
import os
33
import sqlite3
44
import sys
5+
from rich import box
6+
from rich.table import Table
7+
from rich.console import Console
58

69
sys.path.append('apis//api_keys.db')
710

11+
console = Console()
12+
813
def db_connect():
914
sqlite_connection = sqlite3.connect('report_storage.db')
1015
cursor = sqlite_connection.cursor()
@@ -44,22 +49,46 @@ def db_select():
4449
if_rows = "SELECT * FROM report_storage"
4550
cursor.execute(if_rows)
4651
rows = cursor.fetchall()
52+
data_presence_flag = False
4753
if rows:
4854
try:
4955
select_query = "SELECT creation_date, report_file_extension, target, id, comment, dorks_results, robots_text, sitemap_text, sitemap_file, api_scan FROM report_storage;"
5056
cursor.execute(select_query)
5157
records = cursor.fetchall()
52-
print(Fore.LIGHTMAGENTA_EX + "\n[DATABASE'S CONTENT]\n" + Style.RESET_ALL)
58+
table = Table(title="[white on magenta]DATABASE CONTENT[/white on magenta]", show_lines=True, border_style="magenta", box=box.ROUNDED)
59+
table.add_column("ID", style="cyan", justify="center")
60+
table.add_column("Target", style="white", justify="center")
61+
table.add_column("Extension", style="white", justify="center")
62+
table.add_column("Comment", style="white", justify="center")
63+
table.add_column("Created", style="white", justify="center")
64+
table.add_column("Dorking", style="white", justify="center")
65+
table.add_column("robots.txt", style="white", justify="center")
66+
table.add_column("sitemap.xml", style="white", justify="center")
67+
table.add_column("API scan", style="white", justify="center")
68+
5369
for row in records:
54-
dorks_presence = robots_presence = sitemap_presence = "None"
55-
if len(row[4]) > 1:
70+
dorks_presence = "None"
71+
robots_presence = "None"
72+
sitemap_presence = "None"
73+
if row[5] and len(str(row[5])) > 1:
5674
dorks_presence = "In DB"
57-
if len(row[5]) > 1:
75+
if row[6] and len(str(row[6])) > 1:
5876
robots_presence = "In DB"
59-
if len(row[6]) > 1:
77+
if row[7] and len(str(row[7])) > 1:
6078
sitemap_presence = "In DB"
61-
print(Fore.LIGHTBLUE_EX + f"Case ID: {row[3]} | Case name: {row[2]} | Case file extension: {row[1]} | Case comment: {row[4]} | Case creation date: {row[0]} | Dorking: {dorks_presence} | robots.txt: {robots_presence} | sitemap.xml: {sitemap_presence} | API scan: {row[-1]}" + Style.RESET_ALL)
79+
table.add_row(
80+
str(row[3]),
81+
str(row[2]),
82+
str(row[1]),
83+
str(row[4]),
84+
str(row[0]),
85+
dorks_presence,
86+
robots_presence,
87+
sitemap_presence,
88+
str(row[9])
89+
)
6290
data_presence_flag = True
91+
console.print(table)
6392
except sqlite3.Error as e:
6493
print(Fore.RED + "Failed to see storage database's content. Reason: {}".format(e))
6594
sqlite_connection.close()
@@ -94,10 +123,10 @@ def db_report_recreate(extracted_folder_name, id_to_extract):
94123
blob_data = blob[0]
95124
cursor.execute("SELECT report_file_extension FROM report_storage WHERE id=?", (id_to_extract,))
96125
report_file_extension = (cursor.fetchone())[0]
97-
if str(report_file_extension) == 'XLSX':
126+
if str(report_file_extension).upper() == 'XLSX':
98127
with open(extracted_folder_name + '//report_extracted.xlsx', 'wb') as file:
99128
file.write(blob_data)
100-
elif str(report_file_extension) == 'HTML':
129+
elif str(report_file_extension).upper() == 'HTML':
101130
with open(extracted_folder_name + '//report_extracted.html', 'wb') as file:
102131
file.write(blob_data)
103132
cursor.execute("SELECT dorks_results FROM report_storage WHERE id=?", (id_to_extract,))
@@ -120,7 +149,7 @@ def db_report_recreate(extracted_folder_name, id_to_extract):
120149
except Exception as e:
121150
print(Fore.RED + "Error appeared when recreating report from database. Reason: {}".format(e))
122151

123-
def insert_blob(report_file_type, pdf_blob, db_casename, creation_date, case_comment, robots, sitemap_xml, sitemap_links, dorking_results, api_scan_db):
152+
def insert_blob(report_file_type, pdf_blob, db_casename, creation_date, case_comment, robots, sitemap_xml, sitemap_links, dorking_results, api_scan_db):
124153
try:
125154
sqlite_connection = sqlite3.connect('report_storage.db')
126155
cursor = sqlite_connection.cursor()
@@ -163,14 +192,36 @@ def select_api_keys(mode):
163192
cursor = conn.cursor()
164193
cursor.execute("SELECT id, api_name, api_key, limitations FROM api_keys")
165194
rows = cursor.fetchall()
166-
for row in rows:
167-
if row[2] != 'YOUR_API_KEY':
168-
print(Fore.LIGHTBLUE_EX + f"ID: {row[0]} | API Name: {row[1]} | API Key: {row[2]} | Limitations: {row[3]}\n" + Style.RESET_ALL)
169-
else:
170-
print(Fore.LIGHTBLUE_EX + f"ID: {row[0]} | API Name: {row[1]} | " + Style.RESET_ALL + Fore.RED + f"API Key: {row[2]} " + Fore.LIGHTBLUE_EX + f"| Limitations: {row[3]}\n" + Style.RESET_ALL)
195+
console = Console()
196+
if rows:
197+
try:
198+
table = Table(
199+
title="[white on magenta]SUPPORTED API AND YOUR KEYS[/white on magenta]",
200+
show_lines=True,
201+
border_style="magenta",
202+
box=box.ROUNDED
203+
)
204+
table.add_column("ID", style="cyan", justify="center")
205+
table.add_column("API Name", style="white", justify="center")
206+
table.add_column("API Key", style="white", justify="center")
207+
table.add_column("Limitations", style="white", justify="center")
208+
for row in rows:
209+
api_key = f"[red]{row[2]}[/red]" if row[2] == "YOUR_API_KEY" else str(row[2])
210+
table.add_row(
211+
str(row[0]),
212+
str(row[1]),
213+
api_key,
214+
str(row[3])
215+
)
216+
console.print(table)
217+
except sqlite3.Error as e:
218+
print(Fore.RED + "Failed to see API keys database's content. Reason: {}".format(e))
219+
conn.close()
220+
else:
221+
print(Fore.RED + 'No data found in API keys database')
222+
conn.close()
171223
if mode == 'printing':
172224
conn.close()
173225
return None
174226
else:
175-
pass
176227
return cursor, conn

0 commit comments

Comments
 (0)