by susam · 4y ago · 0 comments
while true; do echo ok | nc -l 8000; for i in 1 2 3 4; do printf '\a'; sleep 1; done; done
While the above command worked fine on macOS with the default /usr/bin/nc, on Debian 11.2, I had to modify the above command as follows to make it work: while true; do echo ok | nc -q 1 -l -p 8000; for i in 1 2 3 4; do printf '\a'; sleep 1; done; done
Now anytime someone connects to port 8000 of my system by any means, I will hear 4 beeps! The other party can use whatever client they have to connect to port 8000 of my system, e.g., a web browser, nc HOST 8000, curl HOST:8000, or even, ssh HOST -p 8000, irssi -c HOST -p 8000, etc.If your port 8000 is already occupied, I recommend port 41327 as an alternative for this alerting service. After all, 41327 reads "ALERT" in leetspeak.
By the way, visit http://susam.net:8000/ right now to send me some beeps! :)
while true; do curl -q --http0.9 http://susam.net:8000/; sleep $(( $RANDOM % 10 )); doneAm disappointed and my day is ruined
while true; do (echo ok | nc -q 1 -vlp 8000 2>&1; echo; date -u) | tee -a beeper.log; for i in 1 2 3 4; do printf '\a'; sleep 1; done & done
Here is a log of the timestamps of the connections received so far: https://gist.github.com/susam/159c7d92659b3185eb0b0d683998a3...Distributed denial of service and sleep. Nice work.
while true; do echo Coming! | nc -l 8000; for i in 1 2 3 4; do say "Lunch time!"; sleep 1; done; done
If you are on the client end of the equation and have ssh access to their mac: ssh user@host say "get your ** here right now"