SSH
Pentesting SSH - TCP Port 22
Theory
SSH or Secure Shell or Secure Socket Shell, is a network protocol that gives users a secure way to access a computer over an unsecured network.
SHH protocol operate by default on TCP port 22
Practice
Enumerate SSH server
We can use nmap to enumerate informations about the running SSH server
Enumerate Users
In some versions of OpenSSH you can make a timing attack to enumerate users. You can use a metasploit module in order to exploit this:
Brute-Force Credentials
If the target host opens port 80 or 443, you can generate wordlist from the contents of the website then use it with your tool.
When bruteforcing accounts, you may lock accounts
Crack SSH Private Key
Some private keys require a password or passphrase for operation, so we may attempt to Brute Force the passphrase off-line.
SSH Private KeysPersistence
It's possible to backdoor an SSH public key using the command=
argument. The backdoor will execute whenever the user logs in using this key.
Resources
Last updated