From: Roland Häder Date: Fri, 8 Dec 2023 03:56:26 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=32c5ba74dbfcf62fbb8c841b8faa2a746d372587;p=fba.git Continued: - added list/scoreboard mode for column 'original_software' --- diff --git a/daemon.py b/daemon.py index cd91932..dc29823 100755 --- a/daemon.py +++ b/daemon.py @@ -77,6 +77,8 @@ def api_scoreboard(mode: str, amount: int): database.cursor.execute("SELECT blocker, COUNT(blocker) AS score FROM blocks GROUP BY blocker ORDER BY score DESC LIMIT ?", [amount]) elif mode == "reference": database.cursor.execute("SELECT origin, COUNT(domain) AS score FROM instances WHERE origin IS NOT NULL GROUP BY origin ORDER BY score DESC LIMIT ?", [amount]) + elif mode == "original_software": + database.cursor.execute("SELECT original_software, COUNT(domain) AS score FROM instances WHERE original_software IS NOT NULL GROUP BY original_software ORDER BY score DESC, original_software ASC LIMIT ?", [amount]) elif mode == "software": database.cursor.execute("SELECT software, COUNT(domain) AS score FROM instances WHERE software IS NOT NULL GROUP BY software ORDER BY score DESC, software ASC LIMIT ?", [amount]) elif mode == "command": @@ -115,7 +117,7 @@ def api_list(request: Request, mode: str, value: str, amount: int): elif amount > config.get("api_limit"): raise HTTPException(status_code=500, detail=f"amount={amount} is to big") - if mode in ("detection_mode", "software", "command", "origin"): + if mode in ("detection_mode", "original_software", "software", "command", "origin"): database.cursor.execute( f"SELECT * \ FROM instances \ diff --git a/templates/views/index.html b/templates/views/index.html index 8660d39..d51b3ea 100644 --- a/templates/views/index.html +++ b/templates/views/index.html @@ -59,6 +59,7 @@
  • Defederated instances
  • Referencing instances
  • Used software
  • +
  • ... original
  • Commands
  • Error codes
  • Detection modes
  • diff --git a/templates/views/list.html b/templates/views/list.html index 1e48ebd..101e926 100644 --- a/templates/views/list.html +++ b/templates/views/list.html @@ -2,6 +2,7 @@ {% block title %} {% if mode == 'detection_mode' %} - Detection mode {{value}} + {% elif mode == 'original_software' %} - Original software {{value}} {% elif mode == 'software' %} - Used software {{value}} {% elif mode == 'command' %} - Command {{value}} {% elif mode == 'recently' %} - {{amount}} recently added instances @@ -11,6 +12,8 @@ {% block header %} {% if mode == 'detection_mode' %}

    Instances detected by method {{value}}

    + {% elif mode == 'original_software' %} +

    Original software name {{value}}

    {% elif mode == 'software' %}

    Instances using software {{value}}

    {% elif mode == 'command' %} @@ -39,7 +42,8 @@ Domain Origin - Software + Software + Original Detection mode Command Total peers @@ -62,6 +66,11 @@ {% include "widgets/links.html" %} {% endwith %} + + {% with mode='original_software', amount=amount, value=row['original_software'] %} + {% include "widgets/list_links.html" %} + {% endwith %} + {% with mode='software', amount=amount, value=row['software'] %} {% include "widgets/list_links.html" %} diff --git a/templates/views/scoreboard.html b/templates/views/scoreboard.html index 2f76194..1cc68b7 100644 --- a/templates/views/scoreboard.html +++ b/templates/views/scoreboard.html @@ -2,7 +2,8 @@ {% block title %} Scoreboard - - {% if mode == 'software' %}TOP {{amount}} used software + {% if mode == 'original_software' %}TOP {{amount}} original software + {% elif mode == 'software' %}TOP {{amount}} aliased software {% elif mode == 'detection_mode' %}Detection mode statistics {% elif mode == 'block_level' %}TOP {{amount}} block level statistics {% elif mode == 'obfuscation' %}Obfuscation statistics @@ -24,8 +25,10 @@

    Top {{amount}} defederated instances

    {% elif mode == 'reference' %}

    Top {{amount}} referencing instances

    + {% elif mode == 'original_software' %} +

    Top {{amount}} original software names

    {% elif mode == 'software' %} -

    Top {{amount}} used software

    +

    Top {{amount}} aliased software

    {% elif mode == 'command' %}

    TOP {{amount}} commands

    {% elif mode == 'error_code' %} @@ -53,7 +56,7 @@ № - {% if mode in ('software', 'avg_peers', 'avg_blocks', 'obfuscator') %}Software + {% if mode in ('original_software', 'software', 'avg_peers', 'avg_blocks', 'obfuscator') %}Software {% elif mode == 'obfuscation' %}Obfuscation status {% elif mode == 'detection_mode' %}Detection mode {% elif mode == 'error_code' %}Error code @@ -63,7 +66,7 @@ {% if mode == 'reference' %}References {% elif mode in('avg_peers', 'avg_blocks') %}Average - {% elif mode in('software', 'error_code', 'obfuscator', 'obfuscation', 'block_level', 'detection_mode', 'command') %}Total + {% elif mode in('original_software', 'software', 'error_code', 'obfuscator', 'obfuscation', 'block_level', 'detection_mode', 'command') %}Total {% else %}Blocks {% endif %} @@ -82,7 +85,7 @@ {{entry['domain']}} {% elif mode in ('avg_peers', 'avg_blocks', 'obfuscator') %} {{entry['domain']}} - {% elif mode in ('software', 'detection_mode', 'command') %} + {% elif mode in ('original_software', 'software', 'detection_mode', 'command') %} {{entry['domain']}} {% else %} {% with domain=entry['domain'] %}