image28

Simple Webserver using netcat

Sep 17th, 2020
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.23 KB | None | 0 0
  1. #!/bin/bash
  2. # from https://www.digitalocean.com/community/tutorials/how-to-use-netcat-to-establish-and-test-tcp-and-udp-connections-on-a-vps
  3.  
  4. while true;
  5. do
  6.     printf 'HTTP/1.1 200 OK\n\n%s' "$(cat index.html)" | netcat -l 8888;
  7. done
  8.  
Add Comment
Please, Sign In to add comment