Last active
May 7, 2021 02:08
-
-
Save Plazmaz/cafd0bd3a3a4471446cc8fe6e4f0c036 to your computer and use it in GitHub Desktop.
A one-liner for a netcat webserver w/ sane logging
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
#! /bin/bash | |
sudo bash -c 'while true; do echo "HTTP/1.1 200 OK\n\n" |nc -l -p 80 |egrep -v "Accept" |egrep -v "Content-Length" |egrep -v "Host" |egrep -vi "cache"; done' | |
# Original (no sudo): | |
# while true; do echo "HTTP/1.1 200 OK\n\n" |nc -l -p 80 |egrep -v "Accept" |egrep -v "Content-Length" |egrep -v "Host" |egrep -vi "cache"; done | |
# Raw (Skip filtering header lines): | |
# sudo bash -c 'while true; do echo "HTTP/1.1 200 OK\n\n" |nc -l -p 80; done' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment