Skip to content
TARGET$IP10.10.11.42$DOMAINcorp.local$USERsvc_sql$PASS••••••••••filled into every command · stored in your browser only
techniques/null-sessions
TECHNIQUE · discovery · ATT&CK T1087.002
Null sessions
Some Windows and Samba hosts still allow an unauthenticated SMB or RPC session. With no username or password you can list users, groups and the password policy — the groundwork for spraying and roasting.
WindowsSambaDiscovery
Needs credsNo
Network positionReach SMB/RPC
NoiseLow
Fixed byRestrictAnonymous
01

Requirements

all must hold
REQUIRED SMB or RPC reachable

Port 445, 139 or 135 open to you.

CHECK Anonymous access allowed

The host hasn't restricted anonymous enumeration.

check on 445 →
02

Do it

your target is filled in
01
List shares and policy

Try an empty username and password over SMB.

command · target filled in
nxc smb $IP -u '' -p '' --shares --pass-pol
02
Enumerate users over RPC

Pull the user list to build a spraying list.

command · target filled in
impacket-rpcdump $IP && rpcclient -U '' -N $IP -c enumdomusers
03

Variants

→ Guest session

Where anonymous is blocked, a 'Guest' account with a blank password sometimes isn't.

→ RID cycling

Walk RIDs with lookupsids to recover names even when enumeration is limited.

04

Detect & harden

Detect
  • Anonymous SMB session establishment
  • IPC$ connections with an empty user name
Harden
  • Set RestrictAnonymous / RestrictAnonymousSAM
  • Deny the Guest account and blank passwords

A null session rarely wins the engagement on its own, but it’s cheap and quiet, and the password policy plus a clean user list are exactly what you need before spraying a credential — without locking anyone out.

TECHNIQUE ⌘K jump c copy commands t set target l start lab search.deflance.com static · no tracking