Skip to content
This repository was archived by the owner on Nov 21, 2026. It is now read-only.

Two-VM live detection: one model per host, Sysmon command lines (D14), anomaly-first cross-host correlation - #19

Merged
ngodat0103 merged 20 commits into
mainfrom
test-train-with-two-window-vm
Nov 15, 2026
Merged

ngodat0103 merged 20 commits into
mainfrom
test-train-with-two-window-vm

Conversation

@ngodat0103

@ngodat0103 ngodat0103 commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

What this is

One coherent body of work taking the live detector from one Windows VM to two VMs, one model per host, plus the deliverables that report it. 19 commits on test-train-with-two-window-vm, squashed on merge. (A final cleanup commit drops the superseded exp16-ws0 run — see Artifacts below.)

All --selftests pass: cmdlines, alg2, correlate, live_server, engine, lab, launch_exploit, and etwcollect.

Changes

Two-VM live detection (one model per host, D12)

  • ws-etw-0 is the nt2102.lab Domain Controller, scored by exp17-ws0 — retrained on all DC-era benign after a false-positive review (docs/notes/fp-review-20261115.md).
  • ws-etw-1 is the teammate's react2shell Next.js RCE box, scored by exp15-ws1 (NET gate passed at tol 0.01; docs/notes/ws-etw-1-retrain-20261111.md).
  • live_server.py runs one Engine per active VM; lab promote --host / lab hosts pick the models and scored VMs.

Sysmon command lines for investigation (D14)

  • Collector gains an optional Sysmon provider (Event ID 1 only); a missing optional provider no longer stops capture.
  • New src/pipeline/cmdlines.py joins the command line to each PROCESS node by PID + time.
  • Shown in the live UI and the LLM document (alg2.serialize), never a feature — excluded from scores.csv and invisible to the converter (graph unchanged).
  • Attack pack neutralised: stage URLs /u.ps1 /s.ps1 and env vars U_H/U_P/U_D, so the Sysmon-logged cradle carries no lab vocabulary that would bias the LLM toward "attack".

Cross-host correlation, rebuilt anomaly-first (D13)

  • correlate.py now starts only from a red window's kept subgraph, follows its NET nodes to the peer VM, does a 5-tuple join to the peer process, and resolves pending → one-sided → corroborated; the LLM reads both sides.
  • Removed the flow-baseline model: lab flows command and flow-baseline.json are gone; API /api/campaigns → /api/crosshost, investigate_campaign → investigate_crosshost.
  • NET rule off live + SG-Det cut-off lowered to 4.5 so the teammate's real react2shell run is not suppressed (tuned in-sample; D8).

