Smb Enumeration 标志

Smb Enumeration

组织
blacklanternsecurity
smb-enumeration

枚举 SMB 共享、测试访问权限、提取密码策略并搜索内容。通过空会话、来宾访问和已验证身份的访问来枚举共享。涵盖共享列表、逐个测试共享访问权限、使用 MANSPIDER 搜索内容,以及检测 SMB 漏洞(签名、EternalBlue)。在 network-recon 识别出 SMB 端口(139/445)后使用。

Add to TypingMind

概览

发布者blacklanternsecurity
代码仓库red-run
技能名称smb-enumeration
星标数
276
复刻数
39
附带文件
仅含指令
许可协议GPL-3.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 blacklanternsecurity 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Smb Enumeration AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/blacklanternsecurity/red-run/tree/main/skills/network/smb-enumeration
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/blacklanternsecurity/red-run.git /tmp/red-run
mkdir -p .claude/skills
cp -r /tmp/red-run/skills/network/smb-enumeration .claude/skills/smb-enumeration
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Smb Enumeration,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Smb Enumeration。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Smb Enumeration 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

SMB Enumeration

You are helping a penetration tester enumerate SMB services on a target host. All testing is under explicit written authorization.

Engagement Logging

Check for ./engagement/ directory. If absent, proceed without logging.

When an engagement directory exists:

  • Print [smb-enumeration] Activated → <target> to the screen on activation.
  • Evidence → save significant output to engagement/evidence/ with descriptive filenames (e.g., smb-shares-10.10.10.5.txt, smb-manspider-results.txt).

Scope Boundary

This skill covers SMB enumeration only — share listing, access testing, content searching, and vulnerability detection. When you reach the boundary of this scope, STOP.

Do not load or execute another skill. Return to the orchestrator with:

  • What was found (shares, credentials, vulnerabilities)
  • Recommended next skill
  • Context to pass (DC IP, domain name, credentials, share paths)

Routing boundaries:

  • RCE exploitation (EternalBlue, SMBGhost, PrintNightmare)
  • Domain enumeration (LDAP, BloodHound, GPP)
  • Password brute forcing or spraying
  • Writable share abuse (web shells, DLL hijack)

Stay in methodology. Only use techniques documented in this skill.

What This Skill Does NOT Do

  • Exploit SMB vulnerabilities (EternalBlue, SMBGhost, PrintNightmare)
  • Perform password spraying or brute force attacks
  • Run Active Directory enumeration (LDAP queries, BloodHound)
  • Abuse writable shares for code execution or relay NTLM authentication

These are handled by dedicated skills. This skill discovers and reports.

State Management

Call get_state_summary() to read current engagement state. Use it to:

  • Skip re-testing targets already enumerated for SMB
  • Leverage existing credentials for authenticated enumeration (Step 7)
  • Check what's been tried and failed (Blocked section)

State writes — write critical discoveries immediately:

  • SMB signing disabled → add_vuln(title="SMB signing disabled on <host>", host="<host>", vuln_type="smb-signing", severity="medium")
  • Null session or guest access → add_vuln(title="SMB null/guest access on <host>", host="<host>", vuln_type="null-session", severity="medium")
  • EternalBlue confirmed → add_vuln(title="MS17-010 EternalBlue on <host>", host="<host>", vuln_type="rce", severity="critical")
  • Domain name/hostnames from SMB → add_pivot(source="SMB on <host>", destination="<domain>/<hostname>", method="SMB OS discovery")
  • Credentials found in share files → add_credential(username="<user>", secret="<password>", secret_type="password", source="SMB share file <path>")

Return summary must include:

  • Per-share access table (mandatory — every share gets a row)
  • Account lockout policy (if enumerable)
  • Domain/hostname info discovered
  • Credentials found
  • Vulnerabilities confirmed (signing, null session, EternalBlue)

Prerequisites

  • Network access to SMB ports (139/445) on target
  • Target IP address (provided by orchestrator or operator)
  • Optional: credentials for authenticated enumeration (passed by orchestrator)

Step 1: Share Listing

Run ALL of the following tools in sequence — not just one. SMB tools use different RPC calls and authentication methods under the hood. A failure or partial result from one tool does NOT mean the others will also fail. NetExec might return STATUS_USER_SESSION_DELETED while smbclient -L succeeds, or vice versa. You must try every tool before concluding that SMB enumeration has failed.

bash
# Tool 1: smbclient null session share listing
smbclient -N -L //TARGET_IP/

