diff --git a/README.md b/README.md index 38a0348..dccc8d5 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,7 @@
-
-
+
[PAGESEARCH SCAN INFO]
9. PageSearch results (if was selected)
10. PageSearch Sitemap Inspection results (if was selected)
[API SCAN INFO]
-11. VirusTotal API scan results (if was selected)
-12. SecurityTrails API scan results (if was selected)
+10. VirusTotal API scan results (if was selected)
+11. SecurityTrails API scan results (if was selected)
+12. HudsonRock API scan results (if was selected)
Google Dorking status: {{dorking_status}}
PageSearch conduction: {{pagesearch_ui_mark}}
+Snapshotting conduction: {{snapshotting_ui_mark}}
Report creation time: {{ctime}}
-
Total links amount: {{ss_l}}
Amount of accessed links: {{ss_a}}
+{{ virustotal_output }}
-
-
Categories: {{vt_cats}}
Detected URLs: {{vt_deturls}}
Detected samples: {{vt_detsampls}}
Undetected samples: {{vt_undetsampls}}
{{ securitytrails_output }}
-
-
Alexa rank: {{st_alexa}}
Apex domain: {{st_apex}}
-Hostname: {{st_hostname}}
A records:
MX records:
NS records:
SOA records:
TXT records values:
Subdomains list
{{ hudsonrock_output }}
diff --git a/snapshotting/__init__.py b/snapshotting/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/snapshotting/__init__.py @@ -0,0 +1 @@ + diff --git a/snapshotting/html_snapshotting.py b/snapshotting/html_snapshotting.py new file mode 100644 index 0000000..bee2bab --- /dev/null +++ b/snapshotting/html_snapshotting.py @@ -0,0 +1,13 @@ +import requests +from colorama import Fore, Style + +def save_page_as_html(url, filename): + try: + print(Fore.GREEN + "Getting web page's content" + Style.RESET_ALL) + response = requests.get(url) + print(Fore.GREEN + "Creating .HTML file" + Style.RESET_ALL) + with open(filename, 'w', encoding='utf-8') as file: + file.write(response.text) + print(Fore.GREEN + ".HTML snapshot was successfully created" + Style.RESET_ALL) + except Exception as e: + print(Fore.RED + f"Error: {e}" + Style.RESET_ALL) diff --git a/snapshotting/screen_snapshotting.py b/snapshotting/screen_snapshotting.py new file mode 100644 index 0000000..c390f7a --- /dev/null +++ b/snapshotting/screen_snapshotting.py @@ -0,0 +1,64 @@ +from selenium import webdriver +from selenium.webdriver.chrome.service import Service as ChromeService +from selenium.webdriver.firefox.service import Service as FirefoxService +from selenium.webdriver.edge.service import Service as EdgeService +from webdriver_manager.chrome import ChromeDriverManager +from webdriver_manager.firefox import GeckoDriverManager +from webdriver_manager.microsoft import EdgeChromiumDriverManager +from selenium.webdriver.chrome.options import Options as ChromeOptions +from selenium.webdriver.firefox.options import Options as FirefoxOptions +from selenium.webdriver.edge.options import Options as EdgeOptions +from colorama import Fore, Style +import sys +sys.path.append('snapshotting') + +def setup_driver(browser_name): + if browser_name == "chrome": + service = ChromeService(ChromeDriverManager().install()) + options = ChromeOptions() + options.add_argument('--headless=new') + driver = webdriver.Chrome(service=service, options=options) + + elif browser_name == "firefox": + service = FirefoxService(GeckoDriverManager().install()) + options = FirefoxOptions() + options.add_argument('-headless') + driver = webdriver.Firefox(service=service, options=options) + + elif browser_name == "edge": + service = EdgeService(EdgeChromiumDriverManager().install()) + options = EdgeOptions() + options.add_argument('--headless=new') + driver = webdriver.Edge(service=service, options=options) + + elif browser_name == "safari": + options = webdriver.SafariOptions() + driver = webdriver.Safari(options=options) + + elif browser_name == "opera": + from config_processing import read_config + config_values = read_config() + service = ChromeService(ChromeDriverManager().install()) + options = ChromeOptions() + options.add_argument('--headless=new') + options.binary_location = config_values['opera_browser_path'] + driver = webdriver.Chrome(service=service, options=options) + else: + raise ValueError("Unsupported browser") + driver.set_window_size(1920, 1080) + return driver + +def take_screenshot(browser_name, url, screenshot_path): + try: + print(Fore.GREEN + f"Starting {browser_name} browser in headless mode..." + Style.RESET_ALL) + driver = setup_driver(browser_name) + print(Fore.GREEN + f"Going to {url}" + Style.RESET_ALL) + driver.get(url) + print(Fore.GREEN + "Taking screenshot..." + Style.RESET_ALL) + driver.save_screenshot(screenshot_path) + driver.quit() + print(Fore.GREEN + f"Screenshot successfully saved in report folder" + Style.RESET_ALL) + except Exception as e: + print(Fore.RED + f"Error appeared: {str(e)}" + Style.RESET_ALL) + if 'driver' in locals(): + driver.quit()