Blocking IP addresses that keep hammering?

ryno267

Well-Known Member
Mar 3, 2004
212
0
166
Chandler, AZ
cPanel Access Level
Root Administrator
In my LogWatch reports everyday - I continue to get the same two IP's that keep trying to log into an old demo account I had. I setup a demo account for the control panel and they somehow found it and used it for emailing... I stopped all that and eliminated the account, but they keep pinging my sever trying to get into that old account.

Is there a way to completely block these IP's from my server so they don't even show up in the LogWatch anymore?
Maybe you guys should ban these IP's too cause they are spammers.

LogWatch:
Code:
--------------------- SSHD Begin ------------------------ 
Failed logins from these:
   admin/password from 211.46.49.252: 2 Time(s)
   admin/password from 66.114.227.251: 6 Time(s)
   guest/password from 211.46.49.252: 1 Time(s)
   guest/password from 66.114.227.251: 3 Time(s)
   root/password from 211.46.49.252: 3 Time(s)
   root/password from 66.114.227.251: 9 Time(s)
   test/password from 211.46.49.252: 3 Time(s)
   test/password from 66.114.227.251: 6 Time(s)
   user/password from 211.46.49.252: 1 Time(s)
   user/password from 66.114.227.251: 3 Time(s)

**Unmatched Entries**
Illegal user test from 211.46.49.252
Illegal user test from 211.46.49.252
Illegal user guest from 211.46.49.252
Illegal user admin from 211.46.49.252
Illegal user admin from 211.46.49.252
Illegal user user from 211.46.49.252
Illegal user test from 211.46.49.252
Illegal user test from 66.114.227.251
Illegal user guest from 66.114.227.251
Illegal user admin from 66.114.227.251
Illegal user admin from 66.114.227.251
Illegal user user from 66.114.227.251
Illegal user test from 66.114.227.251
Illegal user test from 66.114.227.251
Illegal user guest from 66.114.227.251
Illegal user admin from 66.114.227.251
Illegal user admin from 66.114.227.251
Illegal user user from 66.114.227.251
Illegal user test from 66.114.227.251
Illegal user test from 66.114.227.251
Illegal user guest from 66.114.227.251
Illegal user admin from 66.114.227.251
Illegal user admin from 66.114.227.251
Illegal user user from 66.114.227.251
Illegal user test from 66.114.227.251
---------------------- SSHD End -------------------------
thanks much guys!
 

SarcNBit

Well-Known Member
Oct 14, 2003
1,001
3
168
You didn't say what OS you were running.

If you are running iptables, you can enter:

iptables -A INPUT -s <IP> -j DROP

as root from a shell inserting the IP you want to block for <IP> and repeat as needed.
 

JamieH

Member
Aug 16, 2004
5
0
151
What i do

Well what i do is (on red hat 9) is edit the /etc/hosts.allow and hosts.deny files

I have it to where only me and techs can access ssh
 

Chew

Well-Known Member
Dec 31, 2003
96
0
156
Maryland
NovemberRain said:
Just change the ssh port to something else.
that's just what I did...

Changed my port number, and now, haven't had a single login attempt for about a month now.

Chew
 

SarcNBit

Well-Known Member
Oct 14, 2003
1,001
3
168
I am not sure why you would limit it to TCP traffic (-p tcp). The post I made earlier would cover all traffic from a single IP.

SarcNBit said:
You didn't say what OS you were running.

If you are running iptables, you can enter:

iptables -A INPUT -s <IP> -j DROP

as root from a shell inserting the IP you want to block for <IP> and repeat as needed.
 

bmcpanel

Well-Known Member
Jun 1, 2002
544
0
316
Got the following from a post on one of the forums I visit. It seems to work quite well.
------------------------------------

/sbin/route add -host 111.111.111.111 reject

Whereas 111.111.111.111 is the origin ip.

this will kill all incoming and outgoing connections from that IP.

there is no file it's written to. it is kept in the kernel routing table
(which is in memory).

if you would like to save the information after rebooting, just add the commands
to /etc/rc.d/rc.local and it will re-execute them when the server comes back online.