Skip to content

Commit 5bcf232

Browse files
🐛 fix acunetix360 parser #10435 (#10440)
1 parent dd4985b commit 5bcf232

3 files changed

Lines changed: 72 additions & 7 deletions

File tree

dojo/tools/acunetix/parse_acunetix360_json.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,30 @@ def get_findings(self, filename, test):
2929
sev = item["Severity"]
3030
if sev not in ["Info", "Low", "Medium", "High", "Critical"]:
3131
sev = "Info"
32-
mitigation = text_maker.handle(item.get("RemedialProcedure", ""))
33-
references = text_maker.handle(item.get("RemedyReferences", ""))
32+
if item["RemedialProcedure"] is not None:
33+
mitigation = text_maker.handle(item.get("RemedialProcedure", ""))
34+
else:
35+
mitigation = None
36+
if item["RemedyReferences"] is not None:
37+
references = text_maker.handle(item.get("RemedyReferences", ""))
38+
else:
39+
references = None
3440
if "LookupId" in item:
3541
lookupId = item["LookupId"]
36-
references = (
37-
f"https://online.acunetix360.com/issues/detail/{lookupId}\n"
38-
+ references
39-
)
42+
if references is None:
43+
references = (
44+
f"https://online.acunetix360.com/issues/detail/{lookupId}\n"
45+
)
46+
else:
47+
references = (
48+
f"https://online.acunetix360.com/issues/detail/{lookupId}\n"
49+
+ references
50+
)
4051
url = item["Url"]
41-
impact = text_maker.handle(item.get("Impact", ""))
52+
if item["Impact"] is not None:
53+
impact = text_maker.handle(item.get("Impact", ""))
54+
else:
55+
impact = None
4256
dupe_key = title
4357
request = item["HttpRequest"]["Content"]
4458
if request is None or len(request) <= 0:
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"Generated": "19/06/2024 04:48 PM",
3+
"Target": {
4+
"Duration": "00:00:58.0662477",
5+
"Initiated": "23/02/2023 02:30 PM",
6+
"ScanId": "cb10809365d246d0881eafb202e63e55",
7+
"Url": "XXXX"
8+
},
9+
"Vulnerabilities": [
10+
{
11+
"Certainty": 90,
12+
"Classification": null,
13+
"Confirmed": false,
14+
"Description": "This vulnerability is removed or expired.",
15+
"ExploitationSkills": null,
16+
"ExternalReferences": null,
17+
"ExtraInformation": [],
18+
"FirstSeenDate": "02/06/2022 05:25 PM",
19+
"HttpRequest": {
20+
"Content": "GET /cgi-bin/ HTTP/1.1\r\nHost: XXXX\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\r\nAccept-Language: en-us,en;q=0.5\r\nCache-Control: no-cache\r\nCookie: PHPSESSID=1adegrqlm9oebggs8mghcs78gt\r\nReferer: https://ics-monitoring.amersports.int/cgi-bin/\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.5249.62 Safari/537.36\r\nX-Scanner: Acunetix 360\r\n\r\n",
21+
"Method": "GET",
22+
"Parameters": []
23+
},
24+
"HttpResponse": {
25+
"Content": "HTTP/1.1 403 Forbidden\r\nServer: Apache\r\nConnection: Keep-Alive\r\nKeep-Alive: timeout=5, max=100\r\nContent-Length: 199\r\nContent-Type: text/html; charset=iso-8859-1\r\nDate: Thu, 23 Feb 2023 09:45:56 GMT\r\n\r\n<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don't have permission to access this resource.</p>\n</body></html>\n",
26+
"Duration": 668.4901,
27+
"StatusCode": 403
28+
},
29+
"LookupId": "7ce8d15a-e5f0-4dd5-1f83-aea8034f4105",
30+
"Impact": null,
31+
"KnownVulnerabilities": [],
32+
"LastSeenDate": "23/02/2023 10:46 AM",
33+
"Name": "MissingXFrameOptionsHeader",
34+
"ProofOfConcept": null,
35+
"RemedialActions": null,
36+
"RemedialProcedure": null,
37+
"RemedyReferences": null,
38+
"Severity": "Low",
39+
"State": "Present",
40+
"Type": "MissingXFrameOptionsHeader",
41+
"Url": "XXXX",
42+
"Tags": []
43+
}
44+
]
45+
}

unittests/tools/test_acunetix_parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,3 +330,9 @@ def test_parse_file_issue_10370(self):
330330
parser = AcunetixParser()
331331
findings = parser.get_findings(testfile, Test())
332332
self.assertEqual(1, len(findings))
333+
334+
def test_parse_file_issue_10435(self):
335+
with open("unittests/scans/acunetix/issue_10435.json") as testfile:
336+
parser = AcunetixParser()
337+
findings = parser.get_findings(testfile, Test())
338+
self.assertEqual(1, len(findings))

0 commit comments

Comments
 (0)