# Tool 2: NetExec null session + guest
netexec smb TARGET_IP -u '' -p '' --shares
netexec smb TARGET_IP -u 'guest' -p '' --shares

# Tool 3: enum4linux-ng comprehensive enumeration
enum4linux-ng -A TARGET_IP

Collect all unique share names from ALL tools. A share discovered by any tool counts — even if other tools failed to list it.

Step 2: Password/Lockout Policy

bash
netexec smb TARGET_IP -u '' -p '' --pass-pol
netexec smb TARGET_IP -u 'guest' -p '' --pass-pol

If either succeeds, record the full policy. The orchestrator needs this before routing to password-spraying. Key values: lockout threshold (0 = no lockout — critical for spray decisions), observation window, lockout duration, min password length, complexity requirements.

Step 3: User and Vulnerability Enumeration via NSE

bash
nmap -sV -p445 --script smb-enum-shares,smb-enum-users,smb-os-discovery,smb-vuln* TARGET_IP

Check results for: SMB signing status, OS version, EternalBlue (ms17-010), SMBGhost (CVE-2020-0796), user accounts enumerated.

Step 4: Per-Share Access Testing (MANDATORY)

This step is NOT optional. Test every share individually with smbclient. Access denied on one share tells you NOTHING about other shares — Windows ACLs are per-share. Skipping a share is a methodology failure.

For EVERY share discovered in Steps 1 and 3 (from ANY tool), run:

bash
smbclient //TARGET_IP/SHARENAME -N -c 'ls' 2>&1

If ls succeeds (shows files/directories), the share is readable. Follow up:

bash
# Recursive listing of accessible share
smbclient //TARGET_IP/SHARENAME -N -c 'recurse ON; prompt OFF; ls'

# Download interesting files (configs, scripts, credentials, backups)
smbclient //TARGET_IP/SHARENAME -N -c 'recurse ON; prompt OFF; mget *'

Write Access Verification

For every readable share, test write access with an actual file upload. Share-level ACLs (what nxc --shares reports) can differ from NTFS filesystem ACLs. The only reliable way to determine write access is to attempt a write.

bash
# Test write — lcd avoids smbclient path resolution issues
smbclient //TARGET_IP/SHARENAME -N -c 'lcd /tmp; put /etc/hostname .write-test'
# Clean up on success
smbclient //TARGET_IP/SHARENAME -N -c 'del .write-test'

If the smbclient write fails but nxc --shares reported WRITE for this share, retry with a second tool before concluding read-only. Different SMB clients use different dialect negotiation and session handling — one tool failing does not mean writes are blocked:

bash
# Fallback write test with impacket
impacket-smbclient -no-pass TARGET_IP
# At prompt: use SHARENAME, then: put /etc/hostname .write-test
# Clean up: del .write-test

Mark the share as WRITE only after a successful file upload. Mark as READ only after two tools fail to write.

Per-share results table (mandatory in return summary). Every share must have a row. No share may be listed as "not tested".

| Share | Access | Method | Contents/Notes |
|-------|--------|--------|----------------|
| ADMIN$ | DENIED | smbclient -N | NT_STATUS_ACCESS_DENIED |
| C$ | DENIED | smbclient -N | NT_STATUS_ACCESS_DENIED |
| Development | READ | smbclient -N, write failed (2 tools) | Automation/ directory found |
| Shared | WRITE | smbclient -N | Empty, write confirmed via put |
| IPC$ | LIMITED | smbclient -N | IPC only, no file listing |
| NETLOGON | READ | smbclient -N, write failed (2 tools) | Empty or standard scripts |
| SYSVOL | READ | smbclient -N, write failed (2 tools) | Policies, scripts |

Rules:

  • "Access" must be one of: READ, WRITE, DENIED, LIMITED, ERROR
  • WRITE requires a successful file upload — never infer from share ACL metadata alone
  • READ requires write failure from at least two tools (smbclient + one fallback)
  • "Method" must show the actual command used
  • Never report a share as DENIED unless you received NT_STATUS_ACCESS_DENIED (or similar error) from testing THAT SPECIFIC share
  • Never infer access status from other shares — test each one individually
  • If smbclient hangs or times out on a share, report as ERROR with details

Step 5: Fallback Share Probing

Only if ALL listing tools in Step 1 failed. Some Windows configurations block null-session share listing but allow null-session access to individual shares:

bash
for share in ADMIN$ C$ IPC$ SYSVOL NETLOGON Development Users Backups Public Data IT HR Finance Software Shared Docs; do
    echo "--- $share ---"
    smbclient //TARGET_IP/"$share" -N -c 'ls' 2>&1 | head -20
done

Step 6: Content Search with MANSPIDER

After identifying accessible shares, search file contents for credentials and sensitive data. MANSPIDER crawls SMB shares and greps file contents (including Office docs, PDFs, and archives) without downloading everything.

Only run after the share access table is complete — needs at least one readable share. If all shares returned DENIED, skip this step.

bash
# Keyword search for passwords and credentials
manspider TARGET_IP -c password passwd cred secret
manspider TARGET_IP -c connectionstring server= uid= pwd=

# Regex search for credential patterns
manspider TARGET_IP -e '(password|passwd|pwd)\s*[=:]\s*\S+'

# Limit to specific file types
manspider TARGET_IP -e 'password' -f xml conf config ini txt ps1 bat vbs

Step 7: Authenticated Re-enumeration

If the orchestrator passes credentials, repeat Steps 1, 4 (including write verification), and 6 with creds.

Shell-special characters in passwords (!, @, $, *, backticks): store the password in a file and reference it to avoid shell expansion issues.

bash
# Store password safely (do this first if password contains special chars)
echo -n 'PASSWORD' > /tmp/claude-1000/pass.txt

# Share listing
netexec smb TARGET_IP -u 'USERNAME' -p "$(cat /tmp/claude-1000/pass.txt)" -d DOMAIN --shares

# Per-share read + write testing (lcd before put — see Step 4)
smbclient //TARGET_IP/SHARENAME -U 'DOMAIN/USERNAME%PASSWORD' -c 'ls' 2>&1
smbclient //TARGET_IP/SHARENAME -U 'DOMAIN/USERNAME%PASSWORD' -c 'lcd /tmp; put /etc/hostname .write-test; del .write-test'

# Content search
manspider TARGET_IP -u 'USERNAME' -p 'PASSWORD' -d DOMAIN -c password secret

Update the per-share access table with authenticated results. Follow the same write verification rules as Step 4 — test every readable share for write access, retry with a second tool on discrepancies.

Step 8: Escalate or Pivot

After completing enumeration:

  • EternalBlue/SMBGhost confirmed → STOP. Recommend smb-exploitation. Pass: host, vuln type, OS version.
  • Domain info discovered → STOP. Recommend ad-discovery. Pass: DC IP, domain name, creds/null session.
  • Password policy extracted (lockout=0) → STOP. Recommend password-spraying. Pass: policy, usernames.
  • Credentials found in shares → STOP. Recommend ad-discovery or authenticated re-enumeration.
  • Writable shares found → STOP. Recommend smb-exploitation. Pass: share name, write method.
  • All shares denied, no vulns → Report complete. No further SMB enumeration without creds.

Troubleshooting

smbclient hangs or times out

Add -t 10 for a 10-second timeout. Verify port 445 is open with nmap.

NT_STATUS_CONNECTION_DISCONNECTED

Target rejecting null sessions. Try guest: -U 'guest%'. If guest also fails, enumeration requires credentials.

enum4linux-ng not found

Fall back to enum4linux (Perl version) or rely on smbclient + NetExec. Do not install — report missing.

NetExec STATUS_USER_SESSION_DELETED

Common and does NOT mean SMB is inaccessible. Continue with smbclient and enum4linux-ng.

MANSPIDER permission errors

Permission errors on ADMIN$/C$ are expected. Verify it crawled readable shares from Step 4.

常见问题

Smb Enumeration AI 技能有什么作用?

枚举 SMB 共享、测试访问权限、提取密码策略并搜索内容。通过空会话、来宾访问和已验证身份的访问来枚举共享。涵盖共享列表、逐个测试共享访问权限、使用 MANSPIDER 搜索内容,以及检测 SMB 漏洞(签名、EternalBlue)。在 network-recon 识别出 SMB 端口(139/445)后使用。

为什么在 TypingMind 中使用 Smb Enumeration?

因为您只需安装一次,就能搭配任何模型使用。Smb Enumeration 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Smb Enumeration?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/blacklanternsecurity/red-run/tree/main/skills/network/smb-enumeration。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Smb Enumeration?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Smb Enumeration 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Smb Enumeration 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Smb Enumeration AI 技能免费吗?

是的。blacklanternsecurity 已在 GitHub 上根据 GPL-3.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