SNMP Community Login Scanner - Metasploit


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

Module Overview


Name: SNMP Community Login Scanner
Module: auxiliary/scanner/snmp/snmp_login
Source code: modules/auxiliary/scanner/snmp/snmp_login.rb
Disclosure date: -
Last modification time: 2019-06-27 17:06:32 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 161
List of CVEs: CVE-1999-0508

This module logs in to SNMP devices using common community names.

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_login
msf auxiliary(snmp_login) > show options
    ... show and set options ...
msf auxiliary(snmp_login) > set RHOSTS ip-range
msf auxiliary(snmp_login) > exploit

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(snmp_login) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(snmp_login) > set RHOSTS 192.168.1.1/24

Example 3:

msf auxiliary(snmp_login) > 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


Vulnerable Application


Installation instructions for SNMP server can be found for every operating system. The Ubuntu 14.04 instructions can be used as an example for installing and configuring NFS. The following was done on Kali linux:

  1. sudo apt-get install snmpd
  2. Set SNMP to listen on non-localhost: nano /etc/snmp/snmpd.conf # Listen for connections from the local system only #agentAddress udp:127.0.0.1:161 # Listen for connections on all interfaces (both IPv4 *and* IPv6) agentAddress udp:161,udp6:[::1]:161
  3. Restart the service: service snmpd restart

SNMP Versions

SNMP has 3 main versions. * 1, 2c: both use simple password protection (string), and are often defaulted to public (read only), and private (read/write). Version 2 is backwards compatible with version 1. This is a plaintext protocol and is vulenrable to being intercepted. * 3: has several security levels and is significantly more complex, but also not covered in this module.

Verification Steps


  1. Install and configure SNMP
  2. Start msfconsole
  3. Do: use auxiliary/scanner/snmp/snmp_login
  4. Do: run

Scenarios


A run against the configuration from these docs

    msf > use auxiliary/scanner/snmp/snmp_login 
    msf auxiliary(snmp_login) > set rhosts 127.0.0.1
    rhosts => 127.0.0.1
    msf auxiliary(snmp_login) > run

    [!] No active DB -- Credential data will not be saved!
    [+] 127.0.0.1:161 - LOGIN SUCCESSFUL: public (Access level: read-only); Proof (sysDescr.0): Linux hostname 4.9.0-kali1-amd64 #1 SMP Debian 4.9.6-3kali2 (2017-01-30) x86_64
    [*] Scanned 1 of 1 hosts (100% complete)
    [*] Auxiliary module execution completed

