Code Monkey home page Code Monkey logo

snmp-shell's Introduction

SNMP Shell

Shell Simulation over Net-SNMP with extend functionality

All thanks and regards to mxrch.

Here is a preview :

Screenshot

Description

If your target has a Net-SNMP instance with the "extend" functionality, and you got a SNMP community string which gives you write access, you can use this tool to automate the process of sending commands with the SNMP RCE.

The tool automatically put you in your path to simulate a real shell.
You can also use all the commands you can imagine, apart those requiring a fully interactive shell (MySQL, Vim, Nano, etc.)
Not compatible Windows, sorry.

Prereqs

To run on OpenWRT you need configured snmpd and next packages:

opkg update
opkg install coreutils-whoami coreutils-base64

Installation (Linux)

sudo apt install snmp snmp-mibs-downloader rlwrap -y
git clone https://github.com/wimark/snmp-shell
cd snmp-shell
sudo python3 -m pip install -r requirements.txt

Usage

$ rlwrap python shell.py <IP> -c <community string>

Help

If you need to send longer strings, like your SSH public key, please use the legacy.py version.
The characters limit to send is short (SNMP Limitation).
Tips : use a ed25519 SSH publickey, not a RSA one, it's shorter.

Usage: shell.py [OPTIONS] IP

  Simulates a terminal over Net-SNMP "extend" functionality. Be sure your
  SNMP Community String has write access.

Options:
  -c, --communitystring TEXT  Community string for SNMP
  -v, --version TEXT          SNMP version (1/2c/3)
  -ss, --snmpset TEXT         Path for the snmpset binary
  -sw, --snmpwalk TEXT        Path for the snmpwalk binary
  -h, --help                  Show this message and exit.

References

https://mogwailabs.de/blog/2019/10/abusing-linux-snmp-for-rce/

snmp-shell's People

Contributors

danyanya avatar mxrch avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.