Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
json output support for scanned result
Browse files Browse the repository at this point in the history
  • Loading branch information
the-robot committed Dec 6, 2017
1 parent 64ec101 commit 76c5b56
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/std.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import print_function

import time
import json
from termcolor import colored, cprint
from terminaltables import SingleTable

Expand Down Expand Up @@ -54,6 +55,21 @@ def dump(array, filename):
for data in array:
output.write(data + "\n")

def dumpjson(array, filename='wtf.json'):
"""save the scanned result into a file as"""
jsondata = {}

for index, result in enumerate(array):
jsondata[index] = {
'url': result[0].encode('utf-8'),
'db': result[1].encode('utf-8'),
'server': result[2].encode('utf-8'),
'lang': result[3].encode('utf-8')
}

with open(filename, 'w') as output:
output.write(json.dumps(jsondata, indent=4))

def printserverinfo(data):
"""show vulnerable websites in table"""

Expand Down

0 comments on commit 76c5b56

Please sign in to comment.