Advertisement
Guest User

snmpwalk-target-mib.sh

a guest
Aug 22nd, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #!/bin/bash
  2. if [ -z "$1" ]; then
  3. echo "[*] Simple Automated snmpwalk Script"
  4. echo "[*] Usage: $0 <file of ip addresses>"
  5. exit
  6. fi
  7.  
  8. IFS=$'\n' # make newlines the only separator
  9. set -f # disable globbing
  10.  
  11. for ip in $(cat $1); do
  12. echo "[*] Trying SNMP Walk for $ip..."
  13.  
  14. for line in $(cat mib-values); do
  15. value=$(echo $line | cut -d' ' -f1)
  16. parameter=$(echo $line | cut -d' ' -f2-)
  17. echo "[*] Trying $parameter"
  18. snmpwalk -c public -v1 $ip $value | cut -d' ' -f4-
  19. echo
  20. done
  21. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement