Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: SSH Scans Lockout
PostPosted: Mon Nov 08, 2004 8:43 am 
Offline
Senior Newbie

Joined: Mon May 31, 2004 7:13 pm
Posts: 10
I don't know about anybody else but I'm getting a lot of SSH scanning attempts appearing in the logs on my linode. Whilst this isn't a problem as such, with root ssh disabled and only 1 account allowed to login, it's getting annoying with pages of log entries showing failed attempts using "admin/password", "root/password" etc.

What I'm looking to do is add any host that has 3 login attempts to hosts.deny and cut down on that logs that are created. Apparantly this is easy to do with Free BSD though I've never heard of it being done on Linux (Debian incidentally).

Anybody have any suggestions?


Top
   
 Post subject:
PostPosted: Mon Nov 08, 2004 12:37 pm 
Offline
Senior Member

Joined: Fri Feb 13, 2004 11:30 am
Posts: 140
Location: England, UK
The easiest way is probably to have a script that tails the logs and adds to the hosts.deny itself. I'm not quite sure of the details though. One variant on that idea would be to have a continuous process that runs tail -f on it and uses that. It wouldn't miss anything, but it would need to run as root, or have some means of getting root. Besides, I'm not sure what the performance issues with that would be.

I don't offhand know of any other ways, unless you look into some sort of IDS program. I've never fiddled with them myself so I don't know how you would get them working on Linux either.

Hope this helps.


Top
   
 Post subject:
PostPosted: Tue Nov 09, 2004 12:54 am 
Offline
Senior Newbie

Joined: Wed Sep 22, 2004 11:53 pm
Posts: 17
I also noticed a lot of those scans in my logs (interestingly, the username 'patrick' seems to be tried quite often, as well as 'guest', 'admin', 'root', etc.) and modified my firewall to ignore ssh connection attempts after the 3rd within 60 seconds from any one ip. It's not exactly what you wanted to do, but has some of the same effect. More details are in the thread:
http://www.linode.com/forums/viewtopic.php?t=1240


Top
   
 Post subject:
PostPosted: Tue Nov 09, 2004 10:56 am 
Offline
Senior Member
User avatar

Joined: Sat Oct 16, 2004 11:13 am
Posts: 176
Since I'm the only person using my Linode, I don't install SSH at all.

Instead I log in throught the host-server (i.e.hostXX.linode.com) and use the actual console.


Top
   
 Post subject:
PostPosted: Wed Nov 10, 2004 2:05 am 
Offline
Junior Member

Joined: Sat Nov 29, 2003 1:28 am
Posts: 25
Website: http://virtig01.net
I too have noticed ssh login attempts that are not mine. What I've done is edited my /etc/ssh/sshd_config file appropriately, most importantly disallowing remote root login. It may also be wise to put up a login banner to alert hackers that they can be prosecuted for their actions.


Top
   
 Post subject:
PostPosted: Wed Nov 10, 2004 12:34 pm 
Offline
Senior Newbie

Joined: Fri Aug 20, 2004 2:05 pm
Posts: 8
Website: http://rubystuff.org/
Ciaran wrote:
The easiest way is probably to have a script that tails the logs and adds to the hosts.deny itself.


