当前位置:网站首页>The best network packet capturing tool mitmproxy
The best network packet capturing tool mitmproxy
2022-06-21 18:36:00 【Test plus】
Introduce
Daily testing of client requirements , Often use Fiddler、Charles Tools , Grab the content of the network request .Fiddler、Charles There are also shortcomings in use , such as Fiddler Support only winsows、Charles Is the charge , in addition Fiddler、Charles They are weak in extending development scripts .
Today, let's introduce compatibility 、 Extensible and free agent tools mitmproxy.mitmproxy It's free of charge 、 Open based Python Developed interactive HTTPS Agent tools .
Here's how it works :
characteristic :
- 1、 Support Web
- 2、 Support terminal
- 3、 Support Python Script
- 4、 It can be recorded and replayed
Official documents :
https://docs.mitmproxy.org/stable/
githu Address :
https://github.com/mitmproxy/mitmproxy.git
mitmproxy And Fiddler、Charles contrast
install
stay mac The installation commands in the environment are as follows :
pip3 install mitmproxy
brew install mitmproxy
mitmproxy Three commands are provided , The startup mode is different :
- mitmproxy: Provides a command line interface .
- mitmweb: Provide a browser interface .
- mitmdump: Provides a simple terminal output .
Run the command
mitmproxy
The command line terminal executes mitmproxy command , A command line page appears , Show request list : request 、 Respond to 、 The details are divided into three parts , You can switch between up and down buttons tab.
mitmweb
The command line terminal executes mitmweb command , Will automatically open the browser ,http://127.0.0.1:8081, Cell phones or PC Connection proxy address :http://*:8080.
mitmweb Page and Charles The function of the page is almost the same , You can view packet requests 、 Request to retry 、 Filtration, etc. .
mitmdump
mitmdump yes mitmprxoy Command line interface for , Requests can be monitored in real time , It can dock Python The request is processed , With it we don't have to manually intercept and analyze HTTP Requests and responses , Just write the request and response processing logic .
in addition mitmdump Data analysis can be realized 、 Storage, etc , All of these processes can be done through Python Realization .
Prepare one first py Documents such as scripts.py, Modify requests and responses .
Modification request
Modify the request header agent The field value is MitmProxy.
from mitmproxy import flow
def request(flow):
flow.request.headers["agent"] = "MitmProxy"
print(flow.request.headers["agent"])
Modify response
Modify the status code of the response result as 418.
from mitmproxy import http
def request(flow: http.HTTPFlow):
if flow.request.path.endswith("/brew"):
flow.response = http.HTTPResponse.make(
418, b"I'm a teapot",
)
After writing the script , Carry out orders : mitmdump -s script.py
Conclusion
This paper introduces mitmproxy A brief introduction to the agent tool , Introduction to the follow-up meeting mitmproxy The high-order functions of and some practices in the work .
边栏推荐
猜你喜欢

Paper notes ACL 2022 unified structure generation for universal information extraction

力扣160. 相交链表

RK3566调试GC2053

R语言 bug?报错?关于亚变量0、1 结局outcome,outcome变量经过factor和numeric过程,改变了原始内容?

AI自己写代码让智能体进化!OpenAI的大模型有“人类思想”那味了

Node的字符处理

JSON parsing of node

大学物理第9章·振动

泰克示波器TCP202电流探头的使用说明

Show you how to distinguish several kinds of parallelism
随机推荐
Typescript object type
RK3566调试GC2053
Typescript接口
Initialization of typescript class objects
有哪些好用的工作汇报工具
案例驱动 :从入门到掌握Shell编程详细指南
LeetCode 1108 IP地址无效化[暴力] HERODING的LeetCode之路
云安全日报220621:Ubuntu操作系统发现英特尔微码漏洞,需要尽快升级
信创环境下缓存服务Redis集群部署
markdown写作软件:Ulysses v27
RMB 18billion, a super master fund was born in Suzhou
Day17QtQLcdNumber2021-10-22
启动!阿里巴巴编程之夏2022
微生物 个人笔记 taxonkit
论文解读(USIB)《Towards Explanation for Unsupervised Graph-Level Representation Learning》
Typescript的泛型
C语言__attribute__(packed)属性(学习一下)
JZ59.按之字型顺序打印二叉树
ByteDance proposes a lightweight and efficient new network mocovit, which has better performance than GhostNet and mobilenetv3 in CV tasks such as classification and detection!
AWS Device Shadow使用