Skip to content

Commit

Permalink
fix: google geolocation recon script
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Krause committed Nov 2, 2018
1 parent 57dbe95 commit ea0ba6b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tools/recon/google_geolocate_bssid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@
require 'rex/google/geolocation'
require 'optparse'

if ARGV.empty?
$stderr.puts("Usage: #{$PROGRAM_NAME} <mac> [mac] ...")
if ARGV.length < 2
$stderr.puts("Usage: #{$PROGRAM_NAME} <api_key> <mac> [mac] ...")
$stderr.puts("Ask Google for the location of the given set of BSSIDs")
$stderr.puts
$stderr.puts("Example: iwlist sc 2>/dev/null|awk '/Address/{print $5}'|xargs #{$PROGRAM_NAME}")
$stderr.puts("Example: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I|awk '/BSSID/{print $2}'|xargs #{$PROGRAM_NAME}")
$stderr.puts("Example: iwlist sc 2>/dev/null|awk '/Address/{print $5}'|xargs #{$PROGRAM_NAME} <api_key>")
$stderr.puts("Example: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I|awk '/BSSID/{print $2}'|xargs #{$PROGRAM_NAME} <api_key>")
exit(1)
end

g = Rex::Google::Geolocation.new
ARGV.each do |mac|
g.add_wlan(mac, nil, -83)
g.set_api_key(ARGV[0])
ARGV.drop(1).each do |mac|
g.add_wlan(mac, -83)
end

g.fetch!
Expand Down

0 comments on commit ea0ba6b

Please sign in to comment.