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:
sudo apt-get install snmpd
- 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
- 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
- Install and configure SNMP
- Start msfconsole
- Do:
use auxiliary/scanner/snmp/snmp_login
- 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.
Related Pull Requests
- #12022 Merged Pull Request: Deregister PASSWORD_SPRAY option for LoginScanner modules
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8338 Merged Pull Request: Fix msf/core and self.class msftidy warnings
- #6655 Merged Pull Request: use MetasploitModule as a class name
- #6648 Merged Pull Request: Change metasploit class names
- #6520 Merged Pull Request: Better service reporting for snmp_login
- #5497 Merged Pull Request: Refactor LoginScanner::SNMP to be fast and less buggy
- #5477 Merged Pull Request: Use run_host so that we can use THREADS (See #5459)
- #5369 Merged Pull Request: Bug/5266/snmp issues
- #4722 Merged Pull Request: Add additional timing options to snmp_login scanner
- #4737 Merged Pull Request: Preserve Context in LoginScanner socket calls, fixes #4723
- #4364 Merged Pull Request: Modules should respect bruteforce_speed again
- #4254 Merged Pull Request: Fix #4253 - Print access level for snmp_login
- #3999 Merged Pull Request: Fix #3995 - Make negative messages less verbose for LoginScanner modules
- #3559 Merged Pull Request: Feature/msp 10230/snmp login
- #2525 Merged Pull Request: Change module boilerplate
- #2426 Merged Pull Request: Find and replace Msf::Config.install_root, "data"
- #1228 Merged Pull Request: MSFTIDY cleanup #1 - auxiliary
References
See Also
Check also the following modules related to this module:
- auxiliary/scanner/snmp/snmp_enum
- auxiliary/scanner/snmp/snmp_enum_hp_laserjet
- auxiliary/scanner/snmp/snmp_enumshares
- auxiliary/scanner/snmp/snmp_enumusers
- auxiliary/scanner/snmp/snmp_set
- auxiliary/scanner/snmp/aix_version
- auxiliary/scanner/snmp/arris_dg950
- auxiliary/scanner/snmp/brocade_enumhash
- auxiliary/scanner/snmp/cisco_config_tftp
- auxiliary/scanner/snmp/cisco_upload_file
- auxiliary/scanner/snmp/cnpilot_r_snmp_loot
- auxiliary/scanner/snmp/epmp1000_snmp_loot
- auxiliary/scanner/snmp/netopia_enum
- auxiliary/scanner/snmp/sbg6580_enum
- auxiliary/scanner/snmp/ubee_ddw3611
- auxiliary/scanner/snmp/xerox_workcentre_enumusers
- exploit/linux/snmp/awind_snmp_exec
- exploit/linux/snmp/net_snmpd_rw_access
- exploit/linux/http/nagios_xi_snmptrap_authenticated_rce
- exploit/windows/http/hp_nnm_ovwebsnmpsrv_main
- exploit/windows/http/hp_nnm_ovwebsnmpsrv_ovutil
- exploit/windows/http/hp_nnm_ovwebsnmpsrv_uro
- exploit/windows/http/hp_nnm_snmp
- exploit/windows/http/hp_nnm_snmpviewer_actapp
- post/windows/gather/enum_snmp
- exploit/dialup/multi/login/manyargs
Related Nessus plugins:
- Cayman DSL Router Unauthenticated Access
- PostgreSQL Default Unpassworded Account
- Shiva Integrator Default Password
- 3Com Superstack 3 Switch Multiple Default Accounts
- SiteScope Web Service Unpassworded Access
- Symantec pcAnywhere Service Unrestricted Access
- F5 Device Default Support Password
- AirConnect Default Password
- Sun JavaServer Default Admin Password
- Shiva LanRover Blank Password
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.