20 command-line examples to enumerate SNMP (Simple Network Management Protocol) information when provided with an IP address and UDP port 161:
Basic Enumeration
- Check if SNMP is reachable
snmpwalk -v2c -c public <IP> .1
- List all available OIDs using SNMPv2
snmpbulkwalk -v2c -c public <IP>
- List all available OIDs using SNMPv1
snmpwalk -v1 -c public <IP> .1
- Fetch the SNMP system information
snmpwalk -v2c -c public <IP> system
Community Strings
- Test a specific community string (replace ‘community’)
snmpwalk -v2c -c community <IP> .1
- Brute force SNMP community strings with a dictionary
onesixtyone -c community_list.txt <IP>
Device and Host Information
- Retrieve device hostname
snmpget -v2c -c public <IP> SNMPv2-MIB::sysName.0
- Fetch OS description and version
snmpget -v2c -c public <IP> SNMPv2-MIB::sysDescr.0
- Get system uptime
snmpget -v2c -c public <IP> SNMPv2-MIB::sysUpTime.0
- Find system contact details
snmpget -v2c -c public <IP> SNMPv2-MIB::sysContact.0
- List SNMP interfaces
snmpwalk -v2c -c public <IP> IF-MIB::ifDescr
Network Information
- Retrieve IP addresses of interfaces
snmpwalk -v2c -c public <IP> IP-MIB::ipAdEntAddr
- Get MAC addresses of interfaces
snmpwalk -v2c -c public <IP> IF-MIB::ifPhysAddress
- Find routing table entries
snmpwalk -v2c -c public <IP> IP-FORWARD-MIB::ipCidrRouteTable
Performance and Monitoring
- Monitor interface traffic statistics
snmpwalk -v2c -c public <IP> IF-MIB::ifInOctets
- Fetch CPU usage metrics
snmpwalk -v2c -c public <IP> HOST-RESOURCES-MIB::hrProcessorLoad
- Fetch memory usage metrics
snmpwalk -v2c -c public <IP> HOST-RESOURCES-MIB::hrMemorySize
- Get disk storage information
snmpwalk -v2c -c public <IP> HOST-RESOURCES-MIB::hrStorageTable
SNMPv3 Specific Commands
- Enumerate OIDs using SNMPv3 (user: ‘admin’, auth: ‘MD5’, priv: ‘AES’)
snmpwalk -v3 -u admin -A auth_pass -a MD5 -X priv_pass -x AES <IP> .1
- Get system details with SNMPv3
snmpget -v3 -u admin -A auth_pass -a MD5 -X priv_pass -x AES <IP> SNMPv2-MIB::sysDescr.0
Notes
- Replace
<IP>
with the target’s IP address. - Replace
public
with the correct community string if known. - For commands 19 and 20, adjust user credentials (
admin
,auth_pass
,priv_pass
) to match SNMPv3 configurations. - Use a tool like Wireshark or tcpdump to observe the SNMP responses for troubleshooting or deeper inspection.