Enable --host option for mitmdump
This commit is contained in:
parent
0e993bec6f
commit
e50da8164f
|
@ -57,12 +57,12 @@ def str_response(resp):
|
|||
return r
|
||||
|
||||
|
||||
def str_request(req):
|
||||
def str_request(req, showhost):
|
||||
if req.client_conn:
|
||||
c = req.client_conn.address[0]
|
||||
else:
|
||||
c = "[replay]"
|
||||
r = "%s %s %s"%(c, req.method, req.get_url())
|
||||
r = "%s %s %s"%(c, req.method, req.get_url(showhost))
|
||||
if req.stickycookie:
|
||||
r = "[stickycookie] " + r
|
||||
return r
|
||||
|
@ -76,6 +76,7 @@ class DumpMaster(flow.FlowMaster):
|
|||
self.anticache = options.anticache
|
||||
self.anticomp = options.anticomp
|
||||
self.eventlog = options.eventlog
|
||||
self.showhost = options.showhost
|
||||
self.refresh_server_playback = options.refresh_server_playback
|
||||
|
||||
if filtstr:
|
||||
|
@ -179,16 +180,16 @@ class DumpMaster(flow.FlowMaster):
|
|||
result = " << %s"%f.error.msg
|
||||
|
||||
if self.o.verbosity == 1:
|
||||
print >> self.outfile, str_request(f.request)
|
||||
print >> self.outfile, str_request(f.request, self.showhost)
|
||||
print >> self.outfile, result
|
||||
elif self.o.verbosity == 2:
|
||||
print >> self.outfile, str_request(f.request)
|
||||
print >> self.outfile, str_request(f.request, self.showhost)
|
||||
print >> self.outfile, self.indent(4, f.request.headers)
|
||||
print >> self.outfile
|
||||
print >> self.outfile, result
|
||||
print >> self.outfile, "\n"
|
||||
elif self.o.verbosity >= 3:
|
||||
print >> self.outfile, str_request(f.request)
|
||||
print >> self.outfile, str_request(f.request, self.showhost)
|
||||
print >> self.outfile, self.indent(4, f.request.headers)
|
||||
if utils.isBin(f.request.content):
|
||||
print >> self.outfile, self.indent(4, netlib.utils.hexdump(f.request.content))
|
||||
|
|
Loading…
Reference in New Issue