|
1 | 1 | from colorama import Fore, Style
|
2 | 2 | import sys
|
3 | 3 | sys.path.append('service')
|
| 4 | +sys.path.append('pagesearch') |
4 | 5 |
|
5 | 6 | import crawl_processor as cp
|
6 | 7 | import dorking_processor as dp
|
7 | 8 | import networking_processor as np
|
| 9 | +from pagesearch_main import normal_search |
8 | 10 |
|
9 | 11 | try:
|
10 | 12 | import requests
|
@@ -37,7 +39,7 @@ def report_preprocessing(self, short_domain, report_file_type):
|
37 | 39 | os.makedirs(report_folder, exist_ok=True)
|
38 | 40 | return casename, db_casename, db_creation_date, robots_filepath, sitemap_filepath, sitemap_links_filepath, report_file_type, report_folder, ctime
|
39 | 41 |
|
40 |
| - def data_gathering(self, short_domain, url, report_file_type): |
| 42 | + def data_gathering(self, short_domain, url, report_file_type, pagesearch_flag): |
41 | 43 | casename, db_casename, db_creation_date, robots_filepath, sitemap_filepath, sitemap_links_filepath, report_file_type, report_folder, ctime = self.report_preprocessing(short_domain, report_file_type)
|
42 | 44 | print(Fore.GREEN + "Started scanning domain" + Style.RESET_ALL)
|
43 | 45 | print(Fore.GREEN + "Getting domain IP address" + Style.RESET_ALL)
|
@@ -83,22 +85,35 @@ def data_gathering(self, short_domain, url, report_file_type):
|
83 | 85 | for key in common_socials:
|
84 | 86 | common_socials[key] = list(set(common_socials[key]))
|
85 | 87 | total_socials = sum(len(values) for values in common_socials.values())
|
86 |
| - |
87 | 88 | if report_file_type == 'pdf':
|
88 | 89 | data_array = [ip, res, mails, subdomains, subdomains_amount, social_medias, subdomain_mails, sd_socials,
|
89 | 90 | subdomain_ip, issuer, subject, notBefore, notAfter, commonName, serialNumber, mx_records,
|
90 | 91 | robots_txt_result, sitemap_xml_result, sitemap_links_status,
|
91 | 92 | web_servers, cms, programming_languages, web_frameworks, analytics, javascript_frameworks, ports,
|
92 | 93 | hostnames, cpes, tags, vulns, dorking_status, common_socials, total_socials]
|
| 94 | + if pagesearch_flag.lower() == 'y': |
| 95 | + to_search_array = [subdomains, social_medias, sd_socials] |
| 96 | + print(Fore.LIGHTMAGENTA_EX + "\n[PAGESEARCH SUBPROCESS START]\n" + Style.RESET_ALL) |
| 97 | + normal_search(to_search_array, report_folder) |
| 98 | + print(Fore.LIGHTMAGENTA_EX + "\n[PAGESEARCH SUBPROCESS END]\n" + Style.RESET_ALL) |
| 99 | + #to_search_array = [subdomains, social_medias, sd_socials, sitemap_links_filepath] WIP |
| 100 | + elif pagesearch_flag.lower() == 'n': |
| 101 | + pass |
93 | 102 | elif report_file_type == 'xlsx':
|
94 | 103 | data_array = [ip, res, mails, subdomains, subdomains_amount, social_medias, subdomain_mails, sd_socials,
|
95 | 104 | subdomain_ip, issuer, subject, notBefore, notAfter, commonName, serialNumber, mx_records,
|
96 | 105 | robots_txt_result, sitemap_xml_result, sitemap_links_status,
|
97 | 106 | web_servers, cms, programming_languages, web_frameworks, analytics, javascript_frameworks, ports,
|
98 | 107 | hostnames, cpes, tags, vulns, dorking_status, common_socials, total_socials, parsed_links, subdomain_urls, dorking_results]
|
| 108 | + if pagesearch_flag.lower() == 'y': |
| 109 | + to_search_array = [subdomains, social_medias, sd_socials] |
| 110 | + print(Fore.LIGHTMAGENTA_EX + "\n[PAGESEARCH SUBPROCESS START]\n" + Style.RESET_ALL) |
| 111 | + normal_search(to_search_array, report_folder) |
| 112 | + print(Fore.LIGHTMAGENTA_EX + "\n[PAGESEARCH SUBPROCESS END]\n" + Style.RESET_ALL) |
| 113 | + #to_search_array = [subdomains, social_medias, sd_socials, sitemap_links_filepath] WIP |
| 114 | + elif pagesearch_flag.lower() == 'n': |
| 115 | + pass |
99 | 116 |
|
100 | 117 | report_info_array = [casename, db_casename, db_creation_date, report_folder, ctime, report_file_type]
|
101 | 118 |
|
102 | 119 | return data_array, report_info_array
|
103 |
| - |
104 |
| - |
|
0 commit comments