From e5b8b6a8ea3f00bedad696dffc818ae3e670a1f8 Mon Sep 17 00:00:00 2001 From: Yogesh Ojha Date: Mon, 19 Apr 2021 11:30:11 +0530 Subject: [PATCH] Vulnerability chart fixed --- .../templates/startScan/detail_scan.html | 183 ++++++++++++++---- startScan/views.py | 2 + 2 files changed, 152 insertions(+), 33 deletions(-) diff --git a/startScan/templates/startScan/detail_scan.html b/startScan/templates/startScan/detail_scan.html index cf0d05fb..1e346357 100644 --- a/startScan/templates/startScan/detail_scan.html +++ b/startScan/templates/startScan/detail_scan.html @@ -47,7 +47,7 @@ All Subdomains -
+
@@ -73,7 +73,7 @@ All Subdomains
-
+
@@ -112,6 +112,152 @@ All Subdomains
+
+ {% include 'base/_items/interesting_recon.html' %} +
+
+
+
+
Subdomain Changes
+

+ {% if new_subdomains.count or removed_subdomains.count %} + During the last scan + {% if new_subdomains.count %} + {{new_subdomains.count}} Subdomains were Added + {% endif %} + {% if removed_subdomains.count %} + {{removed_subdomains.count}} Subdomains were Removed + {% endif %} + {% else %} +
+ {% endif %} +

+
+
+
+
+ + + + + + + + + {% for subdomain in new_subdomains %} + + + + + {% endfor %} + {% for subdomain in removed_subdomains %} + + + + + {% endfor %} + +
SubdomainStatus
{{subdomain.subdomain}} Added
{{subdomain.subdomain}} Removed
+
+
+
+
+
+
+
+
+
Endpoint Changes
+

+ {% if new_urls.count or removed_urls.count %} + During the last scan + {% if new_urls.count %} + {{new_urls.count}} URLs were Added + {% endif %} + {% if removed_urls.count %} + {{removed_urls.count}} URLs were Removed + {% endif %} + {% else %} +
+ {% endif %} +

+
+
+
+
+ + + + + + + + + {% for url in new_urls %} + + + + + {% endfor %} + {% for url in removed_urls %} + + + + + {% endfor %} + +
EndpointStatus
{{url.http_url|truncatechars:100}} Added
{{url.http_url|truncatechars:100}} Removed
+
+
+
+
+
+
+
+
+
Vulnerability Scan Summary
+
+
+
+
+
+
+
+
+ + + + + + + + + + {% for vulnerability in vulnerability_list %} + + + + + + {% endfor %} + +
Vulnerability
Severity
Vulnerable URL
{{vulnerability.name}}{% 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.url|truncatechars:20}}
+
+
+
+
+
+
+ {% endblock main_content %} @@ -383,7 +529,7 @@ function span_values(data, color) var options = { chart: { type: 'donut', - width: 380 + width: 355 }, colors: ['#D50000', '#F44336', '#FF6D00', '#FFD600', '#2962FF'], dataLabels: { @@ -446,36 +592,7 @@ var options = { width: 25, }, series: [{{critical_count}}, {{high_count}}, {{medium_count}}, {{low_count}}, {{info_count}}], - labels: ['Critical', 'High', 'Medium', 'Low', 'Info'], - responsive: [{ - breakpoint: 1599, - options: { - chart: { - width: '350px', - height: '400px' - }, - legend: { - position: 'bottom' - } - }, - breakpoint: 1439, - options: { - chart: { - width: '250px', - height: '390px' - }, - legend: { - position: 'bottom' - }, - plotOptions: { - pie: { - donut: { - size: '65%', - } - } - } - }, - }] + labels: ['Critical', 'High', 'Medium', 'Low', 'Info'] } var chart = new ApexCharts( diff --git a/startScan/views.py b/startScan/views.py index 9a6ab84b..066b303e 100644 --- a/startScan/views.py +++ b/startScan/views.py @@ -53,6 +53,8 @@ def detail_scan(request, id=None): vulnerability_of__id=id, severity=3).count() critical_count = VulnerabilityScan.objects.filter( vulnerability_of__id=id, severity=4).count() + context['vulnerability_list'] = VulnerabilityScan.objects.filter( + vulnerability_of__id=id).all() context['total_vulnerability_count'] = info_count + low_count + \ medium_count + high_count + critical_count context['info_count'] = info_count