mirror of https://github.com/CIRCL/lookyloo
fix: Avoid exception when there are no historical data.
parent
2e666423c8
commit
db26633ebb
|
@ -434,7 +434,8 @@ class Lookyloo():
|
|||
else:
|
||||
hostname = urlparse(cache.url).hostname
|
||||
if hostname:
|
||||
to_return['riskiq'] = self.riskiq.get_passivedns(hostname)
|
||||
if entries := self.riskiq.get_passivedns(hostname):
|
||||
to_return['riskiq'] = entries
|
||||
except RiskIQError as e:
|
||||
self.logger.warning(e.response.content)
|
||||
if self.circl_pdns.available:
|
||||
|
@ -444,8 +445,8 @@ class Lookyloo():
|
|||
else:
|
||||
hostname = urlparse(cache.url).hostname
|
||||
if hostname:
|
||||
to_return['circl_pdns'][hostname] = self.circl_pdns.get_passivedns(hostname)
|
||||
|
||||
if entries := self.circl_pdns.get_passivedns(hostname):
|
||||
to_return['circl_pdns'][hostname] = entries
|
||||
return to_return
|
||||
|
||||
def hide_capture(self, capture_uuid: str, /) -> None:
|
||||
|
|
|
@ -108,7 +108,7 @@ class RiskIQ(AbstractModule):
|
|||
return
|
||||
|
||||
pdns_info = self.client_dns.get_passive_dns(query=hostname, start=first_seen.isoformat())
|
||||
if not pdns_info:
|
||||
if not pdns_info or not pdns_info.get('results'):
|
||||
try:
|
||||
url_storage_dir.rmdir()
|
||||
except OSError:
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
{% from "macros.html" import shorten_string %}
|
||||
|
||||
<div>
|
||||
{% if not circl_pdns and not riskiq %}
|
||||
No historical data available
|
||||
{%else%}
|
||||
{% if circl_pdns %}
|
||||
<center>
|
||||
<h1 class="display-4">CIRCL Passive DNS
|
||||
|
@ -9,7 +12,7 @@
|
|||
style="cursor: pointer;">
|
||||
</div>
|
||||
</h1>
|
||||
{% for query, responses in circl_pdns.items() %}
|
||||
{% for query, responses in circl_pdns.items() if responses %}
|
||||
<div>
|
||||
<h3>{{query}}</h3>
|
||||
<table class="table">
|
||||
|
@ -35,9 +38,8 @@
|
|||
</div>
|
||||
{%endfor%}
|
||||
</center>
|
||||
|
||||
{% endif%}
|
||||
{% if riskiq and current_user.is_authenticated %}
|
||||
{% if riskiq %}
|
||||
<hr>
|
||||
<center>
|
||||
<h1 class="display-4">RiskIQ</h1>
|
||||
|
@ -65,4 +67,5 @@
|
|||
</div>
|
||||
</center>
|
||||
{% endif%}
|
||||
{% endif%}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue