This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Client side (sender of their own IP), sending to port 1234 | |
MYPUBIP=`curl https://canihazip.com/s` 2>/dev/null | |
echo "supersecretpassword$MYPUBIP" | nc domain.name.or.ip.of.receiver.com 1234 | |
# Server side (receiver/displayer of the IP), listening on port 1234 | |
while true ; do | |
nc -l 1234 | grep supersecretpassword | sed "s/supersecretpassword/At `date` the IP was: /" | |
done >>wherever_you_want_to_save_the_ip_history.txt |