Fix Hide info vulns on report when box checked

This commit is contained in:
Raynald
2023-12-05 02:10:18 +01:00
parent 753b2613e0
commit c76eeb4967
3 changed files with 23 additions and 6 deletions
+7
View File
@@ -262,6 +262,13 @@ class Subdomain(models.Model):
vulns = vulns.filter(scan_history=self.scan_history)
return vulns
@property
def get_vulnerabilities_without_info(self):
vulns = Vulnerability.objects.filter(subdomain__name=self.name).exclude(severity=0)
if self.scan_history:
vulns = vulns.filter(scan_history=self.scan_history)
return vulns
@property
def get_directories_count(self):
subdomains = (
+2
View File
@@ -908,6 +908,7 @@ def create_report(request, id):
'scan_object': scan,
'unique_vulnerabilities': unique_vulns,
'all_vulnerabilities': vulns,
'all_vulnerabilities_count': vulns.count(),
'subdomain_alive_count': subdomain_alive_count,
'interesting_subdomains': interesting_subdomains,
'subdomains': subdomains,
@@ -915,6 +916,7 @@ def create_report(request, id):
'show_recon': show_recon,
'show_vuln': show_vuln,
'report_name': report_name,
'is_ignore_info_vuln': is_ignore_info_vuln,
}
# Get report related config
+14 -6
View File
@@ -514,7 +514,7 @@
<p class="bg-critical">Vulnerabilities
<br>
<span class="inside-box-counter">
{{scan_object.get_vulnerability_count}}
{{all_vulnerabilities_count}}
</span>
</p>
</section>
@@ -563,7 +563,11 @@
<p class="bg-info">Info
<br>
<span class="inside-box-counter">
{{scan_object.get_info_vulnerability_count}}
{% if is_ignore_info_vuln %}
0
{% else %}
{{scan_object.get_info_vulnerability_count}}
{% endif %}
</span>
</p>
</section>
@@ -834,11 +838,11 @@
</td>
</tr>
{% endif %}
{% if subdomain.get_vulnerabilities %}
{% if subdomain.get_vulnerabilities_without_info %}
<tr>
<td colspan="3" class="cell table-border">
Vulnerabilities
{% regroup subdomain.get_vulnerabilities by name as vuln_list %}
{% regroup subdomain.get_vulnerabilities_without_info by name as vuln_list %}
<ul>
{% for vulnerability in vuln_list %}
<li>
@@ -864,7 +868,7 @@
{{scan_object.get_critical_vulnerability_count}} of them were Critical,
{{scan_object.get_high_vulnerability_count}} of them were High Severity,
{{scan_object.get_medium_vulnerability_count}} of them were Medium severity,
{{scan_object.get_low_vulnerability_count}} of them were Low severity, and
{% if is_ignore_info_vuln %}0{% else %}{{scan_object.get_info_vulnerability_count}}{% endif %} of them were Low severity, and
{{scan_object.get_info_vulnerability_count}} of them were Informational.
{{scan_object.get_unknown_vulnerability_count}} of them were Unknown Severity.
</p>
@@ -906,7 +910,11 @@
<p class="bg-info">Info
<br>
<span class="inside-box-counter">
{{scan_object.get_info_vulnerability_count}}
{% if is_ignore_info_vuln %}
0
{% else %}
{{scan_object.get_info_vulnerability_count}}
{% endif %}
</span>
</p>
</section>