@@ -82,9 +82,7 @@ def data_gathering(self, short_domain, url, report_file_type, pagesearch_flag, k
82
82
print (Fore .GREEN + 'Processing social medias gathering' + Style .RESET_ALL )
83
83
social_medias = cp .sm_gather (url )
84
84
print (Fore .GREEN + 'Processing subdomain analysis' + Style .RESET_ALL )
85
- if report_file_type == 'pdf' :
86
- subdomain_mails , sd_socials , subdomain_ip = cp .domains_reverse_research (subdomains , report_file_type )
87
- elif report_file_type == 'xlsx' :
85
+ if report_file_type == 'xlsx' :
88
86
subdomain_urls , subdomain_mails , subdomain_ip , sd_socials = cp .domains_reverse_research (subdomains , report_file_type )
89
87
elif report_file_type == 'html' :
90
88
subdomain_mails , sd_socials , subdomain_ip = cp .domains_reverse_research (subdomains , report_file_type )
@@ -95,7 +93,7 @@ def data_gathering(self, short_domain, url, report_file_type, pagesearch_flag, k
95
93
print (Fore .GREEN + 'Extracting robots.txt and sitemap.xml' + Style .RESET_ALL )
96
94
robots_txt_result = np .get_robots_txt (short_domain , robots_filepath )
97
95
sitemap_xml_result = np .get_sitemap_xml (short_domain , sitemap_filepath )
98
- if report_file_type == 'pdf' or report_file_type == ' html' :
96
+ if report_file_type == 'html' :
99
97
sitemap_links_status = np .extract_links_from_sitemap (sitemap_links_filepath , sitemap_filepath )
100
98
elif report_file_type == 'xlsx' :
101
99
try :
@@ -113,66 +111,12 @@ def data_gathering(self, short_domain, url, report_file_type, pagesearch_flag, k
113
111
common_socials [key ] = list (set (common_socials [key ]))
114
112
total_socials = sum (len (values ) for values in common_socials .values ())
115
113
print (Fore .LIGHTMAGENTA_EX + "\n [BASIC SCAN END]\n " + Style .RESET_ALL )
116
-
117
- if report_file_type == 'pdf' :
114
+ if report_file_type == 'xlsx' :
118
115
if pagesearch_flag .lower () == 'y' :
119
116
if subdomains [0 ] != 'No subdomains were found' :
120
117
to_search_array = [subdomains , social_medias , sd_socials ]
121
118
print (Fore .LIGHTMAGENTA_EX + "\n [EXTENDED SCAN START: PAGESEARCH]\n " + Style .RESET_ALL )
122
119
ps_emails_return , accessible_subdomains , emails_amount , files_counter , cookies_counter , api_keys_counter , website_elements_counter , exposed_passwords_counter , keywords_messages_list = normal_search (to_search_array , report_folder , keywords , keywords_flag )
123
- if len (keywords_messages_list ) == 0 :
124
- keywords_messages_list = ['No keywords were found' ]
125
- total_links_counter = accessed_links_counter = 0
126
- print (Fore .LIGHTMAGENTA_EX + "\n [EXTENDED SCAN END: PAGESEARCH]\n " + Style .RESET_ALL )
127
- else :
128
- print (Fore .RED + "Cant start PageSearch because no subdomains were detected" )
129
- ps_emails_return = ""
130
- accessible_subdomains = files_counter = cookies_counter = api_keys_counter = website_elements_counter = exposed_passwords_counter = total_links_counter = accessed_links_counter = emails_amount = 'No data was gathered because no subdomains were found'
131
- keywords_messages_list = ['No data was gathered because no subdomains were found' ]
132
- pass
133
- elif pagesearch_flag .lower () == 'si' :
134
- print (Fore .LIGHTMAGENTA_EX + "\n [EXTENDED SCAN START: PAGESEARCH SITEMAP INSPECTION]\n " + Style .RESET_ALL )
135
- ps_emails_return , total_links_counter , accessed_links_counter , emails_amount = sitemap_inspection_search (report_folder )
136
- accessible_subdomains = files_counter = cookies_counter = api_keys_counter = website_elements_counter = exposed_passwords_counter = keywords_messages_list = 0
137
- print (Fore .LIGHTMAGENTA_EX + "\n [EXTENDED SCAN END: PAGESEARCH SITEMAP INSPECTION]\n " + Style .RESET_ALL )
138
- elif pagesearch_flag .lower () == 'n' :
139
- accessible_subdomains = files_counter = cookies_counter = api_keys_counter = website_elements_counter = exposed_passwords_counter = total_links_counter = accessed_links_counter = emails_amount = keywords_messages_list = 0
140
- ps_emails_return = ""
141
- pass
142
-
143
- if dorking_flag == 'none' :
144
- dorking_status = 'Google Dorking mode was not selected for this scan'
145
- dorking_file_path = 'Google Dorking mode was not selected for this scan'
146
- else :
147
- dorking_db_path , table = establishing_dork_db_connection (dorking_flag .lower ())
148
- print (Fore .LIGHTMAGENTA_EX + f"\n [EXTENDED SCAN START: { dorking_flag .upper ()} DORKING]\n " + Style .RESET_ALL )
149
- dorking_status , dorking_file_path = dp .save_results_to_txt (report_folder , table , dp .get_dorking_query (short_domain , dorking_db_path , table ))
150
- print (Fore .LIGHTMAGENTA_EX + f"\n [EXTENDED SCAN END: { dorking_flag .upper ()} DORKING]\n " + Style .RESET_ALL )
151
-
152
- if used_api_flag != ['Empty' ]:
153
- print (Fore .LIGHTMAGENTA_EX + f"\n [EXTENDED SCAN START: API SCANNING]\n " + Style .RESET_ALL )
154
- if 1 in used_api_flag :
155
- api_virustotal_check (short_domain )
156
- if 2 in used_api_flag :
157
- api_securitytrails_check (short_domain )
158
- print (Fore .LIGHTMAGENTA_EX + f"\n [EXTENDED SCAN END: API SCANNING]\n " + Style .RESET_ALL )
159
- else :
160
- pass
161
-
162
- data_array = [ip , res , mails , subdomains , subdomains_amount , social_medias , subdomain_mails , sd_socials ,
163
- subdomain_ip , issuer , subject , notBefore , notAfter , commonName , serialNumber , mx_records ,
164
- robots_txt_result , sitemap_xml_result , sitemap_links_status ,
165
- web_servers , cms , programming_languages , web_frameworks , analytics , javascript_frameworks , ports ,
166
- hostnames , cpes , tags , vulns , common_socials , total_socials , ps_emails_return ,
167
- accessible_subdomains , emails_amount , files_counter , cookies_counter , api_keys_counter ,
168
- website_elements_counter , exposed_passwords_counter , total_links_counter , accessed_links_counter , keywords_messages_list , dorking_status , dorking_file_path ]
169
-
170
- elif report_file_type == 'xlsx' :
171
- if pagesearch_flag .lower () == 'y' :
172
- if subdomains [0 ] != 'No subdomains were found' :
173
- to_search_array = [subdomains , social_medias , sd_socials ]
174
- print (Fore .LIGHTMAGENTA_EX + "\n [EXTENDED SCAN START: PAGESEARCH]\n " + Style .RESET_ALL )
175
- ps_emails_return , accessible_subdomains , emails_amount , files_counter , cookies_counter , api_keys_counter , website_elements_counter , exposed_passwords_counter = normal_search (to_search_array , report_folder , keywords , keywords_flag )
176
120
total_links_counter = accessed_links_counter = 0
177
121
print (Fore .LIGHTMAGENTA_EX + "\n [EXTENDED SCAN END: PAGESEARCH]\n " + Style .RESET_ALL )
178
122
else :
@@ -190,23 +134,27 @@ def data_gathering(self, short_domain, url, report_file_type, pagesearch_flag, k
190
134
accessible_subdomains = files_counter = cookies_counter = api_keys_counter = website_elements_counter = exposed_passwords_counter = total_links_counter = accessed_links_counter = emails_amount = 0
191
135
pass
192
136
193
- if dorking_flag == 'none ' :
137
+ if dorking_flag == 'n ' :
194
138
dorking_status = 'Google Dorking mode was not selected for this scan'
195
139
dorking_results = ['Google Dorking mode was not selected for this scan' ]
196
140
else :
197
141
dorking_db_path , table = establishing_dork_db_connection (dorking_flag .lower ())
198
142
print (Fore .LIGHTMAGENTA_EX + f"\n [EXTENDED SCAN START: { dorking_flag .upper ()} DORKING]\n " + Style .RESET_ALL )
199
143
dorking_status , dorking_results = dp .transfer_results_to_xlsx (table , dp .get_dorking_query (short_domain , dorking_db_path , table ))
200
- print (Fore .LIGHTMAGENTA_EX + f"\n [EXTENDED SCAN END: { dorking_flag .upper ()} DORKING]\n " + Style .RESET_ALL )
144
+ print (Fore .LIGHTMAGENTA_EX + f"[EXTENDED SCAN END: { dorking_flag .upper ()} DORKING]\n " + Style .RESET_ALL )
201
145
146
+ api_scan_db = []
202
147
if used_api_flag != ['Empty' ]:
203
148
print (Fore .LIGHTMAGENTA_EX + f"\n [EXTENDED SCAN START: API SCANNING]\n " + Style .RESET_ALL )
204
149
if 1 in used_api_flag :
205
150
api_virustotal_check (short_domain )
151
+ api_scan_db .append ('VirusTotal' )
206
152
if 2 in used_api_flag :
207
153
api_securitytrails_check (short_domain )
208
- print (Fore .LIGHTMAGENTA_EX + f"\n [EXTENDED SCAN END: API SCANNING]\n " + Style .RESET_ALL )
154
+ api_scan_db .append ('SecurityTrails' )
155
+ print (Fore .LIGHTMAGENTA_EX + f"[EXTENDED SCAN END: API SCANNING]\n " + Style .RESET_ALL )
209
156
else :
157
+ api_scan_db .append ('No' )
210
158
pass
211
159
212
160
data_array = [ip , res , mails , subdomains , subdomains_amount , social_medias , subdomain_mails , sd_socials ,
@@ -243,7 +191,7 @@ def data_gathering(self, short_domain, url, report_file_type, pagesearch_flag, k
243
191
ps_emails_return = ""
244
192
pass
245
193
246
- if dorking_flag == 'none ' :
194
+ if dorking_flag == 'n ' :
247
195
dorking_status = 'Google Dorking mode was not selected for this scan'
248
196
dorking_file_path = 'Google Dorking mode was not selected for this scan'
249
197
else :
@@ -252,16 +200,21 @@ def data_gathering(self, short_domain, url, report_file_type, pagesearch_flag, k
252
200
dorking_status , dorking_file_path = dp .save_results_to_txt (report_folder , table , dp .get_dorking_query (short_domain , dorking_db_path , table ))
253
201
print (Fore .LIGHTMAGENTA_EX + f"\n [EXTENDED SCAN END: { dorking_flag .upper ()} DORKING]\n " + Style .RESET_ALL )
254
202
203
+ api_scan_db = []
255
204
if used_api_flag != ['Empty' ]:
256
205
print (Fore .LIGHTMAGENTA_EX + f"\n [EXTENDED SCAN START: API SCANNING]\n " + Style .RESET_ALL )
257
206
if 1 in used_api_flag :
258
207
api_virustotal_check (short_domain )
208
+ api_scan_db .append ('VirusTotal' )
259
209
if 2 in used_api_flag :
260
210
api_securitytrails_check (short_domain )
211
+ api_scan_db .append ('SecurityTrails' )
261
212
print (Fore .LIGHTMAGENTA_EX + f"\n [EXTENDED SCAN END: API SCANNING]\n " + Style .RESET_ALL )
262
213
else :
214
+ api_scan_db .append ('No' )
263
215
pass
264
216
217
+
265
218
data_array = [ip , res , mails , subdomains , subdomains_amount , social_medias , subdomain_mails , sd_socials ,
266
219
subdomain_ip , issuer , subject , notBefore , notAfter , commonName , serialNumber , mx_records ,
267
220
robots_txt_result , sitemap_xml_result , sitemap_links_status ,
@@ -270,6 +223,6 @@ def data_gathering(self, short_domain, url, report_file_type, pagesearch_flag, k
270
223
accessible_subdomains , emails_amount , files_counter , cookies_counter , api_keys_counter ,
271
224
website_elements_counter , exposed_passwords_counter , total_links_counter , accessed_links_counter , keywords_messages_list , dorking_status , dorking_file_path ]
272
225
273
- report_info_array = [casename , db_casename , db_creation_date , report_folder , ctime , report_file_type , report_ctime ]
226
+ report_info_array = [casename , db_casename , db_creation_date , report_folder , ctime , report_file_type , report_ctime , api_scan_db ]
274
227
logging .info (f'### THIS LOG PART FOR { casename } CASE, TIME: { ctime } ENDS HERE' )
275
228
return data_array , report_info_array
0 commit comments