Arachni

Parser

synopsis:Specialized ptp.libptp.parser.AbstractParser classes for the tool Arachni.
class ptp.tools.arachni.parser.ArachniXMLParser(pathname='./', filename='*.xml', **kwargs)[source]

Arachni XML specialized parser.

__tool__ = 'arachni'
__format__ = 'xml'
__version__ = '(^0\\.4\\.[0-9]+$)|(^1\\.[0-9]+(\\.[0-9]+)?$)'
_parse_report_full(tree)[source]

Parse Arachni XML reports to extract additional information.

Arachni HTTP traffic is divided into following fields:
  • request
  • response status code
  • response headers
  • response body
Returns:List of dicts where each entry is the HTTP traffic generated for the issue.
Return type:list
classmethod is_mine(pathname, filename='*.xml', light=False, first=True)[source]

Check if it can handle the report file.

Parameters:
  • pathname (str) – Path to the report directory.
  • filename (str) – Regex matching the report file.
  • light (bool) – True to only parse the ranking of the findings from the report.
  • first (bool) – Only process first file (True) or each file that matched (False).
Raises:
  • IOError – when the report file cannot be found.
  • OSError – when the report file cannot be found.
Returns:

True if it supports the report, False otherwise.

Return type:

bool

parse_metadata()[source]

Parse the metadata of the report.

Raises:NotSupportedVersionError – if it does not support the version of this report.
Returns:The metadata of the report.
Return type:dict
parse_report()[source]

Parse the results of the report.

Returns:List of dicts where each one represents a discovery.
Return type:list
class ptp.tools.arachni.parser.ArachniJSONParser(pathname='./', filename='*', light=False, first=True)[source]

Arachni XML specialized parser.

__tool__ = 'arachni'
__format__ = 'xml'
__version__ = '(^1\\.[0-9]+(\\.[0-9]+)?$)'
_parse_report_full(issues)[source]

Parse Arachni JSON reports to extract additional information.

Arachni HTTP traffic is divided into following fields:
  • request
  • response status code
  • response headers
  • response body
Returns:List of dicts where each entry is the HTTP traffic generated for the issue.
Return type:list
classmethod is_mine(pathname, filename='*.json', light=False, first=True)[source]

Check if it can handle the report file.

Parameters:
  • pathname (str) – Path to the report directory.
  • filename (str) – Regex matching the report file.
  • light (bool) – True to only parse the ranking of the findings from the report.
  • first (bool) – Only process first file (True) or each file that matched (False).
Returns:

True if it supports the report, False otherwise.

Return type:

bool

parse_metadata()[source]

Parse the metadata of the report.

Raises:NotSupportedVersionError – if it does not support the version of this report.
Returns:The metadata of the report.
Return type:dict
parse_report()[source]

Parse the results of the report.

Returns:List of dicts where each one represents a discovery.
Return type:list