dev-master
9999999-devMiTM Proxy by sskaje
MIT
The Requires
- php >=7.0.0
- react/react 0.4.2
proxy mitm
Wallogit.com
2017 © Pedro Peláez
MiTM Proxy by sskaje
PHP Man-in-The-Middle TCP Proxy based on ReactPHP., (*1)
This proxy is not for SSL to plain or SSL to SSL hijacking., (*2)
Author: sskaje (http://sskaje.me/), (*3)
$ git clone git@github.com:sskaje/mitm.git
or, (*4)
$ git clone https://github.com/sskaje/mitm.git
$ cd mitm $ php composer.phar install
examples/proxy.php is a simple implementation of PHP-MiTM sending logs to stderr., (*5)
examples/verbose.php does the same and dumps traffic data to stderr., (*6)
php examples/proxy.php LISTEN_PORT CONNECT_HOST CONNECT_PORT [RESOLVER]
This requires ROOT permission, you must know why., (*7)
If not, try 5353 as the first argument of bin/proxy.php., (*8)
php examples/proxy.php 53 114.114.114.114 53
# direct tcp dns query to 114.114.114.114 $ dig +tcp @114.114.114.114 # query 127.0.0.1:53 $ dig +tcp @127.0.0.1 # query port to 5353 if you bind proxy to 127.0.0.1:5353 $ dig +tcp -p 5353 @127.0.0.1
php examples/proxy.php 15920 118.184.180.46 80
curl 127.0.0.1:15920 -H 'Host: ip.cn' 当前 IP:39.166.202.153 来自:江西省九江市 移动
Change http requests from sskaje.me to ip.rst.im, (*9)
php examples/hijack.php 15920 104.31.70.199 80
curl 127.0.0.1:15920 -H 'Host: sskaje.me'
You'll see, (*10)
[1] [HIJACK] sskaje.me FOUND in HTTP Header [1] [HIJACK] replaced to ip.rst.im
If you have a Linux Router, or Linux box with net.ipv4.ip_forward=1:, (*11)
iptables -t nat -A PREROUTING -p tcp --dst {CONNECT_HOST} --dport {CONNECT_PORT} -j REDIRECT --to-port {LISTEN_PORT}
MiTM Proxy by sskaje
MIT
proxy mitm