-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ssh_version module #18686
ssh_version module #18686
Conversation
Still need to do docs, and test on additional devices. |
I would suggest using a map like [url => [cipher1, cipher2, cipher3, …]]` instead of copy/pasting everything :) |
A passing thought, it would be nice if the data gathered and displayed here was stored even when a vuln in not found. |
I'm up for suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm generally concerned about the output in a scanner module increasing from 1 line to 96 for a single host in the default condition. How would you feel about making some of the output either VERBOSE
or controlled by a dedicated datastore option?
server_data[:encryption_server].each do |encryption| | ||
encryption_checks.each do |encryptions, refs| | ||
encryptions.each do |bad_enc| | ||
next unless encryption.downcase.start_with? bad_enc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the #start_with?
check necessary here instead of a normal equality check? The reason I ask is that before of arcfour
being defined in the first group, anything that starts with arcfour
would be included, not just the ones that are defined. The same goes for other entries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done for consistency. https://datatracker.ietf.org/doc/html/rfc8732#name-deprecated-algorithms mentions gss-group1-sha1-*
and it seemed like a lot of added logic for some to check starts_with
and others not. However, I've switched it to be more exact.
I made the |
@msjenkins-r7 test this please. |
1 similar comment
@msjenkins-r7 test this please. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything is looking good to me on this now. Thanks for all the changes you put together to improve this!
msf6 auxiliary(scanner/ssh/ssh_version) > show options
Module options (auxiliary/scanner/ssh/ssh_version):
Name Current Setting Required Description
---- --------------- -------- -----------
EXTENDED_CHECKS true yes Check for cryptographic issues
RHOSTS 192.168.250.1 yes The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html
RPORT 22 yes The target port
THREADS 1 yes The number of concurrent threads (max one per host)
TIMEOUT 30 yes Timeout for the SSH probe
View the full module info with the info, or info -d command.
msf6 auxiliary(scanner/ssh/ssh_version) > run
msf6 auxiliary(scanner/ssh/ssh_version) > run
[*] 192.168.250.1 - Key Fingerprint: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGMf2Rx2HLHYxwv3acxlS+r8ZXSwrcNb/z6YPSl4rmEs
[*] 192.168.250.1 - SSH server version: SSH-2.0-OpenSSH_6.6.1p1 Debian-4~bpo70+1
[*] 192.168.250.1 - Server Information and Encryption
=================================
Type Value Note
---- ----- ----
encryption.compression none
encryption.compression [email protected]
encryption.encryption [email protected]
encryption.encryption aes128-ctr
encryption.encryption aes192-ctr
encryption.encryption aes256-ctr
encryption.encryption [email protected]
encryption.encryption [email protected]
encryption.hmac [email protected]
encryption.hmac [email protected]
encryption.hmac [email protected]
encryption.hmac [email protected]
encryption.hmac [email protected]
encryption.hmac [email protected]
encryption.hmac [email protected]
encryption.hmac hmac-sha2-256
encryption.hmac hmac-sha2-512
encryption.hmac hmac-sha1
encryption.host_key ssh-rsa
encryption.host_key ssh-dss
encryption.host_key ecdsa-sha2-nistp256 Weak elliptic curve
encryption.host_key ssh-ed25519
encryption.key_exchange [email protected]
encryption.key_exchange ecdh-sha2-nistp256
encryption.key_exchange ecdh-sha2-nistp384
encryption.key_exchange ecdh-sha2-nistp521
encryption.key_exchange diffie-hellman-group-exchange-sha256
encryption.key_exchange diffie-hellman-group-exchange-sha1 Deprecated
encryption.key_exchange diffie-hellman-group14-sha1
encryption.key_exchange diffie-hellman-group1-sha1 Deprecated
fingerprint_db ssh.banner
openssh.comment Debian-4~bpo70+1
os.cpe23 cpe:/o:debian:debian_linux:7.0
os.family Linux
os.product Linux
os.vendor Debian
os.version 7.0
service.cpe23 cpe:/a:openbsd:openssh:6.6.1p1
service.family OpenSSH
service.product OpenSSH
service.protocol ssh
service.vendor OpenBSD
service.version 6.6.1p1
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf6 auxiliary(scanner/ssh/ssh_version) > set EXTENDED_CHECKS false
EXTENDED_CHECKS => false
msf6 auxiliary(scanner/ssh/ssh_version) > run
[*] 192.168.250.1 - Key Fingerprint: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGMf2Rx2HLHYxwv3acxlS+r8ZXSwrcNb/z6YPSl4rmEs
[*] 192.168.250.1 - SSH server version: SSH-2.0-OpenSSH_6.6.1p1 Debian-4~bpo70+1
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf6 auxiliary(scanner/ssh/ssh_version) >
Release NotesThis updates the existing |
fix #18685
ssh_version
module does what it says. However, it would be nice if we had the ability to pull ciphers, encryption methods etc. Similar to the upgrade tossl_version
in #17149This PR does that, it shows:
Validation
msfconsole
use auxiliary/scanner/ssh/ssh_version
set rhost
to the docker image, or any host really that you wantrun