Or instead of adding the ip to hosts.deny (which clues the user in that he's been denied and just causes him to continue his mischief from a different host), go ahead and give him a root shell. Not a real one, just make it look real enough to waste his time. When he realizes there's nothing worth looking at and that the system is broken enough that it's not worth the time to break in ("why do ps and top always segfault?"), he'll go away and bother someone else.


Top
   
 Post subject:
PostPosted: Wed Nov 10, 2004 2:55 pm 
Offline
Senior Member

Joined: Thu Apr 08, 2004 3:24 pm
Posts: 92
ICQ: 3765104
Website: http://www.unixfool.com
Yahoo Messenger: wigglit2001@yahoo.com
Location: VA
cout wrote:
Ciaran wrote:
The easiest way is probably to have a script that tails the logs and adds to the hosts.deny itself.


Or instead of adding the ip to hosts.deny (which clues the user in that he's been denied and just causes him to continue his mischief from a different host), go ahead and give him a root shell. Not a real one, just make it look real enough to waste his time. When he realizes there's nothing worth looking at and that the system is broken enough that it's not worth the time to break in ("why do ps and top always segfault?"), he'll go away and bother someone else.


This sounds like it has the potential to tick a hacker off, which may make him try to "get even". He'll see a challenge and continue to dig. hosts.deny sounds like the better option between the two, as all its doing is denying access (sorta similar to a firewall). If he sees that he's being denied and tries to use another IP, that one will be blocked also, after 3 tries.


Top
   
 Post subject:
PostPosted: Wed Nov 10, 2004 4:30 pm 
Offline
Junior Member

Joined: Wed Jul 21, 2004 5:15 pm
Posts: 25
mayby we can ask caker to install a honey pot we can send all of our mischeff makers too.

I wonder if Chris is a whitehat or a blackhat?
:twisted:


Top
   
 Post subject:
PostPosted: Wed Nov 10, 2004 4:47 pm 
Offline
Senior Newbie

Joined: Thu Jun 24, 2004 4:45 pm
Posts: 19
Website: http://jeffmacmichael.com
Location: Maryland, USA
How about configure hosts.allow/hosts.deny to deny SSH traffic for all but a couple of (or block of) IP addresses?


Top
   
PostPosted: Mon Nov 15, 2004 6:17 am 
Offline
Junior Member

Joined: Wed Jul 21, 2004 4:45 am
Posts: 21
Website: http://www.percederberg.net
Location: Stockholm, Sweden
An alternative is to simply block the SSH port in the firewall and only open it for users who know the secret port knocking sequence (who then proceed to login as normal). That way it will look like you don't even run an SSH server on the box.


Top
   
PostPosted: Thu Nov 18, 2004 10:29 am 
Offline
Senior Member

Joined: Thu Apr 08, 2004 3:24 pm
Posts: 92
ICQ: 3765104
Website: http://www.unixfool.com
Yahoo Messenger: wigglit2001@yahoo.com
Location: VA
cederberg wrote:
An alternative is to simply block the SSH port in the firewall and only open it for users who know the secret port knocking sequence (who then proceed to login as normal). That way it will look like you don't even run an SSH server on the box.


OOOO....

I'm gonna check that one out!


Top
   
 Post subject:
PostPosted: Thu Nov 18, 2004 3:07 pm 
Offline
Senior Member

Joined: Sun Nov 14, 2004 6:37 pm
Posts: 138
Website: http://oldos.org
WLM: jasonlfaulkner@hotmail.com
Yahoo Messenger: jasonfncsu
AOL: jaylfaulkner
Location: NC, USA
Or do like me, and just SSH using a nonstandard port, it's one line in the sshd_config, and you lose all the bot login attempts

_________________
Jay Faulkner
http://oldos.org


Top
   
 Post subject:
PostPosted: Thu Nov 18, 2004 9:49 pm 
Offline
Junior Member

Joined: Tue May 25, 2004 2:21 pm
Posts: 20
Location: Newnan, Georgia
My ssh client happens to use protocol version 1. Just for heck of it I added the line "protocol 1" to the sshd_config file. Sure enough, once or twice a day the following line appears in /var/log/secure similar to:

Protocol major versions differ for ::ffff:211.184.84.128: SSH-1.5-OpenSSH_3.5p1 vs. SSH-2.0-libssh-0.1

BTW, the only difference is the IP address.... the 'SSH-2.0-libssh-0.1' is always there.

Hal Williams


Top
   
 Post subject:
PostPosted: Sat Nov 20, 2004 4:39 pm 
Offline
Junior Member

Joined: Fri Jun 25, 2004 10:31 am
Posts: 27
i have had the same but since i changed the port to a non statnard i have not had that problem


Top
   
 Post subject:
PostPosted: Fri Dec 10, 2004 2:46 pm 
Offline
Senior Member
User avatar

Joined: Wed Mar 17, 2004 12:35 am
Posts: 118
Website: http://www.necrobones.com/
Location: Sterling, VA
Yeah, that's what I did too, I moved SSH to a non-standard port just to reduce the log spammage (especially since I have unexpected log entries mailed to me automatically). I've also considered using iptables to only allow SSH from my known IP ranges, but I like being able to get in from wherever I happen to be.

_________________
----
Ed/Bones.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group