-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathFantom
More file actions
467 lines (323 loc) · 11 KB
/
Fantom
File metadata and controls
467 lines (323 loc) · 11 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
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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
//https://discord.gg/dkaMDj8c6b if you want
//Updated for the Version 0.7.3391a
//by Saschahi
//Original Sourcecode Yoinked from: https://github.com/tball1/greyhack-scripts
//have a nice day :)
//Here you can lock the program so other people can't steal it from you and use it
fantompassword = ""
hc=get_shell.host_computer
mx = include_lib("/lib/metaxploit.so")
crypto = include_lib("/lib/crypto.so")
if not mx then
mx = include_lib(current_path+"/metaxploit.so")
if not mx then
exit("Please install metaxploit.so in /lib or in installation directory.")
end if
end if
if not crypto then
crypto = include_lib(current_path+"/crypto.so")
if not crypto then
exit("Please install crypto.so in /lib or in installation directory.")
end if
end if
print("\n<color=#3f3e40>Fantom build 0.4 (Unofficial, by saschahi)</color>")
system_message = function(text)
print("<color=#3f3e40>[Fantom Notification] > </color>"+text)
end function
if active_user == "root" then
system_message("\nRunning Fantom in a root shell is the only way too run most security commands.")
end if
hackrouter = function(ip,lan)
r=get_router(ip)
netsess = mx.net_use(ip)
lib = netsess.dump_lib
addrs = mx.scan(lib)
exhandler = function(addr,unsec)
ex = lib.overflow(addr,unsec,lan)
if typeof(ex) == "computer" then
pwd = ex.File("/etc/passwd")
if pwd != null then
print(pwd.get_content)
end if
//------------------------------------------------------------
mhome = ex.File("/home")
musers = mhome.get_folders
for user in musers
bankfile = ex.File( "/home/" + user.name + "/Config/Bank.txt")
if not bankfile == null then
bankfilecontent = bankfile.get_content
print (bankfile.path + " : " + bankfilecontent)
splitted = bankfilecontent.split(":")
if crypto then
m0n3y = crypto.decipher(splitted[1])
print (m0n3y)
else
end if
end if
end for
//------------------------------------------------------------
end if
if typeof(ex) == "shell" then
print("Fantom has found a shell\nwould you like too use it? y/n")
said = user_input("Answer:")
if said == "y" then ex.start_terminal end if
end if
end function
for addr in addrs
info = mx.scan_address(lib,addr)
info = info.remove("decompiling source...").remove("searching unsecure values...")
info = info[2:]
while info.indexOf("Unsafe check: ") != null or info.indexOf("<b>") != null or info.indexOf("</b>") != null
info = info.remove("Unsafe check: ").remove("<b>").remove("</b>")
end while
while info.indexOf("loop in array ") != null
info = info.replace("loop in array ", "<tag>")
end while
while info.indexOf("string copy in ") != null
info = info.replace("string copy in ", "<tag>")
end while
while info.indexOf("<tag>") != null
a = info.indexOf("<tag>") + 5
info = info.remove(info[:a])
str = info[:info.indexOf(".")]
exhandler(addr,str)
end while
//print(info)
end for
end function
hack = function(ip,port)
r=get_router(ip)
netsess = mx.net_use(ip,port)
lib = netsess.dump_lib
addrs = mx.scan(lib)
exhandler = function(addr,unsec)
ex = lib.overflow(addr,unsec)
if typeof(ex) == "computer" then
pwd = ex.File("/etc/passwd")
if not pwd == null then
if pwd.has_permission("r") then
print(pwd.get_content)
print("DEBUG: here should be the password")
else
print("<color=red>Fantom doesn't have permission too read /etc/passwd</color>")
end if
else
print("<color=red>The password file seems too have been deleted...</color>")
end if
//------------------------------------------------------------
mhome = ex.File("/home")
musers = mhome.get_folders
for user in musers
bankfile = ex.File( "/home/" + user.name + "/Config/Bank.txt")
if not bankfile == null then
bankfilecontent = bankfile.get_content
print (bankfile.path + " : " + bankfilecontent)
splitted = bankfilecontent.split(":")
if crypto then
m0n3y = crypto.decipher(splitted[1])
print (m0n3y)
else
end if
end if
end for
//------------------------------------------------------------
end if
if typeof(ex) == "shell" then
print("Fantom has found a shell\nwould you like too use it? y/n")
said = user_input("Answer:")
if said == "y" then ex.start_terminal end if
end if
end function
for addr in addrs
info = mx.scan_address(lib,addr)
info = info.remove("decompiling source...").remove("searching unsecure values...")
info = info[2:]
while info.indexOf("Unsafe check: ") != null or info.indexOf("<b>") != null or info.indexOf("</b>") != null
info = info.remove("Unsafe check: ").remove("<b>").remove("</b>")
end while
while info.indexOf("loop in array ") != null
info = info.replace("loop in array ", "<tag>")
end while
while info.indexOf("string copy in ") != null
info = info.replace("string copy in ", "<tag>")
end while
while info.indexOf("<tag>") != null
a = info.indexOf("<tag>") + 5
info = info.remove(info[:a])
str = info[:info.indexOf(".")]
exhandler(addr,str)
end while
//print(info)
end for
end function
system_shell = function()
message = user_input("\n<color=#3f3e40>Fantom <color=green>[SYSTEM]</color> > </color>")
args = message.split(" ")
if args[0] == "commands" then
print("\n<color=green> Security Commands.</color>\n")
print(" secure -> Removes programs/files that introduce security issues also chmods the system.")
print(" decipher [file] -> Fancy version of the decipher tool\n")
print(" rshell_interface -> Fantom's rshell interface")
print(" <i>More soon..</i>\n")
end if
if args[0] == "rshell_interface" then
victims = mx.rshell_server
l = {}
c = 0
for victim in victims
ip = victim.host_computer.public_ip
local = victim.host_computer.local_ip
print(c+". shell@"+ip+"-"+local)
l[c]=victim
c = c +1
end for
pick = user_input("number:")
l[pick.to_int].start_terminal
end if
if args[0] == "decipher" then
filename = args[1]
file = get_shell.host_computer.File(filename)
if not file == null then
logins = file.get_content.split("\n")
for login in logins
info = login.split(":")
accnum = info[0]
hash = info[1]
got = crypto.decipher(accnum,hash)
print(accnum+" -> "+got)
end for
end if
end if
if args[0] == "secure" then
if not active_user == "root" then
print("<color=red>Fantom cannot be sure that this command worked due to no root access</color>")
end if
get_shell.host_computer.File("/").chmod("o-wrx",1)
get_shell.host_computer.File("/").chmod("u-wr",1)
get_shell.host_computer.File("/").chmod("g-wr",1)
pwd = get_shell.host_computer.File("/etc/passwd")
if not pwd == null then
pwd.delete()
end if
print("<color=green>Fantom has secured this machine.")
print("<color=red>You have too run sudo an get root before you can do anything or your machine</color>")
end if
if args[0] == "exit" then
return
end if
system_shell
end function
menu = function()
passwordinput = ""
while(passwordinput != fantompassword)
passwordinput = user_input("\n<color=green>Password: </color> ")
if not passwordinput == fantompassword then
print("Wrong Password. Join our Discord for the Sourcecode: dkaMDj8c6b")
print("Or try again")
print(" ")
justwaiting = user_input("Press Enter to try again")
end if
end while
target = user_input("\n<color=green>Target IP/DOMAIN: </color> ")
if target == "shell" then system_shell end if
target_router = get_router(target)
target_domain = nslookup(target)
if not target_domain == "Not found" then
print("\n<color=green>Valid domain detected, using IP instead..</color>")
target_router = target_domain
end if
if target_router == null then
menu
end if
if not target_domain == "Not found" then
target_router = get_router(target_router)
end if
usedports = target_router.used_ports
print("\n<color=green> Port information</color>\n")
for port in usedports
service = target_router.port_info(port)
if port.is_closed then
print(service+" "+port.port_number+" "+port.get_lan_ip+" <color=green>[CLOSED]</color>")
else
print(service+" "+port.port_number+" "+port.get_lan_ip+" <color=green>[OPEN]</color>")
end if
end for
print("\n<color=green> WHOIS information</color>")
print(whois(target_router.public_ip)+"\n")
print("\n<color=green> Other information</color>\n")
kernel = mx.net_use(target_router.public_ip).dump_lib.version
print("kernel_router: "+kernel+"\n")
system_message("Type 'commands' too see commands.")
system_message("Alternatively you can type 'exit' too inspect another IP.")
usr_shell = function()
message = user_input("\n<color=#3f3e40>Fantom > </color>")
args = message.split(" ")
if args[0] == "commands" then
print("\n<color=green> Reconnaissance Commands.</color>\n")
print(" wifi -> Gets wifi information.")
print(" lans -> Gets all devices on the network.")
print(" router -> Gets the routers local IP.")
print(" decipher [hash] -> Deciphers a hash")
print(" smtp [port] -> Shows smtp information")
print(" sniffer -> Sniffs for outbound connections")
print("\n<color=green> Hacking Commands.</color>\n")
print(" hack [port] -> Have Fantom do the hacking for you")
print(" routerhack [lan] -> Fantom will hack this lan address through the router")
print("\n <i>More soon..</i>")
end if
if args[0] == "sniffer" then
mx.sniffer
end if
if args[0] == "hack" then
port = args[1].to_int
hack(target_router.public_ip,port)
end if
if args[0] == "routerhack" then
lan = args[1]
hackrouter(target_router.public_ip,lan)
end if
if args[0] == "smtp" then
port = args[1].to_int
got = crypto.smtp_user_list(target_router.public_ip,port)
for mail in got
print(mail)
end for
end if
if args[0] == "wifi" then
print("ESSID: "+target_router.essid_name)
print("BSSID: "+target_router.bssid_name)
crypto.airmon("start","wlan0")
networks = get_shell.host_computer.wifi_networks("wlan0")
if networks.indexOf(target_router.essid_name) != null and networks.indexOf(target_router.bssid_name) != null then
print("<color=green> This WIFI is in range!</color>")
else
print("Not in range.")
end if
end if
if args[0] == "router" then
print(target_router.local_ip)
end if
if args[0] == "decipher" then
hash = args[1]
got = crypto.decipher(hash)
print(got)
end if
if args[0] == "lans" then
lans = target_router.devices_lan_ip
for lan in lans
if target_router.public_ip == get_router.public_ip and get_shell.host_computer.lan_ip == lan then
print(lan+" <color=green>[YOU]</color>")
else
print(lan)
end if
end for
end if
if args[0] == "exit" then
return
end if
usr_shell
end function
usr_shell
menu
end function
menu