Location: /projects/liboverride
Sat, 22 Dec 2007liboverride project page is up.
I finally got around to putting up a project page for liboverride.
Location: /projects/liboverride
Comments: 0 (view comments)
Tracking and Analyzing SSH Bots.
I've posted previously
about what can be done about ssh bots. In this same context, I've just finished
working on a new idea: Tracking the username/passwords used by the bots.
To track the login attempts, I wrote a new pam module: pam_logfailure. The goal of pam_logfailure is to log the passwords used by bots attempting to bruteforce logins. However, when I installed the module, I found that it wasn't working properly: Dec 20 12:24:50 kenya2 pam_logfailure: host:125.243.206.194 user:john pass:^H ^M^?INCORRECTI saw line after line of these, and couldn't figure out why the bots were using this as a password. Turns out they aren't. This password is what OpenSSH forces upon pam for users that do not exist. This is apparently by design: auth-pam.c: static char badpw[] = "\b\n\r\177INCORRECT";If you are an invalid user, or are trying to login as root while root login is disabled, the password you sent is replaced with 'badpw' above. This makes it kind of hard to track what passwords bots are using... Thankfully, I was already one step ahead of myself when I wrote a function injection tool back in September (liboverride). So, all I had to do was inject my own 'getpwnam' function to spoof data when a user did not exist to trick OpenSSH into passing the password through. After injecting my own getpwnam(), pam_logfailure started working just fine: Dec 22 11:17:47 kenya2 pam_logfailure: host:218.1.65.233 user:admin pass:adminsSo where will I go next with these ssh-bot games?
The usage of getpwnam.over is like any other liboverride code. 'make
getpwnam.so' and then use "LD_PRELOAD=/path/to/getpwnam.so
Here is the code:
Comments: 1 (view comments)
|
Search this siteNavigationMetadataHome About Resume My Code (SVN)ArticlesARP Security Dynamic DNS with DHCP OpenLDAP+Kerberos+SASL PPP over SSH SSH Security: /bin/false Week of Unix Tools Work EfficiencyProjectsfex firefox tabsearch firefox urledit grok keynav liboverride newpsm (FreeBSD) nis2ldap pam_captcha poor man's backup Solaris audio utility xboxproxy xdotool xmlpresenter xpathtool misc scriptsPresentationsYahoo! Hack Day '08 Yahoo! Hack Day '06 Unix Essentials Vi/Vim Essentials SSH Tunneling (Video)Tag CloudCalendar
FriendsBarCamp Kent Brewster Tantek Çelik John Resig Wesley Shields Tyler ShieldsTechnorati |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||