Created
March 26, 2020 09:41
-
-
Save lingxiankong/187262d183e84e4cf65471b0d45a0fde to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/bin/sh | |
| MYIP=$(ip route get 8.8.8.8 | head -1 | awk '{print $7}') | |
| OUTPUT="Hi, I am $MYIP\r" | |
| LEN=${#OUTPUT} | |
| while true; do echo -e "HTTP/1.1 200 OK\r\nContent-Length: ${LEN}\r\n\r\n${OUTPUT}" | sudo nc -l -p 80; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment