Skip to main content

The Mindset

SMB (Server Message Block) is the protocol Windows uses for file and printer sharing. It runs on TCP 445. For a pentester, SMB is valuable because:
  • Shares hold sensitive files — backups, password spreadsheets, deployment scripts with embedded credentials
  • Shares enable lateral movement — write access to the right share spreads your payload
  • SMB is a historic vulnerability magnet — EternalBlue and friends live here

Enumerating Shares — Locally

If you’re already on a Windows box:

Enumerating Shares — From Linux

This is how you’ll usually do it during external/internal assessments.

smbclient — List and Browse

crackmapexec / netexec — The Power Tool

netexec (the maintained successor to crackmapexec) is the fastest way to enumerate SMB across one host or a whole subnet:
Always test for null/anonymous sessions first (-u '' -p ''). Misconfigured shares that allow anonymous access are common and hand you files before you’ve authenticated to anything.

Mounting a Share on Linux


NTFS vs Share Permissions — Again

This came up on the Permissions & icacls page, and it’s critical for SMB. When you access a file over the network, both permission layers apply and the most restrictive wins: So a share might be set to “Everyone: Full Control” at the share level — but if NTFS only grants you Read on the files inside, you get Read. This is why you check both, and why a wide-open share permission doesn’t always mean wide-open files.
The reverse misconfiguration is the useful one: an admin sets restrictive NTFS permissions but forgets the share is set to Everyone:Full. If you can reach it over the network and NTFS happens to allow your account, you’re in. Always check what you can actually read and write rather than assuming from one layer.

Windows Defender Firewall

The firewall controls what’s reachable. Understanding its state tells you what you can connect to and what might be blocking your callbacks.
When your reverse shell won’t connect back, the host firewall blocking outbound traffic on your chosen port is a common cause. Try common allowed ports (443, 80) for your callbacks — they’re rarely blocked outbound.

SMB Vulnerabilities — Know the Classics

SMB has a long history of critical vulnerabilities. You don’t need exploit internals, but you should recognize the names and check for them:
SMBv1 being enabled at all is a red flag — it’s deprecated and the EternalBlue vector. netexec smb <target> shows the SMB version and whether signing is required (unsigned SMB enables relay attacks).

Next: The Windows Registry — the central config database, where persistence lives and credentials sometimes hide.