From 760eef08f2cd87dc263be772385ee97fe574418d Mon Sep 17 00:00:00 2001 From: Yogesh Ojha Date: Wed, 13 Apr 2022 00:05:43 +0530 Subject: [PATCH] Fix vulnerability highlights on target summary --- .../templates/startScan/detail_scan.html | 36 ++- web/targetApp/templates/target/list.html | 3 +- web/targetApp/templates/target/summary.html | 292 ++++++++++++++---- web/targetApp/views.py | 2 +- 4 files changed, 266 insertions(+), 67 deletions(-) diff --git a/web/startScan/templates/startScan/detail_scan.html b/web/startScan/templates/startScan/detail_scan.html index 1353f680..11b65fe6 100644 --- a/web/startScan/templates/startScan/detail_scan.html +++ b/web/startScan/templates/startScan/detail_scan.html @@ -317,7 +317,7 @@ Scan Findings

{{critical_count}} Critical, {{high_count}} High, {{medium_count}} Medium
- {{low_count}} Low Vulnerabilities and {{info_count}} Informational Vulnerabilities + {{low_count}} Low and {{info_count}} Info Vulnerabilities

{% else %}

Vulnerability scan hasn't been performed.

@@ -539,22 +539,28 @@ Scan Findings

Vulnerability Breakdown by Severity

-
+
+
+

Critical

{{critical_count}}

-
+

High

{{high_count}}

-
+

Medium

{{medium_count}}

-
+

Low

{{low_count}}

+
+

Info

+

{{info_count}}

+
@@ -569,19 +575,31 @@ Scan Findings - + + - + {% for vulnerability in vulnerability_list %} - + +
VulnerabilityTypeVulnerability SeverityVulnerable URLVulnerable URL
{{vulnerability.name}}
Discovered: {{vulnerability.discovered_date|naturaltime}}
{{vulnerability.type}} + {{vulnerability.name}} + {% if vulnerability.cve_ids %} +
+ {% for cve in vulnerability.cve_ids %} + {{cve}} + {% endfor %} + {% endif %} +
+ Discovered: {{vulnerability.discovered_date|naturaltime}} +
{% if vulnerability.severity == 0 %} Info {% elif vulnerability.severity == 1 %} - Low + Low {% elif vulnerability.severity == 2 %} Medium {% elif vulnerability.severity == 3 %} diff --git a/web/targetApp/templates/target/list.html b/web/targetApp/templates/target/list.html index 949f45b9..b459742a 100644 --- a/web/targetApp/templates/target/list.html +++ b/web/targetApp/templates/target/list.html @@ -97,6 +97,7 @@ Targets
+   Target Summary   Initiate Scan
@@ -335,6 +335,95 @@ Target Summary
+
+
+
+
+

Vulnerability Breakdown by Severity

+
+
+
+ +
+
+

Critical

+

{{critical_count}}

+
+
+

High

+

{{high_count}}

+
+
+

Medium

+

{{medium_count}}

+
+
+

Low

+

{{low_count}}

+
+
+

Info

+

{{info_count}}

+
+
+
+
+
+
+
+
+
+
+

Vulnerability Highlights

+
+ + + + + + + + + + + {% for vulnerability in vulnerability_list %} + + + + + + + {% empty %} + Not enough data. + {% endfor %} + +
TypeVulnerabilitySeverityVulnerable URL
{{vulnerability.type}} + {{vulnerability.name}} + {% if vulnerability.cve_ids %} +
+ {% for cve in vulnerability.cve_ids %} + {{cve}} + {% endfor %} + {% endif %} +
+ Discovered: {{vulnerability.discovered_date|naturaltime}} +
{% if vulnerability.severity == 0 %} + Info + {% elif vulnerability.severity == 1 %} + Low + {% elif vulnerability.severity == 2 %} + Medium + {% elif vulnerability.severity == 3 %} + High + {% elif vulnerability.severity == 4 %} + Critical + {% endif %} + {{vulnerability.http_url|truncatechars:50}}
+
+
+
+
+
@@ -348,65 +437,158 @@ Target Summary {% endblock page_level_script %} diff --git a/web/targetApp/views.py b/web/targetApp/views.py index d50e392f..c5a2eac4 100644 --- a/web/targetApp/views.py +++ b/web/targetApp/views.py @@ -281,7 +281,7 @@ def target_summary(request, id): context['vulnerability_count'] = vulnerability_count context['vulnerability_list'] = Vulnerability.objects.filter( - target_domain__id=id).order_by('-severity').all()[:20] + target_domain__id=id).order_by('-severity').all()[:30] context['http_status_breakdown'] = Subdomain.objects.filter(target_domain=id).exclude(http_status=0).values('http_status').annotate(Count('http_status'))