Skip to content

Commit

Permalink
#193 fix short reports for domain and fqdn when using reverse-ip service
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeleonard committed Feb 24, 2018
1 parent cc2fe88 commit 4434bb8
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions analyzers/DomainTools/domaintools.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@ def summary(self, raw):
}

if("ip_addresses" in raw):
r["ip"] = {
"address": raw["ip_addresses"]["ip_address"],
"domain_count": raw["ip_addresses"]["domain_count"]
}
if type(raw["ip_addresses"]) == dict:
r["ip"] = {
"address": raw["ip_addresses"]["ip_address"],
"domain_count": raw["ip_addresses"]["domain_count"]
}
elif type(raw["ip_addresses"]) == list:
r["ip"] = {
"address": "{} IP addresses".format(len(r)),
"domain_count": sum(d["domain_count"] for d in raw["ip_addresses"])
}

if("domain_count" in raw):
r["domain_count"] = {
Expand All @@ -54,7 +60,7 @@ def summary(self, raw):
taxonomies = []

# Prepare predicate and value for each service
if r["service"] == "reverse-ip":
if r["service"] in ["reverse-ip", "host-domains"]:
taxonomies.append(self.build_taxonomy("info", "DT", "Reverse_IP","\"{}, {} domains\"".format(r["ip"]["address"], r["ip"]["domain_count"])))

if r["service"] == "name-server-domains":
Expand Down Expand Up @@ -92,7 +98,7 @@ def run(self):
else:
query = {}

if (self.service == 'reverse-ip' and self.data_type == 'domain') or \
if (self.service == 'reverse-ip' and self.data_type in ['domain', 'ip', 'fqdn']) or \
(self.service == 'host-domains' and self.data_type == 'ip') or \
(self.service == 'name-server-domains' and self.data_type == 'domain') or \
(self.service == 'whois/history' and self.data_type == 'domain') or \
Expand Down

0 comments on commit 4434bb8

Please sign in to comment.