Difference between revisions of "MITM: mitmproxy"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) (Created page with "Sumber: https://blog.heckel.xyz/2013/07/01/how-to-use-mitmproxy-to-read-and-modify-https-traffic-of-your-phone/ How To: Use mitmproxy to read and modify HTTPS traffic Ca...") |
Onnowpurbo (talk | contribs) |
||
Line 2: | Line 2: | ||
+ | ==Instalasi kalau dibutuhkan== | ||
+ | Instalasi mitmproxy | ||
+ | apt-get install python-pyasn1 python-flask python-urwid python-dev libxml2-dev libxslt-dev libffi-dev | ||
+ | pip install mitmproxy | ||
− | + | Ini tidak perlu dilakukan di Kali Linux, karena kali linux sudah siap dengan mitmproxy. | |
− | + | ==Install CA== | |
− | + | Kalau mau benar2 menipu browser, kita perlu menginstalasi CA Certificate MITMproxy, dari | |
− | + | ~/.mitmproxy/mitmproxy-ca-cert.cer | |
− | + | ke android, | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | /sdcard/Download/mitmproxy-ca-cert.cer | |
− | + | Masuk ke menu android | |
− | |||
− | + | * Settings > Security > “Install from device storage” | |
− | + | * Masukan “mitmproxy-ca-cert” (tanpa suffix!) > click “OK” | |
+ | * Click on “Trusted credentials” > Select “User” tab. The certificate should now appear in the list. | ||
− | |||
− | + | ==Redirect IP== | |
− | + | mitmproxy secara internal run pada port 8080. Secara external run pada port 80/HTTP dan 443/HTTPS. | |
+ | Lakukan, | ||
− | + | sysctl -w net.ipv4.ip_forward=1 | |
− | + | iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 | |
+ | iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8080 | ||
− | + | ==Jalankan mitmproxy== | |
− | + | Jalankan transparan proxy | |
− | |||
− | |||
− | + | mitmproxy -T --host | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | mitmproxy -T --host | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | untuk memonitor pada port lain gunakan switch -p | ||
Revision as of 20:13, 4 April 2017
Instalasi kalau dibutuhkan
Instalasi mitmproxy
apt-get install python-pyasn1 python-flask python-urwid python-dev libxml2-dev libxslt-dev libffi-dev pip install mitmproxy
Ini tidak perlu dilakukan di Kali Linux, karena kali linux sudah siap dengan mitmproxy.
Install CA
Kalau mau benar2 menipu browser, kita perlu menginstalasi CA Certificate MITMproxy, dari
~/.mitmproxy/mitmproxy-ca-cert.cer
ke android,
/sdcard/Download/mitmproxy-ca-cert.cer
Masuk ke menu android
- Settings > Security > “Install from device storage”
- Masukan “mitmproxy-ca-cert” (tanpa suffix!) > click “OK”
- Click on “Trusted credentials” > Select “User” tab. The certificate should now appear in the list.
Redirect IP
mitmproxy secara internal run pada port 8080. Secara external run pada port 80/HTTP dan 443/HTTPS. Lakukan,
sysctl -w net.ipv4.ip_forward=1 iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8080
Jalankan mitmproxy
Jalankan transparan proxy
mitmproxy -T --host
untuk memonitor pada port lain gunakan switch -p