Live UI / server

  • Top Parameters panel: per-host training hyperparameters (from each run's train_meta.json), running flags, and the server's git code version.
  • Projector-friendly Present mode and a collapsible LLM card.

Lab networking

  • VPN clients keep their real 10.8.0.x source address in the lab; the Kali route is pushed (vpn_routing).

Deliverables

  • Report §R4 and the Slidev deck add the teammate's react2shell detection as a second result (flagged in-sample).
  • New sync-submit project skill builds the course-form submission bundle into the gitignored submit/.
  • Deck tightened: Figure 2 (Training/Inference), acronyms named, parameter choices shown by colour instead of an [OURS] chip.

Docs: PROGRESS.md, DEVIATIONS.md (D13 rewrite, D14 added), CLAUDE.md.

Artifacts

The squash adds only the two current per-host runs: exp15-ws1 and exp17-ws0. The intermediate exp16-ws0 (live 11-12 → 11-15, then superseded by exp17-ws0) is dropped — its ~19 MB of train_scores.csv + .pt files are not kept. Its training-basis exclusions (exclusions/ws-etw-0-20261112.json) and provenance notes remain.

Not included / follow-up

  • Cross-host correlation is validated locally only; no attack has crossed hosts yet. Verifying it on the teammate's real react2shell → DC hop is the next action.
  • The 4.5 cut-off and NET-rule-off were tuned on the react2shell runs, so that second result is in-sample — not independent evidence (D8). No P/R/F1 is claimed (no label oracle; D6).

ngodat0103 and others added 20 commits November 12, 2026 00:28
ws-etw-1 retrained on 55 h of idle (11-06 20:30Z to 11-09 10:10Z) as
exp11-ws1. FILE trains fully; NET stops early on all 3 seeds and PROCESS
on 2 of 3, so nothing is promoted and ocr-live stays in one-VM mode on
exp10. Held-out idle windows: 0 red on 3 seeds against 2 for exp09-ws1.

- exclusion files for the range and for the held-out part
- walk-through note with the numbers, the NET diagnosis and repeat commands
- PROGRESS, DEVIATIONS D12, verify-two-host and CLAUDE.md section 8 updated
- runbook: tally SessionID != 0, watch for unowned scheduled tasks, start
  at a run with a dos map, NET validation size

Models and replay output exist only on the trainer.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxFwFXdebdeh4BtqNGRQ6m
…ified

The exp11-ws1 NET gate failure was the best-TNR early-stop keeping a loose,
undertrained epoch: on this churny host NET validation TNR peaks while the
sphere is loose and degrades as it tightens (the ~200-node NET val set always
holds 2-3 brand-new benign peers a trained sphere correctly flags). --patience
is irrelevant (patience 15 == patience 5, byte-identical). The lever is a
tolerance larger than the irreducible fresh-peer FPR (~2.5%): 0.03 fixes PROCESS
only, 0.06 fixes NET too. One CLI value, no code change; ws-etw-0 keeps 0.01.

exp14-ws1 (tol 0.06): all types best_ep 99 on 3 seeds, NET tau stable negative.
Held-out idle red 0/0/0 (vs exp09-ws1's 2); preview 0 alerts/287 windows.
NOT promoted/deployed - Phase 3 stays user-gated. react2shell on ws-etw-1 is the
friend's vuln app (owner resolved). Documents the result and the user's next
action; models + eval output live only on the trainer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxFwFXdebdeh4BtqNGRQ6m
…ction

Retrain ws-etw-1 on its current state so the NetBIOS broadcast 10.21.3.255:138
(live since 11-09 09:19Z, the real cause of the exp11/exp14 NET gate failure,
not "fresh peers") is in training. Baseline 11-06 20:30Z -> 11-12 12:15Z
includes the teammate's setup and RDP sessions by user decision; only their
exploit/enumeration runs and our rotation canaries are excluded (214 of 4070
windows, ws-etw-1-20261112.json). Gate passes at tol 0.01 like ws-etw-0:
best_ep 99 on file/net/process, val_fpr 0.0004/0.0000/0.0020 (seed 360).

Deployed in two-VM mode (lab hosts ws-etw-0 ws-etw-1) by user decision, who
allowed deploy even if the gate failed; trainer moved to main via Ansible
--tags project. First check: both engines on Loki, 0 red on both VMs.

- Pull exp15-ws1 weights (models/*.pt, scaler, lineage, summaries,
  train_scores.csv) to match the committed-run convention.
- Correct the wrong "fresh peers" explanation of exp14 (committed in a66cd56)
  to the broadcast finding across PROGRESS, DEVIATIONS D2/D12, retrain note
  sec 10-11, CLAUDE.md sec 8-9.
- Record the NEXT ACTION (user): demo lateral movement DVWA -> react2shell so
  correlation fires on real cross-host flows.

Not committed: seeds 361/362 (exp15s-ws1, still training, spread only).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxFwFXdebdeh4BtqNGRQ6m
…opology

The teammate's two Windows VMs are the reverse of our records (verified by
Loki + WinRM): ws-etw-1 (WEB-SERVER, DomainRole 3) is the react2shell node.js
RCE box, ws-etw-0 (WIN-3CSNFVOEN0R, DomainRole 5) is the Primary Domain
Controller of nt2102.lab, promoted 2026-11-09 10:41:41Z. exp10 trained on
idle ending 11-09 10:25Z, 16 min before the promotion, so it was blind to all
AD services (ADWS/DFSR/DNS/NTDS, LDAP/Kerberos/replication); red=0 under it
was steady-state luck, not a covered baseline.

- exp16-ws0: retrain ws-etw-0 on its DC-era state (11-09 16:49Z -> 11-12
  15:08Z, starting after the promotion/reboot burst). Benign = DC
  steady-state + admin RDP/console sessions (user decision), excluding 12
  rotation canaries + the 11-10 14:49-15:05Z DVWA->RCE kill chain
  (ws-etw-0-20261112.json, 67 of 2107 windows). Gate PASS at tol 0.01:
  best_ep 99 on file/net/process, val_fpr 0.0002/0.0000/0.0023; the NET gate
  is the strongest (2130 val nodes) now that the DC's NET is in-distribution.
  Deployed two-VM (ws-etw-0=exp16-ws0, ws-etw-1=exp15-ws1), converter match,
  first check 0 red on both hosts.
- Docs: corrected the reversed topology and attack direction (react2shell
  ws-etw-1 -> DC ws-etw-0) across CLAUDE.md, PROGRESS, DEVIATIONS D2/D12/D13;
  added the 15-min trainer-heartbeat rule to CLAUDE.md.
- Resolved: the 11-10 14:50Z ws-etw-0 "false positive" was the real
  DVWA->RCE kill chain (true positive); now excluded from training.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxFwFXdebdeh4BtqNGRQ6m
…ment

Kernel-Process ProcessStart carries no command line, so process rows only
showed powershell.exe / cmd.exe. Sysmon (new role win_sysmon, Event ID 1
only) records it at creation; etwcollect reads it as optional provider
`sysmon`. cmdlines.py joins it to PROCESS nodes by PID + start time,
decodes -enc payloads and redacts obvious secrets. The engine writes
node_cmdlines.csv and shows the line in the UI; alg2.serialize adds one
command-line line per process before the event lines.

Investigation-only per [PAPER] 5.1.1: converter, features and scores are
unchanged (no retrain). The RCE cradle uses neutral stage paths and env
names so the decoded payload leaks no lab vocabulary to the LLM (D9).
DEVIATIONS D14.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxFwFXdebdeh4BtqNGRQ6m
…tack-flow note

Docs cleanup after the Sysmon command-line feature (D14) went live:
- PROGRESS.md: replace the stale "code done, NOT deployed" D14 block with the
  verified-live result (ws-etw-0 idle green / DVWA window red sg 51.7 / LLM
  attack 0.93 / no lab words / converter match); rewrite the next action to the
  teammate's REAL cross-host attack (no synthetic scenario, no label oracle).
- DEVIATIONS D14: deployed on both hosts; ws-etw-1 rolled out + verified green.
- CLAUDE.md §8: next action = verify with the teammate's real attack.

Prep for the cross-host verification:
- src/artifacts/flow-baseline.json: 8 benign member->DC AD flows (24 h), so
  correlation reports only new flows. Finding: SMB :445 / LDAP :389 / Kerberos
  :88 are constant AD traffic and baselined out, so a pivot there is invisible
  to the flow layer; WinRM :5985 is not baselined and makes correlation fire.
- docs/notes/cross-host-attack-flow.md: network-focused attack-flow note for the
  teammate (Kali -> react2shell RCE -> DC), Mermaid diagram, per-hop
  src->dst:port/protocol, the baseline finding, open questions to align on.

No code changed (selftests unaffected). etw2nodlink.py untouched (converter sha).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxFwFXdebdeh4BtqNGRQ6m
The two-host timeline rendered each host as an independent flex strip packed
from the left with its own scroll, so the same wall-clock window sat at a
different x in each row (a host with fewer windows left-aligned; one with more
overflowed and scrolled right). For a cross-host view that defeats reading a
column by time.

renderTimeline now builds one column per 5-min slot across the union of both
hosts' scored + open windows; each host drops its window into the matching
slot and shows an invisible placeholder where it has none, so identical
timestamps line up vertically. Horizontal scroll is mirrored across rows and
both scroll to the end, keeping the columns locked. Single-host view is
unchanged. No backend change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxFwFXdebdeh4BtqNGRQ6m
The teammate's real react2shell run on ws-etw-1 (2026-11-14 18:10-19:00Z) stayed
green at the paper's Moderate-from-10: its best subgraph with an anomalous NET node
scores 4.72, so 5 alone would not alert either. A re-judge of the saved live
subgraphs (24 h and ~57 h) picked 4.5 with the NET rule kept: ws-etw-1 red only on
the attack window; the DC gains about two red windows per day. Inventory-only
change (live_sg_moderate_from); the code default stays 10. Also corrects PROGRESS:
the trainer checkout is this branch, not main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p of the live UI

/api/status now also carries the run's training hyperparameters (train_meta.json
args), the Alg. 1 score range, and server facts (git sha/branch/dirty read at start,
start time, Loki URL, watchdog). The UI renders all hosts side by side and tags values
that differ from the paper [OURS]. Fixes the History cut-off column rounding 4.5 to 5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…PROGRESS

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oute

nt2102-vpn MASQUERADEd every VPN client to 10.21.3.50, so lab VMs, Loki and the LLM report saw the VPN box
instead of the client. Clients also never got a route to Kali's subnet, so SSH to 10.21.4.30 failed.

- vpn.yml + role vpn_routing (nt2102-vpn): push routes for 10.21.3.0/24 and 10.21.4.0/24; iptables RETURN
  above the hand-made MASQUERADE for those subnets (nt2102: comments, saved by netfilter-persistent).
- proxmox-firewall.yml (pve-master): return route 10.8.0.0/24 via nt2102-vpn (not persistent by choice;
  re-run after a reboot/SDN apply) and nt2102: FORWARD accepts for the asymmetric path.
- Docs: infrastructure + ansible READMEs, PROGRESS, CLAUDE.md pipeline map.

Detection scores are unaffected (features carry no IPs); the LLM, IOCs and correlation now see the client IP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f live

Cross-host (D13): correlate.py now starts from a red window instead of from
flows between the VMs. NET nodes in its kept subgraphs that point at the
other monitored host are joined by 5-tuple on the raw knet lines to the
peer's socket, owner process and nearby nodes, scored by the peer's own
model -> pending / one-sided / corroborated -> one two-host LLM document.
The flow-first `link` level, `lab flows` and flow-baseline.json are
removed: they reported traffic the GNN never scored and hid attacks that
reuse a known port. API /api/crosshost and a "Cross-host follow-up" panel
in the UI. Selftests only (synthetic windows); not deployed, no crossing
attack yet.

Live config (D8): SG-Det Moderate from 4.5 and the NET rule off on both
hosts (live_sg_require_types=none), after the teammate's 11-15 react2shell
run was suppressed by the rule. Tuned on that run, so in-sample.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxFwFUHnAuSsvo7pUZfoB2
… a submission sync skill

The exp08 DVWA demo stays the main result; the teammate's real react2shell
attack on ws-etw-1 (exp15-ws1, 11-15 04:15Z 7.24 / 04:20Z 19.86 red, LLM
attack 0.85 / 0.95) is the second one, flagged in-sample everywhere: the
4.5 cut-off and NET rule off were tuned on that run.

Report (latex/, 26 pages): new R4 section with the window table and UI
screenshots, lab and deviation tables for two hosts, limits (in-sample
tuning, score change after restart, DC), appendix D12/D14 and the cut-off /
NET-rule paragraphs. All \todoval filled (screenshots, DeepSeek
deepseek-flash, LLM excerpt). Fixes: the exp08 attack and the 22:25Z false
alarm are 11-05, not 11-06; LLM document times are UTC+7, not UTC.

Deck (15 slides): LabInfra shows both hosts and the VPN attacker, a
"live >= 4.5" line, a "Video demo 2" placeholder for the teammate's video
and a "Ket qua thu hai" slide; note.txt Q7 extended, Q13 added.

Submission: /submit/ is gitignored; the project skill sync-submit
(.claude/skills/sync-submit/) rebuilds the course-form bundle (docx via
pandoc with TikZ rendered to PNG, pptx, source zip, demo, size checks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxFwFUHnAuSsvo7pUZfoB2
…nt mode, slim Parameters

The LLM card shows a verdict pill, ATT&CK tactic chips and the rationale per subgraph; evidence,
IOCs and the Alg. 2 reports are collapsed. Each evidence line becomes one short row (decoded
payload instead of base64) with the full line in a large hover popover. A Present toggle in the
header (or #present=1) scales the text and hides the pipeline diagnostics. The Parameters panel
lists only [OURS] values and tau per type. Times are 24 h.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxFwFUHnAuSsvo7pUZfoB2
…e review

Every saved live window since 11-12 was re-scored with the old and new model at the live settings
(Moderate from 4.5, NET rule off). On ws-etw-0, benign red windows drop 24 -> 9 (mostly in-sample),
but the held-out DVWA attack windows drop from ~51 to ~7.5: still red, now below the admin
GPO-editor windows. Deployed by user decision; the ws-etw-1 retrain was aborted by the user.

- exp17-ws0 model files (models, scaler, meta, train_scores; train edges/features stay out of git)
- exclusion files for both hosts, incl. 8 teammate runs on ws-etw-1 no earlier note listed
- docs/notes/fp-review-20261115.md: method, tables, the ngen-burst trade-off
- PROGRESS, DEVIATIONS D2/D12 and CLAUDE.md section 8 updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxFwFUHnAuSsvo7pUZfoB2
…cut extra text

- Slide 1: drop the "Vì sao khó" card and the "node vụn / graph thô" bullet.
- Behavior feature table: one header row with full names (out_write ... in_load).
- Replace the GNN message-passing slide with the stacked-layers slide
  ("nhìn xa L bước") between RGCN and OCRGCN; its points move to speaker notes.
- Spell out RGCN and OCRGCN (One-Class Relational Graph Convolutional Network).
- OCRGCN slide: larger hypersphere, drop the 3-models card.
- Add the paper's Figure 2 as two slides (Training / Inference), cropped at
  600 dpi from latex/images/paper-fig2-ocrgcn.pdf.
- Remove the "Kết quả thứ hai" slide and the caption under video 2; the
  result stays in report §R4 and note.txt.
- Deck is 16 slides; cap raised to 20 (CLAUDE.md updated).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…} in docx

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the narrative of how the live cut-off and the NET rule were tuned
(10 -> 4.5, rule added then turned off, old 30 cut-off, exp10/exp16,
restart re-scoring) and the in-sample remarks. The report now states
Moderate from 10 for exp08 (R1-R3) and from 4.5 for the two-host live
run (R4); the NET rule no longer appears. Deck notes follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-host models)

exp16-ws0 was live on ws-etw-0 from 11-12 to 11-15, then superseded by
exp17-ws0 on the same branch after the false-positive review. Its ~19 MB of
artifacts (train_scores.csv + three .pt models) are not worth keeping: the
current per-host models are exp17-ws0 (ws-etw-0) and exp15-ws1 (ws-etw-1).

The exp17-ws0 training basis exclusions/ws-etw-0-20261112.json is kept, and the
rollback note in fp-review-20261115.md is updated to no longer point at the
removed run.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ngodat0103 ngodat0103 self-assigned this Nov 15, 2026
@ngodat0103 ngodat0103 changed the title Test train with two window vm Two-VM live detection: one model per host, Sysmon command lines (D14), anomaly-first cross-host correlation Nov 15, 2026
@ngodat0103
ngodat0103 merged commit fdb2905 into main Nov 15, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant