Assets Added in Report

This commit is contained in:
Yogesh Ojha
2022-04-24 22:57:30 +05:30
parent c65953f753
commit 97ea68e8bd
2 changed files with 48 additions and 4 deletions
+5 -1
View File
@@ -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')
+43 -3
View File
@@ -144,7 +144,7 @@
<div class="cell" style="width: 33%">
Page title
</div>
<div class="cell" style="width: 13%">
<div class="cell" style="width: 15%">
HTTP Status
</div>
</div>
@@ -161,7 +161,7 @@
{{subdomain.page_title}}
{% endif %}
</div>
<div class="cell" style="width: 13%;">
<div class="cell" style="width: 15%;">
{{subdomain.http_status}}
</div>
</div>
@@ -219,7 +219,8 @@
</div>
</article>
<article class="summary" style="page-break-before: always">
<h2 id="reconnaissance-results">Reconnaissance Results</h2>
<h2 id="reconnaissance-results">Discovered Assets</h2>
<h3 id="">Subdomains</h3>
<p>
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 @@
</div>
{% endfor %}
</div>
<h3 id="">IP Addresses</h3>
<h4>{{ip_addresses.count}} IP Addresses were identified on <span id="primary-title">{{scan_object.domain.name}}</span></h4>
<div class="table">
<div class="row header blue-header">
<div class="cell" style="width: 38%">
IP
</div>
<div class="cell" style="width: 38%">
Open Ports
</div>
<div class="cell" style="width: 18%">
Remarks
</div>
</div>
{% for ip in ip_addresses %}
<div class="row">
<div class="cell" style="width: 38%">
{{ip.address}}
</div>
<div class="cell" style="width: 38%">
{% for port in ip.ports.all %}
{{port.number}}/{{port.service_name}}{% if not forloop.last %},{% endif %}
{% endfor %}
</div>
{% if ip.is_cdn %}
<div class="cell medium" style="width: 18%">
CDN IP Address
{% else %}
<div class="cell" style="width: 18%">
{% endif %}
</div>
</div>
{% endfor %}
</div>
</article>
<br>
<article class="">
<h3 class="bold-h3">Reconnaissance Findings</h3>
</article>
<article style="page-break-before: always" class="summary">
<h2 id="vulnerabilities-discovered">Vulnerabilities Discovered</h2>