Open main menu
Posts
Gists
Guilds
Users
Decipher
Docs
Open user menu
Log in
Sign up
Create a new gist
Posts
Gists
Guilds
Users
Decipher
Docs
Files
wifu
wifu
// Include the crypto library
cryptoLib = include_lib("/lib/crypto.so")
hostComputer = get_shell.host_computer
networkInterface = "wlan0"
// Ensure the crypto library is loaded
if not cryptoLib then
cryptoLib = include_lib("crypto.so")
if not cryptoLib then
exit("Missing crypto library, shutting down operation")
end if
end if
// Start monitoring on the specified network interface
if not cryptoLib.airmon("start", networkInterface) then
exit("Cannot start monitoring on " + networkInterface)
end if
// Function to print informational messages
printInfo = function(message)
print("<color=#ffff00>" + message + "</color>")
end function
// Function to print error messages
printError = function(message)
print("<color=#ff0000>[-] " + message + "</color>")
end function
// Function to print success messages
printSuccess = function(message)
print("<color=#ff8000>[*]</color>" + "<color=#0080ff>" + message + "</color>")
end function
// Function to determine the color based on signal strength
getSignalColor = function(signal)
if signal >= 75 then
return "#00FF00" // Green for strong signal
else if signal >= 50 then
return "#FFFF00" // Yellow for medium signal
else if signal >= 25 then
return "#FFA500" // Orange for weak signal
else
return "#FF0000" // Red for very weak signal
end if
end function
// Function to perform the WiFi exploitation
exploitWiFi = function(network)
acks = network.signal
requiredAcks = 300000 / acks + 100
cryptoLib.airmon("start", networkInterface)
printInfo("Collecting " + requiredAcks + " ACKs...")
cryptoLib.aireplay(network.bssid, network.essid, requiredAcks)
password = cryptoLib.aircrack(home_dir + "/file.cap")
if password then
printSuccess("Cracked::" + network.essid + " Password = <color=#FF00D4>" + password + "</color>")
else
printError("Failed to crack WiFi.")
return null
end if
file = hostComputer.File(home_dir + "/file.cap")
file.delete()
cryptoLib.airmon("stop", networkInterface)
return password
end function
// Function to handle a single network
handleNetwork = function(network)
clear_screen()
print("Usage:")
printInfo(" exploit Attempt to crack the WiFi network(s)")
signalColorCode = getSignalColor(network.signal)
printSuccess("Target => [" + network.essid + "] [Signal: <color=" + signalColorCode + ">" + network.signal + "%</color>] [BSSID: " + network.bssid + "]")
while true
input = user_input("::[" + network.essid + "] >")
args = input.split(" ")
if args[0] == "exploit" then
exploitWiFi(network)
else if args[0] == "back" then
return
else
printError("Unknown command: " + input)
end if
end while
end function
// Function to filter networks based on signal strength
filterNetworks = function(networks, filter)
filteredNetworks = []
for network in networks
if (filter == "strong" and network.signal >= 75) or
(filter == "medium" and network.signal >= 50 and network.signal < 75) or
(filter == "weak" and network.signal >= 25 and network.signal < 50) or
(filter == "very weak" and network.signal < 25) or
(filter == "all") then
filteredNetworks.push(network)
end if
end for
return filteredNetworks
end function
// Function to display help information
displayHelp = function()
printInfo("<color=#FF6347>WiFu - WiFi Utility Script</color>")
print("Usage: (Stage 1)")
printInfo(" scan [options] Scan WiFi networks with optional filters:")
printInfo(" -s (strong signal)")
printInfo(" -m (medium signal)")
printInfo(" -w (weak signal)")
printInfo(" -vw (very weak signal)")
printInfo(" -a (all signals, default)")
print("Usage: (Stage 2)")
printInfo(" use <ID> Interact with a specific WiFi network by its ID")
print("Usage: (Stage 3)")
printInfo(" exploit Attempt to crack the WiFi network(s)")
print("Additional Commands")
printInfo(" back Go back to the previous menu")
printInfo(" help Display this help menu")
printInfo(" clear Clear the screen")
end function
// Function to load networks and apply the filter
loadNetworks = function(filter)
printInfo("Loading WiFi networks...")
networks = hostComputer.wifi_networks(networkInterface)
formattedNetworks = []
for network in networks
bssid = network.split(" ")[0]
essid = network.split(" ")[2]
signalStrength = network.split(" ")[1].replace("%", "").to_int()
id = formattedNetworks.len + 1
formattedNetworks.push({ "id": id, "bssid": bssid, "essid": essid, "signal": signalStrength })
end for
formattedNetworks.sort("signal", 1)
return filterNetworks(formattedNetworks, filter)
end function
// Function to display networks with appropriate colors for signal strength
displayNetworks = function(networks)
idCounter = 1
for network in networks
signalColorCode = getSignalColor(network.signal)
printSuccess("[" + idCounter + "] [Signal: <color=" + signalColorCode + ">" + network.signal + "%</color>] [BSSID: " + network.bssid + "] [ESSID: " + network.essid + "]")
idCounter = idCounter + 1
end for
end function
// Main function to handle user input and manage program flow
main = function(clearScreen)
if clearScreen then
clear_screen()
end if
displayHelp()
loadedNetworks = []
filter = "all"
while true
input = user_input(">")
args = input.split(" ")
if args[0] == "scan" then
if args.len > 1 then
if args[1] == "-s" then
filter = "strong"
else if args[1] == "-m" then
filter = "medium"
else if args[1] == "-w" then
filter = "weak"
else if args[1] == "-vw" then
filter = "very weak"
else if args[1] == "-a" then
filter = "all"
else
printError("Unknown filter option: " + args[1])
continue
end if
end if
loadedNetworks = loadNetworks(filter)
displayNetworks(loadedNetworks)
else if args[0] == "use" then
if loadedNetworks.len == 0 then
printError("Please scan the networks first using the 'scan' command.")
continue
end if
if args.len < 2 then
printError("Please enter an ID.")
continue
end if
id = args[1].to_int() - 1
if id >= 0 and id < loadedNetworks.len then
handleNetwork(loadedNetworks[id])
else
printError("Invalid ID: " + (id + 1))
end if
else if args[0] == "help" then
displayHelp()
else if args[0] == "clear" then
clear_screen()
else if args[0] == "back" then
exit
else
printError("Unknown command: " + input)
end if
end while
end function
main(false)