Stories
Slash Boxes
Comments

SoylentNews is people

posted by chromas on Monday March 25 2019, @10:24AM   Printer-friendly
from the "'Mawnin'!'-sez-Brer-Rabbit" dept.

Software engineer Chris Wellons writes about tar-pitting nefarious SSH probes. Anyone with a publicly-facing SSH server knows that it is probed from the moment it is turned on. Usually, the overwhelming majority of incoming connection attempts are malevolent in nature. There are several ways to deal with these attempts, one method is to drag out the response for as long as possible.

This program opens a socket and pretends to be an SSH server. However, it actually just ties up SSH clients with false promises indefinitely — or at least until the client eventually gives up. After cloning the repository, here’s how you can try it out for yourself (default port 2222):

[...] Your SSH client will hang there and wait for at least several days before finally giving up. Like a mammoth in the La Brea Tar Pits, it got itself stuck and can’t get itself out. As I write, my Internet-facing SSH tarpit currently has 27 clients trapped in it. A few of these have been connected for weeks. In one particular spike it had 1,378 clients trapped at once, lasting about 20 hours.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 3, Insightful) by DannyB on Monday March 25 2019, @03:17PM (3 children)

    by DannyB (5839) Subscriber Badge on Monday March 25 2019, @03:17PM (#819554) Journal

    Sorry I wrote SSL when I meant SSH.

    For SSH, I have one forwarded to a non standard port in the 3xxx range. I could forward more as you describe.

    I suppose then the standard SSH port could run the tarpit.

    But it would be really cool to be able to mix the tarpit with a real SSH implementation if that were possible to allow a real login to proceed.

    Or another approach: something like fail2ban could redirect certain 'ssh visitors' to the tarpit once it is clear that they are nothing but a brute force attack.

    --
    The lower I set my standards the more accomplishments I have.
    Starting Score:    1  point
    Moderation   +1  
       Insightful=1, Total=1
    Extra 'Insightful' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   3  
  • (Score: 2) by FatPhil on Monday March 25 2019, @03:42PM (2 children)

    by FatPhil (863) <{pc-soylent} {at} {asdf.fi}> on Monday March 25 2019, @03:42PM (#819580) Homepage
    The combination of fail2ban banning by tarpitting is indeed an interesting solution.
    I did plan to write a lightweight fail2ban replacement at some point (installed size half a meg? for something that just calls notify/poll and matches a few regexps and optionally calls some scripts, that sounds like bloat to me), I'll remember to consider that kind of option when I do.
    --
    Great minds discuss ideas; average minds discuss events; small minds discuss people; the smallest discuss themselves
    • (Score: 2) by canopic jug on Monday March 25 2019, @03:50PM (1 child)

      by canopic jug (3949) Subscriber Badge on Monday March 25 2019, @03:50PM (#819585) Journal

      If your needs are not complex, then the replacement can be quite short. I have one which is less than 10 lines of AWK. Though it depends on probes making specific errors, it seems to get nearly all of them quickly. I should connect it to a tar pit maybe but would want to re-write the tar pit in perl so that I don't have to add python to the mix. It looks simple enough to try.

      --
      Money is not free speech. Elections should not be auctions.
      • (Score: 2) by RS3 on Monday March 25 2019, @06:22PM

        by RS3 (6367) on Monday March 25 2019, @06:22PM (#819668)

        Some years ago I had tried fail2ban and either had trouble getting it to work or just considered it too complicated. Too many years to remember.

        Have any of you tried "pam shield"?