Quote:
Originariamente inviato da Bovirus
@M0nT30
Grazie.
Attendo il batch modificato per aggiornare l'emulatore.
|
Eccolo!
genpassORIGINALE:
Codice:
#!/bin/sh
scriptcommand=genpass
runcommand=getpassword
title1="**** Zyxel VMG8823/8825"
title2="**** Calculate admin/supervisor/wifi password by serial number"
serialstartok1="172"
serialstartok2="182"
serialstartok3="192"
debug=0
exec=1
echo ""
echo $title1
echo $title2
echo ""
error=0
if [ $# -eq 0 ]; then
error=1
else
export SERIAL=$1
seriallenght=${#SERIAL}
serialsubstring1=$(echo $SERIAL | cut -c1-1)
serialsubstring2=$(echo $SERIAL | cut -c2-4)
serialsubstring3=$(echo $SERIAL | cut -c5-5)
serialsubstring4=$(echo $SERIAL | cut -c6-13)
if [ $seriallenght -ne 13 ]; then
if [ $error -eq 0 ]; then
error=2
fi
fi
if [ "$serialsubstring1" != "S" ]; then
if [ $error -eq 0 ]; then
error=3
fi
fi
if [ "$serialsubstring3" != "V" ]; then
if [ $error -eq 0 ]; then
error=4
fi
fi
if [ "$(echo $serialsubstring2 | grep -E "^[0-9]{1,}$")" ]; then
echo "" > /dev/null
else
if [ $error -eq 0 ]; then
error=5
fi
fi
if [ "$(echo $serialsubstring4 | grep -E "^[0-9]{1,}$")" ]; then
echo "" > /dev/null
else
if [ $error -eq 0 ]; then
error=6
fi
fi
if [ $# -eq 2 ] ; then
option2=$2
if [ "$option2" != "-debug" ] && [ "$option2" != "-noexec" ]; then
error=7
fi
if [ "$option2" = "-debug" ]; then
debug=1
fi
if [ "$option2" = "-noexec" ]; then
debug=1
exec=0
fi
fi
fi
if [ $debug -eq 1 ]; then
echo "serial = "$SERIAL
echo "seriallenght = "$seriallenght
echo "serialsubstring1 = "$serialsubstring1
echo "serialsubstring2 = "$serialsubstring2
echo "serialsubstring3 = "$serialsubstring3
echo "serialsubstring4 = "$serialsubstring4
echo "debug = "$debug
echo "exec = "$exec
fi
if [ $error -ne 0 ]; then
echo "error = "$error
echo "-----------------------------------------"
if [ $debug -eq 1 ]; then
echo "error 0 = no error"
fi
echo "error 1 = no serial number defined"
echo "error 2 = serial number lenght not 13"
echo "error 3 = first character of SN is not 'S'"
echo "error 4 = fifth character of SN is not 'V'"
echo "error 5 = 2 to 4 characters of SN are not digits"
echo "error 6 = 5 to 13 characters of SN are not digits"
if [ $# -eq 2 ]; then
echo "error 7 = second parameter (optional) wrong"
echo " is not '-debug' or '-noexec'"
fi
echo ""
echo "*** "$scriptcommand" - command syntax"
echo ""
echo $scriptcommand" SxxxVyyyyyy"
echo ""
echo "where xxx the first part of serial numner (are only digits)"
echo ""
echo $serialstartok1" for VMG8823"
echo $serialstartok2" for VMG8825 (nobrand)"
echo $serialstartok3" for VMG8825 (Tiscali)"
echo ""
echo "yyyyyyyy is the second part of serial number (are only digits)"
echo ""
echo " Example: "$scriptcommand" S182V12345678"
else
export SERIAL=$1
echo ""
echo "Modem serial number = "$SERIAL
if [ $exec -eq 1 ]; then
export LD_LIBRARY_PATH=/opt/zyxel/lib:/opt/zyxel/lib/private:/opt/zyxel/lib/public:/opt/zyxel/usr/lib
export LD_PRELOAD=/opt/genpass/libhook.so
/opt/genpass/$runcommand
else
echo ""
echo "Simulating command ("$runcommand") - (exec = "$exec")...."
fi
fi
echo ""
genpassMODT50K
Codice:
#!/bin/sh
scriptcommand=genpass
runcommand=getpassword
title1="**** Zyxel VMG8823/8825"
title2="**** Calculate admin/supervisor/wifi password by serial number"
serialstartok1="172"
serialstartok2="182"
serialstartok3="190"
debug=0
exec=1
echo ""
echo $title1
echo $title2
echo ""
error=0
if [ $# -eq 0 ]; then
error=1
else
export SERIAL=$1
seriallenght=${#SERIAL}
serialsubstring1=$(echo $SERIAL | cut -c1-1)
serialsubstring2=$(echo $SERIAL | cut -c2-4)
serialsubstring3=$(echo $SERIAL | cut -c5-5)
serialsubstring4=$(echo $SERIAL | cut -c6-13)
if [ $seriallenght -ne 13 ]; then
if [ $error -eq 0 ]; then
error=2
fi
fi
if [ "$serialsubstring1" != "S" ]; then
if [ $error -eq 0 ]; then
error=3
fi
fi
if [ "$serialsubstring3" != "Y" ]; then
if [ $error -eq 0 ]; then
error=4
fi
fi
if [ "$(echo $serialsubstring2 | grep -E "^[0-9]{1,}$")" ]; then
echo "" > /dev/null
else
if [ $error -eq 0 ]; then
error=5
fi
fi
if [ "$(echo $serialsubstring4 | grep -E "^[0-9]{1,}$")" ]; then
echo "" > /dev/null
else
if [ $error -eq 0 ]; then
error=6
fi
fi
if [ $# -eq 2 ] ; then
option2=$2
if [ "$option2" != "-debug" ] && [ "$option2" != "-noexec" ]; then
error=7
fi
if [ "$option2" = "-debug" ]; then
debug=1
fi
if [ "$option2" = "-noexec" ]; then
debug=1
exec=0
fi
fi
fi
if [ $debug -eq 1 ]; then
echo "serial = "$SERIAL
echo "seriallenght = "$seriallenght
echo "serialsubstring1 = "$serialsubstring1
echo "serialsubstring2 = "$serialsubstring2
echo "serialsubstring3 = "$serialsubstring3
echo "serialsubstring4 = "$serialsubstring4
echo "debug = "$debug
echo "exec = "$exec
fi
if [ $error -ne 0 ]; then
echo "error = "$error
echo "-----------------------------------------"
if [ $debug -eq 1 ]; then
echo "error 0 = no error"
fi
echo "error 1 = no serial number defined"
echo "error 2 = serial number lenght not 13"
echo "error 3 = first character of SN is not 'S'"
echo "error 4 = fifth character of SN is not 'Y'"
echo "error 5 = 2 to 4 characters of SN are not digits"
echo "error 6 = 5 to 13 characters of SN are not digits"
if [ $# -eq 2 ]; then
echo "error 7 = second parameter (optional) wrong"
echo " is not '-debug' or '-noexec'"
fi
echo ""
echo "*** "$scriptcommand" - command syntax"
echo ""
echo $scriptcommand" SxxxYyyyyyy"
echo ""
echo "where xxx the first part of serial numner (are only digits)"
echo ""
echo $serialstartok1" for VMG8823"
echo $serialstartok2" for VMG8825 (nobrand)"
echo $serialstartok3" for VMG8825 (Tiscali)"
echo ""
echo "yyyyyyyy is the second part of serial number (are only digits)"
echo ""
echo " Example: "$scriptcommand" S182Y12345678"
else
export SERIAL=$1
echo ""
echo "Modem serial number = "$SERIAL
if [ $exec -eq 1 ]; then
export LD_LIBRARY_PATH=/opt/zyxel/lib:/opt/zyxel/lib/private:/opt/zyxel/lib/public:/opt/zyxel/usr/lib
export LD_PRELOAD=/opt/genpass/libhook.so
/opt/genpass/$runcommand
else
echo ""
echo "Simulating command ("$runcommand") - (exec = "$exec")...."
fi
fi
echo ""
Tramite lo script cosė modificato ho trovato le password autogenerate:
La password supervisor risulta sotto la voce:
New algorithm supervisor password..............
La password di admin:
Old algorithm admin zyxel password param 1.....
La wireless key risulta essere quella dell'etichetta e non cambia e la si trova sotto:
Wifi password param 2 e 1......................
Prendendo pero' solo le prime 10 cifre.
Ciao!!