Another example can be found at this source:

    [+] 10.4.xx.xx:161 - LOGIN SUCCESSFUL: public (Access level: read-only); Proof (sysDescr.0): Cisco IOS Software, C1130 Software (C1130-K9W7-M), Version 12.4(10b)JA, RELEASE SOFTWARE (fc2)
    Technical Support: http://www.cisco.com/techsupport
    Copyright (c) 1986-2007 by Cisco Systems, Inc.
    Compiled Wed 24-Oct-07 15:17 by prod_rel_team
    [*] Scanned 12 of 58 hosts (20% complete)
    [*] Scanned 18 of 58 hosts (31% complete)
    [+] 10.10.xx.xx:161 - LOGIN SUCCESSFUL: public (Access level: read-only); Proof (sysDescr.0): Digi Connect ME Version 82000856_F6 07/21/2006
    [+] 10.10.xx.xx:161 - LOGIN SUCCESSFUL: public (Access level: read-only); Proof (sysDescr.0): Digi Connect ME Version 82000856_F6 07/21/2006
    [*] Scanned 24 of 58 hosts (41% complete)
    [+] 10.11.xx.xx:161 - LOGIN SUCCESSFUL: private (Access level: read-write); Proof (sysDescr.0): ExtremeXOS version 12.2.2.11 v1222b11 by release-manager on Mon Mar 23 17:54:47 PDT 2009
    [+] 10.11.xx.xx:161 - LOGIN SUCCESSFUL: public (Access level: read-only); Proof (sysDescr.0): ExtremeXOS version 12.2.2.11 v1222b11 by release-manager on Mon Mar 23 17:54:47 PDT 2009
    [+] 10.11.xx.xx:161 - LOGIN SUCCESSFUL: private (Access level: read-write); Proof (sysDescr.0): ExtremeXOS version 12.2.2.11 v1222b11 by release-manager on Mon Mar 23 17:54:47 PDT 2009
    [+] 10.11.xx.xx:161 - LOGIN SUCCESSFUL: public (Access level: read-only); Proof (sysDescr.0): ExtremeXOS version 12.2.2.11 v1222b11 by release-manager on Mon Mar 23 17:54:47 PDT 2009
    [+] 10.11.xx.xx:161 - LOGIN SUCCESSFUL: private (Access level: read-write); Proof (sysDescr.0): ExtremeXOS version 12.2.2.11 v1222b11 by release-manager on Mon Mar 23 17:54:47 PDT 2009
    [+] 10.11.xx.xx:161 - LOGIN SUCCESSFUL: public (Access level: read-only); Proof (sysDescr.0): ExtremeXOS version 12.2.2.11 v1222b11 by release-manager on Mon Mar 23 17:54:47 PDT 2009
    [*] Scanned 29 of 58 hosts (50% complete)
    [*] Scanned 35 of 58 hosts (60% complete)
    [*] Scanned 41 of 58 hosts (70% complete)
    [*] Scanned 47 of 58 hosts (81% complete)
    [+] 10.25.xx.xx:161 - LOGIN SUCCESSFUL: public (Access level: read-only); Proof (sysDescr.0): Digi Connect ME Version 82000856_F6 07/21/2006

Confirming


Since SNMP has been around for quite a while, there are many tools which can also be used to verify this configuration issue. The following are other industry tools which can also be used.

nmap

nmap -p 161 -sU --script=snmp-info 127.0.0.1

