import_code("/lib/croco_lib.src")
I = new Inputer
P = new Printer
P.settings.wait_after_author_logo = 0
P.settings.wait_after_program_logo = 4
P.settings.program_logo.push(" __ __ __ ______ __ ______ ______")
P.settings.program_logo.push("/\ \ _ \ \ /\ \ /\ ___\ /\ \ /\__ _\ /\ ___\ ")
P.settings.program_logo.push("\ \ \/ \ \ \ \ \ \ \ \ __\ \ \ \ \/_/\ \/ \ \ __\ ")
P.settings.program_logo.push(" \ \__/ \ \_\ \ \_\ \ \_\ \ \_\ \ \_\ \ \_____\ ")
P.settings.program_logo.push(" \/_/ \/_/ \/_/ \/_/ \/_/ \/_/ \/_____/ ")
crypto = lib_import("crypto.so")
P.author_logo
P.program_logo
shell = get_shell
computer = shell.host_computer
P.info("Searching net card")
net_cards = computer.network_devices
if len(net_cards) == 0 then P.error("No net cards found")
net_card = net_cards.split(" ")[0]
P.result("Net card: " + net_card, 1)
P.info("Searching WiFi networks")
networks = computer.wifi_networks(net_card)
if len(networks) == 0 then P.error("No networks found")
P.result("Networks found: " + len(networks), 1)
network = networks[I.option_choice(networks, "network", "BSSID Power ESSID(Name)")]
bssid = network.split(" ")[0]
essid = network.split(" ")[2]
P.info("Target: " + essid)
P.info("Enable mon mode for " + net_card)
crypto.airmon("start", net_card)
P.info("Collecting 7500 ACKs")
P.warning("Do not interrupt the execution! The collection will stop automatically when there are enough ACKs", 1)
crypto.aireplay(bssid, essid, 7500)
P.info("Stopign mon mode for " + net_card)
crypto.airmon("stop", net_card)
P.info("Cracking the password...")
cap = computer.File("file.cap")
password = crypto.aircrack(cap.path)
cap.delete()
if not password then P.error("Fail... Please, try again")
P.result("Success!", 1)
print("WiFi: " + essid)
print("Password: " + password + "\n")
if I.binary("Connect to this network automaticly ?") then computer.connect_wifi(net_card, bssid, essid, password)