Can I ban an entire country? Lol

Ranger375

Well-known member
I’m getting spammed by Chinese spammers using multiple IPs (through my contact form). I’ve tried every type of captcha and no luck. Is there a way I can ban the entire country from accessing my forum/site?
 
Last edited:
I’m getting spammed by Chinese spammers using multiple IPs (through my contact form). I’ve tried every type of captcha and no luck. Is there a way I can ban the entire country from accessing my forum/site?

What type of server are you running?
 
If you are running CSF as a firewall you can block all of the Chinese IP's CIDR, but if they are coming in via a proxy from another country they will still be able to hit the contact us. This can also negatively impact performance on the server due to the IP checking involved in the iptables rules.
 
Look into "ipset" for iptables. It is a powerful utility which allows you to work with sets of IP addresses (including banning countries) through a single line in iptables, as opposed to cluttering up your iptables rules with hundreds of entries. Here is a guide:


...and you can use this link to get your list of countries to block (after registration):


Download the Linux IPTables version, which the aforementioned article will show you how to import into ipset. I noticed after banning a dozen or so of the notorious offenders, our "junk" registrations have dropped on a few sites. Any drop is better than none!
 
Yup, ipset is the way to go for a dedicated linux machine; easy to setup, high performance and pretty powerful
 
100% will prevent bots and spam. The challenge mode does not put anyone on your site without the google chapters. You can try cloudflare. (XX and Tor Challenge .)

I got to challenge all countries, with api. bot and ddos atack stopped :)

191174
 
Back
Top Bottom