Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/documentation/modules/auxiliary/scanner/ssh/ssh_identify_pubkeys.md
Views: 11784
Vulnerable Application
This module can determine what public keys are configured for key-based authentication across a range of machines, users, and sets of known keys. The SSH protocol indicates whether a particular key is accepted prior to the client performing the actual signed authentication request. To use this module, a text file containing one or more SSH keys should be provided. These can be private or public, so long as no passphrase is set on the private keys.
If you have loaded a database plugin and connected to a database, this module will record authorized public keys and hosts so you can track your process. Key files may be a single public (unencrypted) key, or several public keys concatenated together as an ASCII text file. Non-key data should be silently ignored. Private keys will only utilize the public key component stored within the key file.
Setup
This module has been tested against Metasploitable2. Installation and setup instructions and additional information can be found in the Rapid7 documentation here: https://docs.rapid7.com/metasploit/metasploitable-2/
Verification Steps
Have Metasploitable2 running
Copy the
msfadmin
's public key from/home/msfadmin/.ssh/id_rsa.pub
to your machineStart
msfconsole -q
Do:
use auxiliary/scanner/ssh/ssh_identify_pubkeys
Do:
set rhosts
Do:
set username root
Do:
set key_path
to the copiedid_rsa.pub
fileDo:
run
Options
KEY_FILE
Filename of one or several cleartext public keys.
SSH_DEBUG
When enabled, outputs verbose SSH debug messages.
SSH_BYPASS
When enabled, verify that authentication was not bypassed when keys are found.
SSH_KEYFILE_B64
Raw data of an unencrypted SSH public key. This should be used by programmatic interfaces to this module only.
KEY_DIR
Directory of several keys. Filenames must not begin with a dot in order to be read.
SSH_TIMEOUT
The maximum time to negotiate a SSH session.