Spaces:
Running
Running
Live-corpus dashboard: split attacker endpoints from crawler self-IDs; rebuild dataset from active sensors
Browse filesFiles changed (6)
- README.md+78-35
- data/intel.json
- index.html+31-9
- scripts/parse_intel.pyDeleted-354
- scripts/parse_live.py+43-2
- style.cssDeleted-28
4 unmodified lines567889101112131415161516171819202122232422232425262627282728293031323334353637383940414243444546474849505152535455565758593435606162636465663738396768697071724344457374757677787980818283845051528586878889909192939495965455569798991005960616263646566101102103691041051061077374751081091101111121131141151161171184 unmodified linescolorTo: graysdk: staticapp_file: index.htmlshort_description: Real tarpit attacker telemetry, parsed and graphed.short_description: Real honeypot attacker telemetry, parsed and graphed.pinned: false---
# SENTRY INTEL
A dark operations dashboard for **real** attacker telemetry captured by thetarpit / honeypot sensors on the `sentry` host. Nothing on this page issynthetic sample data — every row is a parsed log block from the sensors.honeypot / tarpit sensors on the `sentry` host. Every row on the page is aparsed log record from those sensors. There is no synthetic sample data.
## What's shown
| Panel | Source of truth ||---|---|| Totals / KPIs | parsed `intel.log` + `decimator.log` blocks || Events over time | hourly binning of the capture window || Ports hit | `PORT:` field of each log block || Totals / KPIs | all four sensor files below || Events over time | hourly binning across the whole capture window || Protocol mix | `protocol` field of each beacon session (postgres / redis / mysql / s3 / http) || Sensor event mix | `event` field (command / connect / error / http / credential) || Attacker geography | per-`/24` subnet clusters, coordinates resolved **offline** || Payload mix | classifier over the leading bytes of each `PAYLOAD:` hex blob || Payload inspector | the raw hex blob next to its decoded text rendering || Recent events / top subnets / top IPs | direct projections of the parsed rows || Attack paths | nginx decoy hit paths (`/.env`, `/.git/HEAD`, `/.aws/credentials`, …) || **Harvested C2 URLs** | `c2_urls` extracted from captured session payloads || Credential capture | sessions where an attacker actually submitted credentials || Tool fingerprints | client library / scanner identification per session || Payload inspector | the raw captured payload next to its decoded rendering |
## Live capture, quoted honestly
The sensors are **active and currently logging**. The page renders a **frozencapture** — a snapshot parsed at build time — because a Static Space runs noserver code and cannot poll the host. The exact `generated_at` timestamp andthe true `first` → `last` capture span are printed on the page and stored in`data/intel.json`, so staleness is never disguised as liveness.
Current build:
| | ||---|---|| Events | **96,913** || Beacon sessions | 78,581 || Decoy path hits | 14,963 || Honeypot sessions | 3,369 || HIGH C2 alerts | 904 (45 source IPs) || Unique source IPs | **7,578** || Unique `/24` subnets | 3,584 || Harvested C2 URLs | **80** || Credential captures | 13 || Capture window | 2026-07-28 → 2026-10-16 |
## Provenance
Sensor logs, pulled from `root@172.236.112.52`:
- `/opt/attacker-intel/v2/intel.log` — primary- `/opt/sentry-v5/logs/decimator.log` — same block format, longer window| File | Bytes ||---|---|| `/opt/attacker-intel/beacon_sessions.jsonl` | 28,623,834 || `/opt/attacker-intel/poison_hits.log` | 1,869,259 || `/opt/attacker-intel/honeypot_sessions.jsonl` | 435,459 || `/opt/attacker-intel/beacon_alerts.log` | 452,157 |
Both file SHA-256 digests and their event counts are printed on the page andstored in `data/intel.json`. The exact capture window is displayed so stalenessis never disguised as liveness — **this is a frozen capture, not a live feed.**A SHA-256 digest and byte count for every source is printed on the page andstored in `data/intel.json`, so any published figure can be traced back to theexact bytes it came from.
## No runtime network calls
The Space is plain HTML/CSS/JS with no build step. Charts and the world view arehand-rolled `<canvas>`. Both the dataset (`data/intel.json`) and the world landmask (`data/landmask.json`) are baked into the repo.Plain HTML/CSS/JS with no build step. Charts and the world view are hand-rolled`<canvas>`. Both the dataset (`data/intel.json`) and the world land mask(`data/landmask.json`) are baked into the repo. Geo is resolved at build timefrom a local `GeoLite2-City.mmdb` — no runtime geo API, no CDN, no analytics.
## Regenerating the dataset
The refresh job pulls the four live sensor files, rebuilds the dataset, pushesonly `data/intel.json`, then re-fetches it to confirm the served copy carriesthe new `generated_at`:
```bash# 1. pull the raw sensor logssh root@172.236.112.52 'cat /opt/attacker-intel/v2/intel.log' > raw/intel.logssh root@172.236.112.52 'cat /opt/sentry-v5/logs/decimator.log' > raw/decimator.logpython D:/.hermes/scripts/sentry_intel_refresh.py # full refreshpython D:/.hermes/scripts/sentry_intel_refresh.py --dry-run # pull + parse, no push```
Manually:
```bash# 1. pull the live sensor filesfor f in beacon_sessions.jsonl honeypot_sessions.jsonl poison_hits.log beacon_alerts.log; do scp "root@172.236.112.52:/opt/attacker-intel/$f" raw/done
# 2. offline geo database (not shipped in the Space — build-time only)curl -L -o geo/GeoLite2-City.mmdb \ https://raw.githubusercontent.com/P3TERX/GeoLite.mmdb/download/GeoLite2-City.mmdb# 2. build-time geo database (NOT shipped in the Space)# GeoLite2-City.mmdb — 50 MB, keep it out of the repo
# 3. parse -> data/intel.jsonuv pip install --system maxminddbpython scripts/parse_intel.py
# 4. world land mask (Natural Earth 110m, public domain) -> data/landmask.jsoncurl -L -o geo/ne_110m_land.geojson \ https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_110m_land.geojsonpython scripts/rasterize_land.pycp geo/landmask.json data/landmask.jsonpython3 scripts/parse_live.py --dir raw --mmdb GeoLite2-City.mmdb --out data/intel.json```
Then `hf upload ereezy/sentry-intel . --repo-type space`.Then push: `hf upload ereezy/sentry-intel data/intel.json data/intel.json --repo-type space`
## Data hygiene
This is **attacker-side** telemetry only: source IPs that probed the tarpit,the ports they hit, and the bytes they sent. No operator data, no credentials,no interior network detail is published here.This is **attacker-side** telemetry only: source IPs that probed the sensors andthe bytes they sent. No operator data, no real credentials, no interior networkdetail is published here. The one access key on the page is a deliberatelyplanted decoy.
## Known state
The older tarpit on port `8443` (`multi_tarpit.py`, `/opt/attacker-intel/v2/`)stopped logging on **2026-10-08** and no longer listens. The sensors feedingthis dashboard are `beacon_catcher.py` (`/opt/attacker-intel/`) and the nginxdecoy layer.136 unmodified lines137138139140141140141142143143144145146147148145149150147151152153154155156157158159160161162163164165166167168209 unmodified lines3783793803633813823833847 unmodified lines39239339437737839539639739839940040140240340440582 unmodified lines488489490469491492493494136 unmodified lines <div class="kpis" id="kpis"></div> <div class="strip" id="kpis2"></div>
<!-- PRIMARY INTEL PANEL — harvested C2 callbacks --> <div class="grid"> <!-- PRIMARY INTEL PANEL — endpoints the intruders actually used --> <div class="grid g2"> <div class="panel pri"> <h2>Harvested C2 callbacks <span class="hint" id="c2hint"></span></h2> <h2>Attacker endpoints <span class="hint" id="c2hint"></span></h2> <div class="body tight"> <p style="color:#6B6560;font-size:11.5px;line-height:1.5;margin:0 0 10px"> URLs found <b style="color:#D4A843">inside the bytes the attacker sent</b> — endpoints they actually tried to pull a payload or push data to. These are real callbacks. </p> <div class="scroll" style="max-height:392px"> <div class="scroll" style="max-height:360px"> <table id="t_c2"> <thead><tr><th class="num" style="width:64px">hits</th><th>url harvested from captured payloads</th></tr></thead> <thead><tr><th class="num" style="width:64px">hits</th><th>endpoint</th></tr></thead> <tbody></tbody></table> </div> </div> </div> <div class="panel"> <h2>Scanner self-identifiers <span class="hint" id="scihint"></span></h2> <div class="body tight"> <p style="color:#6B6560;font-size:11.5px;line-height:1.5;margin:0 0 10px"> URLs that appear <b style="color:#F0EDE8">only in a client's User-Agent</b>, never in payload bytes — crawlers and research scanners announcing themselves. <b style="color:#F0EDE8">Not callbacks.</b> </p> <div class="scroll" style="max-height:360px"> <table id="t_sci"> <thead><tr><th class="num" style="width:64px">hits</th><th>crawler identifier</th></tr></thead> <tbody></tbody></table> </div> </div>209 unmodified lines ['unique attacking IPs', fmt(T.unique_ips), T.alert_ips+' flagged in HIGH alerts', false], ['unique /24 subnets', fmt(T.unique_subnets), 'distinct source networks', false], ['HIGH C2 alerts', fmt(T.high_alerts), 'beacon alerts raised', true], ['harvested C2 URLs', fmt(T.c2_urls), 'callbacks pulled from payloads', true], ['attacker endpoints', fmt(T.c2_urls), 'URLs found in payload bytes', true], ['decoy keys captured', fmt(T.decoy_keys), 'honeytoken value exfiltrated', true] ]; $('#kpis').innerHTML = kpis.map(([l,v,s,hot])=>7 unmodified lines `<span>hourly bins <b>${fmt(DATA.timeline.length)}</b></span>`+ `<span>days observed <b>${fmt(DATA.daily.length)}</b></span>`;
// ---- C2 URLs (primary) ---- $('#c2hint').textContent = DATA.c2_urls.length+' callbacks ranked by hit count'; // ---- attacker endpoints (payload-borne) + scanner self-IDs (primary) ---- $('#c2hint').textContent = DATA.c2_urls.length+' endpoints · payload-borne'; $('#t_c2 tbody').innerHTML = DATA.c2_urls.map((u,i)=> `<tr class="${i<3?'hitrow':''}"><td class="num">${fmt(u.count)}</td><td class="url">${esc(u.url)}</td></tr>`).join(''); const SCI = DATA.scanner_ids || []; $('#scihint').textContent = SCI.length+' client UA identifiers'; $('#t_sci tbody').innerHTML = SCI.map(u=> `<tr><td class="num">${fmt(u.count)}</td><td class="url">${esc(u.url)}</td></tr>`).join('');
// ---- protocol mix ---- bars('#protocols', DATA.protocols.map(p=>[p.name, p.count]));82 unmodified lines operator data, no working credentials, no interior network detail.</div>`;
$('#f_left').innerHTML = `SENTRY INTEL · ${fmt(T.events)} events · ${fmt(T.unique_ips)} src IPs · `+ `${DATA.c2_urls.length} C2 URLs · ${fmt(T.high_alerts)} HIGH alerts · built ${esc(DATA.generated_at)}`; `${DATA.c2_urls.length} attacker endpoints · ${fmt(T.high_alerts)} HIGH alerts · built ${esc(DATA.generated_at)}`;
$('#b_hour').onclick = ()=>{ TSMODE='hour'; $('#b_hour').classList.add('on'); $('#b_day').classList.remove('on'); $('#tlhint').textContent = DATA.timeline.length+' hourly bins'; drawTime(); };123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354#!/usr/bin/env python3"""sentry-intel dataset builder.
Reads the raw tarpit/honeypot sensor logs from Eddy's box and emitsdata/intel.json, which is baked into the Static Space.
Source logs (pulled from root@172.236.112.52): /opt/attacker-intel/v2/intel.log (primary) /opt/sentry-v5/logs/decimator.log (same format, longer window)
Geo is resolved OFFLINE at build time with a local GeoLite2-City.mmdb —no runtime network calls in the Space.
Usage: python scripts/parse_intel.py \ --intel raw/intel.log \ --decimator raw/decimator.log \ --mmdb geo/GeoLite2-City.mmdb \ --out data/intel.json"""import argparseimport hashlibimport ipaddressimport jsonimport osimport reimport sysfrom collections import Counter, defaultdictfrom datetime import datetime, timezone
BLOCK_TS = re.compile(r"^\[([0-9T:\-\.]+)\]\s+IP:\s+([0-9A-Fa-f:.]+)\s+\|\s+PORT:\s+(\d+)\s+\|\s+INTEL:\s*(.*)$")SEP = "----------------------------------------"
def classify(hexs: str, port: int) -> str: """Classify a raw payload by its leading bytes / port.""" if not hexs: return "empty" try: b = bytes.fromhex(hexs[:64]) except ValueError: return "binary" if b[:4] == b"SSH-": return "SSH banner" if b[:2] == b"GE" or b[:4] in (b"POST", b"HEAD", b"PUT "): return "HTTP request" if len(b) >= 3 and b[0] == 0x16 and b[1] == 0x03: return "TLS ClientHello" if b[:4] == b"\xffSMB" or (len(b) >= 8 and b[4:8] == b"\xffSMB"): return "SMB negotiate" if port == 27017 and len(b) >= 4 and b[:4] == b"\x3f\x00\x00\x00": return "MongoDB OP_QUERY" if len(b) >= 3 and b[:3] == b"\x03\x00\x00" and port in (3389, 1433, 8443): return "RDP X.224" if b[:1] == b"\x05": return "SOCKS5" if all(0x20 <= c < 0x7F or c in (9, 10, 13) for c in b[:16]): return "text protocol" return "binary"
def render_text(hexs: str, limit_bytes: int = 512) -> str: """Human-readable rendering: printable kept, control bytes escaped.""" if not hexs: return "" try: b = bytes.fromhex(hexs) except ValueError: return "[not hex]" out = [] for c in b[:limit_bytes]: if c in (10,): out.append("\\n") elif c == 13: out.append("\\r") elif c == 9: out.append("\\t") elif 0x20 <= c < 0x7F: out.append(chr(c)) else: out.append("<%02x>" % c) s = "".join(out) if len(b) > limit_bytes: s += " ...[+%d bytes]" % (len(b) - limit_bytes) return s
def parse_log(path: str, source_label: str, events: list, stats: dict): """Parse one sensor log in place. Appends to `events`.""" if not os.path.exists(path): print(" skip (missing): %s" % path, file=sys.stderr) return raw = open(path, "rb").read() digest = hashlib.sha256(raw).hexdigest() text = raw.decode("utf-8", "replace") lines = text.split("\n") n = 0 i = 0 total = len(lines) while i < total: m = BLOCK_TS.match(lines[i]) if not m: i += 1 continue ts, ip, port, rest = m.group(1), m.group(2), int(m.group(3)), m.group(4) # INTEL json may be pretty-printed across lines until the PAYLOAD line / separator jbuf, payload_hex = [], "" j = i + 1 while j < total: ln = lines[j] if ln.startswith("PAYLOAD:"): payload_hex = ln[len("PAYLOAD:"):].strip() j += 1 break if ln.strip() == SEP or ln.startswith("["): break jbuf.append(ln) j += 1 intel = None blob = (rest + "\n" + "\n".join(jbuf)).strip() try: intel = json.loads(blob) except Exception: intel = {"_raw": blob[:300]} ev = { "ts": ts, "ip": ip, "port": port, "src": source_label, "reason": (intel or {}).get("reason") or "", "msg": ((intel or {}).get("message") or "")[:120], "country": (intel or {}).get("country_code") or (intel or {}).get("country") or "", "city": (intel or {}).get("city") or "", "lat": (intel or {}).get("latitude"), "lon": (intel or {}).get("longitude"), "org": (intel or {}).get("org") or (intel or {}).get("asn") or "", "payload_hex": payload_hex[:2048], "payload_bytes": len(payload_hex) // 2, "kind": classify(payload_hex, port), } events.append(ev) n += 1 # advance past separator k = j while k < total and lines[k].strip() in ("", SEP): k += 1 i = k if k > i else i + 1 stats["sources"].append({ "path": source_label, "events": n, "bytes": len(raw), "sha256": digest, }) print(" %-42s %6d events (sha256 %s)" % (source_label, n, digest[:12]))
def subnet24(ip: str) -> str: try: return str(ipaddress.ip_network(ip + "/24", strict=False)) except ValueError: return "unknown"
def main(): ap = argparse.ArgumentParser() ap.add_argument("--intel", default="raw/intel.log") ap.add_argument("--decimator", default="raw/decimator.log") ap.add_argument("--mmdb", default="geo/GeoLite2-City.mmdb") ap.add_argument("--out", default="data/intel.json") ap.add_argument("--recent", type=int, default=300) args = ap.parse_args()
events = [] stats = {"sources": []} print("parsing sensor logs...") parse_log(args.intel, "/opt/attacker-intel/v2/intel.log", events, stats) parse_log(args.decimator, "/opt/sentry-v5/logs/decimator.log", events, stats) events.sort(key=lambda e: e["ts"]) print(" total parsed events: %d" % len(events))
# ---- offline geo ---- geo_note = "no geo database present at build time" reader = None if os.path.exists(args.mmdb): try: import maxminddb reader = maxminddb.open_database(args.mmdb) geo_note = "IP->lat/lon resolved offline at build time with local GeoLite2-City.mmdb" except Exception as e: geo_note = "geo db present but unreadable: %s" % e
ip_counts = Counter(e["ip"] for e in events) geo_cache = {}
def geo_for(ip): if ip in geo_cache: return geo_cache[ip] rec = {"country": "", "country_name": "", "city": "", "lat": None, "lon": None, "org": ""} if reader is not None: try: r = reader.get(ip) or {} c = r.get("country", {}) or {} rec["country"] = c.get("iso_code", "") or "" rec["country_name"] = (c.get("names", {}) or {}).get("en", "") or "" rec["city"] = ((r.get("city", {}) or {}).get("names", {}) or {}).get("en", "") or "" loc = r.get("location", {}) or {} rec["lat"] = loc.get("latitude") rec["lon"] = loc.get("longitude") except Exception: pass # sensor-supplied intel wins if the db was silent if not rec["country"]: for e in events: if e["ip"] == ip and e.get("country"): rec["country"] = e["country"] rec["city"] = rec["city"] or e.get("city") or "" rec["lat"] = rec["lat"] if rec["lat"] is not None else e.get("lat") rec["lon"] = rec["lon"] if rec["lon"] is not None else e.get("lon") break geo_cache[ip] = rec return rec
top_ips = [] for ip, cnt in ip_counts.most_common(60): g = geo_for(ip) top_ips.append({ "ip": ip, "count": cnt, "country": g["country"], "country_name": g["country_name"], "city": g["city"], "lat": g["lat"], "lon": g["lon"], })
# subnet clusters (the dashboard's world view) subnets = [] for sn, cnt in Counter(subnet24(e["ip"]) for e in events).most_common(40): ips_in = sorted({e["ip"] for e in events if subnet24(e["ip"]) == sn}) lats, lons, ctry, city = [], [], Counter(), Counter() for ip in ips_in: g = geo_for(ip) if g["lat"] is not None and g["lon"] is not None: lats.append(g["lat"]); lons.append(g["lon"]) if g["country"]: ctry[g["country"]] += 1 if g["city"]: city[g["city"]] += 1 subnets.append({ "subnet": sn, "count": cnt, "ips": len(ips_in), "sample_ip": ips_in[0], "lat": round(sum(lats) / len(lats), 4) if lats else None, "lon": round(sum(lons) / len(lons), 4) if lons else None, "country": ctry.most_common(1)[0][0] if ctry else "", "city": city.most_common(1)[0][0] if city else "", "geo_pts": len(lats), "geo_dispersed": (max(lats) - min(lats) > 2.0 or max(lons) - min(lons) > 2.0) if lats else False, })
# hourly timeline tl = Counter() for e in events: tl[e["ts"][:13] + ":00"] += 1 timeline = [{"t": k, "count": v} for k, v in sorted(tl.items())]
ports = [{"port": p, "count": c} for p, c in Counter(e["port"] for e in events).most_common(20)] reasons = [{"reason": r or "unclassified", "count": c} for r, c in Counter(e["reason"] for e in events).most_common(12)] kinds = [{"kind": k, "count": c} for k, c in Counter(e["kind"] for e in events).most_common(12)]
recent = [] for e in events[-args.recent:][::-1]: recent.append({ "ts": e["ts"], "ip": e["ip"], "port": e["port"], "reason": e["reason"] or "-", "kind": e["kind"], "payload_bytes": e["payload_bytes"], "payload_hex": e["payload_hex"], "payload_text": render_text(e["payload_hex"]), "country": (geo_for(e["ip"]) or {}).get("country") or "", })
# diverse payload samples: one per (kind, port, ip) signature, spread over the # whole window so the inspector is not 300 copies of the same SSH banner. seen = set() samples = [] for e in events: key = (e["kind"], e["port"], e["ip"], e["payload_hex"][:24]) if key in seen: continue seen.add(key) samples.append(e) buckets = defaultdict(list) for e in samples: buckets[e["kind"]].append(e) picked, idx = [], 0 while len(picked) < 150 and idx < 400: for k in buckets: if idx < len(buckets[k]) and len(picked) < 150: picked.append(buckets[k][idx]) idx += 1 payload_samples = [{ "ts": e["ts"], "ip": e["ip"], "port": e["port"], "reason": e["reason"] or "-", "kind": e["kind"], "payload_bytes": e["payload_bytes"], "payload_hex": e["payload_hex"], "payload_text": render_text(e["payload_hex"]), "country": (geo_for(e["ip"]) or {}).get("country") or "", "city": (geo_for(e["ip"]) or {}).get("city") or "", } for e in picked]
unique_ips = len(ip_counts) resolved = sum(1 for ip in ip_counts if geo_for(ip)["lat"] is not None) out = { "generated_at": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"), "sources": stats["sources"], "totals": { "events": len(events), "unique_ips": unique_ips, "unique_ports": len({e["port"] for e in events}), "unique_subnets": len({subnet24(e["ip"]) for e in events}), "first_event": events[0]["ts"] if events else "", "last_event": events[-1]["ts"] if events else "", "payload_bytes_total": sum(e["payload_bytes"] for e in events), }, "ports": ports, "reasons": reasons, "payload_kinds": kinds, "timeline": timeline, "top_ips": top_ips, "subnets": subnets, "recent": recent, "payload_samples": payload_samples, "geo": { "method": geo_note, "resolved_ips": resolved, "total_ips": unique_ips, "granularity": "city/point when the offline db had a fix, otherwise subnet cluster centroid; " "clusters flagged geo_dispersed spread the real points around their centroid", }, }
os.makedirs(os.path.dirname(args.out), exist_ok=True) with open(args.out, "w", encoding="utf-8") as f: json.dump(out, f, ensure_ascii=False, separators=(",", ":")) print("\nwrote %s (%.1f KB)" % (args.out, os.path.getsize(args.out) / 1024)) print(" events=%d unique_ips=%d ports=%d subnets=%d geo_resolved=%d/%d" % (len(events), unique_ips, out["totals"]["unique_ports"], out["totals"]["unique_subnets"], resolved, unique_ips)) print(" window: %s -> %s" % (out["totals"]["first_event"], out["totals"]["last_event"]))
if __name__ == "__main__": main()145 unmodified lines14614714814915015115215315438 unmodified lines19319419519619719819920020120220320420519520620720820921021121298 unmodified lines31131231331431531631731831932032132232332432532632732832933033133233333433533633733836 unmodified lines3753763773783793803812 unmodified lines384385386350387388389390391392393394145 unmodified lines paths = collections.Counter() attack_paths = collections.Counter() c2_urls = collections.Counter() url_total = collections.Counter() url_in_payload = collections.Counter() scanner_ids = collections.Counter() ip_counts = collections.Counter() subnet_counts = collections.Counter() hourly = collections.Counter()38 unmodified lines tools[str(r["tool"])[:70]] += 1 if r.get("path"): paths[str(r["path"])[:80]] += 1 # URLs found in a session. CRITICAL: the raw `c2_urls` field mixes # two unrelated things — (a) endpoints the attacker actually used, # which appear INSIDE the captured payload, and (b) URLs that are # merely part of a client's User-Agent string (openai.com/gptbot, # about.censys.io, google.com/bot.html...). Calling the latter "C2" # is simply wrong. Split them and keep the evidence for each. pl = r.get("payload") pl_s = json.dumps(pl) if isinstance(pl, (dict, list)) else str(pl or "") for u in (r.get("c2_urls") or []): if isinstance(u, str): c2_urls[u[:160]] += 1 uk = u[:160] url_total[uk] += 1 if u and u in pl_s: url_in_payload[uk] += 1 if r.get("access_key"): decoy_keys.add(str(r["access_key"])[:80]) if ev == "credential":98 unmodified lines "sha256": sha256_of(p), })
# ---- split URL-like strings: attacker endpoints vs crawler self-IDs ---- ip_host = re.compile(r"^https?://\d{1,3}(?:\.\d{1,3}){3}(?::\d+)?(?:/|$)", re.I) payload_artifact = re.compile(r"(\.sh|/kworker|cc\.txt|/ndt\.sh|init\.sh)(\?|$)", re.I) # XML namespace / schema URIs are structural markup inside SOAP payloads, # not endpoints anyone contacted. Drop them or the panel is polluted. NOISE = ("w3.org/2001/xmlschema", "schemas.xmlsoap.org", "w3.org/2001/xml", "xmlsoap.org/soap/envelope") for uk, tot in url_total.items(): low = uk.lower() if any(nz in low for nz in NOISE): continue # a bare/short host from a truncated payload is not a usable endpoint if len(uk.split("://", 1)[-1].split("/", 1)[0]) < 4: continue ratio = (url_in_payload.get(uk, 0) / tot) if tot else 0.0 host_ip = bool(ip_host.match(uk)) artifact = bool(payload_artifact.search(uk)) if host_ip or artifact or ratio > 0.5: c2_urls[uk] = tot else: scanner_ids[uk] = tot
# ---- subnet aggregates ---- subnets = [] for sn, cnt in subnet_counts.most_common(40):36 unmodified lines "high_alerts": n_alerts, "alert_ips": len(alert_ips), "c2_urls": len(c2_urls), "scanner_ids": len(scanner_ids), "decoy_keys": len(decoy_keys), "credential_events": len(credential_rows), },2 unmodified lines "tools": [{"name": k, "count": v} for k, v in tools.most_common(14)], "paths": [{"name": k, "count": v} for k, v in paths.most_common(14)], "attack_paths": [{"name": k, "count": v} for k, v in attack_paths.most_common(16)], "c2_urls": [{"url": k, "count": v} for k, v in c2_urls.most_common(25)], "c2_urls": [{"url": k, "count": v, "payload_hits": url_in_payload.get(k, 0), "in_payload": url_in_payload.get(k, 0) > 0} for k, v in c2_urls.most_common(25)], "scanner_ids": [{"url": k, "count": v} for k, v in scanner_ids.most_common(20)], "timeline": [{"t": k, "count": v} for k, v in sorted(hourly.items())], "daily": [{"d": k, "count": v} for k, v in sorted(daily.items())], "top_ips": top_ips,12345678910111213141516171819202122232425262728body { padding: 2rem; font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;}
h1 { font-size: 16px; margin-top: 0;}
p { color: rgb(107, 114, 128); font-size: 15px; margin-bottom: 10px; margin-top: 5px;}
.card { max-width: 620px; margin: 0 auto; padding: 16px; border: 1px solid lightgray; border-radius: 16px;}
.card p:last-child { margin-bottom: 0;}README.md+78-35
data/intel.json
index.html+31-9
scripts/parse_intel.pyDeleted-354
scripts/parse_live.py+43-2
style.cssDeleted-28