当前位置:网站首页>Construction of middleman environment mitmproxy
Construction of middleman environment mitmproxy
2022-04-23 08:02:00 【Xihang】
List of articles
Requirements and hardware environment
Simulated man in the middle attack :
- mitmproxy Software acts as a middleman agent
- wireshark Capture traffic Check the protocol name and version
- Two sets of Vmware virtual machine , All systems are ubuntu20.04
- Two wireless network cards :
- One for middleman equipment , Turn on hot spots , Do gateway use
- One for the client , Connect hot , Initiate traffic
The network of man in the middle equipment is in bridge mode , You need to turn on the hotspot . When bridging , The host machine ( The real host environment cannot connect to the server that needs authentication WIFI, That is, the campus network of the school WIFI Can't connect , You can connect to... Using password wifi)

The client network is set to NAT that will do
Configure the wireless network card driver on the client and the middleman
The author's wireless network card is TP-LINK Manufacturer's TL-WN726N Drive free version , But drive free is right windows No drive , stay ubuntu I can't help but drive , Therefore, you need to download the driver .
https://blog.csdn.net/zhou_438/article/details/116297868
Installation driver :
https://github.com/McMCCRU/rtl8188gu
sudo apt-get install git
git clone https://github.com/McMCCRU/rtl8188gu
cd rtl8188gu
make
sudo make install
Plug in the wireless card , Select connect to virtual machine
Middleman end
Verify whether the wireless network card can turn on the hotspot

install AP
https://github.com/lakinduakash/linux-wifi-hotspot
sudo add-apt-repository ppa:lakinduakash/lwh
sudo apt install linux-wifi-hotspot
Turn on hot spots
wihotspot

- SSID Is the hotspot name
- password It's a password
- wifiinterface Is the name of the wireless network card
- internet interface Is the normal network card of the virtual machine
- create hotspot Turn on hot spots
install mitmproxy
Middleman equipment
https://blog.csdn.net/qq_39889867/article/details/83477480
Installation dependency
sudo apt-get install openssl
sudo apt-get install libssl-dev
sudo apt-get install libc6-dev gcc openssl
sudo apt-get install -y make build-essential zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm tk-dev
sudo apt-get update
install mitmproxy
sudo pip3 install mitmproxy
Use
mitmproxy
( Default port number 8080, Level is equivalent to mitmproxy -p 8080)
Test for successful installation

If you encounter some agents https Failure situation , In the start command mitmproxy -p 8080 Followed by --ssl-insecure Will solve some problems
mitmproxy When reporting a mistake , Check the event log :
from Mitmproxy The console type :console.view.eventlog
mitmproxy Configure transparent agents
Middleman equipment
https://docs.mitmproxy.org/stable/howto-transparent/
sysctl -w net.ipv4.ip_forward=1
sysctl -w net.ipv6.conf.all.forwarding=1
sysctl -w net.ipv4.conf.all.send_redirects=0
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
ip6tables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
ip6tables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8080
mitmproxy --mode transparent --showhost
eth0 Is the specified network card , After turning on the hotspot , The specified network card should be a wireless network card wlx18f22c620f72
Wireshark
Client installation wireshark
https://www.cnblogs.com/or2-/p/7813446.html
sudo apt-get install libcap2-bin wireshark
sudo chgrp gmz /usr/bin/dumpcap
sudo chmod 750 /usr/bin/dumpcap
sudo setcap cap_net_raw,cap_net_admin+eip /usr/bin/dumpcap
client
Client shutdown NAT network connections , Select hotspot connection



Configure certificate
Middleman end
Two ways :
- Open the browser and type mitm.it, choice linux

sudo mv mitmproxy-ca-cert.pem /usr/local/share/ca-certificates/mitmproxy.crt
sudo update-ca-certificates
The certificate configuration may fail in the above way
- The second way
https://blog.csdn.net/u013091013/article/details/101430260
mitm@ubuntu:~/Desktop$mitmproxy # Run the middleman
mitm@ubuntu:~/Desktop$ cd ~/.mitmproxy/

openssl x509 -in mitmproxy-ca-cert.pem -inform PEM -out mitmproxy-ca-cert.crt
sudo mkdir /usr/share/ca-certificates/extra
sudo cp mitmproxy-ca-cert.crt /usr/share/ca-certificates/extra/mitmproxy-ca-cert.crt
sudo dpkg-reconfigure ca-certificates
Just return all the way
ubuntu20.04 The certificate can be added successfully
Test success
client curl www.baidu.com
The middleman checks to see if

版权声明
本文为[Xihang]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230625153532.html
边栏推荐
- 【问题解决】VS2019解决编译生成的exe文件打不开的情况
- C smoothprogressbar custom progress bar control
- How does Apache Hudi accelerate traditional batch mode?
- Redis--为什么字符串emstr的字符串长度是44字节上限?
- BUUCTF MISC刷题
- Export all SVG files in the specified path into pictures in PNG format (thumbnail or original size)
- Weblux file upload and download
- SAP STO With Billing流程与配置
- 国基北盛-openstack-容器云-环境搭建
- About USB flash drive data prompt raw, need to format, data recovery notes
猜你喜欢

Teach-Repeat-Replan: A Complete and Robust System for Aggressive Flight in Complex Environments

Houdini>流体,刚体导出学习过程笔记

三分钟教你用Houdini流体>>解算粒子流体水滴

Intranet penetration series: icmptunnel of Intranet tunnel (by master dhavalkapil)

内网渗透系列:内网隧道之icmptunnel(jamesbarlow师傅的)

SAP自建表log功能开启

TA notes of Zhuang understand (VII) < Lambert + Phong + shadow + 3evcolor + Ao >

云计算技能大赛 -- openstack私有云环境 第一部分

Simplify exporting to SVG data files and all images in SVG folder

Unity get real geographic map application terrain notes
随机推荐
Houdini terrain and fluid solution (simulated debris flow)
Redis--为什么字符串emstr的字符串长度是44字节上限?
SAP自建表log功能开启
CTF-MISC总结
05 use of array
内网渗透系列:内网隧道之icmp_tran
ABAP ALV显示金额与导出金额不一致
The projection vector of a vector to a plane
内网渗透系列:内网隧道之icmptunnel(DhavalKapil师傅的)
VBA appelle SAP RFC pour réaliser la lecture et l'écriture des données
Buctf MISC brossage
About unity to obtain links related to the transformation of real geographic maps into 3D
SAP tr manual import system operation manual
Understanding the role of individual units in a deep neural networks
How does Apache Hudi accelerate traditional batch mode?
Dvwa 靶场练习记录
一文了解系列,对web渗透的常见漏洞总结(持续更新)
Houdini流体>>粒子流体导出到unity笔记
[NLP notes] preliminary study on CRF principle
内网渗透系列:内网隧道之dnscat2