2016-10-15 27 views
0

我正在使用mitmdump -dd > outfile來解析內容,它給我提供了完整的請求和響應「標題及其正文內容」(它也移除了流量的垃圾部分,即沒有證書和沒有壓縮數據)。如何解析Mitmdump/Mitmproxy內容

但是,這讓我真的文件可以large.How我剛剛得到的只有交通的請求部分....

任何意見或鏈接如何才能做到這一點?

感謝

回答

0

我處理不準確,但類似的情況下使用mitmdump的-s標誌,並在我的劇本得到flow.request.content,並登錄到這將是整齊漂亮一些日誌文件和清潔

來這裏的路上下面的代碼可能會有一些幫助(保存爲t.py並運行mitmdump -s t.py

from mitmproxy import http 
import time,re 
import logging 

def response(flow: http.HTTPFlow) -> None: 
    flow.response.headers["newheader"] = "foo" 

def request(flow: http.HTTPFlow) -> None: 
    print(flow.request.content) 
    request_content = flow.request.content 
    # here u get the request content and then log it and use it