diff --git a/web/startScan/static/startScan/js/detail_scan.js b/web/startScan/static/startScan/js/detail_scan.js index aa455424..0ed97d35 100644 --- a/web/startScan/static/startScan/js/detail_scan.js +++ b/web/startScan/static/startScan/js/detail_scan.js @@ -1477,16 +1477,33 @@ function fetch_whois(domain_name){ pos: 'top-right', duration: 1500, }); + $("#whois_not_fetched_alert").hide(); + $("#whois_fetching_alert").show(); fetch(`/api/tools/whois/?format=json&ip_domain=${domain_name}&save_db`, {}).then(res => res.json()) .then(function (response) { + $("#whois_fetching_alert").hide(); + document.getElementById('domain_age').innerHTML = response['domain']['domain_age'] + ' ' + response['domain']['date_created']; + document.getElementById('ip_address').innerHTML = response['domain']['ip_address']; + document.getElementById('ip_geolocation').innerHTML = response['domain']['geolocation']; + + document.getElementById('registrant_name').innerHTML = response['registrant']['name']; + console.log(response['registrant']['organization']) + document.getElementById('registrant_organization').innerHTML = response['registrant']['organization'] ? response['registrant']['organization'] : ' '; + document.getElementById('registrant_address').innerHTML = response['registrant']['address'] + ' ' + response['registrant']['city'] + ' ' + response['registrant']['state'] + ' ' + response['registrant']['country']; + document.getElementById('registrant_phone_numbers').innerHTML = response['registrant']['tel']; + document.getElementById('registrant_fax').innerHTML = response['registrant']['fax']; + Snackbar.show({ - text: 'Whois Fetched...(Click to reload)', + text: 'Whois Fetched...', pos: 'top-right', - duration: 3000, - actionText: 'Reload', - onActionClick: function(element) { - location.reload(); - } + duration: 3000 }); + + $("#whois_fetched_alert").show(); + + $("#whois_fetched_alert").fadeTo(2000, 500).slideUp(1500, function(){ + $("#whois_fetched_alert").slideUp(500); + }); + }); } diff --git a/web/startScan/templates/startScan/detail_scan.html b/web/startScan/templates/startScan/detail_scan.html index 21a81ad2..ca55f1f5 100644 --- a/web/startScan/templates/startScan/detail_scan.html +++ b/web/startScan/templates/startScan/detail_scan.html @@ -343,7 +343,7 @@ Detailed Scan
- +

 Target Information

@@ -358,6 +358,19 @@ Detailed Scan
+ {% if not history.domain.domain_info %} + + {% endif %} + +

Domain Information

@@ -370,15 +383,15 @@ Detailed Scan - + - + - +
Domain age{{history.domain.domain_info.domain_age}} {{history.domain.domain_info.date_created}}
IP Address{{history.domain.domain_info.ip_address}}{{history.domain.domain_info.ip_address}}
IP Geolocation{% if history.domain.domain_info.geolocation_iso %}{{history.domain.domain_info.geolocation_iso}}{% endif %} {{history.domain.domain_info.geolocation}}{% if history.domain.domain_info.geolocation_iso %}{{history.domain.domain_info.geolocation_iso}}{% endif %} {{history.domain.domain_info.geolocation}}

Registrant Information

@@ -389,23 +402,23 @@ Detailed Scan Name - {{history.domain.domain_info.whois.registrant.name}} + {{history.domain.domain_info.whois.registrant.name}} Organization - {{history.domain.domain_info.whois.registrant.organization}} + {{history.domain.domain_info.whois.registrant.organization}} Address - {% if history.domain.domain_info.whois.registrant.country_iso %}{{history.domain.domain_info.whois.registrant.country_iso}}{% endif %} {{history.domain.domain_info.whois.registrant.address}} {{history.domain.domain_info.whois.registrant.City}} {{history.domain.domain_info.whois.registrant.state}} {{history.domain.domain_info.whois.registrant.country}} + {% if history.domain.domain_info.whois.registrant.country_iso %}{{history.domain.domain_info.whois.registrant.country_iso}}{% endif %} {{history.domain.domain_info.whois.registrant.address}} {{history.domain.domain_info.whois.registrant.City}} {{history.domain.domain_info.whois.registrant.state}} {{history.domain.domain_info.whois.registrant.country}} Phone Numbers - {{history.domain.domain_info.whois.registrant.phone_number}} + {{history.domain.domain_info.whois.registrant.phone_number}} Fax - {{history.domain.domain_info.whois.registrant.fax}} + {{history.domain.domain_info.whois.registrant.fax}}
diff --git a/web/targetApp/models.py b/web/targetApp/models.py index dbf06943..98212328 100644 --- a/web/targetApp/models.py +++ b/web/targetApp/models.py @@ -24,9 +24,6 @@ class WhoisDetail(models.Model): details = models.TextField(blank=True, null=True) registrant = models.ForeignKey(RegistrantInfo, on_delete=models.CASCADE, null=True, blank=True) - def __str__(self): - return self.registrant.name - class NameServerHistory(models.Model): date = models.CharField(max_length=10, null=True, blank=True) @@ -54,10 +51,6 @@ class DomainInfo(models.Model): nameserver_history = models.ManyToManyField(NameServerHistory) nameserver_record = models.ManyToManyField(NSRecord) - def __str__(self): - return self.whois.registrant.name - - class Organization(models.Model): id = models.AutoField(primary_key=True)