SNMP Windows SMB Share Enumeration - Metasploit


This page contains detailed information about how to use the auxiliary/scanner/snmp/snmp_enumshares metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: SNMP Windows SMB Share Enumeration
Module: auxiliary/scanner/snmp/snmp_enumshares
Source code: modules/auxiliary/scanner/snmp/snmp_enumshares.rb
Disclosure date: -
Last modification time: 2017-07-24 06:26:21 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 161
List of CVEs: -

This module will use LanManager OID values to enumerate SMB shares on a Windows system via SNMP

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


This module is a scanner module, and is capable of testing against multiple hosts.

msf > use auxiliary/scanner/snmp/snmp_enumshares
msf auxiliary(snmp_enumshares) > show options
    ... show and set options ...
msf auxiliary(snmp_enumshares) > set RHOSTS ip-range
msf auxiliary(snmp_enumshares) > exploit

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(snmp_enumshares) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(snmp_enumshares) > set RHOSTS 192.168.1.1/24

Example 3:

msf auxiliary(snmp_enumshares) > set RHOSTS file:/tmp/ip_list.txt

Required Options


  • RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'

Knowledge Base


Description


This module will simply scan a range of hosts and queries via SNMP to determine any available shares.

Verification Steps


  1. Do: use auxiliary/scanner/snmp/snmp_enumshares
  2. Do: set RHOSTS [IP]
  3. Do: set THREADS [number of threads]
  4. Do: run

Scenarios


msf > use auxiliary/scanner/snmp/snmp_enumshares
msf auxiliary(scanner/snmp/snmp_enumshares) > set RHOSTS 1.1.1.200-211
RHOSTS => 1.1.1.200-211
msf auxiliary(scanner/snmp/snmp_enumshares) > set THREADS 11
THREADS => 11
msf auxiliary(scanner/snmp/snmp_enumshares) > run 

[+] 1.1.1.201 
    shared_docs -  (C:\Documents and Settings\Administrator\Desktop\shared_docs)
[*] Scanned 02 of 11 hosts (018% complete)
[*] Scanned 03 of 11 hosts (027% complete)
[*] Scanned 05 of 11 hosts (045% complete)
[*] Scanned 07 of 11 hosts (063% complete)
[*] Scanned 09 of 11 hosts (081% complete)
[*] Scanned 11 of 11 hosts (100% complete)
[*] Auxiliary module execution completed
msf auxiliary(scanner/snmp/snmp_enumshares) > 

Go back to menu.

Msfconsole Usage


Here is how the scanner/snmp/snmp_enumshares auxiliary module looks in the msfconsole:

msf6 > use auxiliary/scanner/snmp/snmp_enumshares

msf6 auxiliary(scanner/snmp/snmp_enumshares) > show info

       Name: SNMP Windows SMB Share Enumeration
     Module: auxiliary/scanner/snmp/snmp_enumshares
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  tebo <[email protected]>

Check supported:
  No

Basic options:
  Name       Current Setting  Required  Description
  ----       ---------------  --------  -----------
  COMMUNITY  public           yes       SNMP Community String
  RETRIES    1                yes       SNMP Retries
  RHOSTS                      yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT      161              yes       The target port (UDP)
  THREADS    1                yes       The number of concurrent threads (max one per host)
  TIMEOUT    1                yes       SNMP Timeout
  VERSION    1                yes       SNMP Version <1/2c>

Description:
  This module will use LanManager OID values to enumerate SMB shares 
  on a Windows system via SNMP

Module Options


This is a complete list of options available in the scanner/snmp/snmp_enumshares auxiliary module:

msf6 auxiliary(scanner/snmp/snmp_enumshares) > show options

Module options (auxiliary/scanner/snmp/snmp_enumshares):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   COMMUNITY  public           yes       SNMP Community String
   RETRIES    1                yes       SNMP Retries
   RHOSTS                      yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT      161              yes       The target port (UDP)
   THREADS    1                yes       The number of concurrent threads (max one per host)
   TIMEOUT    1                yes       SNMP Timeout
   VERSION    1                yes       SNMP Version <1/2c>

Advanced Options


Here is a complete list of advanced options supported by the scanner/snmp/snmp_enumshares auxiliary module:

msf6 auxiliary(scanner/snmp/snmp_enumshares) > show advanced

Module advanced options (auxiliary/scanner/snmp/snmp_enumshares):

   Name                 Current Setting  Required  Description
   ----                 ---------------  --------  -----------
   CHOST                                 no        The local client address
   CPORT                                 no        The local client port
   ShowProgress         true             yes       Display progress messages during a scan
   ShowProgressPercent  10               yes       The interval in percent that progress should be shown
   VERBOSE              false            no        Enable detailed status messages
   WORKSPACE                             no        Specify the workspace for this module

Auxiliary Actions


This is a list of all auxiliary actions that the scanner/snmp/snmp_enumshares module can do:

msf6 auxiliary(scanner/snmp/snmp_enumshares) > show actions

Auxiliary actions:

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

Evasion Options


Here is the full list of possible evasion options supported by the scanner/snmp/snmp_enumshares auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 auxiliary(scanner/snmp/snmp_enumshares) > 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.

<IP> Unknown error: <E.CLASS> <E>


Here is a relevant code snippet related to the "<IP> Unknown error: <E.CLASS> <E>" error message:

51:	
52:	    rescue ::Rex::ConnectionError, ::SNMP::RequestTimeout, ::SNMP::UnsupportedVersion
53:	    rescue ::Interrupt
54:	      raise $!
55:	    rescue ::Exception => e
56:	      print_error("#{ip} Unknown error: #{e.class} #{e}")
57:	    ensure
58:	      disconnect_snmp
59:	    end
60:	
61:	  end

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • tebo[at]attackresearch.com

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.