From b5927d848271b26be0bc0c2e8ced950694575933 Mon Sep 17 00:00:00 2001 From: Thayol Date: Sat, 10 Aug 2024 16:53:22 +0200 Subject: [PATCH] update README with busybox http method --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 3256c91..ce0845c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,19 @@ # simple-nc-server + +## Ncat + Only works with Ncat versions that are compiled with the `-c` switch. ```sh while true; do nc -lnp 1337 -c 'read REQ; GET=$(echo $REQ | sed -E "s/GET \/(.*) HTTP.*/\1/"); echo -e "HTTP/1.1 200 OK\nContent-Type: text/html; charset=UTF-8\n\n"; eval "$(echo "%>$(cat index.sh.html)<%" | sed -e "s/<%=/<%echo /g" -e "s/<%/\nRAW\n/g" -e "s/%>/\ncat <<- RAW\n/g")"'; done ``` + +## Busybox httpd + +If Busybox was compiled with `httpd`, it can serve simple scripts. If there is no `index.html` it tries `cgi-bin/index.cgi` next using whatever is in the shebang. It can be further customized by having a `httpd.conf` around but keeping it minimal, this works in this repo: + +```sh +busybox httpd -p 1337 -f +``` + +_(Note: Alpine Linux now splits Busybox into multiple packages: `apk add busybox-extras`)_