PTP¶
-
class
ptp.
PTP
(tool_name='', cumulative=False)[source]¶ PTP
class exposingptp
’s public API.Example:
ptp = PTP(pathname='my/path') ptp.parse()
-
__init__
(tool_name='', cumulative=False)[source]¶ Initialize
PTP
.Parameters: Raises: ptp.libptp.exceptions.NotSupportedToolError
whentool_name
is not in the PTP’s supported tools list.
-
_init_parser
(*args, **kwargs)[source]¶ Find and initialize the parser automatically.
Parameters: - *args (list) – Arguments that are needed by the parser.
- **kwargs (dict) – Arguments that are needed by the parser.
-
highest_ranking
¶ Return the highest ranking of the report.
Returns: the risk id of the highest ranked vulnerability referenced in the report. Return type: int Note
The ranking starts from 0 to n where n represents the most critical risk. (See
ptp.libptp.constants
).
-
parse
(*args, **kwargs)[source]¶ Parse a tool report.
Parameters: - *args (list) – Arguments that are needed by the parser.
- **kwargs (dict) – Arguments that are needed by the parser.
Raises: NotSupportedToolError
if the tool that has generated the report is not supported by PTP.Returns: The list of dictionaries of the results found in the report.
Return type: list
-
supported
= {'arachni': [<class 'ptp.tools.arachni.parser.ArachniXMLParser'>, <class 'ptp.tools.arachni.parser.ArachniJSONParser'>], 'skipfish': [<class 'ptp.tools.skipfish.parser.SkipfishJSParser'>], 'w3af': [<class 'ptp.tools.w3af.parser.W3AFXMLParser'>], 'wapiti': [<class 'ptp.tools.wapiti.parser.WapitiXMLParser'>, <class 'ptp.tools.wapiti.parser.Wapiti221XMLParser'>], 'metasploit': [<class 'ptp.tools.metasploit.parser.MetasploitParser'>], 'dirbuster': [<class 'ptp.tools.dirbuster.parser.DirbusterParser'>], 'nmap': [<class 'ptp.tools.nmap.parser.NmapXMLParser'>], 'owasp-cm-008': [<class 'ptp.tools.owasp.cm008.parser.OWASPCM008Parser'>], 'robots': [<class 'ptp.tools.robots.parser.RobotsParser'>], 'burpsuite': [<class 'ptp.tools.burpsuite.parser.BurpXMLParser'>], 'hoppy': [<class 'ptp.tools.hoppy.parser.HoppyParser'>]}¶ dict
– Supported tools and their parser(s).
-
vulns
= None¶ list
– Vulnerabilities that are listed in the report.
-