Re:whoarethey: Determine Who Can Log in to an SSH Server
by pimlottc on Tuesday January 10, 2023 @08:44PM
(#34334020)
The exploit title says “public key” but the details say “private key”, which is it?
Re:whoarethey: Determine Who Can Log in to an SSH Server
by justsomeadvice0 on Tuesday January 10, 2023 @09:11PM
(#34334230)
You're totally right, this is not the module I am thinking of. We used to do this exact step (yank all admins pubkeys from somewhere, and test logins with it to make an access map) in our pentests but now I am having trouble remembering what we used. Even better that there is a standalone tool then :)
Edit: here is the right module: `auxiliary/scanner/ssh/ssh_identify_pubkeys`, it is sort of nice in that you can give it a range of usernames, pubkeys, and hosts and it will try all combinations, and can be routed through your meterpreter pivots: https://www.rapid7.com/db/modules/auxiliary/scanner/ssh/ssh_...
Re:whoarethey: Determine Who Can Log in to an SSH Server
by jeroenhd on Tuesday January 10, 2023 @09:01PM
(#34334167)
The exploit actually performs a login, so you need a private key for that. It's a way for a hacker to track what machines (still) accept the key they've obtained.
Key-based authentication for SSH is often referred to as "pubkey authentication" (because you share your public key with the server) so that's probably where the title comes from. I don't think it exploits the same problem.
In practice I have used metasploit's `auxiliary/scanner/ssh/ssh_login_pubkey` to do this: https://www.rapid7.com/db/modules/auxiliary/scanner/ssh/ssh_...
But standalone tools are always handy!
(Edited to add a better URL)