Replaces LICENSE (GPLv3 -> AGPLv3) and prepends `SPDX-License-Identifier: AGPL-3.0-or-later` to every source file across decnet/, decnet_web/, tests/, scripts/, and tools/. Rationale: closes the GPLv3 ASP loophole so any party operating a modified DECNET as a network service must offer their modified source. Personal copyright (Samuel Paschuan) + inbound=outbound contributions make a future unilateral relicense infeasible. - LICENSE: full AGPL-3.0 text (gnu.org/licenses/agpl-3.0.txt) - COPYRIGHT: project copyright notice - tools/add_spdx_headers.py: idempotent header injector (shebang- and PEP 263-aware) Touches 1565 source files (.py, .ts, .tsx, .js, .jsx, .css, .sh). No behavior change; comments only.
36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from decnet.prober.base import ActiveProbe
|
|
from decnet.prober.jarm import JARM_EMPTY_HASH, jarm_hash
|
|
from decnet.telemetry import traced as _traced
|
|
|
|
DEFAULT_PORTS: list[int | None] = [443, 8443, 8080, 4443, 50050, 2222, 993, 995, 8888, 9001]
|
|
|
|
|
|
class JarmProbe(ActiveProbe):
|
|
probe_name = "jarm"
|
|
default_ports: list[int | None] = DEFAULT_PORTS
|
|
event_type = "jarm_fingerprint"
|
|
rotation_type = "jarm"
|
|
rotation_hash_key = "jarm_hash"
|
|
priority = 100
|
|
|
|
@_traced("prober.jarm_probe")
|
|
def run(self, ip: str, port: int | None, timeout: float) -> dict[str, Any] | None:
|
|
if port is None:
|
|
return None
|
|
h = jarm_hash(ip, port, timeout=timeout)
|
|
if h == JARM_EMPTY_HASH:
|
|
return None
|
|
return {"jarm_hash": h}
|
|
|
|
def syslog_fields(self, ip: str, port: int | None, result: dict[str, Any]) -> tuple[dict[str, Any], str]:
|
|
h = result["jarm_hash"]
|
|
return {"jarm_hash": h}, f"JARM {ip}:{port} = {h}"
|
|
|
|
def publish_payload(self, ip: str, port: int | None, result: dict[str, Any]) -> dict[str, Any]:
|
|
return {"attacker_ip": ip, "port": port, "jarm_hash": result["jarm_hash"]}
|