Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
179 views
in Technique[技术] by (71.8m points)

android - libmproxy and mitmproxy documentation

I am new to the mitmproxy world. I need to write a python script that would log all the requests made from a certain app on Genymotion emulator. Now, I learned that mitmproxy can be helpful for my requirement. So I have successfully set up mitmproxy and now I am able to monitor all the traffic HTTP/S from any app on Gennymotion through the mitm client.

However, what I want is :

The app would be explored manually by the user and there should be this Python script running that would simply log all the requests being made while the user is exploring the app.

I have tried going through the Github examples of mitmproxy APIs, but have not been able to understand them. Could someone please point me to a more detailed explanation/usage guide for these APIs ?

Through some more digging, I figured out that I need something similar to https://github.com/mitmproxy/mitmproxy/blob/master/examples/flowbasic but I do not understand what is happening inside the script in the above resource. Like

what is f.reply() ?
what is flow.State() ?
what is m.run() ?
what is flow.FlowMaster ?

And more importantly, is there a place i can learn about these various methods and others used in the above ?

Similarly, found this as well : get a "raw" request esponse from MITM Proxy

Can someone please explain how to or where do I call the request() from ?
What is the context and flow parameters there ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
mitmproxy -w log_file.txt

should work for what you want. As for the docs, mitmproxy --help gives you some insight on the available options.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...