Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
R00tS3c
GitHub Repository: R00tS3c/DDOS-RootSec
Path: blob/master/Botnets/Exploits/IPCAM FULL/scrap.py
5038 views
1
#!/usr/bin/python
2
# Python scanner, RCE Exploit CCTV
3
# Usage: python3 scrap.py 1000
4
5
from urllib.request import Request, urlopen
6
import time, random
7
8
# Shodan API
9
req = Request("https://www.shodan.io/search?query=GoAhead+5ccc069c403ebaf9f0171e9517f40e41", headers={'User-Agent': 'Mozilla/5.0'})
10
11
12
while 1:
13
try:
14
webpage = str(urlopen(req).read())
15
ips = []
16
while webpage.find("Document Error: Unauthorized") != -1:
17
webpage = webpage[webpage.find("Document Error: Unauthorized")-40:]
18
ips.append(webpage[webpage.find("<a href=")+9:webpage.find("\">Document Error")])
19
webpage = webpage[100:]
20
check = []
21
for ip in ips:
22
check.append(ip.strip("http://").strip("s://"))
23
reader = open("output.txt", "r")
24
data = reader.read()
25
reader.close()
26
current = data.split("\n")
27
while "\n" in current != -1:
28
current.remove("\n")
29
new = []
30
for ip in check:
31
if ip not in current:
32
new.append(ip)
33
current.append(ip)
34
writestring = ""
35
for ip in current:
36
writestring += ip + "\n"
37
writer = open("output.txt", "w")
38
writer.write(writestring[:len(writestring)-1])
39
writer.close()
40
time.sleep(15)
41
consoleprint = ""
42
for ip in new:
43
consoleprint += ip + ", "
44
if len(new) != 0:
45
print(str(len(new)) + " new IPs added: " + consoleprint[:len(consoleprint)-2])
46
except Exception as printouterror:
47
print(printouterror)
48
49