Is it possible on the server to log the password encoded by the remote user inside a log. I want to make a honeypot to see the type of user/password used.
|
|
Another method is to attach strace to the process (and it's children). Input/output will be logged there after decryption, yielding the password. In my experience this sort of thing works more reliably than mucking about with the log levels of sshd (but of course YMMV).
|
|||
|
|
|
If you run ssh in full debug mode you can have it log the content of all packets and then go back and extract the passwords from that. you can do this bu running
or add it to your /etc/ssh/sshd_config:
this runs it once, in non-daemon mode and logs way more than you care about. you can improve this by disabling the sshd service and running ssh with the -ddddd from xinitd. At work I currently maintain an open-ssh fork that includes this ability because it uses an external web service to verify the passwords. If you can afford to maintain an open-ssh fork it will likely give a cleaner experience. |
|||||||||||
|
|
This is dramatically simpler to accomplish if you just modify the sshd binary to log password attempts either to a log file or to a remote logging service. This is trivial to accomplish since the source code is availble and very well-written. In fact, attackers who get root level access on a server typically install modified ssh and sshd binaries that do exactly that! It should be simple to find source code patches out there if you have a look; I know I've seen the patch files show up on people's servers many times in the past. |
|||
|
|