-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdomainSearch.py
39 lines (35 loc) · 1.4 KB
/
domainSearch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from time import sleep
class domain:
### Domain or Url Search
# Find scan_id using by domain scan
def domain_search(self, api, query):
vulnerability_ip_list = set()
scan_result = api.criminal_domain_scan(query)
scan_id = scan_result['data']['scan_id']
# Find ip using by domain search
if scan_id != '':
sleep(5)
i = 1
scan_ip = ''
try:
while(True):
report_result = api.criminal_domain_report(scan_id)
# Find Data using by scan_id
if (i < 30):
++i
if 'No Search Data' in report_result['message']:
continue
else:
report_result_list = report_result['data']['mapped_ip']
for list in report_result_list:
scan_ip = list['ip']
# print(scan_ip)
vulnerability_ip_list.add(scan_ip)
break
break
return vulnerability_ip_list
except Exception as e:
print('[domain_search Error]')
print(e)
else:
print("Cannot find Scan_id")