-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path7wifi.src
More file actions
71 lines (58 loc) · 2.24 KB
/
7wifi.src
File metadata and controls
71 lines (58 loc) · 2.24 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
// DESC: 7wifi (connects automatic to the strongest WiFi found)
cryptools = include_lib("/lib/crypto.so")
if not cryptools then exit("Missing cryptools: /lib/crypto.so")
PrintYellow=function(string); print("<color=yellow>" + string + "</color>"); end function
PrintWhite=function(string); print("<color=white>" + string + "</color>"); end function
// AIRMON
computer = get_shell.host_computer
networkDevices = computer.network_devices
counter = 0
interfaceName = ""
while networkDevices[counter] != " "
interfaceName = interfaceName + networkDevices[counter]
counter = counter + 1
end while
output = cryptools.airmon("start", interfaceName)
if not output then exit("airmon: " + interfaceName + " not found")
if typeof(output) == "string" then error(output)
PrintWhite("airmon started on: " + interfaceName)
// WIFI NETWORKS
wifiNetworks = computer.wifi_networks(interfaceName)
counter = 0; wifiStrong = 0
PrintWhite("searching for strongest WiFi-Network ...")
for wifiNetwork in wifiNetworks
wifiConnection = wifiNetworks[counter].split(" ") //TBD: check if last is always the strongest
wifiPower = wifiConnection[1].split("%")[0]
if wifiPower > wifiStrong then
wifiStrong = wifiPower
bssid = wifiConnection[0]
essid = wifiConnection[2]
end if
counter = counter + 1
end for
// AIRPLAY
print("aireplay using WiFi: " + essid)
if wifiStrong >= 75 then
maxAcks = 4000
else if wifiStrong >= 50 then
maxAcks = 5000
else
maxAcks = 20000
end if
PrintYellow("WiFi connection power is: " + wifiStrong + " setting MaxAcks to: " + maxAcks)
result = cryptools.aireplay(bssid, essid, maxAcks)
if typeof(result) == "string" then exit(result)
// AIRCRACK
pathFile = "file.cap"
file = computer.File(pathFile)
if file == null then exit("aircrack: file not found: " + pathFile)
if not file.is_binary then exit("aircrack: not valid filecap.")
if not file.has_permission("r") then exit("aircrack: permission denied")
password = cryptools.aircrack(file.path)
file.delete // Cleanup: remove file.cap
if not password then exit("aircrack: Unable to get the key")
if computer.connect_wifi(interfaceName, bssid, essid, password) then
PrintWhite("successfully connected to WiFi: " + essid + " with password: " + password)
else
exit("could not connect to WiFi: " + essid)
end if