Running is therapy

a blog about running, cats, Linux and programming.
  • Home
  • Current Schedule
  • Personal Records
  • Upcoming Races

Stupid people

Published by Nathan Powell on March 28, 2007 07:22 pm under sysadmin

At work we launched the new colo over last weekend. In the aftermath it was time to get pam_abl installed. However for some reason it wouldn’t work. I found one blog post that suggested that the OpenSSH server that is on Dapper doesn’t properly call pam and so you need a patched version to run pam_abl. Well the idea that 1. I only found it in one blog, and 2. He was offering a deb that was patched, didn’t really sit well with me.

I am all about community, but something as fundamental as ssh, I am sorry I am not willing to install that on the word of some yabo with a wordpress blog.

I decided that there was more than one way to skin a cat, and that I would give DenyHosts a try. It’s a simple idea. It’s a python script that adds IP’s to /etc/hosts.deny on failed attempts at whatever protocol you give it. I just wanted to stop the lame ssh brute force attacks (and really if I had my druthers I would have used pam_abl, I think it’s much more elegant). I installed DenyHosts and am pretty pleased so far. I set it up to send me a notification when a host is blocked (at least for a little while till I trust it). It’s not surprising that I get about 8 emails at a time. The brute force script just goes down the line of IP’s on the subnet and tries each one…so in turn each server blocks the ip and sends me an email.

This is the most recent jackass: 69.249.96.57 (c-69-249-96-57.hsd1.nj.comcast.net)

Fricken stupid people.

4 Comments so far

  1. Doug on March 28th, 2007

    I’m using an iptables blocking method; I stick this before any “-m tcp -m state –state ESTABLISHED,RELATED” lines:

    -A INPUT -p tcp -m state –state NEW –dport 22 -m recent –name sshattack –set
    -A INPUT -p tcp –dport 22 -m state –state NEW -m recent –name sshattack –update
    –seconds 30 –hitcount 4 -j LOG –log-prefix “SSH REJECT: ”
    -A INPUT -p tcp –dport 22 -m state –state NEW -m recent –name sshattack –update
    –seconds 30 –hitcount 4 -j REJECT –reject-with tcp-reset

    This blocks any new connections within 30 seconds after the 4th try.

  2. Lon on March 28th, 2007

    Mmm… zombied machines. Gotta love botnets.

  3. Patrick on March 29th, 2007

    I really like non-standard ports. Just distribute a copy of the ~/.ssh/config snippet needed, like:
    Host gw.corp.com
    User me
    Port 2222

    Tandem that with Doug’s solution above and you get very little log noise.

  4. Doug on March 29th, 2007

    Just for a frame of reference; with the above iptables config I cut a 1MB+ logwatch email down to

Posting your comment.

  • Search

  • Archives

    • October 2008 (4)
    • September 2008 (4)
    • August 2008 (10)
    • July 2008 (11)
    • June 2008 (14)
    • May 2008 (15)
    • April 2008 (10)
    • March 2008 (16)
    • February 2008 (17)
    • January 2008 (37)
    • December 2007 (21)
    • November 2007 (30)
    • October 2007 (29)
    • September 2007 (22)
    • August 2007 (30)
    • July 2007 (49)
    • June 2007 (32)
    • May 2007 (29)
    • April 2007 (38)
    • March 2007 (26)
    • February 2007 (25)
    • January 2007 (23)
    • December 2006 (10)
    • November 2006 (12)
    • October 2006 (9)
    • September 2006 (9)
    • August 2006 (5)
    • July 2006 (13)
    • June 2006 (9)
    • May 2006 (8)
    • April 2006 (11)
    • March 2006 (12)
    • February 2006 (12)
    • January 2006 (13)
    • December 2005 (15)
    • November 2005 (19)
    • October 2005 (8)
  • Categories

    • blather (63)
    • books (10)
    • computers (177)
    • cooking (1)
    • economics (3)
    • emacs (3)
    • football (1)
    • gaming (1)
    • hiking (5)
    • housekeeping (5)
    • lifehacking (7)
    • music (3)
    • paddling (2)
    • personal (1)
    • politics (21)
    • programming (70)
    • running (232)
    • smoking (40)
    • sysadmin (10)
    • tlc (10)
    • Uncategorized (1)
  • Pages

    • Current Schedule
    • Personal Records
    • Upcoming Races

Copyright © 2008 Running is therapy
WordPress Theme based on Light Theme