diff --git a/ptp/tools/hoppy/parser.py b/ptp/tools/hoppy/parser.py index 770708b..81c4e56 100644 --- a/ptp/tools/hoppy/parser.py +++ b/ptp/tools/hoppy/parser.py @@ -21,10 +21,10 @@ class HoppyParser(FileParser): _re_version = re.compile(r"\D{3} \S+ (\d\.\d+\.\d+) \S") _re_transaction = re.compile(r"(?<=We Sent:)\n.*?(\S+ /.*?)\n(?=\n\t\D{3} Parsed Response:)", re.S) - _re_request = re.compile(r"(\S+ /.*?)\n(?=Server)", re.S) + _re_request = re.compile(r"(\S+ /.*?)(?=\r\n\r\n)", re.S) _re_response = re.compile(r"(?<=Responded:\n\n)(.*)", re.S) _re_response_status_code = re.compile(r"(?<=HTTP/\w.\w )(.*)") - _re_response_parse = re.compile(r"(?PHTTP.*?)\n(?=\r\n)(?P.*)", re.S) + _re_response_parse = re.compile(r"(?PHTTP.*?)(?=\n)(?P.*)", re.S) def __init__(self, pathname, filename='*.spider', **kwargs): """Initialize HoppyParser. @@ -93,9 +93,20 @@ def parse_report(self): if not transactions: return None for count, transaction in enumerate(transactions): - response = self._re_response.search(transaction).group().strip() + '\n\n' - status_code = self._re_response_status_code.findall(response) - parsed_response = self._re_response_parse.findall(response) + try: + response = self._re_response.search(transaction).group().strip() + '\n\n' + except AttributeError: + response = "NOT FOUND" + if(response != "NOT FOUND"): + try: + status_code = self._re_response_status_code.findall(response) + parsed_response = self._re_response_parse.findall(response) + except Exception: + status_code = ["NOT FOUND"] + parsed_response = [["NOT FOUND", "NOT FOUND"]] + else: + status_code = ["NOT FOUND"] + parsed_response = [["NOT FOUND", "NOT FOUND"]] # Somehow follow naming conventions from http://docs.python-requests.org/en/master/ data.append({ 'request': self._re_request.findall(transaction)[0].strip() + '\n\n', @@ -103,5 +114,5 @@ def parse_report(self): 'headers': parsed_response[0][0].strip() + '\n\n', 'body': parsed_response[0][1].strip() + '\n\n' }) - self.data.append({'ranking': constants.UNKOWN, 'transactions': data}) + self.data.append({'ranking': constants.UNKNOWN, 'transactions': data}) return self.data diff --git a/tests/tools/hoppy/__init__.py b/tests/tools/hoppy/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/tools/hoppy/hoppy_1_8.spider b/tests/tools/hoppy/hoppy_1_8.spider new file mode 100644 index 0000000..1207649 --- /dev/null +++ b/tests/tools/hoppy/hoppy_1_8.spider @@ -0,0 +1,320 @@ + +[+] Spider Beggining for example.com:443 with a Virtual Host of example.com + + [+] Start points are '/' and '/images/dummy.txt' + + +We Sent: + +GET / HTTP/1.1 +Host: example.com + + + +Server Responded: + +HTTP/1.1 200 OK +Cache-Control: max-age=604800 +Content-Type: text/html +Date: Tue, 24 Jan 2017 09:57:22 GMT +Etag: "359670651+gzip+ident" +Expires: Tue, 31 Jan 2017 09:57:22 GMT +Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT +Server: ECS (cpm/F845) +Vary: Accept-Encoding +X-Cache: HIT +x-ec-custom-error: 1 +Content-Length: 1270 + + + + + Example Domain + + + + + + + + +
+

Example Domain

+

This domain is established to be used for illustrative examples in documents. You may use this + domain in examples without prior coordination or asking for permission.

+

More information...

+
+ + + + + [+] Parsed Response: + + /domains/example + +We Sent: + +GET /images/dummy.txt HTTP/1.1 +Host: example.com + + + +Server Responded: + +HTTP/1.1 404 Not Found +Accept-Ranges: bytes +Cache-Control: max-age=604800 +Content-Type: text/html +Date: Tue, 24 Jan 2017 09:57:22 GMT +Etag: "359670651" +Expires: Tue, 31 Jan 2017 09:57:22 GMT +Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT +Server: ECS (oxr/83CA) +Vary: Accept-Encoding +X-Cache: HIT +x-ec-custom-error: 1 +Content-Length: 1270 + + + + + Example Domain + + + + + + + + +
+

Example Domain

+

This domain is established to be used for illustrative examples in documents. You may use this + domain in examples without prior coordination or asking for permission.

+

More information...

+
+ + + + + [+] Parsed Response: + + /domains/example + +We Sent: + +GET /domains/example HTTP/1.1 +Host: example.com + + + +Server Responded: + +HTTP/1.1 404 Not Found +Accept-Ranges: bytes +Cache-Control: max-age=604800 +Content-Type: text/html +Date: Tue, 24 Jan 2017 09:57:23 GMT +Etag: "359670651" +Expires: Tue, 31 Jan 2017 09:57:23 GMT +Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT +Server: ECS (oxr/83CA) +Vary: Accept-Encoding +X-Cache: HIT +x-ec-custom-error: 1 +Content-Length: 1270 + + + + + Example Domain + + + + + + + + +
+

Example Domain

+

This domain is established to be used for illustrative examples in documents. You may use this + domain in examples without prior coordination or asking for permission.

+

More information...

+
+ + + + + [+] Parsed Response: + + /domains/example + +We Sent: + +GET /domains/ HTTP/1.1 +Host: example.com + + + +Server Responded: + +HTTP/1.1 404 Not Found +Accept-Ranges: bytes +Cache-Control: max-age=604800 +Content-Type: text/html +Date: Tue, 24 Jan 2017 09:57:23 GMT +Etag: "359670651" +Expires: Tue, 31 Jan 2017 09:57:23 GMT +Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT +Server: ECS (oxr/83CA) +Vary: Accept-Encoding +X-Cache: HIT +x-ec-custom-error: 1 +Content-Length: 1270 + + + + + Example Domain + + + + + + + + +
+

Example Domain

+

This domain is established to be used for illustrative examples in documents. You may use this + domain in examples without prior coordination or asking for permission.

+

More information...

+
+ + + + + [+] Parsed Response: + + /domains/example \ No newline at end of file diff --git a/tests/tools/hoppy/hoppy_1_8.summary b/tests/tools/hoppy/hoppy_1_8.summary new file mode 100644 index 0000000..acf9464 --- /dev/null +++ b/tests/tools/hoppy/hoppy_1_8.summary @@ -0,0 +1,1011 @@ + +[+] hoppy 1.8.1 run @ Tue Jan 24 04:57:34 2017: + + [+] hoppy -h https://example.com -t 60 -o ./http-methods -k ./response-keywords -F ./hoppy.conf -S /root/Desktop/hoppy2 -vvv -4 + +[+] Configuring Test Environment + + [+] Saving Attack data to /root/Desktop/hoppy2.attack.1 + + [+] Saving Summary data to /root/Desktop/hoppy2.summary.1 + + [+] Saving Spider data to /root/Desktop/hoppy2.spider.1 + + [+] Setup complete :-) + +[+] Initialising Connection + + [+] Test host example.com resolves to 93.184.216.34 + + [+] Testing SSL Connection to example.com:443 - OK Data Recieved + +[+] Beginning spider with '/' and '/images/dummy.txt' as start points: + + /domains/ + + [+] Spider Completed :-) + + [+] Found 1 directories for testing + +[+] Testing https://example.com:443 [93.184.216.34] with /images/dummy.txt as webDAV location + + +[+] Testing Invalid Method request on /images/dummy.txt +. +[+] Testing Options request on /images/dummy.txt +. +[+] Testing Options request on /images/dummy.txt +. +[+] Testing Invalid Method request on /images/dummy.txt +. +[+] Testing Options request on /images/dummy.txt +. +[+] Testing Invalid Method request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Options request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt + +[+] Testing Options request on /images/dummy.txt +.. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Options request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info /domains request on /images/dummy.txt +. +[+] Testing Info /domains request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info /d%c0%afomains request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info /d%c0%afomains request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt + +[+] Testing Info request on /images/dummy.txt +.. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing IIS Trace request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing IIS Trace request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Track request on /images/dummy.txt +. +[+] Testing Track request on /images/dummy.txt +. +[+] Testing Track request on /images/dummy.txt +. +[+] Testing IIS Trace request on /images/dummy.txt +. +[+] Testing Track request on /images/dummy.txt +. +[+] Testing Trace request on /images/dummy.txt +. +[+] Testing Trace request on /images/dummy.txt +. +[+] Testing Track request on /images/dummy.txt +. +[+] Testing Trace request on /images/dummy.txt +. +[+] Testing Track request on /images/dummy.txt +. +[+] Testing Trace request on /images/dummy.txt +. +[+] Testing Trace request on /images/dummy.txt +. +[+] Testing Trace request on /images/dummy.txt +. +[+] Testing Track request on /images/dummy.txt +. +[+] Testing Track request on /images/dummy.txt +. +[+] Testing Track request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Trace request on /images/dummy.txt +. +[+] Testing Track request on /images/dummy.txt +. +[+] Testing Trace request on /images/dummy.txt +. +[+] Testing Track request on /images/dummy.txt +. +[+] Testing Trace request on /images/dummy.txt +. +[+] Testing Track request on /images/dummy.txt +. +[+] Testing Copy request on /images/dummy.txt +. +[+] Testing Track request on /images/dummy.txt +. +[+] Testing Trace request on /images/dummy.txt +. +[+] Testing Trace request on /images/dummy.txt +. +[+] Testing Trace request on /images/dummy.txt +. +[+] Testing Trace request on /images/dummy.txt +. +[+] Testing Track request on /images/dummy.txt +. +[+] Testing Copy request on /images/dummy.txt +. +[+] Testing Put /images/dummy.txt.put request on /images/dummy.txt +. +[+] Testing IIS Trace request on /images/dummy.txt +. +[+] Testing Trace request on /images/dummy.txt +. +[+] Testing Put /images/dummy.txt.put request on /images/dummy.txt +. +[+] Testing Put /images/dummy.txt.put request on /images/dummy.txt +. +[+] Testing Debug request on /images/dummy.txt +. +[+] Testing Copy request on /images/dummy.txt +. +[+] Testing IIS Trace request on /images/dummy.txt +. +[+] Testing IIS Trace request on /images/dummy.txt +. +[+] Testing Copy request on /images/dummy.txt +. +[+] Testing Debug request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Delete /images/dummy.txt.put request on /images/dummy.txt +. +[+] Testing Lock request on /images/dummy.txt +. +[+] Testing Debug request on /images/dummy.txt +. +[+] Testing Lock request on /images/dummy.txt +. +[+] Testing Lock request on /images/dummy.txt +. +[+] Testing Copy request on /images/dummy.txt +. +[+] Testing Lock request on /images/dummy.txt +. +[+] Testing Copy request on /images/dummy.txt +. +[+] Testing Lock request on /images/dummy.txt +. +[+] Testing Lock request on /images/dummy.txt +. +[+] Testing Delete /images/dummy.txt.put request on /images/dummy.txt +. +[+] Testing unLock request on /images/dummy.txt +. +[+] Testing Delete /images/dummy.txt.put request on /images/dummy.txt +. +[+] Testing unLock request on /images/dummy.txt +. +[+] Testing unLock request on /images/dummy.txt +. +[+] Testing unLock request on /images/dummy.txt +. +[+] Testing Move request on /images/dummy.txt +. +[+] Testing mkcol request on /images/dummy.txt +. +[+] Testing mkcol request on /images/dummy.txt +. +[+] Testing unLock request on /images/dummy.txt +. +[+] Testing Delete /images/dummy.txt.put request on /images/dummy.txt +. +[+] Testing Delete /images/dummy.txt.put request on /images/dummy.txt +. +[+] Testing Delete /images/dummy.txt.put request on /images/dummy.txt +. +[+] Testing Copy request on /images/dummy.txt +. +[+] Testing unLock request on /images/dummy.txt +. +[+] Testing Copy request on /images/dummy.txt +. +[+] Testing Propfind /images/ request on /images/dummy.txt +. +[+] Testing Propfind /images/ request on /images/dummy.txt +. +[+] Testing Propfind /images/ request on /images/dummy.txt +. +[+] Testing Propfind /images/ request on /images/dummy.txt +. +[+] Testing mkcol request on /images/dummy.txt +. +[+] Testing Propfind / request on /images/dummy.txt +. +[+] Testing Propfind / request on /images/dummy.txt +. +[+] Testing Move request on /images/dummy.txt +. +[+] Testing Copy request on /images/dummy.txt +. +[+] Testing Move request on /images/dummy.txt +. +[+] Testing Propfind /images request on /images/dummy.txt +. +[+] Testing Propfind /images request on /images/dummy.txt +. +[+] Testing Propfind /images request on /images/dummy.txt +. +[+] Testing Propfind /images request on /images/dummy.txt +. +[+] Testing Propfind / request on /images/dummy.txt +. +[+] Testing Basic Auth request on /images/dummy.txt +. +[+] Testing Basic Auth request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Basic Auth request on /images/dummy.txt +. +[+] Testing Basic Auth request on /images/dummy.txt +. +[+] Testing Basic Auth request on /images/dummy.txt +. +[+] Testing Basic Auth request on /images/dummy.txt +. +[+] Testing Basic Auth request on /images/dummy.txt +. +[+] Testing Basic Auth request on /images/dummy.txt +. +[+] Testing Basic Auth request on /images/dummy.txt +. +[+] Testing NTLM Auth request on /images/dummy.txt +. +[+] Testing NTLM Auth request on /images/dummy.txt +. +[+] Testing NTLM Auth request on /images/dummy.txt +. +[+] Testing NTLM Auth request on /images/dummy.txt +. +[+] Testing NTLM Auth request on /images/dummy.txt +. +[+] Testing NTLM Auth request on /images/dummy.txt +. +[+] Testing NTLM Auth request on /images/dummy.txt +. +[+] Testing NTLM Auth request on /images/dummy.txt +. +[+] Testing NTLM Auth request on /images/dummy.txt +. +[+] Testing Digest Auth request on /images/dummy.txt +. +[+] Testing Digest Auth request on /images/dummy.txt +. +[+] Testing Digest Auth request on /images/dummy.txt +. +[+] Testing Digest Auth request on /images/dummy.txt +. +[+] Testing Digest Auth request on /images/dummy.txt +. +[+] Testing Digest Auth request on /images/dummy.txt +. +[+] Testing Digest Auth request on /images/dummy.txt +. +[+] Testing Digest Auth request on /images/dummy.txt +. +[+] Testing Digest Auth request on /images/dummy.txt +. +[+] Testing IIS Cookie Test request on /images/dummy.txt +. +[+] Testing IIS Cookie Test request on /images/dummy.txt +. +[+] Testing Put /images/dummy.txt.put request on /images/dummy.txt +! +[+] Testing IIS Cookie Test request on /images/dummy.txt +. +[+] Testing IIS Cookie Test request on /images/dummy.txt +. +[+] Testing Put /images/dummy.txt.put request on /images/dummy.txt +! +[+] Testing Put /images/dummy.txt.put request on /images/dummy.txt +! +[+] Testing Put /images/dummy.txt.put request on /images/dummy.txt +! +[+] Testing Put /images/dummy.txt.put request on /images/dummy.txt +! +[+] Testing IIS Cookie Test request on /images/dummy.txt +. +[+] Testing IIS Cookie Test request on /images/dummy.txt +. +[+] Testing IIS Cookie Test request on /images/dummy.txt +. +[+] Testing IIS Cookie Test request on /images/dummy.txt +. +[+] Testing IIS Cookie Test request on /images/dummy.txt +. +[+] Testing IIS Cookie Test request on /images/dummy.txt +. +[+] Testing IIS Cookie Test request on /images/dummy.txt +. +[+] Testing IIS Cookie Test request on /images/dummy.txt +. +[+] Testing Propfind /images/dummy.txt request on /images/dummy.txt +! +[+] Testing Propfind /images/dummy.txt request on /images/dummy.txt +! +[+] Testing Propfind /images/ request on /images/dummy.txt +! +[+] Testing .printer request on /images/dummy.txt +. +[+] Testing .printer request on /images/dummy.txt +. +[+] Testing Proppatch /images/ request on /images/dummy.txt +! +[+] Testing Proppatch /images/dummy.txt request on /images/dummy.txt +. +[+] Testing Proppatch /images/ request on /images/dummy.txt +! +[+] Testing IIS Cookie Test request on /images/dummy.txt +. +[+] Testing .printer request on /images/dummy.txt +. +[+] Testing .idq request on /images/dummy.txt +. +[+] Testing Proppatch /images/dummy.txt request on /images/dummy.txt +! +[+] Testing Proppatch /images/dummy.txt request on /images/dummy.txt +! +[+] Testing Propfind /images/ request on /images/dummy.txt +. +[+] Testing .idq request on /images/dummy.txt +. +[+] Testing .htr request on /images/dummy.txt +. +[+] Testing .idq request on /images/dummy.txt +. +[+] Testing .htw request on /images/dummy.txt +. +[+] Testing .idc request on /images/dummy.txt +. +[+] Testing .htw request on /images/dummy.txt +. +[+] Testing .ida request on /images/dummy.txt +. +[+] Testing Propfind /images/ request on /images/dummy.txt +! +[+] Testing .htr request on /images/dummy.txt +. +[+] Testing .htr request on /images/dummy.txt +. +[+] Testing .shtm request on /images/dummy.txt +. +[+] Testing .htw request on /images/dummy.txt +. +[+] Testing .shtml request on /images/dummy.txt +. +[+] Testing Frontpage Config Inf request on /images/dummy.txt +. +[+] Testing .stm request on /images/dummy.txt +. +[+] Testing Frontpage Config Inf request on /images/dummy.txt +. +[+] Testing .shtm request on /images/dummy.txt +. +[+] Testing .shtml request on /images/dummy.txt +. +[+] Testing Frontpage Config Inf request on /images/dummy.txt +. +[+] Testing .idc request on /images/dummy.txt +. +[+] Testing .stm request on /images/dummy.txt +. +[+] Testing Frontpage shtml.dll request on /images/dummy.txt +. +[+] Testing .shtm request on /images/dummy.txt +. +[+] Testing Frontpage shtml.dll request on /images/dummy.txt +. +[+] Testing .stm request on /images/dummy.txt +. +[+] Testing Frontpage Post Inf request on /images/dummy.txt +. +[+] Testing Frontpage Post Inf request on /images/dummy.txt +. +[+] Testing Frontpage shtml.dll request on /images/dummy.txt +. +[+] Testing Frontpage dir (bin) request on /images/dummy.txt +. +[+] Testing Frontpage Post Inf request on /images/dummy.txt +. +[+] Testing Frontpage dir (pvt) request on /images/dummy.txt +. +[+] Testing .ida request on /images/dummy.txt +. +[+] Testing .ida request on /images/dummy.txt +. +[+] Testing IIS Cookie Test request on /images/dummy.txt +. +[+] Testing Frontpage dir (bin) request on /images/dummy.txt +. +[+] Testing Frontpage dir (pvt) request on /images/dummy.txt +. +[+] Testing Frontpage dir (cnf) request on /images/dummy.txt +. +[+] Testing Frontpage dir (log) request on /images/dummy.txt +. +[+] Testing Frontpage dir (cnf) request on /images/dummy.txt +. +[+] Testing Frontpage dir (log) request on /images/dummy.txt +. +[+] Testing Frontpage dir (cnf) request on /images/dummy.txt +. +[+] Testing Frontpage dir (log) request on /images/dummy.txt +. +[+] Testing Frontpage dir (bin) request on /images/dummy.txt +. +[+] Testing Frontpage dir (script) request on /images/dummy.txt +. +[+] Testing Frontpage dir (txt) request on /images/dummy.txt +. +[+] Testing Frontpage dir (script) request on /images/dummy.txt +. +[+] Testing Frontpage dir (txt) request on /images/dummy.txt +. +[+] Testing Frontpage dir (txt) request on /images/dummy.txt +. +[+] Testing Frontpage dir (script) request on /images/dummy.txt +. +[+] Testing MultiViews Check request on /images/dummy.txt +. +[+] Testing Expect Header XSS request on /images/dummy.txt +. +[+] Testing Frontpage dir (pvt) request on /images/dummy.txt +. +[+] Testing MultiViews Check request on /images/dummy.txt +. +[+] Testing MultiViews Check request on /images/dummy.txt +. +[+] Testing Expect Header XSS request on /images/dummy.txt +. +[+] Testing .idc request on /images/dummy.txt +. +[+] Testing Expect Header XSS request on /images/dummy.txt +. +[+] Testing 413 XSS request on /images/dummy.txt +. +[+] Testing Expect Header XSS request on /images/dummy.txt +. +[+] Testing 413 XSS request on /images/dummy.txt +. +[+] Testing Expect Header XSS request on /images/dummy.txt +. +[+] Testing Proxy Connect request on /images/dummy.txt +. +[+] Testing Expect Header XSS request on /images/dummy.txt +. +[+] Testing Proxy request on /images/dummy.txt +. +[+] Testing phpinfo request on /images/dummy.txt +. +[+] Testing phpinfo request on /images/dummy.txt +. +[+] Testing IIS Cookie Test request on /images/dummy.txt +. +[+] Testing phpinfo request on /images/dummy.txt +. +[+] Testing 413 XSS request on /images/dummy.txt +. +[+] Testing phpinfo request on /images/dummy.txt +. +[+] Testing phpinfo request on /images/dummy.txt +. +[+] Testing phpinfo request on /images/dummy.txt +. +[+] Testing phpinfo request on /images/dummy.txt +. +[+] Testing crossdomain.xml request on /images/dummy.txt +. +[+] Testing Robots.txt request on /images/dummy.txt +. +[+] Testing crossdomain.xml request on /images/dummy.txt +. +[+] Testing Robots.txt request on /images/dummy.txt +. +[+] Testing Robots.txt request on /images/dummy.txt +. +[+] Testing phpinfo request on /images/dummy.txt +. +[+] Testing phpinfo request on /images/dummy.txt +. +[+] Testing crossdomain.xml request on /images/dummy.txt +. +[+] Testing webDavDELETE on /domains/dnehoppy.html request on /images/dummy.txt +. +[+] Testing webDavDELETE on /d%c0%afomains/dnehoppy.html request on /images/dummy.txt +. +[+] Testing webDavDELETE on /domains/dnehoppy.html request on /images/dummy.txt +. +[+] Testing webDavDELETE on /d%c0%afomains/dnehoppy.html request on /images/dummy.txt +. +[+] Testing webDavDELETE on /domains/dnehoppy.html request on /images/dummy.txt +. +[+] Testing Put /images/dummy.txt.put request on /images/dummy.txt +! +[+] Testing .shtml request on /images/dummy.txt +. +[+] Testing webDav on /domains request on /images/dummy.txt +. +[+] Testing webDav on /d%c0%afomains request on /images/dummy.txt +. +[+] Testing webDav on /domains request on /images/dummy.txt +. +[+] Testing webDav on /d%c0%afomains request on /images/dummy.txt +. +[+] Testing Propfind /images/dummy.txt request on /images/dummy.txt +! +[+] Testing webDavDELETE on /d%c0%afomains/dnehoppy.html request on /images/dummy.txt +. +[+] Testing Proppatch /images/ request on /images/dummy.txt +! +[+] Testing Info request on /images/dummy.txt +. +[+] Testing webDav on /d%c0%afomains request on /images/dummy.txt +. +[+] Testing Propfind request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing tomcat manager request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing Propfind request on /images/dummy.txt +. +[+] Testing Info request on /images/dummy.txt +. +[+] Testing tomcat manager request on /images/dummy.txt +. +[+] Testing tomcat admin request on /images/dummy.txt +. +[+] Testing tomcat manager request on /images/dummy.txt +. +[+] Testing Frontpage Anon Login request on /images/dummy.txt +! +[+] Testing tomcat admin request on /images/dummy.txt +. +[+] Testing Frontpage Anon Login request on /images/dummy.txt +! +[+] Testing Frontpage Anon Login request on /images/dummy.txt +! +[+] Testing tomcat admin request on /images/dummy.txt +. +[+] Testing Frontpage Anon Login request on /images/dummy.txt +! +[+] Testing Frontpage Anon Login request on /images/dummy.txt +! +[+] Testing JBoss JMX-Server request on /images/dummy.txt +. +[+] Testing JBoss JMX-Server request on /images/dummy.txt +. +[+] Testing Frontpage Anon Login request on /images/dummy.txt +! +[+] Testing JBoss JMX-Server request on /images/dummy.txt +. +[+] Testing Frontpage leakage request on /images/dummy.txt +! +[+] Testing Frontpage leakage request on /images/dummy.txt +. +[+] Testing Frontpage leakage request on /images/dummy.txt +! +[+] Testing webDav on /domains request on /images/dummy.txt +. +[+] Testing webDavPUT on /domains request on /images/dummy.txt +! +[+] Testing webDavPUT on /domains request on /images/dummy.txt +! +[+] Testing webDavPUT on /d%c0%afomains request on /images/dummy.txt +! +[+] Testing webDavPUT on /d%c0%afomains request on /images/dummy.txt +! +[+] Testing webDavPUT on /d%c0%afomains request on /images/dummy.txt +! +[+] Testing webDavPUT on /domains request on /images/dummy.txt +! + +[+] Summary of Findings + + [+] Method Responses: + + .htr - HTTP/1.1 404 Not Found + .htw - HTTP/1.1 404 Not Found + .ida - HTTP/1.1 404 Not Found + .idc - HTTP/1.1 404 Not Found + .idq - HTTP/1.1 404 Not Found + .printer - HTTP/1.1 404 Not Found + .shtm - HTTP/1.1 404 Not Found + .shtml - HTTP/1.1 404 Not Found + .stm - HTTP/1.1 404 Not Found + 413 XSS - HTTP/1.0 501 Not Implemented + Basic Auth - HTTP/1.1 404 Not Found + Copy - HTTP/1.1 404 Not Found + Copy - HTTP/1.1 405 Method Not Allowed + Debug - HTTP/1.0 404 Not Found + Debug - HTTP/1.0 405 Method Not Allowed + Delete /images/dummy.txt.put - HTTP/1.1 404 Not Found + Delete /images/dummy.txt.put - HTTP/1.1 405 Method Not Allowed + Digest Auth - HTTP/1.1 200 OK + Digest Auth - HTTP/1.1 404 Not Found + Expect Header XSS - HTTP/1.1 417 Expectation Failed + Frontpage Anon Login - HTTP/1.1 000 This Test Falied! + Frontpage Anon Login - HTTP/1.1 100 Continue + Frontpage Anon Login - HTTP/1.1 404 Not Found + Frontpage Config Inf - HTTP/1.1 404 Not Found + Frontpage Post Inf - HTTP/1.1 404 Not Found + Frontpage dir (bin) - HTTP/1.1 404 Not Found + Frontpage dir (cnf) - HTTP/1.1 404 Not Found + Frontpage dir (log) - HTTP/1.1 404 Not Found + Frontpage dir (pvt) - HTTP/1.1 404 Not Found + Frontpage dir (script) - HTTP/1.1 404 Not Found + Frontpage dir (txt) - HTTP/1.1 404 Not Found + Frontpage leakage - HTTP/1.1 000 This Test Falied! + Frontpage leakage - HTTP/1.1 100 Continue + Frontpage leakage - HTTP/1.1 502 Bad Gateway + Frontpage shtml.dll - HTTP/1.1 404 Not Found + IIS Cookie Test - HTTP/1.1 200 OK + IIS Cookie Test - HTTP/1.1 404 Not Found + IIS Trace - HTTP/1.1 404 Not Found + Info /d%c0%afomains - HTTP/1.0 404 Not Found + Info /d%c0%afomains - HTTP/1.0 501 Not Implemented + Info /domains - HTTP/1.0 404 Not Found + Info /domains - HTTP/1.0 501 Not Implemented + Info - HTTP/1.0 200 OK + Info - HTTP/1.0 404 Not Found + Info - HTTP/1.0 501 Not Implemented + Info - HTTP/1.1 200 OK + Info - HTTP/1.1 400 Bad Request + Info - HTTP/1.1 404 Not Found + Invalid Method - HTTP/1.0 501 Not Implemented + JBoss JMX-Server - HTTP/1.1 404 Not Found + Lock - HTTP/1.1 404 Not Found + Lock - HTTP/1.1 405 Method Not Allowed + Move - HTTP/1.1 404 Not Found + Move - HTTP/1.1 405 Method Not Allowed + MultiViews Check - HTTP/1.1 404 Not Found + NTLM Auth - HTTP/1.1 200 OK + NTLM Auth - HTTP/1.1 404 Not Found + Options - HTTP/1.1 200 OK + Propfind / - HTTP/1.1 405 Method Not Allowed + Propfind /images - HTTP/1.1 404 Not Found + Propfind /images - HTTP/1.1 405 Method Not Allowed + Propfind /images/ - HTTP/1.1 000 This Test Falied! + Propfind /images/ - HTTP/1.1 100 Continue + Propfind /images/ - HTTP/1.1 404 Not Found + Propfind /images/ - HTTP/1.1 405 Method Not Allowed + Propfind /images/dummy.txt - HTTP/1.1 000 This Test Falied! + Propfind /images/dummy.txt - HTTP/1.1 100 Continue + Propfind /images/dummy.txt - HTTP/1.1 404 Not Found + Propfind - HTTP/1.1 404 Not Found + Proppatch /images/ - HTTP/1.1 000 This Test Falied! + Proppatch /images/ - HTTP/1.1 100 Continue + Proppatch /images/ - HTTP/1.1 404 Not Found + Proppatch /images/dummy.txt - HTTP/1.1 000 This Test Falied! + Proppatch /images/dummy.txt - HTTP/1.1 100 Continue + Proppatch /images/dummy.txt - HTTP/1.1 404 Not Found + Proxy Connect - HTTP/1.1 400 Bad Request + Proxy - HTTP/1.1 400 Bad Request + Put /images/dummy.txt.put - HTTP/1.1 000 This Test Falied! + Put /images/dummy.txt.put - HTTP/1.1 100 Continue + Put /images/dummy.txt.put - HTTP/1.1 404 Not Found + Robots.txt - HTTP/1.1 404 Not Found + Trace - HTTP/1.0 400 Bad Request + Trace - HTTP/1.0 505 HTTP Version Not Supported + Trace - HTTP/1.1 404 Not Found + Trace - HTTP/1.1 405 Method Not Allowed + Track - HTTP/1.0 501 Not Implemented + crossdomain.xml - HTTP/1.1 200 OK + crossdomain.xml - HTTP/1.1 404 Not Found + mkcol - HTTP/1.1 404 Not Found + mkcol - HTTP/1.1 405 Method Not Allowed + phpinfo - HTTP/1.1 404 Not Found + tomcat admin - HTTP/1.1 404 Not Found + tomcat manager - HTTP/1.1 404 Not Found + unLock - HTTP/1.1 404 Not Found + unLock - HTTP/1.1 405 Method Not Allowed + webDav on /d%c0%afomains - HTTP/1.1 404 Not Found + webDav on /d%c0%afomains - HTTP/1.1 405 Method Not Allowed + webDav on /domains - HTTP/1.1 404 Not Found + webDav on /domains - HTTP/1.1 405 Method Not Allowed + webDavDELETE on /d%c0%afomains/dnehoppy.html - HTTP/1.1 404 Not Found + webDavDELETE on /d%c0%afomains/dnehoppy.html - HTTP/1.1 405 Method Not Allowed + webDavDELETE on /domains/dnehoppy.html - HTTP/1.1 404 Not Found + webDavDELETE on /domains/dnehoppy.html - HTTP/1.1 405 Method Not Allowed + webDavPUT on /d%c0%afomains - HTTP/1.1 000 This Test Falied! + webDavPUT on /d%c0%afomains - HTTP/1.1 100 Continue + webDavPUT on /d%c0%afomains - HTTP/1.1 404 Not Found + webDavPUT on /domains - HTTP/1.1 000 This Test Falied! + webDavPUT on /domains - HTTP/1.1 100 Continue + webDavPUT on /domains - HTTP/1.1 404 Not Found + + [+] Interesting Method Responses: + + crossdomain.xml - HTTP/1.1 200 OK + + [+] Information Leakage: + + Allow: OPTIONS, GET, HEAD, POST + Etag: "359670651" + Etag: "359670651+gzip+ident" + Server: ECS (cpm/F845) + Server: ECS (cpm/F84B) + Server: ECS (cpm/F853) + Server: ECS (cpm/F858) + Server: ECS (cpm/F85A) + Server: ECS (cpm/F8D9) + Server: ECS (cpm/F8DC) + Server: ECS (cpm/F8DE) + Server: ECS (cpm/F8DF) + Server: ECS (cpm/F984) + Server: ECS (cpm/F988) + Server: ECS (cpm/F989) + Server: ECS (cpm/F98A) + Server: ECS (cpm/F995) + Server: ECS (cpm/F99A) + Server: ECS (cpm/F9A2) + Server: ECS (cpm/F9A4) + Server: ECS (cpm/F9A8) + Server: ECS (cpm/F9B0) + Server: ECS (cpm/F9B5) + Server: ECS (cpm/F9B6) + Server: ECS (cpm/F9BB) + Server: ECS (cpm/F9BF) + Server: ECS (cpm/F9C2) + Server: ECS (cpm/F9C3) + Server: ECS (cpm/F9C5) + Server: ECS (cpm/F9C7) + Server: ECS (cpm/F9C8) + Server: ECS (cpm/F9CA) + Server: ECS (cpm/F9CF) + Server: ECS (cpm/F9D0) + Server: ECS (cpm/F9D4) + Server: ECS (cpm/F9D6) + Server: ECS (cpm/F9D7) + Server: ECS (cpm/F9E2) + Server: ECS (cpm/F9E4) + Server: ECS (cpm/F9E5) + Server: ECS (cpm/F9E8) + Server: ECS (cpm/F9EC) + Server: ECS (cpm/F9ED) + Server: ECS (cpm/F9EF) + Server: ECS (cpm/F9F7) + Server: ECS (cpm/F9F8) + Server: ECS (cpm/F9FA) + Server: ECS (cpm/F9FB) + Server: ECS (oxr/83CA) + Server: ECSF (cpm/F84A) + Server: ECSF (cpm/F84B) + Server: ECSF (cpm/F852) + Server: ECSF (cpm/F853) + Server: ECSF (cpm/F857) + Server: ECSF (cpm/F859) + Server: ECSF (cpm/F8DC) + Server: ECSF (cpm/F8DD) + Server: ECSF (cpm/F8DE) + Server: ECSF (cpm/F985) + Server: ECSF (cpm/F988) + Server: ECSF (cpm/F98F) + Server: ECSF (cpm/F991) + Server: ECSF (cpm/F993) + Server: ECSF (cpm/F995) + Server: ECSF (cpm/F998) + Server: ECSF (cpm/F99D) + Server: ECSF (cpm/F9A2) + Server: ECSF (cpm/F9A3) + Server: ECSF (cpm/F9A6) + Server: ECSF (cpm/F9A8) + Server: ECSF (cpm/F9AD) + Server: ECSF (cpm/F9AF) + Server: ECSF (cpm/F9B4) + Server: ECSF (cpm/F9B7) + Server: ECSF (cpm/F9BC) + Server: ECSF (cpm/F9BD) + Server: ECSF (cpm/F9BE) + Server: ECSF (cpm/F9BF) + Server: ECSF (cpm/F9C0) + Server: ECSF (cpm/F9C1) + Server: ECSF (cpm/F9C3) + Server: ECSF (cpm/F9C8) + Server: ECSF (cpm/F9C9) + Server: ECSF (cpm/F9CA) + Server: ECSF (cpm/F9CC) + Server: ECSF (cpm/F9D0) + Server: ECSF (cpm/F9D3) + Server: ECSF (cpm/F9D6) + Server: ECSF (cpm/F9E1) + Server: ECSF (cpm/F9E2) + Server: ECSF (cpm/F9E6) + Server: ECSF (cpm/F9E8) + Server: ECSF (cpm/F9E9) + Server: ECSF (cpm/F9EA) + Server: ECSF (cpm/F9F2) + Server: ECSF (cpm/F9F3) + Server: ECSF (cpm/F9F5) + Server: ECSF (cpm/F9F9) + Server: ECSF (cpm/F9FA) + Server: ECSF (cpm/F9FB) + Server: EOS (lax004/280C) + Server: EOS (lax004/2816) + Server: EOS (lax004/2821) + Server: EOS (lax004/45C0) + Vary: Accept-Encoding + + [+] Extracted Data: + + crossdomain.xml: <allow-access-from domain="*" /> + diff --git a/tests/tools/hoppy/test_parser.py b/tests/tools/hoppy/test_parser.py new file mode 100644 index 0000000..c71a30f --- /dev/null +++ b/tests/tools/hoppy/test_parser.py @@ -0,0 +1,31 @@ +# -*- coding: UTF-8 -*- +import mock +import unittest + +from hamcrest import assert_that, has_entry, equal_to + +from ptp.tools.hoppy.parser import HoppyParser + +class TestHoppyParser(unittest.TestCase): + + ### + # HoppyParser.is_mine + ### + def test_parser_hoppy_is_mine(self): + self.assertTrue(HoppyParser.is_mine('./')) + + ### + # HoppyParser.parse_metadata + ### + def test_parser_hoppy_parse_metadata(self): + my_hoppy = HoppyParser('./') + assert_that(my_hoppy.parse_metadata(), has_entry('version', '1.8.1')) + + ### + # HoppyParser.parse_report + ### + def test_parser_burp_xml_parse_report(self): + HoppyParser.__format__ = '' + my_hoppy = HoppyParser("./") + report = my_hoppy.parse_report() + assert_that(4, equal_to(len(report[-1]['transactions']))) \ No newline at end of file