removing hex banner
This commit is contained in:
@@ -301,9 +301,6 @@ tr:hover td { background: #1c2128; }
|
|||||||
.port { color: #f78166; }
|
.port { color: #f78166; }
|
||||||
.ip { color: #79c0ff; }
|
.ip { color: #79c0ff; }
|
||||||
.ts { color: #8b949e; font-size: 11px; }
|
.ts { color: #8b949e; font-size: 11px; }
|
||||||
.hex { color: #a5d6ff; font-size: 11px;
|
|
||||||
max-width: 240px; overflow: hidden;
|
|
||||||
text-overflow: ellipsis; white-space: nowrap; }
|
|
||||||
.cc { color: #8b949e; font-size: 11px; }
|
.cc { color: #8b949e; font-size: 11px; }
|
||||||
.badge {
|
.badge {
|
||||||
display: inline-block; background: #21262d;
|
display: inline-block; background: #21262d;
|
||||||
@@ -378,7 +375,7 @@ _HTML = """\
|
|||||||
<h2>Recent connections <span class="badge">{recent_count} shown</span></h2>
|
<h2>Recent connections <span class="badge">{recent_count} shown</span></h2>
|
||||||
<table>
|
<table>
|
||||||
<tr><th>Timestamp (UTC)</th><th>Source IP</th><th>Src port</th>
|
<tr><th>Timestamp (UTC)</th><th>Source IP</th><th>Src port</th>
|
||||||
<th>Dst port</th><th>Banner (hex)</th><th>Bytes</th></tr>
|
<th>Dst port</th><th>Bytes</th></tr>
|
||||||
{conn_rows}
|
{conn_rows}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@@ -500,12 +497,10 @@ async def _render_dashboard(stats: Stats, cfg: Config) -> str:
|
|||||||
f'<td>{_ip_cell(e["src_ip"])}</td>'
|
f'<td>{_ip_cell(e["src_ip"])}</td>'
|
||||||
f'<td>{e["src_port"]}</td>'
|
f'<td>{e["src_port"]}</td>'
|
||||||
f'<td class="port">{e["dst_port"]}</td>'
|
f'<td class="port">{e["dst_port"]}</td>'
|
||||||
f'<td class="hex" title="{html.escape(e["banner_hex"])}">'
|
|
||||||
f'{html.escape(e["banner_hex"][:48])}{"…" if len(e["banner_hex"]) > 48 else ""}</td>'
|
|
||||||
f'<td>{e["banner_len"]}</td>'
|
f'<td>{e["banner_len"]}</td>'
|
||||||
'</tr>'
|
'</tr>'
|
||||||
for e in recent
|
for e in recent
|
||||||
) if recent else _empty_row(6, 'no connections yet')
|
) if recent else _empty_row(5, 'no connections yet')
|
||||||
)
|
)
|
||||||
|
|
||||||
last = stats.last_connection
|
last = stats.last_connection
|
||||||
@@ -662,8 +657,10 @@ async def _handle(
|
|||||||
ct = 'application/json'
|
ct = 'application/json'
|
||||||
|
|
||||||
elif path == '/api/connections':
|
elif path == '/api/connections':
|
||||||
limit = min(int(qs.get('limit', ['50'])[0]), 500)
|
limit = min(int(qs.get('limit', ['100'])[0]), 500)
|
||||||
body = json.dumps(stats.recent_connections(limit))
|
conns = [{k: v for k, v in e.items() if k != 'banner_hex'}
|
||||||
|
for e in stats.recent_connections(limit)]
|
||||||
|
body = json.dumps(conns)
|
||||||
ct = 'application/json'
|
ct = 'application/json'
|
||||||
|
|
||||||
elif path == '/api/banner':
|
elif path == '/api/banner':
|
||||||
|
|||||||
Reference in New Issue
Block a user