[Full-disclosure] SSH brute force blocking tool

J. Oquendo sil at infiltrated.net
Tue Nov 28 16:59:43 GMT 2006


Tavis Ormandy wrote:
> On Tue, Nov 28, 2006 at 04:02:36PM +0000, Tavis Ormandy wrote:
> I notice you also havnt solved the local privilege escalation, this can
> be abused by local users to gain root by attempting to login with the
> username set to a valid passwd entry and then winning the race condition
> by creating a symlink to the system passwd file (of course, there are
> dozens of other attacks).
>
> Thanks, Tavis.

And just what on God's earth does "SOMEONE LOGGING IN WITH USERNAME SET 
TO A VALID PASSWORD ENTRY" have to do with this script. Let me take my 
script out of the equation for a minute. "SOMEONE LOGS IN WITH A 
USERNAME SET TO A VALID PASSWORD ENTRY" don't you think this is a 
problem with the system they're on? Please explain to me how because I'm 
seriously curious to know how you envision this happening with this 
script of mine.

Nov 27 16:31:21 local sshd[67010]: Illegal user dd from 213.134.128.227
awk '($5=="Illegal"||$6=="Illegal")&&$9=="from"{print $10}'

Would stop the insertion attack and only print out the tench field if 
fields 5, 6 and 9 match Illegal user from.

So that would pretty much minimize the attack on name insertion. If I 
wanted to I could also make sure that if someone came after field 10, 
then ignore the entire line:
Nov 27 16:31:21 local sshd[67010]: Illegal user dd from 213.134.128.227

But before you shoot back let me send your response for you:

Tavis Ormandy will write:
>  "Someone could log in using: "Illegal User foo from 
$OWNIPADDRESS"@host which would make an entry:
>  Nov 27 16:31:21 local sshd[67010]: Illegal user  dd from  Illegal User 
foo from $OWNIPADDRESS 213.134.128.227"

SO let me restate. I could modify it to look at lines 5, 6, and 9 ... 
Take a look at the tenth column and if anything comes after 
that...Ignore that entire line... Should I have done so, maybe... Will I 
do so... Maybe...

But wait there's more... Before you respond back Tavis, I will do so for 
you:

Tavis Ormandy will write:
 > "Someone could cause a race condition in awk that will allow peanut 
butter to seep into my colo"

Sorry can't help you there.

As to a fix to someone injecting ranDumb addresses. That same awk 
statement above will work but if they're doing some netcat voodoo, then 
feel free to shoot off another email on how my script broke TCP/IP entirely.



-- 
====================================================
J. Oquendo
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x1383A743
sil . infiltrated @ net http://www.infiltrated.net 

The happiness of society is the end of government.
John Adams

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5157 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.grok.org.uk/pipermail/full-disclosure/attachments/20061128/778aafac/attachment.bin 


Full-Disclosure is hosted and sponsored by Secunia.