Merge pull request #14 from crdx/update-ssh-ip-blinker
Update ssh-ip-blinker to work with 3-digit octetspull/15/head
commit
5681eb2108
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# Title: SSH IP Blinker
|
# Title: SSH IP Blinker
|
||||||
# Author: Hak5Darren
|
# Author: Hak5Darren
|
||||||
# Version: 1.0
|
# Version: 1.1
|
||||||
#
|
#
|
||||||
# Description: This payload makes it easier to develop payloads which require Internet access.
|
# Description: This payload makes it easier to develop payloads which require Internet access.
|
||||||
# This is useful for installing packages via opkg, or testing payloads in development.
|
# This is useful for installing packages via opkg, or testing payloads in development.
|
||||||
|
@ -14,9 +14,12 @@
|
||||||
# four times, pause, then blink twice. This indicates that the last octet of its IP address is
|
# four times, pause, then blink twice. This indicates that the last octet of its IP address is
|
||||||
# .42 - so if your home LAN is 192.168.1.0, then your Shark Jack should be found at 192.168.1.42
|
# .42 - so if your home LAN is 192.168.1.0, then your Shark Jack should be found at 192.168.1.42
|
||||||
#
|
#
|
||||||
|
# If one of the octets is zero this will be represented as solid for 1 second.
|
||||||
|
#
|
||||||
# Magenta...........Setup
|
# Magenta...........Setup
|
||||||
# Red Slow Blink....Failed to obtain IP address
|
# Red Slow Blink....Failed to obtain IP address
|
||||||
# Cyan Fast Blinks..Last octet of IPv4 address
|
# Cyan Fast Blink...A non-zero digit of last octet
|
||||||
|
# Cyan Solid........A zero digit of last octet
|
||||||
|
|
||||||
LED SETUP
|
LED SETUP
|
||||||
# Set NETMODE to DHCP_CLIENT for Shark Jack v1.1.0+
|
# Set NETMODE to DHCP_CLIENT for Shark Jack v1.1.0+
|
||||||
|
@ -28,55 +31,28 @@ while ! ifconfig eth0 | grep "inet addr"; do sleep 1; done
|
||||||
sleep 10
|
sleep 10
|
||||||
LASTOCTET=$(ifconfig eth0 | grep "inet addr" | awk {'print $2'} | awk -F. {'print $4'})
|
LASTOCTET=$(ifconfig eth0 | grep "inet addr" | awk {'print $2'} | awk -F. {'print $4'})
|
||||||
LED OFF
|
LED OFF
|
||||||
LO1=${LASTOCTET:0:1}
|
|
||||||
LO2=${LASTOCTET:1:2}
|
if [ -z "$LASTOCTET" ]; then
|
||||||
LO3=${LASTOCTET:2:3}
|
LED FAIL
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
for (( i = 0; i < ${#LASTOCTET}; i++ )); do
|
||||||
|
DIGIT=${LASTOCTET:$i:1}
|
||||||
|
|
||||||
if [ -z "$LO1" ]
|
if [ $DIGIT = "0" ]; then
|
||||||
then
|
LED C SOLID; sleep 1
|
||||||
LED FAIL
|
LED OFF; sleep 0.125
|
||||||
exit
|
else
|
||||||
else
|
for (( j = 0; j < $DIGIT; j++ )); do
|
||||||
sleep 1
|
LED C SOLID; sleep 0.05
|
||||||
i=0
|
LED OFF; sleep 0.125
|
||||||
while [ $i -lt $LO1 ]
|
done
|
||||||
do
|
fi
|
||||||
LED C SOLID; sleep 0.05
|
|
||||||
LED OFF; sleep 0.125
|
|
||||||
i=$(( $i + 1 ))
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$LO2" ]
|
sleep 1
|
||||||
then
|
done
|
||||||
sleep 1
|
|
||||||
else
|
|
||||||
sleep 1
|
|
||||||
i=0
|
|
||||||
while [ $i -lt $LO2 ]
|
|
||||||
do
|
|
||||||
LED C SOLID; sleep 0.05
|
|
||||||
LED OFF; sleep 0.125
|
|
||||||
i=$(( $i + 1 ))
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$LO3" ]
|
|
||||||
then
|
|
||||||
sleep 1
|
|
||||||
else
|
|
||||||
sleep 1
|
|
||||||
i=0
|
|
||||||
while [ $i -lt $LO3 ]
|
|
||||||
do
|
|
||||||
LED C SOLID; sleep 0.05
|
|
||||||
LED OFF; sleep 0.125
|
|
||||||
i=$(( $i + 1 ))
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
sleep 2
|
|
||||||
|
|
||||||
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue