[Solved]Log post data to an external file, with a py script?


#1

Anyone got a code for that?


#2

Srsl, no body? I’m running in reverse mode…


#3

maybe something similar to the dumper in this PR that just extracts request bodies?


#4

what config do you have now? Do you already use any py script with mitmproxy?


#5

maybe try mitmdump -nr [output_file] --set flow_detail=1 --showhost > [name_file]
but this is didn’t use py


#6

I’ve come up with a more simple solution. Thanks Guys.

def request(flow):
    empty_request = b''
    if empty_request != flow.request.content :
        a = open('./post.txt', 'ab')
        a.write(flow.request.content + "\n".encode('ascii'))