In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Original articles, welcome to reprint. Reprint please indicate: reproduced from IT Story Association, thank you!
Original link address: "docker practice" python's docker crawler technology-mitmproxy's Android simulator mitmdump (11)
The main component of this section is a particularly important component, mitmdump in mitmproxy. Why is it important? Because it can interact with python scripts, it's not nice!
How to start interactive mitmdump
The default port is 8080
Mitmdump
Startup of mitmdump designated port
The designated port is 8889
Mitmdump-p 8889
Mitmdump specifies the python program
Specify the port and python program
Mitmdump-p 8889-s test.py
Write python programs
There must be a def requet, as mentioned last time about the certificate configuration of the Night God simulator. Not this time.
From mitmproxy import ctx# has to write this. There's a request. There is a responsedef request (flow): # print (flow.request.headers) # ctx.log.info (str (flow.request.headers)) # ctx.log.warn (str (flow.request.headers)) ctx.log.error (str (flow.request.url)) ctx.log.error (str (flow.request.method)) ctx.log.error (str (flow.request.path)) def response (flow): ctx.log.error (str (flow.response.status_code))
Mitmproxy key description Q exit (equivalent to the return key, can be returned at one level) d delete the current (× × × arrow) pointing to the link D restore the request just deleted G jump to the latest request g jump to the first request C empty console (C is uppercase) I can enter files or domain names to be intercepted (comma needs to be used for translation, Chestnut: idig8.com) a release request A release all requests? View interface help information ^ v up and down arrows move the cursor enter to view the contents of the column where the cursor is located tab view details of Request and Response respectively / search for content in body esc exits editing e and enters editing mode
Use the command to start mitmdump and save the intercepted data to the specified file
Mitmdump-w outfile
Use the specified command to intercept the data, such as the specified processing script file as script.py.
Mitmdump-s script.py
PS:mitmdump is actually not too complicated, the important thing is to write python scripts.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.