Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ If you have problems with starting installer.sh, you should try to use `dos2unix


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

Expand Down
4 changes: 2 additions & 2 deletions datagather_modules/data_assembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def data_gathering(self, short_domain, url, report_file_type, pagesearch_flag, k
total_links_counter = accessed_links_counter = "No results because PageSearch does not gather these categories"
print(Fore.LIGHTMAGENTA_EX + "[ENDED EXTENDED DOMAIN SCAN WITH PAGESEARCH]\n" + Style.RESET_ALL)
else:
print(Fore.RED + "Cant start PageSearch because no subdomains were detected")
print(Fore.RED + "Cant start PageSearch because no subdomains were detected\n")
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'
ps_emails_return = ""
pass
Expand Down Expand Up @@ -215,7 +215,7 @@ def data_gathering(self, short_domain, url, report_file_type, pagesearch_flag, k
keywords_messages_list = ['No keywords were found']
print(Fore.LIGHTMAGENTA_EX + "[ENDED EXTENDED DOMAIN SCAN WITH PAGESEARCH]\n" + Style.RESET_ALL)
else:
print(Fore.RED + "Cant start PageSearch because no subdomains were detected")
print(Fore.RED + "Cant start PageSearch because no subdomains were detected\n")
ps_emails_return = ""
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'
ps_string = 'No PageSearch listing provided because no subdomains were found'
Expand Down
732 changes: 424 additions & 308 deletions dpulse.py

Large diffs are not rendered by default.

729 changes: 398 additions & 331 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "dpulse"
version = "1.3.3"
version = "1.3.4"
description = "Convenient,fast and user-friendly collector of domain information from Open-Sources"
authors = ["OSINT-TECHNOLOGIES <osint.technologies@gmail.com>"]
readme = "README.md"
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ MechanicalSoup==1.3.0
builtwith==1.3.4
dnspython==2.6.1
openpyxl==3.1.2
PyMuPDF==1.24.7
PyMuPDF==1.26.6
selenium==4.28.1
webdriver-manager==4.0.2
undetected_chromedriver==3.5.5
setuptools==80.9.0
2 changes: 1 addition & 1 deletion service/cli_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def welcome_menu(self):
Text.assemble(
(fig.renderText('DPULSE'), preview_style),
("\n", ""),
("DPULSE-CLI - v1.3.3 stable - OSINT-TECHNOLOGIES\n\n", "magenta bold"),
("DPULSE-CLI - v1.3.4 stable - OSINT-TECHNOLOGIES\n\n", "magenta bold"),
("Visit our pages:\n", "white"),
("GitHub: ", "white"), ("https://github.com/OSINT-TECHNOLOGIES\n", "blue underline"),
("PyPi: ", "white"), ("https://pypi.org/project/dpulse/\n", "blue underline"),
Expand Down
18 changes: 16 additions & 2 deletions service/config_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ def create_config():
config['HTML_REPORTING'] = {'template': 'modern', 'delete_txt_files': 'n'}
config['LOGGING'] = {'log_level': 'info'}
config['CLI VISUAL'] = {'preview_color': 'red', 'font': 'slant'}
config['DORKING'] = {'dorking_delay (secs)': '2', 'delay_step': '5', 'full_path_to_browser': r'path\to\browser\for\dorking', 'browser_mode': 'nonheadless'}
config['SNAPSHOTTING'] = {'installed_browser': 'firefox', 'opera_browser_path': 'None', 'wayback_retries': '3', 'wayback_req_pause': '2'}
config['DORKING'] = {'dorking_delay (secs)': '2', 'delay_step': '5',
'full_path_to_browser': r'path\to\browser\for\dorking', 'browser_mode': 'nonheadless'}
config['SNAPSHOTTING'] = {'installed_browser': 'firefox', 'opera_browser_path': 'None', 'wayback_retries': '3',
'wayback_req_pause': '2'}
config['USER-AGENTS'] = {}
for i, agent in enumerate(basic_user_agents):
config['USER-AGENTS'][f'agent_{i + 1}'] = agent
Expand All @@ -45,8 +47,18 @@ def check_cfg_presence():
return cfg_presence

def read_config():
if not check_cfg_presence():
create_config()

config = configparser.ConfigParser()
config.read('service//config.ini')

if not config.has_section('LOGGING'):
config.add_section('LOGGING')
config.set('LOGGING', 'log_level', 'info')
with open('service//config.ini', 'w') as configfile:
config.write(configfile)

log_level = config.get('LOGGING', 'log_level')
cli_preview_color = config.get('CLI VISUAL', 'preview_color')
wm_font = config.get('CLI VISUAL', 'font')
Expand Down Expand Up @@ -84,6 +96,8 @@ def read_config():
return config_values

def print_and_return_config():
if not check_cfg_presence():
create_config()
config = configparser.ConfigParser()
config.read('service//config.ini')
print(Fore.LIGHTMAGENTA_EX + "\n[CURRENT CONFIG CONTENT START]" + Style.RESET_ALL)
Expand Down
81 changes: 66 additions & 15 deletions service/db_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
import os
import sqlite3
import sys
from rich import box
from rich.table import Table
from rich.console import Console

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

console = Console()

def db_connect():
sqlite_connection = sqlite3.connect('report_storage.db')
cursor = sqlite_connection.cursor()
Expand Down Expand Up @@ -44,22 +49,46 @@ def db_select():
if_rows = "SELECT * FROM report_storage"
cursor.execute(if_rows)
rows = cursor.fetchall()
data_presence_flag = False
if rows:
try:
select_query = "SELECT creation_date, report_file_extension, target, id, comment, dorks_results, robots_text, sitemap_text, sitemap_file, api_scan FROM report_storage;"
cursor.execute(select_query)
records = cursor.fetchall()
print(Fore.LIGHTMAGENTA_EX + "\n[DATABASE'S CONTENT]\n" + Style.RESET_ALL)
table = Table(title="[white on magenta]DATABASE CONTENT[/white on magenta]", show_lines=True, border_style="magenta", box=box.ROUNDED)
table.add_column("ID", style="cyan", justify="center")
table.add_column("Target", style="white", justify="center")
table.add_column("Extension", style="white", justify="center")
table.add_column("Comment", style="white", justify="center")
table.add_column("Created", style="white", justify="center")
table.add_column("Dorking", style="white", justify="center")
table.add_column("robots.txt", style="white", justify="center")
table.add_column("sitemap.xml", style="white", justify="center")
table.add_column("API scan", style="white", justify="center")

for row in records:
dorks_presence = robots_presence = sitemap_presence = "None"
if len(row[4]) > 1:
dorks_presence = "None"
robots_presence = "None"
sitemap_presence = "None"
if row[5] and len(str(row[5])) > 1:
dorks_presence = "In DB"
if len(row[5]) > 1:
if row[6] and len(str(row[6])) > 1:
robots_presence = "In DB"
if len(row[6]) > 1:
if row[7] and len(str(row[7])) > 1:
sitemap_presence = "In DB"
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)
table.add_row(
str(row[3]),
str(row[2]),
str(row[1]),
str(row[4]),
str(row[0]),
dorks_presence,
robots_presence,
sitemap_presence,
str(row[9])
)
data_presence_flag = True
console.print(table)
except sqlite3.Error as e:
print(Fore.RED + "Failed to see storage database's content. Reason: {}".format(e))
sqlite_connection.close()
Expand Down Expand Up @@ -94,10 +123,10 @@ def db_report_recreate(extracted_folder_name, id_to_extract):
blob_data = blob[0]
cursor.execute("SELECT report_file_extension FROM report_storage WHERE id=?", (id_to_extract,))
report_file_extension = (cursor.fetchone())[0]
if str(report_file_extension) == 'XLSX':
if str(report_file_extension).upper() == 'XLSX':
with open(extracted_folder_name + '//report_extracted.xlsx', 'wb') as file:
file.write(blob_data)
elif str(report_file_extension) == 'HTML':
elif str(report_file_extension).upper() == 'HTML':
with open(extracted_folder_name + '//report_extracted.html', 'wb') as file:
file.write(blob_data)
cursor.execute("SELECT dorks_results FROM report_storage WHERE id=?", (id_to_extract,))
Expand All @@ -120,7 +149,7 @@ def db_report_recreate(extracted_folder_name, id_to_extract):
except Exception as e:
print(Fore.RED + "Error appeared when recreating report from database. Reason: {}".format(e))

def insert_blob(report_file_type, pdf_blob, db_casename, creation_date, case_comment, robots, sitemap_xml, sitemap_links, dorking_results, api_scan_db):
def insert_blob(report_file_type, pdf_blob, db_casename, creation_date, case_comment, robots, sitemap_xml, sitemap_links, dorking_results, api_scan_db):
try:
sqlite_connection = sqlite3.connect('report_storage.db')
cursor = sqlite_connection.cursor()
Expand Down Expand Up @@ -163,14 +192,36 @@ def select_api_keys(mode):
cursor = conn.cursor()
cursor.execute("SELECT id, api_name, api_key, limitations FROM api_keys")
rows = cursor.fetchall()
for row in rows:
if row[2] != 'YOUR_API_KEY':
print(Fore.LIGHTBLUE_EX + f"ID: {row[0]} | API Name: {row[1]} | API Key: {row[2]} | Limitations: {row[3]}\n" + Style.RESET_ALL)
else:
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)
console = Console()
if rows:
try:
table = Table(
title="[white on magenta]SUPPORTED API AND YOUR KEYS[/white on magenta]",
show_lines=True,
border_style="magenta",
box=box.ROUNDED
)
table.add_column("ID", style="cyan", justify="center")
table.add_column("API Name", style="white", justify="center")
table.add_column("API Key", style="white", justify="center")
table.add_column("Limitations", style="white", justify="center")
for row in rows:
api_key = f"[red]{row[2]}[/red]" if row[2] == "YOUR_API_KEY" else str(row[2])
table.add_row(
str(row[0]),
str(row[1]),
api_key,
str(row[3])
)
console.print(table)
except sqlite3.Error as e:
print(Fore.RED + "Failed to see API keys database's content. Reason: {}".format(e))
conn.close()
else:
print(Fore.RED + 'No data found in API keys database')
conn.close()
if mode == 'printing':
conn.close()
return None
else:
pass
return cursor, conn
Loading