Skip to content

This script can enumerate and exploit SNMP (Simple Network Management Protocol) vulnerable server.

Notifications You must be signed in to change notification settings

sangleshubham/SNMP-Enumeration-and-Exploitation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

SNMP Enumeration and Exploitation

This repository contains a Python script to help discover and enumerate devices that are potentially vulnerable to SNMP (Simple Network Management Protocol) misconfigurations or default community strings. By leveraging onesixtyone for scanning and snmpwalk for information gathering, the script attempts to pull various OIDs (object identifiers) from targets to reveal system details, running processes, storage, software, and more.

Disclaimer
This tool is intended for authorized security testing and research purposes only. Always obtain proper permission before scanning or enumerating any systems.

Table of Contents

  1. Features
  2. Requirements
  3. Installation
  4. Usage
  5. Script Explanation
  6. Contributing
  7. License

Features

  • Community String Discovery: Uses onesixtyone to quickly identify valid SNMP community strings.
  • Enumeration of Common OIDs: Enumerates system processes, running programs, processes path, storage units, software names, user accounts, and TCP local ports.
  • Automatic Detection of Vulnerable Hosts: The script identifies which IP addresses have open SNMP and attempts to gather data from them.
  • Easy to Use: Just feed a file containing your target IP addresses, and the script does the rest.
  • Cross-Platform: Works on Linux, macOS, and Windows (with minimal changes and the right dependencies).

Requirements

  1. Python 3
    Ensure Python 3 is installed. Run python3 --version or python --version (depending on your OS) to confirm.

  2. onesixtyone

    • Linux:
      sudo apt-get update
      sudo apt-get install -y onesixtyone
    • Other platforms: Visit the onesixtyone GitHub or your OS package manager.
  3. snmpwalk

    • Linux:
      # For Red Hat/Fedora/CentOS:
      sudo yum install net-snmp-utils
      
      # For Ubuntu/Debian:
      sudo apt-get install snmp
  4. Python Packages

    • None beyond the standard library (the script uses only built-in Python modules).
  5. Community File

    • You must have a file named community in the same directory as the script, containing the SNMP community strings you want to test (e.g. public, private, etc.).

Installation

  1. Clone this repository:
    git clone https://github.com/sangleshubham/SNMP-Enumeration-and-Exploitation.git
  2. Enter the directory:
    cd SNMP-Enumeration-and-Exploitation/

Usage

  1. Create a file (e.g., targets.txt) containing the IP addresses you want to test, one per line:
    192.168.1.10
    192.168.1.20
    10.0.0.5
    ...
    
  2. Update community file with the SNMP community strings you want to try (e.g., public, private, etc.). This file should be in the same folder as the script.
  3. Run the script by providing the file with IPs as an argument:
    python3 snmp_enumeration_script.py targets.txt
  4. Check output:
    • The script will call onesixtyone to identify valid community strings for each IP.
    • Then it will run snmpwalk on each found community/IP pair to gather system info (processes, open ports, software, etc.).

Example snippet of output:

Found IP's:
   public               192.168.1.10
   private              10.0.0.5

Starting Enumeration:
    IP:  192.168.1.10
    Community:  public

         System Processes :
             iso.3.6.1.2.1.25.1.6.0 = 120

         Running Programs :
             iso.3.6.1.2.1.25.4.2.1.2.1001 = "MyProcess"

    ...

    IP:  10.0.0.5
    Community:  private
    ...

Screenshot :

Tool Screenshot


Script Explanation

The script consists of the following main parts:

  1. enum_dict:
    A dictionary mapping descriptive names to SNMP OIDs for system processes, running programs, storage, user accounts, etc.
  2. gathering_info(com, ip):
    • Performs snmpwalk with the given community (com) and IP address (ip) for each OID in enum_dict.
    • Prints the raw output lines containing the matched OIDs.
  3. looping(ips):
    • Iterates over discovered community/IP pairs, calling gathering_info for each.
  4. Main execution flow:
    • Reads the IP file from user-supplied command-line argument.
    • Runs onesixtyone to detect valid community strings for each IP.
    • Logs each vulnerable IP, then calls looping to enumerate details.

License

This project is open-source under the MIT License. However, usage of the tool is governed by relevant local laws and regulations. Always operate responsibly and with explicit permission when exploring security testing.


Happy SNMP Enumeration! 😁

About

This script can enumerate and exploit SNMP (Simple Network Management Protocol) vulnerable server.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages