SSH (Secure Shell) is like FTP's security-conscious younger sibling. It encrypts everything, requires authentication, and provides secure remote access. But "secure" doesn't mean "unbreakable" - weak passwords, key misconfigurations, and old versions still make SSH a juicy target.
Running on port 22 (usually), SSH is the standard way to remotely manage Linux/Unix servers. It can also tunnel other protocols, forward ports, and transfer files via SCP/SFTP. If you compromise SSH credentials, you often have direct shell access.
SSH vs Telnet
SSH Enumeration
Banner Grabbing
The SSH banner reveals version information. Different versions have different vulnerabilities:
- OpenSSH < 7.7: Username enumeration (CVE-2018-15473)
- OpenSSH 2.3-4.7: Various vulnerabilities
- Dropbear: Embedded device SSH - often outdated
Username Enumeration
Some SSH versions respond differently to valid vs invalid usernames, allowing enumeration without actual login attempts.
Common Usernames
SSH Brute Forcing
Rate Limiting
Smart Brute Forcing
SSH Key Attacks
Finding SSH Keys
Private keys are the holy grail. If you find one, you might not need a password at all.
Using Found Keys
Authorized_keys Abuse
Key File Permissions
SSH Tunneling
SSH tunneling lets you route traffic through SSH connections. Perfect for accessing internal services or pivoting through compromised hosts.
Local Port Forwarding
Access remote services as if they were local. "Bring remote port to me."
Remote Port Forwarding
Make your local services accessible on the remote server. "Send my port there."
Dynamic Port Forwarding (SOCKS Proxy)
Create a SOCKS proxy to route any traffic through SSH.
SSH Vulnerabilities
Notable SSH Vulnerabilities
- CVE-2018-15473: Username enumeration in OpenSSH < 7.7
- CVE-2016-0777/0778: Roaming vulnerability (memory leak)
- CVE-2020-15778: Command injection via scp
- Weak algorithms: SHA1, MD5, CBC ciphers are deprecated
ssh-audit is Essential
SSH Enumeration Methodology
SSH Enumeration Process
Knowledge Check
Challenges
Key Takeaways
- SSH runs on port 22 and encrypts all traffic
- Banner grabbing reveals version and potential vulnerabilities
- Some SSH versions allow username enumeration
- Finding private keys = instant access (check permissions!)
- SSH tunneling enables pivoting and accessing internal services
- Use ssh-audit for comprehensive security assessment
- Brute force carefully - rate limiting is common