domain = wildchar = punycode = reason = None
- if mode == "detection_mode":
+ if mode in ("detection_mode", "software"):
database.cursor.execute(
- f"SELECT domain, origin, software, command, total_peers, total_blocks, first_seen, last_updated FROM instances WHERE {mode} = ? LIMIT ?", [value, amount]
+ f"SELECT domain, origin, software, command, total_peers, total_blocks, first_seen, last_updated \
+FROM instances \
+WHERE {mode} = ? \
+ORDER BY domain \
+LIMIT ?", [value, amount]
)
domainlist = database.cursor.fetchall()
elif software in ["runtube.re", "islameye"]:
logger.debug("Setting peertube: software='%s'", software)
software = "peertube"
- elif software == "nextcloud social":
+ elif software in ["nextcloud social", "nextcloudpi"]:
logger.debug("Setting nextcloud: software='%s'", software)
software = "nextcloud"
elif software.find("/") > 0:
logger.warning("Spliting of slash: software='%s'", software)
- software = tidyup.domain(software.split("/")[-1])
+ software = software.split("/")[-1]
elif software.find("|") > 0:
logger.warning("Spliting of pipe: software='%s'", software)
- software = tidyup.domain(software.split("|")[0])
+ software = software.split("|")[0]
elif "powered by" in software:
logger.debug("software='%s' has 'powered by' in it", software)
software = version.strip_powered_by(software)
elif isinstance(software, str) and " by " in software:
logger.debug("software='%s' has ' by ' in it", software)
software = version.strip_until(software, " by ")
+ elif isinstance(software, str) and " - " in software:
+ logger.debug("software='%s' has ' - ' in it", software)
+ software = version.strip_until(software, " - ")
elif isinstance(software, str) and " see " in software:
logger.debug("software='%s' has ' see ' in it", software)
software = version.strip_until(software, " see ")
if software == "":
logger.warning("tidyup.domain() left no software name behind: software='%s'", software)
software = None
+ else:
+ logger.debug("software='%s' is being cleaned up further ...")
+ software = software.rstrip("!")
logger.debug("software[%s]='%s' - EXIT!", type(software), software)
return software
<tr>
<td>{{loop.index}}</td>
<td>
- {% if mode in ('software', 'command', 'error_code', 'avg_peers', 'obfuscator', 'obfuscation') %}
+ {% if mode in ('command', 'error_code', 'avg_peers', 'obfuscator', 'obfuscation') %}
{{entry['domain']}}
{% elif entry['domain'] == None %}
-
{% elif mode == 'block_level' %}
<a href="top?mode={{mode}}&value={{entry['domain']}}&amount=50">{{entry['domain']}}</a>
- {% elif mode == 'detection_mode' %}
+ {% elif mode in ('software', 'detection_mode') %}
<a href="list?mode={{mode}}&value={{entry['domain']}}&amount=50">{{entry['domain']}}</a>
{% else %}
{% with domain=entry['domain'] %}
-[<a class="listlink" href="top?mode=domain&value={{domain}}" title="Search {{domain}}">D</a>]
-[<a class="listlink" href="top?mode=reverse&value={{domain}}" title="Reverse search {{domain}}">R</a>]
-[<a class="listlink" href="infos?domain={{domain}}" title="Information on domain {{domain}}">I</a>]
-<a href="https://{{domain}}" rel="nofollow noopener noreferrer">{{domain}}</a>
+{% if domain != None %}
+ [<a class="listlink" href="top?mode=domain&value={{domain}}" title="Search {{domain}}">D</a>]
+ [<a class="listlink" href="top?mode=reverse&value={{domain}}" title="Reverse search {{domain}}">R</a>]
+ [<a class="listlink" href="infos?domain={{domain}}" title="Information on domain {{domain}}">I</a>]
+ <a href="https://{{domain}}" rel="nofollow noopener noreferrer">{{domain}}</a>
+{% else %}
+ -
+{% endif %}