Newer
Older
// Automates as most as possible the wifi cracking process
// Requirements : crypto.so
// On current version, aireplay must be installed and another Terminal is required
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
imports = {}
imports.utils = {}
imports.utils.IncludeLib = function(libName, mandatory)
lib = include_lib("/lib/" + libName)
if not lib then
currentPath = get_shell.host_computer.current_path
lib = include_lib(currentPath + "/" + libName)
end if
if mandatory and not lib then exit("Error: Can't find " + libName + " library in the /lib path or the current folder")
return lib
end function
imports.utils.Exit = function(reason)
exit(reason)
end function
imports.utils.Choice = function(choices, reason)
len = choices.len
if len < 2 then return len-1
if not reason then print("Please choose "+reason)
while true
for index in range(0,len-1)
print(index+1 + ":" + choices[index])
end for
input = user_input("Enter the number to select then press ENTER: ")
input = input.trim().to_int - 1
if input >= 0 and input < len then return input
print("Not a recognized selection")
end while
return -1 // Should never happen
end function
imports.network = {}
// Is it REALLY useful to call network_devices() for that one?
imports.network.getNetDevices = function()
return ["eth0"]
end function
imports.network.getWifi = function(device)
result = []
for network in get_shell.host_computer.wifi_networks(device)
data = network.split(" ")
data[1] = imports.network.airpower(data[1])
result.push(data)
end for
return result
end function
// Formula is provided by GHTools, sorry!
imports.network.airpower = function(strength)
return -1
end function
// command: airbreaker
cryptools = imports.utils.IncludeLib("crypto.so")
comp = get_shell.host_computer
name = "aireplay"
path = "/bin/"+name
if not comp.File(path) then
path = get_shell.host_computer.current_path+"/"+name
if not comp.File(path) then imports.utils.Exit(name+" command is required")
end if
devices = imports.network.getNetDevices()
if devices.len == 0 then imports.utils.Exit("No devices found")
device = devices[imports.utils.Choice(devices)]
if not cryptools.airmon("start", device) then imports.utils.Exit("Can't activate monitor mode on "+device)
networks = imports.network.getWifi(device)
choice = []
for item in networks
choice.push(item[2])
end for
network = networks[imports.utils.Choice(choice, "a wifi network")]
bssid = network[0]
required = network[1]
essid = network[2]
// Nightly support
if cryptools.hasIndex("aireplay") then
if required < 0 then
print("Please enter the number of ACKs you want to generate")
required = user_prompt().to_int
if typeof(required) == "string" or required < 0 then exit("Error: invalid number")
end if
print("Generating <color=white>"+required+"</color> ACKs, please wait")
cryptools.aireplay(bssid,essid,required)
if required < 0 then required ="*UNKNOWN*"
print("Once <color=white>"+required+"</color> ACKs have been generated, do Ctrl+C")
args = "-b "+bssid+" -e "+essid
result = get_shell.launch(path, args)
if not result then
QUOTE = """"
print("It seems that 'get_shell.launch("+QUOTE+path+QUOTE+", "+QUOTE+args+QUOTE+")' doesn't work, so...")
print("1) Open another Terminal")
print("2) Paste '"+path+" "+args+"'")
print("3) When the ACKs are obtained, do Ctrl+C IN THE OTHER TERMINAL")
print("4) Once you're done, press Enter in THIS terminal\"+"n")
print("PS: I blame Albyton for the wasted 15 minutes writing this text!")
print("Press ENTER to continue")
user_input()
end if
end if
cryptools.airmon("stop", device)
path = home_dir+"/file.cap"
file = comp.File(path)
if not file then imports.utils.Exit("Couldn't find file, expected "+path)
password = cryptools.aircrack(home_dir+"/file.cap")
if not comp.connect_wifi(device, bssid, essid, password) then imports.utils.Exit("Couldn't connect !?")
print("Connected to " + essid + ", password : "+password)
file.delete()