-
Notifications
You must be signed in to change notification settings - Fork 0
/
save.py
34 lines (29 loc) · 859 Bytes
/
save.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from mitmproxy.net.http.http1.assemble import assemble_request, assemble_response
from mitmproxy import ctx, proxy, options
import time
import asyncio
import os
import signal
from mitmproxy.tools.dump import DumpMaster
from mitmproxy.http import HTTPFlow
class AddApk:
def __init__(self):
self.name = ""
def load(self, loader):
loader.add_option(
name = "output",
typespec = str,
default = "",
help = "Specify the apk name",
)
def running(self):
self.name = ctx.options.output
f = open("output/" + self.name + "-mitmproxy.txt", 'w')
def response(self, flow):
f = open("output/" + self.name + "-mitmproxy.txt", 'a')
f.write(assemble_request(flow.request).decode('utf-8'))
def done(self):
f.close()
addons = [
AddApk()
]