From d8511ba8c4c6830bf293d8caeef2bdc3277a7204 Mon Sep 17 00:00:00 2001 From: Yogesh Ojha Date: Sat, 16 May 2020 11:01:35 +0530 Subject: [PATCH] debug removed from detail_scan --- .../migrations/0002_auto_20200516_0530.py | 18 ++++++++++++++++++ startScan/models.py | 3 ++- startScan/templates/startScan/detail_scan.html | 2 +- startScan/views.py | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 startScan/migrations/0002_auto_20200516_0530.py diff --git a/startScan/migrations/0002_auto_20200516_0530.py b/startScan/migrations/0002_auto_20200516_0530.py new file mode 100644 index 00000000..5bb28bd0 --- /dev/null +++ b/startScan/migrations/0002_auto_20200516_0530.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.6 on 2020-05-16 05:30 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('startScan', '0001_initial'), + ] + + operations = [ + migrations.RenameField( + model_name='scannedsubdomains', + old_name='scan_history_model', + new_name='scan_history', + ), + ] diff --git a/startScan/models.py b/startScan/models.py index 18ec1595..06750896 100644 --- a/startScan/models.py +++ b/startScan/models.py @@ -9,11 +9,12 @@ class ScanHistory(models.Model): scan_type = models.ForeignKey(EngineType, on_delete=models.CASCADE) def __str__(self): + # debug purpose remove scan type and id in prod return self.domain_name.domain_name + self.scan_type.scan_type_name + str(self.id) class ScannedSubdomains(models.Model): subdomain = models.CharField(max_length=100) - scan_history_model = models.ForeignKey(ScanHistory, on_delete=models.CASCADE) + scan_history = models.ForeignKey(ScanHistory, on_delete=models.CASCADE) open_ports = models.CharField(max_length=1000) takeover_possible = models.BooleanField() http_status = models.IntegerField() diff --git a/startScan/templates/startScan/detail_scan.html b/startScan/templates/startScan/detail_scan.html index d0e6f0a8..5bd73d05 100644 --- a/startScan/templates/startScan/detail_scan.html +++ b/startScan/templates/startScan/detail_scan.html @@ -51,7 +51,7 @@ Scan history {% else %} {{ subs.subdomain }} {% endif %} - {{ subs.id }} {{subs.http_status}} + {{subs.http_status}} {{ subs.open_ports }} {{ subs.technology_stack }} diff --git a/startScan/views.py b/startScan/views.py index 0a6898ee..a5059e01 100644 --- a/startScan/views.py +++ b/startScan/views.py @@ -13,6 +13,6 @@ def scan_history(request): return render(request, 'startScan/history.html', context) def detail_scan(request, id): - subdomain_details = ScannedSubdomains.objects.filter(scan_history_model__id=id) + subdomain_details = ScannedSubdomains.objects.filter(scan_history__id=id) context = {'scan_history_active': 'true', 'subdomain':subdomain_details} return render(request, 'startScan/detail_scan.html', context)