Starting Nmap 7.40 ( https://nmap.org ) at 2017-02-12 23:00 EST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00017s latency).
PORT    STATE SERVICE
161/udp open  snmp
| snmp-info: 
|   enterprise: net-snmp
|   engineIDFormat: unknown
|   engineIDData: 54ad55664725a15800000000
|   snmpEngineBoots: 2
|_  snmpEngineTime: 31m30s

Nmap done: 1 IP address (1 host up) scanned in 0.38 seconds

Go back to menu.

Msfconsole Usage


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

msf6 > use auxiliary/scanner/snmp/snmp_login

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

       Name: SNMP Community Login Scanner
     Module: auxiliary/scanner/snmp/snmp_login
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  hdm <[email protected]>

Check supported:
  No

Basic options:
  Name              Current Setting                                                                    Required  Description
  ----              ---------------                                                                    --------  -----------
  BLANK_PASSWORDS   false                                                                              no        Try blank passwords for all users
  BRUTEFORCE_SPEED  5                                                                                  yes       How fast to bruteforce, from 0 to 5
  DB_ALL_CREDS      false                                                                              no        Try each user/password couple stored in the current database
  DB_ALL_PASS       false                                                                              no        Add all passwords in the current database to the list
  DB_ALL_USERS      false                                                                              no        Add all users in the current database to the list
  PASSWORD                                                                                             no        The password to test
  PASS_FILE         /opt/metasploit-framework/embedded/framework/data/wordlists/snmp_default_pass.txt  no        File containing communities, one per line
  RHOSTS                                                                                               yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT             161                                                                                yes       The target port
  STOP_ON_SUCCESS   false                                                                              yes       Stop guessing when a credential works for a host
  THREADS           1                                                                                  yes       The number of concurrent threads (max one per host)
  USER_AS_PASS      false                                                                              no        Try the username as the password for all users
  VERBOSE           true                                                                               yes       Whether to print output for all attempts
  VERSION           1                                                                                  yes       The SNMP version to scan (Accepted: 1, 2c, all)

Description:
  This module logs in to SNMP devices using common community names.

References:
  https://nvd.nist.gov/vuln/detail/CVE-1999-0508

Module Options


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

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

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

   Name              Current Setting                                                                    Required  Description
   ----              ---------------                                                                    --------  -----------
   BLANK_PASSWORDS   false                                                                              no        Try blank passwords for all users
   BRUTEFORCE_SPEED  5                                                                                  yes       How fast to bruteforce, from 0 to 5
   DB_ALL_CREDS      false                                                                              no        Try each user/password couple stored in the current database
   DB_ALL_PASS       false                                                                              no        Add all passwords in the current database to the list
   DB_ALL_USERS      false                                                                              no        Add all users in the current database to the list
   PASSWORD                                                                                             no        The password to test
   PASS_FILE         /opt/metasploit-framework/embedded/framework/data/wordlists/snmp_default_pass.txt  no        File containing communities, one per line
   RHOSTS                                                                                               yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT             161                                                                                yes       The target port
   STOP_ON_SUCCESS   false                                                                              yes       Stop guessing when a credential works for a host
   THREADS           1                                                                                  yes       The number of concurrent threads (max one per host)
   USER_AS_PASS      false                                                                              no        Try the username as the password for all users
   VERBOSE           true                                                                               yes       Whether to print output for all attempts
   VERSION           1                                                                                  yes       The SNMP version to scan (Accepted: 1, 2c, all)

Advanced Options


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

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

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

   Name                  Current Setting  Required  Description
   ----                  ---------------  --------  -----------
   MaxGuessesPerService  0                no        Maximum number of credentials to try per service instance. If set to zero or a non-number, this option will not be used.
   MaxGuessesPerUser     0                no        Maximum guesses for a particular username for the service instance. Note that users are considered unique among different services, so a user at 10.1.1.1:22 is different from one at 10.2.2.2:
                                                    22, and both will be tried up to the MaxGuessesPerUser limit. If set to zero or a non-number, this option will not be used.
   MaxMinutesPerService  0                no        Maximum time in minutes to bruteforce the service instance. If set to zero or a non-number, this option will not be used.
   REMOVE_PASS_FILE      false            yes       Automatically delete the PASS_FILE on module completion
   REMOVE_USERPASS_FILE  false            yes       Automatically delete the USERPASS_FILE on module completion
   REMOVE_USER_FILE      false            yes       Automatically delete the USER_FILE on module completion
   ShowProgress          true             yes       Display progress messages during a scan
   ShowProgressPercent   10               yes       The interval in percent that progress should be shown
   TRANSITION_DELAY      0                no        Amount of time (in minutes) to delay before transitioning to the next user in the array (or password when PASSWORD_SPRAY=true)
   WORKSPACE                              no        Specify the workspace for this module

Auxiliary Actions


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

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

Auxiliary actions:

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

Evasion Options


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

msf6 auxiliary(scanner/snmp/snmp_login) > 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>:<RPORT> - LOGIN FAILED: <RESULT.CREDENTIAL> (<RESULT.STATUS>)


Here is a relevant code snippet related to the "<IP>:<RPORT> - LOGIN FAILED: <RESULT.CREDENTIAL> (<RESULT.STATUS>)" error message:

78:	          :info  => result.proof,
79:	          :state => 'open'
80:	        )
81:	      else
82:	        invalidate_login(credential_data)
83:	        print_error "#{ip}:#{rport} - LOGIN FAILED: #{result.credential} (#{result.status})"
84:	      end
85:	    end
86:	  end
87:	
88:	  def rport

Go back to menu.


References


See Also


Check also the following modules related to this module:

Related Nessus plugins:

Authors


hdm

Version


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

Go back to menu.