mirror of https://github.com/hak5/shark-files.git
timeout from busybox needs -t
parent
b224a42e94
commit
115ed70646
|
@ -50,7 +50,7 @@ case $1 in
|
||||||
#make sure nothing interferes
|
#make sure nothing interferes
|
||||||
shut_it_all_down
|
shut_it_all_down
|
||||||
#this will exit 0 if a dhcp discovery/request packet is seen, and 124 if not
|
#this will exit 0 if a dhcp discovery/request packet is seen, and 124 if not
|
||||||
sniffed="$(timeout 15 tcpdump -Z nobody -i eth0 -c 3 udp src port 68 and udp dst port 67 -v 2>&1)"
|
sniffed="$(timeout -t 15 tcpdump -Z nobody -i eth0 -c 3 udp src port 68 and udp dst port 67 -v 2>&1)"
|
||||||
if echo "${sniffed}" | grep -q 'DHCP-Message Option 53, length 1: Discover' && \
|
if echo "${sniffed}" | grep -q 'DHCP-Message Option 53, length 1: Discover' && \
|
||||||
! echo "${sniffed}" | grep -q 'DHCP-Message Option 53, length 1: Request'; then
|
! echo "${sniffed}" | grep -q 'DHCP-Message Option 53, length 1: Request'; then
|
||||||
#we saw a dhcp discover but no dhcp request, so someone wants a dhcp server and didn't find one
|
#we saw a dhcp discover but no dhcp request, so someone wants a dhcp server and didn't find one
|
||||||
|
|
Loading…
Reference in New Issue