Skip to content

Instantly share code, notes, and snippets.

@Plazmaz
Last active May 7, 2021 02:08
Show Gist options
  • Save Plazmaz/cafd0bd3a3a4471446cc8fe6e4f0c036 to your computer and use it in GitHub Desktop.
Save Plazmaz/cafd0bd3a3a4471446cc8fe6e4f0c036 to your computer and use it in GitHub Desktop.
A one-liner for a netcat webserver w/ sane logging
#! /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