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":
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 \
<li><a href="scoreboard?mode=blocked&amount=50">Defederated instances</a></li>
<li><a href="scoreboard?mode=reference&amount=50">Referencing instances</a></li>
<li><a href="scoreboard?mode=software&amount=50">Used software</a></li>
+ <li><a href="scoreboard?mode=original_software&amount=50">... original</a></li>
<li><a href="scoreboard?mode=command&amount=20">Commands</a></li>
<li><a href="scoreboard?mode=error_code&amount=50">Error codes</a></li>
<li><a href="scoreboard?mode=detection_mode&amount=10">Detection modes</a></li>
{% 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
{% block header %}
{% if mode == 'detection_mode' %}
<h1>Instances detected by method {{value}}</h1>
+ {% elif mode == 'original_software' %}
+ <h1>Original software name {{value}}</h1>
{% elif mode == 'software' %}
<h1>Instances using software {{value}}</h1>
{% elif mode == 'command' %}
<thead>
<th>Domain</th>
<th>Origin</th>
- <th>Software</th>
+ <th title="Aliased software name">Software</th>
+ <th title="Original software name">Original</th>
<th>Detection mode</th>
<th>Command</th>
<th>Total peers</th>
{% include "widgets/links.html" %}
{% endwith %}
</td>
+ <td>
+ {% with mode='original_software', amount=amount, value=row['original_software'] %}
+ {% include "widgets/list_links.html" %}
+ {% endwith %}
+ </td>
<td>
{% with mode='software', amount=amount, value=row['software'] %}
{% include "widgets/list_links.html" %}
{% 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
<h1>Top {{amount}} defederated instances</h1>
{% elif mode == 'reference' %}
<h1>Top {{amount}} referencing instances</h1>
+ {% elif mode == 'original_software' %}
+ <h1>Top {{amount}} original software names</h1>
{% elif mode == 'software' %}
- <h1>Top {{amount}} used software</h1>
+ <h1>Top {{amount}} aliased software</h1>
{% elif mode == 'command' %}
<h1>TOP {{amount}} commands</h1>
{% elif mode == 'error_code' %}
<thead>
<th>№</th>
<th>
- {% 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
<th>
{% 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 %}
</th>
<a href="top?mode={{mode}}&value={{entry['domain']}}&amount=50">{{entry['domain']}}</a>
{% elif mode in ('avg_peers', 'avg_blocks', 'obfuscator') %}
<a href="list?mode=software&value={{entry['domain']}}&amount=50">{{entry['domain']}}</a>
- {% elif mode in ('software', 'detection_mode', 'command') %}
+ {% elif mode in ('original_software', 'software', 'detection_mode', 'command') %}
<a href="list?mode={{mode}}&value={{entry['domain']}}&amount=50">{{entry['domain']}}</a>
{% else %}
{% with domain=entry['domain'] %}