Created
December 1, 2010 12:15
-
-
Save micolous/723407 to your computer and use it in GitHub Desktop.
gets pppoe passwords out of Billion 74XX ADSL2+ routers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# The SNMP community to use. Normally this will be "public". Only need read access. | |
COMMUNITY="public" | |
# default interface | |
IFACE="5" | |
case "$2" in | |
"e" | "wired" | "eth" | "ethernet" | "7402vl") | |
# Wired devices | |
# 7402VL, firmware 5.05 | |
IFACE="5" | |
;; | |
"w" | "wireless" | "wifi" | "7402vgp" | "7404vgp-m") | |
# Wireless Devices | |
# 7404VGP-M, firmware 5.07 | |
IFACE="6" | |
;; | |
"m" | "manual") | |
# Manual override | |
IFACE="$3" | |
;; | |
esac # is ridiculous | |
# OIDs to use | |
OIDMODEL="sysDescr.0" | |
OIDUSER="transmission.23.2.3.1.5.${IFACE}.1" | |
OIDPASS="transmission.23.2.3.1.6.${IFACE}.1" | |
echo "Getting PPPoE login details for $1..." | |
MODEL="`snmpget -v1 -c${COMMUNITY} -Ov -OQ $1 ${OIDMODEL}`" | |
USERNAME="`snmpget -v1 -c${COMMUNITY} -Ov -OQ $1 ${OIDUSER}`" | |
PASSWORD="`snmpget -v1 -c${COMMUNITY} -Ov -OQ $1 ${OIDPASS}`" | |
echo "Model/Firmware: ${MODEL}" | |
echo "Username: ${USERNAME}" | |
echo "Password: ${PASSWORD}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment