ssh-pentesting

Tests SSH services through enumeration, credential attacks, tunneling, and known vulnerability exploitation.

1|Updated Aug 3, 2026
One-click install
npx skills add https://github.com/hanmujun/hanmujun-agent-public --skill ssh-pentesting-hanmujun
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ssh-pentesting
Source: https://github.com/hanmujun/hanmujun-agent-public/tree/main/skill-library/ssh-pentesting
Command: npx skills add https://github.com/hanmujun/hanmujun-agent-public --skill ssh-pentesting-hanmujun

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? When an authorized penetration test or CTF challenge exposes port 22, testers need a structured methodology to enumerate the SSH service, attack authentication, pivot through tunnels, and check for known CVEs instead of running ad-hoc commands. ## Core Features & Use Cases - Phased Methodology: A seven-phase decision tree covering service discovery, auth-method enumeration, username enumeration (CVE-2018-15473), credential brute-forcing, SSH tunneling, key theft and reuse, and known vulnerability exploitation. - Detailed Command Reference: A companion references/ssh-techniques.md file with copy-ready commands for ssh-audit, hydra, nmap NSE scripts, Metasploit modules, ssh2john/hashcat key cracking, and SSH-Snake lateral movement. - Use Case: During an authorized assessment you find OpenSSH 9.3 on port 22. The skill routes you to check CVE-2024-6387 (regreSSHion), enumerate auth methods, and if credentials are obtained, set up dynamic SOCKS forwarding with ssh -D plus proxychains to reach internal services. ## Quick Start Ask the agent to run the SSH pentesting methodology against the authorized target at 10.10.10.5 and report the SSH version, supported authentication methods, and any applicable CVEs.

Frequently Asked Questions about ssh-pentesting

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enumerate SSH authentication methods on a target?▼

Run ssh -v with PreferredAuthentications=none to list the methods the server offers, or use the nmap script ssh-auth-methods with a known username. The result determines whether password brute-forcing, key-based attacks, or Kerberos GSSAPI paths are viable.

How to brute force SSH passwords with hydra?▼

Use hydra -l <user> -P wordlist.txt -t 4 ssh://<IP> with low thread counts. SSH typically enforces MaxAuthTries of 6 and fail2ban may block fast attempts, so slow, targeted wordlists work better than aggressive spraying.

Which SSH versions are vulnerable to CVE-2024-6387 regreSSHion?▼

OpenSSH versions 8.5p1 through 9.7p1 are affected by the regreSSHion signal-handler race condition enabling pre-auth RCE on glibc systems. Confirm the version via banner grabbing with nc or nmap -sV, and check that LoginGraceTime is nonzero.

Can I pivot into an internal network through SSH?▼

Yes, once you have SSH access you can use local forwarding (-L), remote forwarding (-R), or dynamic forwarding (-D 1080) as a SOCKS proxy combined with proxychains. Note that AllowTcpForwarding no in sshd_config disables these tunnels.

How do I crack an encrypted SSH private key?▼

Extract the key hash with ssh2john id_rsa > id_rsa.hash, then crack it offline using john with a wordlist or hashcat mode 22921. This only works on passphrase-protected private keys you have legitimately obtained.

What are the limitations of SSH username enumeration?▼

The timing-based enumeration via CVE-2018-15473 only works against OpenSSH versions below 7.7. On patched servers you must rely on OSINT, other service enumeration results, or default username guesses instead.