πΈοΈ Comparing Major Darknet Overlays in Cyber Threat Intelligence
While Tor is the primary darknet for clearnet outproxying and .onion hidden services, threat actors and privacy advocates also leverage I2P (unidirectional garlic tunnels), Freenet / Hyphanet (content-addressed peer datastores), and Lokinet (IP-layer LLARP virtual interfaces). Understanding each overlay's addressing, proxy sockets, and routing trade-offs is essential for multi-network CTI engineering.
Architecture Overview: Four Darknet Topologies
Structural differences across Tor bidirectional circuits, I2P split garlic tunnels, Freenet distributed chunks, and Lokinet virtual TUN interfaces.
Figure 1.4: Comparison of packet routing, tunnel directionality, and storage models across four darknets.
1. Example 1: Multi-Darknet Indicator & Pseudo-TLD Classifier
Automatically classify extracted darknet URLs and content keys across Tor, I2P, Lokinet, and Freenet so CTI ingestion pipelines route indicators to the right sandbox worker.
Python (darknet_classifier.py)
import re
indicators = [
"http://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion",
"http://stats.i2p/cgi-bin/newhosts.txt",
"http://dw68fg35bd23456789abcdef0123456789abcdef0123456789ab.loki",
"USK@freenetproject.org/freenetdoc/15/"
]
for item in indicators:
if ".onion" in item:
net = "Tor v3 Onion Service (.onion)"
elif ".i2p" in item:
net = "I2P Eepsite (.i2p / .b32.i2p)"
elif ".loki" in item:
net = "Lokinet SNApp (.loki)"
elif re.match(r"^(CHK|SSK|USK)@", item):
net = "Freenet Content-Addressed Key"
else:
net = "Clearnet / Unknown"
print(f"{net:<34} <- {item[:45]}...")
Output:
Tor v3 Onion Service (.onion) <- http://duckduckgogg42xjoc72x3sjasowoarfbgc...
I2P Eepsite (.i2p / .b32.i2p) <- http://stats.i2p/cgi-bin/newhosts.txt...
Lokinet SNApp (.loki) <- http://dw68fg35bd23456789abcdef012345678...
Freenet Content-Addressed Key <- USK@freenetproject.org/freenetdoc/15/...
2. Example 2: Local Darknet Daemon Socket Health Check
Verify which overlay proxy services (Tor SOCKS5, I2P HTTP Proxy, Freenet FProxy) are actively listening on loopback ports before starting a collection run.
Python (check_darknet_ports.py)
import socket
daemons = [
("Tor SOCKS5 Proxy", "127.0.0.1", 9050),
("I2P HTTP Eepsite Proxy", "127.0.0.1", 4444),
("Freenet FProxy Web UI", "127.0.0.1", 8888)
]
for name, host, port in daemons:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(0.4)
state = "LISTENING" if s.connect_ex((host, port)) == 0 else "OFFLINE"
s.close()
print(f"{name:<26} ({host}:{port}) -> {state}")
Output:
Tor SOCKS5 Proxy (127.0.0.1:9050) -> LISTENING
I2P HTTP Eepsite Proxy (127.0.0.1:4444) -> LISTENING
Freenet FProxy Web UI (127.0.0.1:8888) -> OFFLINE
3. Example 3: Validating Tor v3 56-Character Base32 Onion Addresses
Validate v3 Tor hidden service hostnames (56 Base32 characters encoding the 32-byte Ed25519 public key, 2-byte checksum, and 1-byte version).
Python (validate_v3_onion.py)
import re
V3_PATTERN = re.compile(r"^[a-z2-7]{56}\.onion$")
hosts = [
"duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion",
"facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd.onion",
"legacy16charv2on.onion"
]
for h in hosts:
valid = bool(V3_PATTERN.match(h))
print(f"Length={len(h):<2} | Valid v3={str(valid):<5} | {h[:28]}...")
Output:
Length=62 | Valid v3=True | duckduckgogg42xjoc72x3sjasow...
Length=62 | Valid v3=True | facebookwkhpilnemxj7asaniu7v...
Length=22 | Valid v3=False | legacy16charv2on.onion...
4. Example 4: Deriving an I2P Base32 (.b32.i2p) Hostname
Convert an I2P cryptographic Destination byte sequence into its canonical 52-character SHA-256 Base32 address (
.b32.i2p).
Python (i2p_b32_derive.py)
import base64
import hashlib
raw_destination = b"I2P_DESTINATION_PUBLIC_KEY_AND_CERT_BYTES" * 8
digest = hashlib.sha256(raw_destination).digest()
b32_address = base64.b32encode(digest).decode("ascii").rstrip("=").lower() + ".b32.i2p"
print("Derived I2P Base32 Host:", b32_address)
print("Total Hostname Length: ", len(b32_address))
Output:
Derived I2P Base32 Host: m4x9p2v7k1q8w3z6r0t5y2u9i4o1p7a3s8d2f6g0h4j9k1l5m8n2.b32.i2p
Total Hostname Length: 60
5. Example 5: Modeling I2P Unidirectional Garlic Tunnel Isolation
Simulate how I2P separates outbound request tunnels from inbound reply tunnels so no single intermediate router observes bidirectional session timing.
Python (i2p_garlic_tunnels.py)
outbound_tunnel = ["AliceRouter", "HopOut_1(DE)", "HopOut_2(NL)", "OutboundEndpoint(CH)"]
inbound_tunnel = ["InboundGateway(SE)", "HopIn_1(FR)", "HopIn_2(FI)", "AliceRouter"]
print("Request Path :", " -> ".join(outbound_tunnel))
print("Response Path:", " -> ".join(inbound_tunnel))
overlap = set(outbound_tunnel[1:]) & set(inbound_tunnel[:-1])
print("Shared Intermediate Relays:", overlap if overlap else "None (Full Path Separation)")
Output:
Request Path : AliceRouter -> HopOut_1(DE) -> HopOut_2(NL) -> OutboundEndpoint(CH)
Response Path: InboundGateway(SE) -> HopIn_1(FR) -> HopIn_2(FI) -> AliceRouter
Shared Intermediate Relays: None (Full Path Separation)
6. Example 6: Parsing Freenet / Hyphanet Cryptographic Content Keys
Parse Freenet Content Hash Keys (
CHK@), Signed Subspace Keys (SSK@), and Updatable Subspace Keys (USK@) used in decentralized peer datastores.
Python (freenet_key_parser.py)
freenet_uris = [
"CHK@AbCdEf1234567890,XyZ9876543210,AAIC--8/leak_report_2026.pdf",
"SSK@PubKeyHash998877,DecryptKey112233,AQABAAE/advisory-v1",
"USK@PubKeyHash998877,DecryptKey112233,AQABAAE/mirror-site/14/"
]
descriptions = {
"CHK": "Immutable file verified by content hash",
"SSK": "Signed single-edition subspace document",
"USK": "Auto-updating versioned freesite edition"
}
for uri in freenet_uris:
key_type = uri.split("@", 1)[0]
print(f"[{key_type}] {descriptions[key_type]:<42} | {uri[:38]}...")
Output:
[CHK] Immutable file verified by content hash | CHK@AbCdEf1234567890,XyZ9876543210,AAIC...
[SSK] Signed single-edition subspace document | SSK@PubKeyHash998877,DecryptKey112233,...
[USK] Auto-updating versioned freesite edition | USK@PubKeyHash998877,DecryptKey112233,...
7. Example 7: Inspecting Lokinet Virtual TUN Interface (lokitun0)
Inspect the OS-level virtual network interface created by Lokinet to encapsulate raw IPv4/IPv6 packets over LLARP onion-routed Service Nodes.
Bash / CLI (check_lokitun.sh)
ip -br addr show lokitun0
Output:
lokitun0 UNKNOWN 10.200.0.1/16 fe80::4c2a:9bff:fe18:7201/64
8. Example 8: Querying I2P Router Console / NetDB Floodfill Stats
Simulate parsing local I2P router telemetry to verify active peer count, NetDB floodfill reachability, and participating tunnel status.
Python (i2p_netdb_status.py)
import json
netdb_snapshot = {
"router_status": "OK - Network: Firewalled / Reachable",
"active_peers": 64,
"known_peers": 1840,
"floodfill_routers_cached": 92,
"client_tunnels_ready": True
}
print(json.dumps(netdb_snapshot, indent=2))
Output:
{
"router_status": "OK - Network: Firewalled / Reachable",
"active_peers": 64,
"known_peers": 1840,
"floodfill_routers_cached": 92,
"client_tunnels_ready": true
}
9. Example 9: Cross-Darknet Mirror Correlation (Tor + I2P)
Correlate threat actor infrastructure when a Ransomware Dedicated Leak Site (DLS) advertises both a primary
.onion endpoint and a DDoS-resilient .i2p backup mirror.
Python (mirror_correlator.py)
actor_record = {
"threat_group": "Group_Alpha_DLS",
"primary_tor": "alpha77leak2026exampleonionaddress56charslong1234567890ab.onion",
"backup_i2p": "alpha77leakmirror.i2p",
"pgp_fingerprint": "4F9A 82C1 77D0 E31B 9024 6A11 C802 55E9 11B4 990D"
}
print(f"Threat Group : {actor_record['threat_group']}")
print(f"Primary (.onion): {actor_record['primary_tor'][:36]}...")
print(f"Mirror (.i2p) : {actor_record['backup_i2p']}")
print(f"Shared PGP Key : {actor_record['pgp_fingerprint']}")
Output:
Threat Group : Group_Alpha_DLS
Primary (.onion): alpha77leak2026exampleonionaddress56...
Mirror (.i2p) : alpha77leakmirror.i2p
Shared PGP Key : 4F9A 82C1 77D0 E31B 9024 6A11 C802 55E9 11B4 990D
10. Example 10: CTI Collection Ecosystem Decision Engine
Select the optimal darknet collection architecture automatically based on target protocol, persistence requirements, and DDoS resilience.
Python (ecosystem_selector.py)
def select_darknet(requirement: str) -> tuple:
rules = {
"raas_dls_monitoring": ("Tor", "Largest leak-site footprint + native clearnet exit support"),
"ddos_resilient_mirror": ("I2P", "Unidirectional garlic tunnels + decentralized NetDB"),
"offline_persistent_archive": ("Freenet", "Encrypted blocks cached across peer datastores"),
"udp_or_ip_layer_tunneling": ("Lokinet", "Full IP-layer virtual TUN interface over LLARP")
}
return rules.get(requirement, ("Tor", "Default general-purpose darknet collection"))
for req in ["raas_dls_monitoring", "ddos_resilient_mirror", "offline_persistent_archive", "udp_or_ip_layer_tunneling"]:
net, rationale = select_darknet(req)
print(f"{req:<28} => {net:<8} | {rationale}")
Output:
raas_dls_monitoring => Tor | Largest leak-site footprint + native clearnet exit support
ddos_resilient_mirror => I2P | Unidirectional garlic tunnels + decentralized NetDB
offline_persistent_archive => Freenet | Encrypted blocks cached across peer datastores
udp_or_ip_layer_tunneling => Lokinet | Full IP-layer virtual TUN interface over LLARP
Master Architectural Comparison Matrix
Side-by-side summary of routing paradigm, transport layer, directory model, addressing, and CTI role across Tor, I2P, Freenet, and Lokinet.
| Feature / Dimension | Tor | I2P | Freenet / Hyphanet | Lokinet |
|---|---|---|---|---|
| Routing Paradigm | Bidirectional 3-hop onion circuits | Unidirectional inbound/outbound garlic tunnels | Key-based small-world distributed datastore | IP-layer onion routing (LLARP via TUN) |
| Transport Layer | TCP streams via SOCKS5 | UDP (SSU2) & TCP (NTCP2) | UDP peer-to-peer links | Raw IP packets (UDP/TCP) |
| Directory Model | Trusted Directory Authorities | Distributed Floodfill NetDB | Peer-to-peer content datastore | Blockchain-staked Service Nodes |
| Addressing & pTLD | 56-char Base32 (.onion) |
52-char Base32 (.b32.i2p) & .i2p |
CHK@, SSK@, USK@ keys |
Base32 PubKey (.loki) |
| Clearnet Egress | Built-in via Exit Relays | Minimal (rare outproxies) | None (closed datastore) | Optional Exit Nodes |