hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Blocking brazilian spammers
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

Blocking brazilian spammers

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 11-17-2005, 03:35 PM
sasha sasha is offline
Hail Eris !
 
Join Date: Oct 2002
Location: Canada
Posts: 3,100

Blocking brazilian spammers


It seems that lately the most of dictionary attacks and spam on the servers i look after comes from Brazil. Whatever the reason is, blocking these IP ranges helps a lot in this matter.

/sbin/iptables -I INPUT -s 200.17/16 -j DROP
/sbin/iptables -I INPUT -s 200.18/15 -j DROP
/sbin/iptables -I INPUT -s 200.20/16 -j DROP
/sbin/iptables -I INPUT -s 200.96/13 -j DROP
/sbin/iptables -I INPUT -s 200.128/9 -j DROP
/sbin/iptables -I INPUT -s 201.0/12 -j DROP
/sbin/iptables -I INPUT -s 201.16/12 -j DROP
/sbin/iptables -I INPUT -s 201.32/12 -j DROP
/sbin/iptables -I INPUT -s 201.48/12 -j DROP


It might help someone. I gave up on blocking one IP at time. Next countries I am looking at are Taiwan, Vietnam and China.

Reply With Quote


Sponsored Links
  #2  
Old 11-17-2005, 04:33 PM
bloodyman bloodyman is offline
Web Hosting Guru
 
Join Date: Oct 2004
Posts: 283
Thanks for those rules!

Reply With Quote
  #3  
Old 11-17-2005, 05:54 PM
jfnllc jfnllc is offline
Lorem Ipsum
 
Join Date: Nov 2002
Location: Oregon
Posts: 1,221
I just applied them. We'll see how they work!

__________________
JetfireVPS.com ● Jetfire Networks L.L.C. OpenVZ VPS Virtual StorageManaged Web Hosting ● cPanel Cert. #YCNG-050617
Public Uptime Reports Never OversoldCustom Configurations Virtualizor Control Panel 99% Uptime SLA


Reply With Quote
Sponsored Links
  #4  
Old 11-17-2005, 07:45 PM
Eglis Eglis is offline
Junior Guru Wannabe
 
Join Date: Oct 2005
Location: Quebec
Posts: 60
wow that is mean

I'd do something more like this, since it's only causing you an " ssh " problem.

Just my point of view

/sbin/iptables -I INPUT -s 200.17/16 -m tcp -p tcp --dport 22 -j DROP
/sbin/iptables -I INPUT -s 200.18/15 -m tcp -p tcp --dport 22 -j DROP
/sbin/iptables -I INPUT -s 200.20/16 -m tcp -p tcp --dport 22 -j DROP
/sbin/iptables -I INPUT -s 200.96/13 -m tcp -p tcp --dport 22 -j DROP
/sbin/iptables -I INPUT -s 200.128/9 -m tcp -p tcp --dport 22 -j DROP
/sbin/iptables -I INPUT -s 201.0/12 -m tcp -p tcp --dport 22 -j DROP
/sbin/iptables -I INPUT -s 201.16/12 -m tcp -p tcp --dport 22 -j DROP
/sbin/iptables -I INPUT -s 201.32/12 -m tcp -p tcp --dport 22 -j DROP
/sbin/iptables -I INPUT -s 201.48/12 -m tcp -p tcp --dport 22 -j DROP

Reply With Quote
  #5  
Old 11-17-2005, 08:03 PM
sasha sasha is offline
Hail Eris !
 
Join Date: Oct 2002
Location: Canada
Posts: 3,100
Quote:
Originally Posted by Eglis
wow that is mean

I'd do something more like this, since it's only causing you an " ssh " problem.

Just my point of view
ssh access is restricted and passwords too hard to guess. ssh is just part of the problem, there are daily scans from those IPs for known holes in scripts and every once in a while when hole is found they upload script and try sending email. i cannot watch erery single script clients upload. mail , ssh , http passwords, even horde and cpanel are hit. Only way to stop it is to block any access from those ips. again, brazil is only part of the problem, there are few more countries that have no decent regulation about internet access and there is no benefit to my clients from having people in those countries access these servers. their credit cards are fake and there is no way to take any legal action against them. i believe that only way to get those goverments and isps to take any action is to cut them off.

