diff --git a/web/startScan/views.py b/web/startScan/views.py index e9f7c948..3bb0f1ae 100644 --- a/web/startScan/views.py +++ b/web/startScan/views.py @@ -629,11 +629,19 @@ def delete_scans(request): def create_report(request, id): scan_object = ScanHistory.objects.get(id=id) - vulnerabilities = Vulnerability.objects.values("name", "severity").annotate(count=Count('name')).order_by('-severity', '-count') + vulnerabilities = Vulnerability.objects.filter(scan_history=scan_object).values("name", "severity").annotate(count=Count('name')).order_by('-severity', '-count') + subdomains = Subdomain.objects.filter(scan_history=scan_object) + subdomain_alive_count = Subdomain.objects.filter( + 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') data = { 'scan_object': scan_object, - 'vulnerabilities': vulnerabilities + 'vulnerabilities': vulnerabilities, + 'subdomain_alive_count': subdomain_alive_count, + 'interesting_subdomains': interesting_subdomains, + 'subdomains': subdomains, } html = template.render(data) pdf = HTML(string=html).write_pdf() diff --git a/web/static/reports/report.css b/web/static/reports/report.css index 6f4bb239..c78ae831 100644 --- a/web/static/reports/report.css +++ b/web/static/reports/report.css @@ -221,7 +221,7 @@ h4 { color: #1976D2; } -#bold-h3{ +.bold-h3{ font-family: roboto-medium; font-size: 18pt; } @@ -264,9 +264,20 @@ h4 { .header{ font-weight: 900; color: #ffffff; +} + +.red-header{ background: #ea6153; } +.blue-header{ + background: #1E88E5; +} + +.green-header{ + background: #66BB6A; +} + .info-cell{ background: #42A5F5; } @@ -274,3 +285,65 @@ h4 { .severity-title-box{ color: #37474F; } + + +#contents { + page: no-chapter; +} +#contents h2 { + font-size: 20pt; + font-weight: 400; + margin-bottom: 3cm; +} +#contents h3 { + font-weight: 500; + margin: 3em 0 1em; +} +#contents h3::before { + background: #FF7043; + content: ''; + display: block; + height: .08cm; + margin-bottom: .25cm; + width: 2cm; +} +#contents ul { + list-style: none; + padding-left: 0; +} +#contents ul li { + border-top: .25pt solid #c1c1c1; + margin: .25cm 0; + padding-top: .25cm; +} +#contents ul li::before { + color: #FF7043; + content: '• '; + font-size: 30pt; + line-height: 16pt; + vertical-align: bottom; +} +#contents ul li a { + color: inherit; + text-decoration-line: inherit; +} +#contents ul li a::before { + content: target-text(attr(href)); +} +#contents ul li a::after { + color: #FF7043; + content: target-counter(attr(href), page); + float: right; +} + +#columns section { + columns: 2; + column-gap: 1cm; + padding-top: 1cm; +} +#columns section p { + text-align: justify; +} +#columns section p:first-of-type { + font-weight: 700; +} diff --git a/web/templates/report/full.html b/web/templates/report/full.html index ea3d9c01..0ddd9274 100644 --- a/web/templates/report/full.html +++ b/web/templates/report/full.html @@ -29,9 +29,20 @@ https://github.com/yogeshojha/rengine +
+

 

+

Table of contents

+ +
-
-

Quick Summary

+
+

Quick Summary

This section contains quick summary of scan performed on {{scan_object.domain.name}}

Subdomains

@@ -49,7 +60,41 @@
-

Vulnerabilities

+ {% if interesting_subdomains %} +

Interesting Recon Data

+

Listed below are the {{interesting_subdomains.count}} interesting subdomains identified on {{scan_object.domain.name}}

+ {% endif %} +
+
+
+ Subdomain +
+
+ Page title +
+
+ HTTP Status +
+
+ {% for subdomain in interesting_subdomains %} +
+
+ {{subdomain.name}} +
+
+ {% if subdomain.page_title %} + {{subdomain.page_title}} + {% endif %} +
+
+ {{subdomain.http_status}} +
+
+ {% endfor %} +
+
+
+

Vulnerability Summary

Critical @@ -89,50 +134,100 @@

Listed below are the vulnerabilities identified on {{scan_object.domain.name}}

+
+
+ Severity +
+
+ Vulnerability Name +
+
+ Times Identified +
+
-
-
- Severity -
-
- Vulnerability Name -
-
- Times Identified -
-
- - {% for vulnerability in vulnerabilities %} -
- {% if vulnerability.severity == 0 %} -
- Informational - {% elif vulnerability.severity == 1 %} -
- Low - {% elif vulnerability.severity == 2 %} -
- Medium - {% elif vulnerability.severity == 3 %} -
- High - {% elif vulnerability.severity == 4 %} -
- Critical - {% endif %} -
-
- {{vulnerability.name}} -
-
- {{vulnerability.count}} -
-
- {% endfor %} -
+ {% for vulnerability in vulnerabilities %} +
+ {% if vulnerability.severity == 0 %} +
+ Informational + {% elif vulnerability.severity == 1 %} +
+ Low + {% elif vulnerability.severity == 2 %} +
+ Medium + {% elif vulnerability.severity == 3 %} +
+ High + {% elif vulnerability.severity == 4 %} +
+ Critical + {% endif %} +
+
+ {{vulnerability.name}} +
+
+ {{vulnerability.count}} +
+
+ {% endfor %} +
-
- +
+

Timeline of the Assessment

+

+ Scan started on: {{scan_object.start_scan_date|date:"F j, Y h:i"}} +
+ Total time taken: + {% if scan_object.scan_status == 0 %} + {{ scan_object.start_scan_date|timesince:scan_object.stop_scan_date }} + {% elif scan_object.scan_status == 1 %} + {{ scan_object.get_elapsed_time }} + {% elif scan_object.scan_status == 2 %} + {% if scan_object.get_completed_time_in_sec < 60 %} + Completed in < 1 minutes {% else %} Completed in {{ scan_object.start_scan_date|timesince:scan_object.stop_scan_date }} {% endif %} {% elif scan_object.scan_status == 3 %} Aborted in + {{ scan_object.start_scan_date|timesince:scan_object.stop_scan_date }} {% endif %}
+ Report Generated on: {% now "F j, Y" %} +

+
+
+

Reconnaissance Results

+

+ 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. + {{interesting_subdomains.count}} interesting subdomains were also identified based on the interesting keywords used. +

+

Listed below are the {{scan_object.get_subdomain_count}} subdomains identified on {{scan_object.domain.name}}

+
+
+
+ Subdomain +
+
+ Page title +
+
+ HTTP Status +
+
+ {% for subdomain in subdomains %} +
+
+ {{subdomain.name}} +
+
+ {% if subdomain.page_title %} + {{subdomain.page_title}} + {% endif %} +
+
+ {{subdomain.http_status}} +
+
+ {% endfor %} +