1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-23 01:39:27 +02:00
dockerfiles/sslsplit/README.md

60 lines
1.3 KiB
Markdown
Raw Normal View History

2016-07-19 04:51:17 +02:00
sslsplit
========
[SSLsplit][1] is a tool for man-in-the-middle attacks against SSL/TLS encrypted
network connections.
## docker-compose.yml
```yaml
sslsplit:
image: vimagick/sslsplit
command:
2016-07-19 07:05:10 +02:00
-k keys/ca.key -c keys/ca.crt -P
-l logs/connections.log -S logs
2016-07-19 04:51:17 +02:00
tcp 0.0.0.0 8080
ssl 0.0.0.0 8443
net: host
volumes:
- ./data:/data
working_dir: /data
restart: unless-stopped
```
2016-07-19 07:05:10 +02:00
## Server Setup
2016-07-19 04:51:17 +02:00
```bash
$ mkdir -p data/{key,log}
2016-07-19 07:05:10 +02:00
$ openssl req -x509 -newkey rsa:2048 -nodes -keyout data/key/ca.key -out data/key/ca.crt -days 3650 -subj '/CN=EasyPi'
2016-07-19 04:51:17 +02:00
$ docker-compose up -d
```
2016-07-19 07:05:10 +02:00
```bash
# setup
2016-07-19 04:51:17 +02:00
sysctl -w net.ipv4.ip_forward=1
2016-07-19 07:05:10 +02:00
iptables -t nat -N SSLSPLIT
iptables -t nat -A SSLSPLIT -p tcp --dport 80 -j REDIRECT --to-ports 8080
iptables -t nat -A SSLSPLIT -p tcp --dport 443 -j REDIRECT --to-ports 8443
# enable
iptables -t nat -A PREROUTING -j SSLSPLIT
# disable
iptables -t nat -D PREROUTING -j SSLSPLIT
2016-07-19 04:51:17 +02:00
```
2016-07-19 07:05:10 +02:00
## Client Setup
```bash
sudo route change default 192.168.31.231
curl -k https://www.baidu.com/s?wd=hello+world
```
> ProTip: No warning dialog after importing `ca.crt` into system/browser.
2016-07-19 04:51:17 +02:00
## read more
- <https://blog.heckel.xyz/2013/08/04/use-sslsplit-to-transparently-sniff-tls-ssl-connections/>
[1]: <http://www.roe.ch/SSLsplit>