Spaces:
Running
Running
Upload folder using huggingface_hub
Browse filesFiles changed (7)
- .gitignoreAdded+3
- README.md+69-4
- data/intel.jsonAdded
- data/landmask.jsonAdded+1
- index.html+452-18
- scripts/parse_intel.pyAdded+354
- scripts/rasterize_land.pyAdded+87
123raw/geo/__pycache__/12345678910---title: Sentry Intelemoji: 🦀colorFrom: redcolorTo: greensdk: staticpinned: false---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475---title: Sentry Intelemoji: 🛰️colorFrom: graycolorTo: graysdk: staticapp_file: index.htmlshort_description: Real tarpit attacker telemetry, parsed and graphed.pinned: false---# SENTRY INTELA 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.## 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 || 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 |## ProvenanceSensor 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 windowBoth 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.**## No runtime network callsThe 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.## Regenerating the dataset```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.log# 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# 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.json```Then `hf upload ereezy/sentry-intel . --repo-type space`.## Data hygieneThis 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.
1{"w":360,"h":180,"b64":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADf//8AAf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////D//////n/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/gf/x////////wAAAAAbgAAB4AAAAAAPwAAAAAAAAAAAAAAAAAAAAAAAAAAAf//8A///////+AAAAB/ngAAAAAAAAAAH8AAAAAAAAAAAAAAAAAAAAAAAAcH3Hv/5////////8AAAAA/gAAAAAAAAAAAAD4AAAAAAAAAAAAAAAAAAAAAAcIAAQP/AH///////+AAAAAPCAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAADwDAc+f+AP///////4AAAAAAAAAAAAAB4AAAAB/8AAAAAAAAAAAAAAAAAAAAAH9wc374AAAf/////8AAAAAAAAAAAAH4AAAA////AAAB/gAAAAAAAAAAAAAAAAwAAA/QAAAH/////8AAAAAAAAAAAAOAAAAP///wAAAAAAAAAAAAAAAAAAAAP8AYe+c3AAAD/////4AAAAAAAAAAAA4AAAH////++HgAOAAAAAAAAAAAAAAAfv+4+w/4gAAB/////wAAAAAAAAAAADwAHgH///////4AfgAAAAAgAAAAAAAAPf/4O4//9AAB/////wAAAAAAAAAAADwAPb////////4m//gAAAAAAAf+AAAAAA/+A8f//4AB////8gAAAAAAA/gAAAAAfv/////////////8AAAAAB///+H//H/+PeDwf+AA3////AAAAAAA//4AAAA8fv///////////////P8gAf////////A4CPz4H8AAP///wAAAAAAD///wADH/n3/////////////////8AD////////////34Z/wA///4AAAAAAAP///+M////n/////////////////+4E/////////////gD/8Af//gAAAAAAAf//5+P////f/////////////////fw/////////////6AD8YAf/wAAf8AAAA/8f+D///////////////////////AgEf///////////zw7/AAP/gAAP4AAAB/4/+f//////////////////////8AMAf//////////+DIA/gAH/gAAAAAAAH/z/////////////////////////+AAH///////////8AwgOAAD+AAAAAAAA//H/////////////////////////6AAP///////////wAA/AAAB+AAAAAAAB/+H//////////////////////nP+AAAH//z////////wAA/wAAAOAAAAAAAB//D/////////////////////+A/4AAAA/zAD///////gAA/4wAAAAAAAAAAB//Ab///////////////////+eDgAAAAABwAA///////4AA/94AAAAAAAAAYA5+A///////////////////4AAHAAAAAADcAAD//////4AAf/8AAAAAAAAA8AC+C///////////////////wAAfgAAAAAMAAAA///////wAf/8AAAAAAAAA4AO8H///////////////////AAA/gAAAABgAAAA///////8A///AAAAAAAAA8ANwH//////////////////8AAB/AAAAAEAAAAAf///////z///4AAAAAAAHOAEDv//////////////////+AAA+AAAAAAAAAABH///////x///8AAAAAAAHHAf/////////////////////6AA8AAAAAAAAAAAD///////x///8AAAAAAAGPz//////////////////////6AAwAAAAAAAAAAAD///////9///6AAAAAAAAPj//////////////////////6AAQAAAAAAAAAAAC///////////MAAAAAAAAYf//////////////////////7AAAAAAAAAAAAAABv////////+MNAAAAAAAAD///////////////////////zAAAAAAAAAAAAAAAH////////7gfgAAAAAAAf///////////////////////yAAAAAAAAAAAAAAAL/////////gCgAAAAAAAH///////////////////////iAAAAAAAAAAAAAAAP/////////pAAAAAAAAAD/////uP////////////////DAAAAAAAAAAAAAAAP/////////+AAAAAAAAAB//v//Gf///////////////+AAAAAAAAAAAAAAAAP////////8wAAAAAAAAAB//H/+AP///////////////8CAAAAAAAAAAAAAAAP////////wAAAAAAAAADj/jz/8AD///////////////4HgAAAAAAAAAAAAAAP////////gAAAAAAAAAH/4Bw/8AA//////////////+APAAAAAAAAAAAAAAAP////////gAAAAAAAAAH/wA8f8Ph//////////////8AAAAAAAAAAAAAAAAAP///////8AAAAAAAAAAH/gMHfJ///////////////v4AMAAAAAAAAAAAAAAAP///////8AAAAAAAAAAH/AMCOP//////////////+JwAMAAAAAAAAAAAAAAAH///////4AAAAAAAAAAH/AAAHH//////////////8BwAIAAAAAAAAAAAAAAAH///////wAAAAAAAAAAH+AAYGH//////////////+w4A4AAAAAAAAAAAAAAAD///////wAAAAAAAAAAAgf+ACBs//////////////g4D4AAAAAAAAAAAAAAAB///////wAAAAAAAAAAAj/+AAAA//////////////AYf4AAAAAAAAAAAAAAAA///////gAAAAAAAAAAB//8AAAA//////////////Ah2AAAAAAAAAAAAAAAAAP/////+AAAAAAAAAAAD//+AAAB//////////////gDwAAAAAAAAAAAAAAAAAH/////8AAAAAAAAAAAH///4GAB//////////////gDAAAAAAAAAAAAAAAAAAG/////4AAAAAAAAAAAP///8P4h//////////////wCAAAAAAAAAAAAAAAAAACf////4AAAAAAAAAAAP////v////////////////gAAAAAAAAAAAAAAAAAAABP//hgYAAAAAAAAAAAP//////3//P///////////wAAAAAAAAAAAAAAAAAAAAv//AAYAAAAAAAAAAAf//////9//H///////////wAAAAAAAAAAAAAAAAAAAB3/+AAcAAAAAAAAAAB///////4//h///////////gAAAAAAAAAAAAAAAAAAAAR/+AANAAAAAAAAAAD///////8//wH//////////AAAAAAAAAAAAAAAAAAAAAJ/+AAEAAAAAAAAAAH///////+f/0B/////////+AAAAAAAAAAAAAAAAAAAAAI/8AAAAAAAAAAAAAH///////+f/44Af///////+QAAAAAAAAAAAAAAAAAAAAAf8AAAAAAAAAAAAAP////////H//+AP///////4gAAAAAAAAAAAAAAAAAAAAAP8AAuAAAAAAAAAAP////////H///AD///v///ggAAAAAAAAAAAAAAAAAAAAAH+AABgAAAAAAAAAf////////n//+AD//4P//YAAAAAAAAAAAAAAAAAAAAAAAP+A4AYAAAAAAAAAP////////j//+AAf/4H/+AAAAAAAAAAAAAAAAgAAAAAAAH/B4ABwAAAAAAAAP////////h//8AAf/gD/8YAAAAAAAAAAAAAAAAAAAAAAAD/nwAD9AAAAAAAAP////////x//4AAf/AD/8QAAAAAAAAAAAAAAAAAAAAAAAAf/wAAAAAAAAAAAP////////4//gAAf+AD/+AAwAAAAAAAAAAAAAAAAAAAAAAH/wAAAAAAAAAAAf////////4f+AAAf8AD//AAwAAAAAAAAAAAAAAAAAAAAAAAH/AAAAAAAAAAAf////////8f8AAAPwAAP/gAwAAAAAAAAAAAAAAAAAAAAAAAD/gAAAAAAAAAAf////////+fgAAAPwAAP/gAwAAAAAAAAAAAAAAAAAAAAAAAA/AAAAAAAAAAAf/////////eAAAAHwAAP/gAMAAAAAAAAAAAAAAAAAAAAAAAAHgAAAAAAAAAAf/////////gAAAAHwAAM/gACAAAAAAAAAAAAAAAAAAAAAAAADABAAAAAAAAAP/////////gYAAADwAAEfgAJAAAAAAAAAAAAAAAAAAAAAAAADgPfKAAAAAAAH/////////34AAADwAAIOABAAAAAAAAAAAAAAAAAAAAAAAAAAyPf+AAAAAAAD//////////4AAADoAAIEACBAAAAAAAAAAAAAAAAAAAAAAAAA8///AAAAAAAB//////////wAAABIAAMAAAFAAAAAAAAAAAAAAAAAAAAAAAAAE///gAAAAAAB//////////wAAAAMAAEAAALgAAAAAAAAAAAAAAAAAAAAAAAAAf//wAAAAAAAf/////////gAAAAMAADAAMCAAAAAAAAAAAAAAAAAAAAAAAAAA////gAAAAAAP/B///////gAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAf///wAAAAAACAA///////AAAAAAAAxgA+AAAAAAAAAAAAAAAAAAAAAAAAAAAf///4AAAAAAAAAD/////+AAAAAAAAZgB4AAAAAAAAAAAAAAAAAAAAAAAAAAB////4AAAAAAAAAD/////8AAAAAAAAMwH8AAAAAAAAAAAAAAAAAAAAAAAAAAB////8AAAAAAAAAH/////4AAAAAAAAHQf8AIAAAAAAAAAAAAAAAAAAAAAAAAD////8AAAAAAAAAH/////gAAAAAAAAHgf88IAAAAAAAAAAAAAAAAAAAAAAAAD////+AAAAAAAAAH/////AAAAAAAAADwf8AAgAAAAAAAAAAAAAAAAAAAAAAAH/////4AAAAAAAAH/////AAAAAAAAABwP5wBwAAAAAAAAAAAAAAAAAAAAAAAH/////6AAAAAAAAD////+AAAAAAAAAB8P5wATwAAAAAAAAAAAAAAAAAAAAAAD//////4AAAAAAAB////8AAAAAAAAAA8AxQif+AAAAAAAAAAAAAAAAAAAAAAH//////8AAAAAAAB////4AAAAAAAAAAcAAIAD/gAAAAAAAAAAAAAAAAAAAAAH///////gAAAAAAA////4AAAAAAAAAAMAAIAI/ywAAAAAAAAAAAAAAAAAAAAH///////gAAAAAAA////4AAAAAAAAAADgAAAI/8BAAAAAAAAAAAAAAAAAAAAD///////gAAAAAAAf///4AAAAAAAAAAB+AAAA/4AIAAAAAAAAAAAAAAAAAAAB///////gAAAAAAAf///4AAAAAAAAAAAAmogAOMAAAAAAAAAAAAAAAAAAAAAB///////AAAAAAAAf///8AAAAAAAAAAAABCAAAGADAAAAAAAAAAAAAAAAAAAA///////AAAAAAAAf///8AAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAf/////+AAAAAAAAP///8AAAAAAAAAAAAAAAgCAAAAAAAAAAAAAAAAAAAAAAAf/////8AAAAAAAAf///+AQAAAAAAAAAAAAB+CAAAAAAAAAAAAAAAAAAAAAAAP/////4AAAAAAAAf///+AQAAAAAAAAAAAAD8DAAAAAAAAAAAAAAAAAAAAAAAP/////4AAAAAAAA////+AwAAAAAAAAAAAA38DgAAAAAAAAAAAAAAAAAAAAAAH/////4AAAAAAAA////8BwAAAAAAAAAAAD/8DgAAAAAAAAAAAAAAAAAAAAAAB/////4AAAAAAAA////8PwAAAAAAAAAAAD//HwAABABAAAAAAAAAAAAAAAAAAf////4AAAAAAAA////wPgAAAAAAAAAAAP//3wAAAACAAAAAAAAAAAAAAAAAAP////wAAAAAAAA////APgAAAAAAAAAAAP///wAAAAAAAAAAAAAAAAAAAAAAAP////wAAAAAAAAf//+APgAAAAAAAAAAAf///4AAAAAAAAAAAAAAAAAAAAAAAP////wAAAAAAAAf//+APgAAAAAAAAAAD////+AAIAAAAAAAAAAAAAAAAAAAAP////gAAAAAAAAP//+AfAAAAAAAAAAAf////+AAEAAAAAAAAAAAAAAAAAAAAP////AAAAAAAAAP///AfAAAAAAAAAAA//////AAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAP//+APAAAAAAAAAAA//////gAAAAAAAAAAAAAAAAAAAAAAf///gAAAAAAAAAH//+AOAAAAAAAAAAB//////wAAAAAAAAAAAAAAAAAAAAAAf///AAAAAAAAAAH//4AEAAAAAAAAAAA//////4AAAAAAAAAAAAAAAAAAAAAAf//+AAAAAAAAAAH//4AAAAAAAAAAAAB//////4AAAAAAAAAAAAAAAAAAAAAAf//+AAAAAAAAAAH//4AAAAAAAAAAAAA//////4AAAAAAAAAAAAAAAAAAAAAAf//+AAAAAAAAAAD//wAAAAAAAAAAAAAf/////8AAAAAAAAAAAAAAAAAAAAAAf//8AAAAAAAAAAB//gAAAAAAAAAAAAAf/////4AAAAAAAAAAAAAAAAAAAAAA///8AAAAAAAAAAB//gAAAAAAAAAAAAAf/////4AAAAAAAAAAAAAAAAAAAAAA///4AAAAAAAAAAA//AAAAAAAAAAAAAAP/////4AAAAAAAAAAAAAAAAAAAAAAf//wAAAAAAAAAAA/+AAAAAAAAAAAAAAP/AP//wAAAAAAAAAAAAAAAAAAAAAA///gAAAAAAAAAAA/4AAAAAAAAAAAAAAf8AG//gAAAAAAAAAAAAAAAAAAAAAA//3AAAAAAAAAAAAYAAAAAAAAAAAAAAAOAAF//gAAAAAAAAAAAAAAAAAAAAAB//4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//AAABAAAAAAAAAAAAAAAAAAB//4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/AAAAgAAAAAAAAAAAAAAAAAD//4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/AAAAQAAAAAAAAAAAAAAAAAB//gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYAAAAcAAAAAAAAAAAAAAAAAB/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAD/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAD/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAADQAAAAAAAAAAAAAAAAAD/4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAHAAAAAAAAAAAAAAAAAAB/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAOAAAAAAAAAAAAAAAAAAD/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAH+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB4AAAAAAAAAAAAAAAAAAH+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAH/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8AAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH4BwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAAAAAAAAAAAH4AAAAAAB4HgAD8AAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAA//AAAD//////////wAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAf///4Af///////////AAAAAAAAAAAAAAAAAAAAAAAz4AAAAAAAAAAAAAAAPz////8B/////////////wAAAAAAAAAAAAAAAAAAAAA78AAAAAAAAAAA8/8///////wf/////////////+AAAAAAAAAAAAAAAAAAAAH9+AAAAAAAAZ////////////w////////////////4AAAAAAAAAAAAAAAAAAAB+AAAAAAAB//////////////////////////////4AAAAAAAAABmAAB8f+HB/+AAAAAAAP//////////////////////////////gAAAAAAAAP/c/oAf/////4AAAAAAAP/////////////////////////////8AAAAAAAD/////////////gAAAAAAB//////////////////////////////wAAAAAAAD////////////wAAAAAAP///////////////////////////////wAAAAAD/////////////4AAAAAAD////////////////////////////////wAAAADh/////////////AAAAB8A/////////////////////////////////+AAAAA4Af///////////gAAAH+AA///////////////////////////////+AAAAAAAAH///////////+A/A/wAA///////////////////////////////8AAAAAAAf//////////////gAAAf////////////////////////////////+AAAAAAAH///////////////h////////////////////////////////////wAAAAAAP/////////////////////////////////////////////////////gA+/gAAH/////////////////////////////////////////////////////8/////v//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////","source":"Natural Earth 110m land (ne_110m_land.geojson), public domain"}12345678910111213141516171819<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>My static Space</title><link rel="stylesheet" href="style.css" /></head><body><div class="card"><h1>Welcome to your static Space!</h1><p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p><p>Also don't forget to check the<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.</p></div></body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>SENTRY INTEL — attacker telemetry</title><style>:root{--forge:#0A0908; --black2:#12100D; --gold:#D4A843; --gold-light:#E8C56D;--gold-muted:#8A7440; --stone:#6B6560; --bone:#F0EDE8; --hairline:#2A2418;--mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;}*{box-sizing:border-box}html,body{margin:0;padding:0;background:var(--forge);color:var(--bone);font-family:var(--mono);font-size:13px;line-height:1.45;-webkit-font-smoothing:antialiased}a{color:var(--gold);text-decoration:none}a:hover{color:var(--gold-light)}.wrap{max-width:1560px;margin:0 auto;padding:18px 20px 60px}header.top{border-bottom:1px solid var(--hairline);padding-bottom:14px;margin-bottom:16px;display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:14px}.brand{display:flex;align-items:baseline;gap:12px}.brand h1{margin:0;font-size:22px;letter-spacing:.24em;font-weight:600;color:var(--gold-light)}.brand .tag{color:var(--stone);letter-spacing:.14em;font-size:11px;text-transform:uppercase}.prov{font-size:11px;color:var(--stone);text-align:right;max-width:720px}.prov b{color:var(--gold-muted);font-weight:600}.prov .stale{color:var(--gold-light)}.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(168px,1fr));gap:10px;margin-bottom:16px}.kpi{background:var(--black2);border:1px solid var(--hairline);border-left:2px solid var(--gold-muted);padding:10px 13px;border-radius:2px}.kpi .lbl{font-size:10px;letter-spacing:.16em;color:var(--stone);text-transform:uppercase}.kpi .val{font-size:25px;color:var(--gold-light);font-weight:600;letter-spacing:.02em;margin-top:2px}.kpi .sub{font-size:10px;color:var(--stone);margin-top:2px}.grid{display:grid;gap:14px;margin-bottom:16px}.g2{grid-template-columns:1.35fr 1fr}.g2b{grid-template-columns:1.25fr 1fr}@media(max-width:1080px){.g2,.g2b{grid-template-columns:1fr}}.panel{background:var(--black2);border:1px solid var(--hairline);border-radius:2px;display:flex;flex-direction:column;min-width:0}.panel > h2{margin:0;font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:var(--stone);padding:9px 13px;border-bottom:1px solid var(--hairline);font-weight:600;display:flex;justify-content:space-between;align-items:center;gap:10px}.panel > h2 .hint{color:var(--gold-muted);letter-spacing:.06em;text-transform:none;font-size:10px}.panel .body{padding:12px 13px}.panel .body.tight{padding:0}canvas{display:block;width:100%}table{width:100%;border-collapse:collapse;font-size:11.5px}th{position:sticky;top:0;background:var(--black2);color:var(--stone);text-align:left;font-weight:600;letter-spacing:.1em;text-transform:uppercase;font-size:10px;padding:7px 9px;border-bottom:1px solid var(--hairline)}td{padding:5px 9px;border-bottom:1px solid rgba(42,36,24,.55);white-space:nowrap;color:var(--bone)}td.num{text-align:right;color:var(--gold-light)}td.dim{color:var(--stone)}.scroll{max-height:330px;overflow:auto}.scroll.tall{max-height:430px}.tagchip{display:inline-block;border:1px solid var(--hairline);border-radius:2px;color:var(--gold-muted);font-size:9.5px;letter-spacing:.08em;padding:1px 5px;text-transform:uppercase}.bars{display:flex;flex-direction:column;gap:6px}.bar{display:grid;grid-template-columns:56px 1fr 62px;align-items:center;gap:9px;font-size:11.5px}.bar .n{color:var(--gold-light);text-align:right}.bar .k{color:var(--stone)}.bar .track{background:rgba(42,36,24,.7);height:13px;border-radius:1px;overflow:hidden}.bar .fill{height:100%;background:var(--gold);opacity:.82}.bar .track.muted .fill{background:var(--stone)}.wraplegend{display:flex;flex-wrap:wrap;gap:14px;font-size:10.5px;color:var(--stone);margin-top:9px}.dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--gold);margin-right:5px}select,input{background:var(--forge);color:var(--bone);border:1px solid var(--hairline);border-radius:2px;font-family:var(--mono);font-size:11.5px;padding:5px 7px;max-width:100%}select:focus,input:focus{outline:none;border-color:var(--gold-muted)}.inspect{display:grid;grid-template-columns:1fr 1fr;gap:12px}@media(max-width:900px){.inspect{grid-template-columns:1fr}}.codepane{background:var(--forge);border:1px solid var(--hairline);border-radius:2px;min-width:0}.codepane h3{margin:0;font-size:10px;letter-spacing:.16em;text-transform:uppercase;color:var(--stone);padding:6px 9px;border-bottom:1px solid var(--hairline);font-weight:600}.codepane pre{margin:0;padding:9px;font-size:11px;line-height:1.55;color:var(--gold-light);white-space:pre-wrap;word-break:break-all;max-height:240px;overflow:auto}.codepane pre.txt{color:var(--bone)}.meta{display:flex;flex-wrap:wrap;gap:8px 16px;font-size:11px;color:var(--stone);margin-bottom:10px}.meta b{color:var(--gold-light);font-weight:600}.note{font-size:10.5px;color:var(--stone);line-height:1.6;margin-top:10px;border-left:2px solid var(--hairline);padding-left:9px}footer{margin-top:26px;border-top:1px solid var(--hairline);padding-top:12px;font-size:10.5px;color:var(--stone);display:flex;flex-wrap:wrap;gap:6px 22px;justify-content:space-between}.warn{color:var(--gold-muted)}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-track{background:var(--forge)}::-webkit-scrollbar-thumb{background:var(--hairline);border-radius:0}::-webkit-scrollbar-thumb:hover{background:var(--gold-muted)}</style></head><body><div class="wrap"><header class="top"><div class="brand"><h1>SENTRY INTEL</h1><span class="tag">tarpit telemetry · attacker-side</span></div><div class="prov" id="prov">loading dataset…</div></header><div class="kpis" id="kpis"></div><div class="grid g2"><div class="panel"><h2>Events over time <span class="hint" id="tlhint"></span></h2><div class="body"><canvas id="c_time" height="210"></canvas></div></div><div class="panel"><h2>Ports hit</h2><div class="body" id="ports"></div></div></div><div class="grid g2b"><div class="panel"><h2>Attacker geography <span class="hint">per-subnet /24 cluster — real coords, offline-resolved</span></h2><div class="body"><canvas id="c_map" height="360"></canvas><div class="wraplegend" id="mlegend"></div></div></div><div class="panel"><h2>Payload mix</h2><div class="body" id="kinds"></div><div class="panel" style="border:0;border-top:1px solid var(--hairline)"><h2>Sensor verdicts <span class="hint">INTEL.reason</span></h2><div class="body" id="reasons"></div></div></div></div><div class="grid"><div class="panel"><h2>Payload inspector <span class="hint">raw hex ↔ decoded bytes — real captured bytes</span></h2><div class="body"><div class="meta" style="margin-bottom:10px"><label>event<select id="sel"></select></label><label>filter <input id="flt" placeholder="ip / kind / port" size="18"></label><span id="imeta" style="align-self:center"></span></div><div class="inspect"><div class="codepane"><h3>raw hex</h3><pre id="hex"></pre></div><div class="codepane"><h3>decoded text</h3><pre id="txt" class="txt"></pre></div></div><div class="note">Non-printable bytes render as <NN> hex escapes; \\r \\n \\t are shown literally.Grep these strings against the source log to verify any row.</div></div></div></div><div class="grid g2"><div class="panel"><h2>Most recent captured events <span class="hint" id="rechint"></span></h2><div class="body tight"><div class="scroll tall"><table id="t_recent"><thead><tr><th>timestamp</th><th>source ip</th><th>cc</th><th class="num">port</th><th>payload class</th><th class="num">bytes</th><th>verdict</th></tr></thead><tbody></tbody></table></div></div></div><div class="panel"><h2>Top source subnets /24 <span class="hint">cluster centroid</span></h2><div class="body tight"><div class="scroll tall"><table id="t_sub"><thead><tr><th>subnet</th><th>cc</th><th class="num">events</th><th class="num">ips</th><th class="num">lat</th><th class="num">lon</th></tr></thead><tbody></tbody></table></div></div></div></div><div class="grid g2b"><div class="panel"><h2>Top source IPs</h2><div class="body tight"><div class="scroll"><table id="t_ips"><thead><tr><th>ip</th><th>country</th><th>city</th><th class="num">events</th><th class="num">lat</th><th class="num">lon</th></tr></thead><tbody></tbody></table></div></div></div><div class="panel"><h2>Provenance & method</h2><div class="body" id="method"></div></div></div><footer><span id="f_left"></span><span class="warn">NOT A LIVE FEED — a frozen capture. Data reflects the sensor log window below, nothing since.</span></footer></div><script>const C = {forge:'#0A0908',black2:'#12100D',gold:'#D4A843',goldLight:'#E8C56D',goldMuted:'#8A7440',stone:'#6B6560',bone:'#F0EDE8',hair:'#2A2418'};const $ = s => document.querySelector(s);const fmt = n => (n==null?'—':n.toLocaleString('en-US'));const cc = s => (s||'--').toUpperCase();let DATA=null, SAMPLES=[], LM=null, CEIL=1;function tsShort(t){ return (t||'').replace('T',' ').slice(0,19); }async function boot(){try{const [d,l] = await Promise.all([fetch('data/intel.json').then(r=>{ if(!r.ok) throw new Error('intel.json HTTP '+r.status); return r.json(); }),fetch('data/landmask.json').then(r=>{ if(!r.ok) throw new Error('landmask.json HTTP '+r.status); return r.json(); })]);DATA=d; LM=l;}catch(e){document.getElementById('prov').innerHTML='DATASET LOAD FAILED: '+e.message;return;}SAMPLES = (DATA.payload_samples||[]).slice();renderAll();}function renderAll(){const T=DATA.totals, g=DATA.geo;CEIL = Math.max(...DATA.subnets.map(s=>s.count), 1);// ---- provenance ----const srcs = DATA.sources.map(s=>`${s.path} <span style="color:var(--gold-muted)">(${fmt(s.events)} events)</span>`).join(' · ');$('#prov').innerHTML =`dataset generated <b>${DATA.generated_at}</b> from ${srcs} — <b>${fmt(T.events)} real events</b>, `+`no synthetic rows.<br>capture window <span class="stale">${tsShort(T.first_event)} → ${tsShort(T.last_event)}</span> `+`<span style="color:var(--gold-muted)">(frozen; not re-polled)</span>`;// ---- kpis ----const kpis=[['events captured', fmt(T.events), 'parsed log blocks'],['unique source IPs', fmt(T.unique_ips), T.unique_subnets+' /24 subnets'],['ports probed', fmt(T.unique_ports), 'distinct service ports'],['payload bytes', (T.payload_bytes_total/1048576).toFixed(2)+' MB', 'raw captured bytes'],['geo resolved', g.resolved_ips+'/'+g.total_ips, 'offline GeoLite2-City'],['capture span', ((new Date(T.last_event)-new Date(T.first_event))/3600000).toFixed(1)+' h', '4-day window']];$('#kpis').innerHTML = kpis.map(([l,v,s])=>`<div class="kpi"><div class="lbl">${l}</div><div class="val">${v}</div><div class="sub">${s}</div></div>`).join('');$('#tlhint').textContent = DATA.timeline.length+' hourly bins';drawTime();bars('#ports', DATA.ports.map(p=>[ ':'+p.port, p.count ]));bars('#kinds', DATA.payload_kinds.map(k=>[ k.kind, k.count ]), true);bars('#reasons', DATA.reasons.map(r=>[ r.reason, r.count ]), true);drawMap();$('#rechint').textContent = DATA.recent.length+' newest';$('#t_recent tbody').innerHTML = DATA.recent.slice(0,120).map(e=>`<tr><td class="dim">${tsShort(e.ts)}</td><td>${e.ip}</td><td class="dim">${cc(e.country)}</td>`+`<td class="num">${e.port}</td><td><span class="tagchip">${e.kind}</span></td>`+`<td class="num">${e.payload_bytes}</td><td class="dim">${e.reason}</td></tr>`).join('');$('#t_sub tbody').innerHTML = DATA.subnets.slice(0,80).map(s=>`<tr><td>${s.subnet}</td><td class="dim">${cc(s.country)}</td><td class="num">${fmt(s.count)}</td>`+`<td class="num">${s.ips}</td>`+`<td class="num dim">${s.lat==null?'—':s.lat.toFixed(2)}</td>`+`<td class="num dim">${s.lon==null?'—':s.lon.toFixed(2)}</td></tr>`).join('');$('#t_ips tbody').innerHTML = DATA.top_ips.map(s=>`<tr><td>${s.ip}</td><td class="dim">${s.country_name||cc(s.country)}</td>`+`<td class="dim">${s.city||'—'}</td><td class="num">${fmt(s.count)}</td>`+`<td class="num dim">${s.lat==null?'—':s.lat.toFixed(2)}</td>`+`<td class="num dim">${s.lon==null?'—':s.lon.toFixed(2)}</td></tr>`).join('');$('#mlegend').innerHTML =`<span><span class="dot"></span>subnet cluster — radius/log(events)</span>`+`<span class="dim">${DATA.subnets.filter(s=>s.lat!=null).length} plotted of ${DATA.subnets.length} subnets</span>`+`<span class="dim">land mask: Natural Earth 110m (offline)</span>`;$('#method').innerHTML = DATA.sources.map(s=>`<div><b style="color:var(--gold-muted)">source</b> ${s.path}<br>`+`<span class="dim" style="color:var(--stone)"> ${fmt(s.events)} events · ${fmt(s.bytes)} B · sha256 ${s.sha256.slice(0,16)}…</span></div>`).join('<hr style="border:0;border-top:1px solid var(--hairline);margin:9px 0">')+ `<div class="note">${g.method}. ${g.granularity}.<br><br>`+`Static Space: plain HTML/CSS/JS committed to the repo, no build step, no runtime network calls. `+`Charts and the world view are hand-rolled canvas; the land mask and every coordinate are baked into `+`<span style="color:var(--gold-muted)">data/</span> at build time by <span style="color:var(--gold-muted)">scripts/parse_intel.py</span> `+`and <span style="color:var(--gold-muted)">scripts/rasterize_land.py</span>.<br><br>`+`Regenerate: <span style="color:var(--gold-light)">ssh root@172.236.112.52 'cat /opt/attacker-intel/v2/intel.log' > raw/intel.log && python scripts/parse_intel.py</span>.</div>`;$('#f_left').innerHTML = `SENTRY INTEL · ${fmt(T.events)} events · ${fmt(T.unique_ips)} src IPs · ${DATA.ports.length} ports · built ${DATA.generated_at}`;buildInspector();window.addEventListener('resize', ()=>{ drawTime(); drawMap(); });}function bars(sel, rows, muted){const max = Math.max(...rows.map(r=>r[1]),1);$(sel).innerHTML = '<div class="bars">'+rows.map(([k,v])=>`<div class="bar"><span class="k">${k}</span>`+`<span class="track${muted?' muted':''}"><span class="fill" style="width:${(100*v/max).toFixed(2)}%"></span></span>`+`<span class="n">${fmt(v)}</span></div>`).join('')+'</div>';}function prep(cv,h){const dpr = window.devicePixelRatio||1;const w = cv.clientWidth||600;cv.width = Math.round(w*dpr); cv.height = Math.round(h*dpr);cv.style.height = h+'px';const x = cv.getContext('2d');x.setTransform(dpr,0,0,dpr,0,0);x.clearRect(0,0,w,h);return {x,w,h};}function drawTime(){const cv=$('#c_time'); if(!cv) return;const {x,w,h}=prep(cv,210);const L=DATA.timeline; if(!L.length) return;const pad={l:58,r:12,t:12,b:26};const iw=w-pad.l-pad.r, ih=h-pad.t-pad.b;const max=Math.max(...L.map(p=>p.count));const sx=i=>pad.l+(L.length<2?iw/2:iw*i/(L.length-1));const sy=v=>pad.t+ih-(v/max)*ih;x.strokeStyle=C.hair; x.lineWidth=1;x.font='10px ui-monospace,monospace'; x.fillStyle=C.stone;for(let i=0;i<=4;i++){const v=max*i/4, y=sy(v);x.beginPath(); x.moveTo(pad.l,y); x.lineTo(pad.l+iw,y); x.stroke();x.textAlign='right'; x.fillText(Math.round(v).toLocaleString(),pad.l-7,y+3.5);}// areaconst grd=x.createLinearGradient(0,pad.t,0,pad.t+ih);grd.addColorStop(0,'rgba(212,168,67,.34)'); grd.addColorStop(1,'rgba(212,168,67,0)');x.beginPath(); x.moveTo(sx(0),sy(0));L.forEach((p,i)=>x.lineTo(sx(i),sy(p.count)));x.lineTo(sx(L.length-1),sy(0)); x.closePath(); x.fillStyle=grd; x.fill();// linex.beginPath(); L.forEach((p,i)=>{ i?x.lineTo(sx(i),sy(p.count)):x.moveTo(sx(i),sy(p.count)); });x.strokeStyle=C.gold; x.lineWidth=1.6; x.stroke();// peak markerlet pi=0; L.forEach((p,i)=>{ if(p.count>L[pi].count) pi=i; });x.beginPath(); x.arc(sx(pi),sy(L[pi].count),3.2,0,7); x.fillStyle=C.goldLight; x.fill();x.textAlign='left'; x.fillStyle=C.goldLight;x.fillText(L[pi].count.toLocaleString()+' peak @ '+L[pi].t.slice(5,13).replace('T',' '),Math.min(sx(pi)+7,w-190), Math.max(sy(L[pi].count)-7,pad.t+10));x.fillStyle=C.stone; x.textAlign='center';L.forEach((p,i)=>{ if(i%Math.ceil(L.length/6)===0)x.fillText(p.t.slice(5,13).replace('T',' '),sx(i),h-9); });x.textAlign='left'; x.fillStyle=C.stone;x.fillText('events / hour',pad.l,pad.t+9);}function drawMap(){const cv=$('#c_map'); if(!cv) return;const {x,w,h}=prep(cv,360);const pad={l:6,r:6,t:6,b:6};const iw=w-pad.l-pad.r, ih=h-pad.t-pad.b;const X=lon=>pad.l+(lon+180)/360*iw;const Y=lat=>pad.t+(90-lat)/180*ih;// land maskif(LM){const bytes=Uint8Array.from(atob(LM.b64),c=>c.charCodeAt(0));const cw=iw/LM.w, ch=ih/LM.h;x.fillStyle='rgba(107,101,96,.34)';for(let r=0;r<LM.h;r++)for(let c=0;c<LM.w;c++){const k=r*LM.w+c;if(bytes[k>>3]>>(7-(k&7))&1) x.fillRect(pad.l+c*cw,pad.t+r*ch,cw+0.6,ch+0.6);}}// graticulex.strokeStyle='rgba(42,36,24,.9)'; x.lineWidth=1;for(let lon=-150;lon<=150;lon+=30){ x.beginPath(); x.moveTo(X(lon),pad.t); x.lineTo(X(lon),pad.t+ih); x.stroke(); }for(let lat=-60;lat<=60;lat+=30){ x.beginPath(); x.moveTo(pad.l,Y(lat)); x.lineTo(pad.l+iw,Y(lat)); x.stroke(); }x.strokeStyle=C.hair; x.strokeRect(pad.l,pad.t,iw,ih);// blipsconst pts=DATA.subnets.filter(s=>s.lat!=null&&s.lon!=null);const maxr=Math.max(...pts.map(p=>p.count),1);pts.slice().sort((a,b)=>b.count-a.count).forEach(s=>{const r=2.2+9.5*Math.sqrt(s.count/maxr);const cx=X(s.lon), cy=Y(s.lat);const a=0.16+0.5*Math.sqrt(s.count/maxr);x.beginPath(); x.arc(cx,cy,r*2.6,0,7); x.fillStyle='rgba(212,168,67,'+(a*0.20).toFixed(3)+')'; x.fill();x.beginPath(); x.arc(cx,cy,r,0,7); x.fillStyle='rgba(232,197,109,'+a.toFixed(3)+')'; x.fill();x.strokeStyle='rgba(212,168,67,.85)'; x.lineWidth=1; x.stroke();});// label the top two clusterspts.slice(0,2).forEach(s=>{const cx=X(s.lon), cy=Y(s.lat);x.font='10px ui-monospace,monospace'; x.fillStyle=C.goldLight; x.textAlign='left';const t=s.subnet+' '+s.count.toLocaleString();const tx=Math.min(cx+13,w-132), ty=Math.max(cy-11,pad.t+11);x.fillText(t,tx,ty);x.strokeStyle='rgba(212,168,67,.55)'; x.beginPath(); x.moveTo(cx,cy); x.lineTo(tx-3,ty-3); x.stroke();});}function buildInspector(){const used = SAMPLES.length?SAMPLES:DATA.recent;const sel=$('#sel');sel.innerHTML = used.map((e,i)=>`<option value="${i}">${tsShort(e.ts)} ${e.ip}:${e.port} [${e.kind}] ${e.payload_bytes}B</option>`).join('');sel.onchange = ()=>show(used[+sel.value]);$('#flt').oninput = ()=>{const q=$('#flt').value.trim().toLowerCase();const keep=[];const idx=[];used.forEach((e,i)=>{ const hay=(e.ip+' '+e.port+' '+e.kind+' '+e.reason).toLowerCase();if(!q||hay.includes(q)){keep.push(e);idx.push(i);} });if(!keep.length) return;sel.innerHTML = keep.map((e,j)=>`<option value="${idx[j]}">${tsShort(e.ts)} ${e.ip}:${e.port} [${e.kind}] ${e.payload_bytes}B</option>`).join('');show(keep[0]);};show(used[0]);}function show(e){if(!e) return;const hex = e.payload_hex||'';$('#hex').textContent = hex? hex.replace(/(.{2})/g,'$1 ').trim(): '(no payload bytes captured for this connection)';$('#txt').textContent = e.payload_text || '(empty)';$('#imeta').innerHTML =`<span>src <b>${e.ip}:${e.port}</b></span>`+`<span>${tsShort(e.ts)}</span>`+`<span>class <b>${e.kind}</b></span>`+`<span>bytes <b>${e.payload_bytes}</b></span>`+`<span>verdict <b>${e.reason}</b></span>`+(e.country?`<span>cc <b>${cc(e.country)}</b></span>`:'');}boot();</script></body></html>
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()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687#!/usr/bin/env python3"""Rasterize Natural Earth 110m land polygons into a compact equirectangularland mask usable by the Space's world view with zero runtime network calls.
Output: geo/landmask.json -> {"w":360,"h":180,"b64":"..."} 1 bit per cell, row-major from lat +90 (top) to -90 (bottom), lon -180..+180.
Usage: python scripts/rasterize_land.py --geojson geo/ne_110m_land.geojson \ --out geo/landmask.json --w 360 --h 180"""import argparseimport base64import json
def rings(geom): """Yield every linear ring (list of [lon,lat]) from a Polygon/MultiPolygon.""" t = geom.get("type") if t == "Polygon": for r in geom["coordinates"]: yield r elif t == "MultiPolygon": for poly in geom["coordinates"]: for r in poly: yield r
def point_in_ring(x, y, ring): inside = False n = len(ring) j = n - 1 for i in range(n): xi, yi = ring[i][0], ring[i][1] xj, yj = ring[j][0], ring[j][1] if ((yi > y) != (yj > y)) and (x < (xj - xi) * (y - yi) / ((yj - yi) or 1e-12) + xi): inside = not inside j = i return inside
def main(): ap = argparse.ArgumentParser() ap.add_argument("--geojson", default="geo/ne_110m_land.geojson") ap.add_argument("--out", default="geo/landmask.json") ap.add_argument("--w", type=int, default=360) ap.add_argument("--h", type=int, default=180) args = ap.parse_args()
gj = json.load(open(args.geojson, encoding="utf-8")) polys = [] for f in gj["features"]: for r in rings(f["geometry"]): if len(r) >= 4: polys.append((r, min(p[0] for p in r), max(p[0] for p in r), min(p[1] for p in r), max(p[1] for p in r))) print("land rings:", len(polys))
W, H = args.w, args.h bits = bytearray((W * H + 7) // 8) land = 0 for row in range(H): lat = 90.0 - (row + 0.5) * (180.0 / H) for col in range(W): lon = -180.0 + (col + 0.5) * (360.0 / W) hit = False for ring, x0, x1, y0, y1 in polys: if lon < x0 or lon > x1 or lat < y0 or lat > y1: continue if point_in_ring(lon, lat, ring): hit = True break if hit: land += 1 k = row * W + col bits[k >> 3] |= 1 << (7 - (k & 7)) out = {"w": W, "h": H, "b64": base64.b64encode(bytes(bits)).decode("ascii"), "source": "Natural Earth 110m land (ne_110m_land.geojson), public domain"} with open(args.out, "w") as f: json.dump(out, f, separators=(",", ":")) print("land cells: %d / %d (%.1f%%)" % (land, W * H, 100.0 * land / (W * H))) print("wrote", args.out)
if __name__ == "__main__": main().gitignoreAdded+3
README.md+69-4
data/intel.jsonAdded
data/landmask.jsonAdded+1
index.html+452-18
scripts/parse_intel.pyAdded+354
scripts/rasterize_land.pyAdded+87