Reply With Quote
  #6  
Old 11-18-2005, 06:31 AM
bloodyman bloodyman is offline
Web Hosting Guru
 
Join Date: Oct 2004
Posts: 283
I do agree with sasha.

Reply With Quote
  #7  
Old 11-18-2005, 01:10 PM
Blapto Blapto is offline
Web Hosting Evangelist
 
Join Date: Sep 2005
Location: Essex, England
Posts: 548
Exactly how many is a brazillion?

Reply With Quote
  #8  
Old 03-25-2011, 12:12 AM
EduardoNunes EduardoNunes is offline
New Member
 
Join Date: Mar 2011
Location: Sao Paulo, Brazil
Posts: 2
Lightbulb There is always another way...

I disagree with sasha, blocking many innocent people that are inside a CIDR block is never a good option.

You can instead use a IDS (Intrusion Detection System) technology to prevent yourself from being attacked by also blocking the attacks from offenders.

I like to use (and I do recommend using) sshblacklist (google for it), it is a very simple Perl script which you can adapt to many uses; some I can give a hint:

sshblacklist main use is to monitor your ssh log for failed passwords and then block the offender IP after some pre-defined login failures, for as long as you want, using anything from iptables|ipfw|your_own_script. Plus it will send you an email alert, so you know actions had been taken against who.

The Best thing about sshblacklist is that you can easily adapt to monitor log files from cpanel, apache, pop3, imap, smtp, ftp, irc, any service that you wish! Using RegEx to match the failure line sshblacklist will get the offender IP and run the command you set.

This way you will be protected from any attack coming from anywhere in the world, and has no need to worry about blocking CIDRs anymore!!

A cool smtp use I make is dropping all packets from a server I reject receiving a message from. This prevents a spammer delivering a later spam that could somehow bypass the filters, annoys them having emails which never deliver plus saves my cpu and logs resources!

Best Regards from Brazil!

Reply With Quote
  #9  
Old 03-25-2011, 12:30 AM
StevenG StevenG is offline
Web Hosting Master
 
Join Date: Apr 2002
Location: Auckland - New Zealand
Posts: 1,573
The OP mentioned spammers, so not sure what this has to do with ssh guys

Anyway, does seem a bit brutal to ban all those ranges completely..

__________________
Flash Arcade Games

Reply With Quote
  #10  
Old 03-26-2011, 04:27 PM
EduardoNunes EduardoNunes is offline
New Member
 
Join Date: Mar 2011
Location: Sao Paulo, Brazil
Posts: 2
Lightbulb It's a wonderful world... full of possibilities!!

The OP also mentioned dictionary attacks (which includes ssh too! )..

As for the spam, one can setup postfix to log a keyword when it flags a spam and adapt sshblacklist to take firewall actions against the postfix logged keyword.. it is one of many ideas...

I also developed one simple mail filter for postfix which can help preventing unwanted email, feel free to google for mail_from_check.sh and my name.

Best Regards!


Last edited by EduardoNunes; 03-26-2011 at 04:32 PM.
Reply With Quote
  #11  
Old 03-26-2011, 05:39 PM
Bo | TMZhosting Bo | TMZhosting is offline
Junior Guru Wannabe
 
Join Date: Mar 2010
Location: NJ, USA
Posts: 58
It just depends on what kind of "attacks" are coming. If it is dictionary attacks (which does indeed use ssh sometimes) blocking a range of IPs that have been logged is a good idea. Blocking an entire range can backfire in many ways.

I always prefer a properly configured CISCO NAT with a few security scripts.

-Eduardo I am going to try that sshblacklist script and see how it works, props for that

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
The Options for Blocking Outbound Spam: The Status Quo Blog 2013-06-06 14:08:10
Outbound Spam Causing Sleepless Nights? Blog 2013-05-13 09:52:21
Canadian Web Host iWeb Plans to Sell Cloud Hosting Services in Brazilian Market Web Hosting News 2012-04-09 15:27:41
Brazillian Government is Reportedly Hitting Service Providers with Domain Takedown Notices Web Hosting News 2012-02-09 10:55:05
Security Firm eleven Report Finds 89 Percent Spam Increase Since July Web Hosting News 2011-10-12 19:04:26


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?