package documentation
(source)

WPScan Output Parser Python library documentation.

The python module exposes helper methods and Parser objects to parse WPScan results as your convevnience.

Exemples

Using helper method parse_results_from_file. Return all results as a simple dictionnary.

import pprint
from wpscan_out_parse import parse_results_from_file

results = parse_results_from_file('./test/output_files/wordpress_many_vuln.json')
pprint.pprint(results)

Using WPScanJsonParser object.

import json
import pprint
from wpscan_out_parse import WPScanJsonParser

with open('./test/output_files/wordpress_one_vuln.json', 'r') as wpscan_out:
    parser = WPScanJsonParser(json.load(wpscan_out))
    pprint.pprint(parser.get_warnings())
Module formatter No module docstring; 4/6 functions documented
Package parser Undocumented
Module __main__ Undocumented

From the __init__.py module:

Variable VERSION Undocumented
Class WPScanCliParser Main interface to parse WPScan CLI output.
Class WPScanJsonParser Main interface to parse WPScan JSON data
Function format_results Format the results dict into a "html", "cli" or "json" string.
Function parse_results_from_file Parse any WPScan output file.
Function parse_results_from_string Parse any WPScan output string.
VERSION = (source)

Undocumented

(type: str)
def parse_results_from_string(wpscan_output_string, false_positives_strings=None, show_all_details=False): (source)

Parse any WPScan output string.

  • wpscan_output_string: WPScan output as string
  • false_positives_strings: List of false positive strings.
  • show_all_details: Boolean, enable to show all wpscan infos (found by, confidence, etc). Only with JSON output.

Return the results as dict object like

{
'infos':[],
'warnings':[],
'alerts':[],
'summary':{
    'table':[
        {
            'Component': None,
            'Version': None,
            'Version State': None,
            'Vulnerabilities': None,
            'Status': None
        },
        ...
    ],
    'line':'WPScan result summary: alerts={}, warnings={}, infos={}, error={}'
    },
'error':None
}

(summary table is only parsed for JSON files)

Parameterswpscan_output_stringUndocumented (type: str)
false_positives_stringsUndocumented (type: Optional[Sequence[str]])
show_all_detailsUndocumented (type: bool)
ReturnsUndocumented (type: WPScanResults)
def parse_results_from_file(wpscan_output_file, false_positives_strings=None, show_all_details=False): (source)

Parse any WPScan output file.

  • wpscan_output_file: Path to WPScan output file
  • false_positives_strings: List of false positive strings.
  • show_all_details: Boolean, enable to show all wpscan infos (found by, confidence, etc). Only with JSON output.

Return the results as dict object.

See parse_results_from_string.

Parameterswpscan_output_fileUndocumented (type: str)
false_positives_stringsUndocumented (type: Optional[Sequence[str]])
show_all_detailsUndocumented (type: bool)
ReturnsUndocumented (type: WPScanResults)
def format_results(results, format, warnings=True, infos=True, nocolor=False): (source)

Format the results dict into a "html", "cli" or "json" string.

  • results: resutlts dict objject.
  • format: in "html", "cli" or "json"
ParametersresultsUndocumented (type: Dict[str, Any])
formatUndocumented (type: str)
warningsUndocumented (type: bool)
infosUndocumented (type: bool)
nocolorUndocumented (type: bool)
ReturnsUndocumented (type: str)
API Documentation for WPScan Output Parser, generated by pydoctor 21.2.2 at 2021-04-12 15:55:36.