akhepcat / snmpbug

refactor of mini-snmpd project to be a simple, yet snmp-compliant community-string logging canary

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This code is a heavily edited version of the mini-snmpd code found at https://github.com/troglobit/mini-snmpd.git

all chages were made to eliminate user-facing variables that are mib-centric.

It also fixes the 'drop privs' function to correctly set the gid based on the provided users's default group id; not by name

It's the 'canary-in-the-coalmine'  for snmp attacks.

Currently, 'snmpbug' simply logs the -v1 and -v2c  community-string to stdout, as well as the soure IPv4/IPv6 address.

Instead of returning data, it always returns an "END of MIB" (No More Variables) result.

-----------------------

Usage: snmpbug [options]

  -h, --help             This help text
  -i, --interfaces IFACE Network interfaces to monitor, default: none
  -I, --listen IFACE     Network interface to listen, default: all
  -p, --udp-port PORT    UDP port to bind to, default: 161
  -P, --tcp-port PORT    TCP port to bind to, default is equal to udp port
  -u, --drop-privs USER  Drop privileges after opening sockets to USER, default: no
  -v, --version          Show program version and exit

Bug report address: https://github.com/akhepcat/snmpbug/issues
Project homepage: https://github.com/akhepcat/snmpbug

---------------------

TODO:
	* keep stripping out unused code
	** simplify, simplify, simplify!

DONE:
	* Return exactly one record of the type requested, with null data - instead of an error.
	** no need for system monitoring
	** no need for MIB parsing/updating/etc

About

refactor of mini-snmpd project to be a simple, yet snmp-compliant community-string logging canary

License:GNU General Public License v2.0


Languages

Language:C 99.3%Language:Makefile 0.7%