Feb 042012
 

I created this because I always forget the command to enumerate snmp and I am often too lazy to read man pages 🙂

#!/bin/bash
 
# By Ed Wiget
# This script takes an input ip or domain and performs a snmpwalk using common community strings
# 20120204 - initial script
 
function proghelp (){
	echo ""
	echo ""
	echo "Help:"
	echo "./eds-smtpwalk.sh ip_address"
	echo ""
	echo "Example:"
	echo "./eds-smtpwalk.sh 127.0.0.1"
	echo ""
	echo ""
}
 
if [ $# -ne 1 ]
then
clear
proghelp
exit
fi
 
# set up the first input value
if [ "$1" == "" ]; then
 
        echo "What is the ip address to query?"
        read SVRIP
else
        SVRIP=$1
fi
 
if [ -f wordlist-common-snmp-community-strings.txt ]; then
	for COMSTG in `cat wordlist-common-snmp-community-strings.txt`
		do
# removed below in favor of auto list
# set up the second input value
#if [ "$2" == "" ]; then		
#        echo "What is the community string?"
#        read COMSTG
#else
#	COMSTG=$2
#fi
 
		snmpwalk -v2c -c ${COMSTG} $1 system
	done
 
else
 
echo "wordlist-common-snmp-community-strings.txt does not exist.......fetching now......please wait"
echo ""
wget http://fuzzdb.googlecode.com/svn/trunk/wordlists-misc/wordlist-common-snmp-community-strings.txt
echo ""
echo "please run again....."
fi