Skip to content

Commit

Permalink
Merge pull request #54 from ilyaglow/json-rework-2
Browse files Browse the repository at this point in the history
Minor rework of a JSON printer
  • Loading branch information
xmendez authored Sep 25, 2017
2 parents 24effa7 + becc884 commit 9b6b2eb
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions wfuzz/plugins/printers/printers.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ def footer(self, summary):
class json(BasePrinter):
name = "json"
summary = "Results in json format"
author = ("Federico (@misterade)",)
version = "0.1"
author = ("Federico (@misterade)", "Minor rework by Ilya Glotov (@ilyaglow)")
version = "0.2"
category = ["default"]
priority = 99

Expand All @@ -153,12 +153,23 @@ def result(self, res):
location = res.history.headers.response['Location']
elif res.history.url != res.history.redirect_url:
location = "(*) %s" % res.history.url
post_data = {}
post_data = []
if res.history.method.lower() == "post":
for n, v in res.history.params.post.items():
post_data[n] = v

res_entry = {"lines": res.lines, "words": res.words, "chars" : res.chars, "url":res.url, "description":res.description, "location" : location, "server" : server, "server" : server, "postdata" : post_data}
post_data.append({"parameter": n, "value": v})

res_entry = {
"chars": res.chars,
"code": res.code,
"payload": res.description,
"lines": res.lines,
"location": location,
"method": res.history.method,
"post_data": post_data,
"server": server,
"url": res.url,
"words": res.words
}
self.json_res.append(res_entry)

def footer(self, summary):
Expand Down

0 comments on commit 9b6b2eb

Please sign in to comment.