1. Install CSF
2. Install Iptables if it's not installed (apt-get install iptables on redhat/centos)
3. In WHM under "# ConfigServer Security&Firewall" click on firewall deny ips
4. Open a 2nd window, Goto Main >> Server Status >> Apache Status
5. Check if there are any spammers with lots of connections to a specific file, that's how I got a lot of the IP's.
6. Goto
http://ws.arin.net/whois/?queryinput=99.225.243.201
7. Enter the IP you found at "Server Status" and enter it at ws.arin.net to get the proper CIDR which you can easily add to your CSF deny hosts file (which is open in another window)
8. Get a tea and watch the server status closely
Code:
#McColo Corporation
208.66.192.0/22
#RIPE Network Coordination Centre
80.0.0.0/8
81.0.0.0/8
82.0.0.0/8
83.0.0.0/8
84.0.0.0/8
85.0.0.0/8
86.0.0.0/8
87.0.0.0/8
88.0.0.0/8
89.0.0.0/8
90.0.0.0/8
91.0.0.0/8
193.0.0.0/8
194.0.0.0/8
195.0.0.0/8
212.0.0.0/8
213.0.0.0/8
217.0.0.0/8
217.174.203.41
218.0.0.0/8
#Latin American and Caribbean IP address Regional Registry
190.0.0.0/8
200.0.0.0/8
201.0.0.0/8
#Asia Pacific Network Information Centre
59.0.0.0/8
116.0.0.0/8
118.0.0.0/8
202.0.0.0/7
203.0.0.0/7
210.0.0.0/7
212.0.0.0/8
221.0.0.0/8
222.0.0.0/8
#Japan Network Information Center
133.0.0.0/8
#African Network Information Center
196.0.0.0/8
#Alexa Internet
209.237.237.0/24
209.237.238.0/24
#SevenTwentyfour Incorporated
209.167.50.16/28
#Spammers on my server
#Comcast Cable Communications Holdings, Inc (24.61.11.145)
24.60.0.0/14
#Hurricane Electric
64.62.128.0/17
# CABLE ONE
67.60.0.0/15
# Charter Communications
71.80.0.0/12
# Road Runner HoldCo LLC
75.176.0.0/12
#Verizon Internet Services Inc.
71.96.0.0/11
# Bell Canada 76.68.229.78
76.64.0.0/13
#Shaw Communications Inc.
24.80.0.0/13
64.59.128.0/18
#Road Runner HoldCo LLC 69.203.88.48
69.200.0.0/13
#AT&T Internet Services 69.224.0.0/12
69.224.0.0/12
#Rogers Cable Communications Inc. (99.248.186.142)
99.224.0.0/11
#Others
24.200.0.0/14
76.192.0.0/10
70.48.0.0/13
Since I'm also new to this I have a question:
Do I have to
order the IP's inside that file to get them all working? I noticed that rogers cable communications are not blocked O.o
And do you recommend to add the whole subnet if there is a IP spamming your server. E.g. if IP 99.248.186.142 is a spammer, is it safe to add their CIDR "99.224.0.0/11" ?