From 97ea68e8bdd227bfe39f37e2aeca3a0020512ae4 Mon Sep 17 00:00:00 2001 From: Yogesh Ojha Date: Mon, 4 Oct 2021 09:00:50 +0530 Subject: [PATCH] Assets Added in Report --- web/startScan/views.py | 6 ++++- web/templates/report/full.html | 46 +++++++++++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/web/startScan/views.py b/web/startScan/views.py index 0cbee7da..caf8400a 100644 --- a/web/startScan/views.py +++ b/web/startScan/views.py @@ -636,7 +636,9 @@ def create_report(request, id): scan_history__id=id).values('name').distinct().filter( http_status__exact=200).count() interesting_subdomains = get_interesting_subdomains(scan_history=id) - template = get_template('report/full.html') + ip_addresses = IpAddress.objects.filter( + ip_addresses__in=Subdomain.objects.filter( + target_domain__id=id)).distinct() data = { 'scan_object': scan_object, 'vulnerabilities': unique_vulnerabilities, @@ -644,7 +646,9 @@ def create_report(request, id): 'subdomain_alive_count': subdomain_alive_count, 'interesting_subdomains': interesting_subdomains, 'subdomains': subdomains, + 'ip_addresses': ip_addresses } + template = get_template('report/full.html') html = template.render(data) pdf = HTML(string=html).write_pdf() response = HttpResponse(pdf, content_type='application/pdf') diff --git a/web/templates/report/full.html b/web/templates/report/full.html index f06c9df2..97aeead8 100644 --- a/web/templates/report/full.html +++ b/web/templates/report/full.html @@ -144,7 +144,7 @@
Page title
-
+
HTTP Status
@@ -161,7 +161,7 @@ {{subdomain.page_title}} {% endif %} -
+
{{subdomain.http_status}}
@@ -219,7 +219,8 @@
-

Reconnaissance Results

+

Discovered Assets

+

Subdomains

During the reconnaissance phase, {{scan_object.get_subdomain_count}} subdomains were discovered. Out of {{scan_object.get_subdomain_count}} subdomains, {{subdomain_alive_count}} returned HTTP status 200. @@ -254,6 +255,45 @@ {% endfor %} +

IP Addresses

+

{{ip_addresses.count}} IP Addresses were identified on {{scan_object.domain.name}}

+
+
+
+ IP +
+
+ Open Ports +
+
+ Remarks +
+
+ {% for ip in ip_addresses %} +
+
+ {{ip.address}} +
+
+ {% for port in ip.ports.all %} + {{port.number}}/{{port.service_name}}{% if not forloop.last %},{% endif %} + {% endfor %} +
+ {% if ip.is_cdn %} +
+ CDN IP Address + {% else %} +
+ {% endif %} +
+
+ {% endfor %} +
+
+
+
+

Reconnaissance Findings

+

Vulnerabilities Discovered