socket.error: illegal IP address string passed to inet_aton
SanStardust opened this issue · 1 comments
SanStardust commented
726232111 commented
Commment follow two lines of code in run.sh and add code IP=$1
#IPINT=$(ifconfig | grep "eth" | cut -d " " -f 1 | head -1)
#IP=$(ifconfig "$IPINT" |grep "inet addr:" |cut -d ":" -f 2 |awk '{ print $1 }')
IP=$1
Command
┌──(kali㉿kali)-[~/Desktop/icmpsh]
└─$ sudo ./run.sh 192.168.1.10
Reason
grep eth
result inculde ether, so the first value of the ifconfig | grep "eth" | cut -d " " -f 1
may be blank
Resulting in ifconfig "$IPINT" |grep "inet addr:" |cut -d ":" -f 2 |awk '{ print $1 }'
is blank
┌──(kali㉿kali)-[~/Desktop/icmpsh]
└─$ ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 02:42:83:d3:4c:ec txqueuelen 0 (Ethernet)
...
┌──(kali㉿kali)-[~/Desktop/icmpsh]
└─$ ifconfig | grep "eth" | cut -d " " -f 1
eth0:
eth1: