moth/pwnables/skel/var/service/networking/run

15 lines
372 B
Plaintext
Raw Normal View History

2009-10-05 17:09:20 -06:00
#! /bin/sh -e
# busybox's dc doesn't support i :<
# Its awk does support 0xa0 as an int, but gawk doesn't. This only works on busybox.
2009-10-06 12:06:30 -06:00
lastd=$(awk -F ':' '{for (i=1; i<NF; i++) {q = xor(q, "0x" $i);} print (q<2?2:q);}' /sys/class/net/eth0/address)
2009-10-05 17:09:20 -06:00
myip=10.0.0.$lastd
ifconfig eth0 $myip netmask 255.255.0.0
ifconfig eth1 192.168.0.1
while true; do
sleep 10d
done