Klem Posted August 10, 2021 Share Posted August 10, 2021 I have a PHP message board built a LONG time ago and just lately it's being spammed badly. How can I stop it? Thanks, Tom 1 Quote Link to comment https://forums.phpfreaks.com/topic/313528-message-board-spam/ Share on other sites More sharing options...
requinix Posted August 10, 2021 Share Posted August 10, 2021 What board? "Built" as in you made it yourself? How old? Where is the spam happening? What type of spam is it? How much? Are there any existing anti-spam measures that aren't catching them for some reason? Do you require user registrations? How are you handling account validation? Tried using CAPTCHAs? Tried IP bans? Email address domain name bans? 1 Quote Link to comment https://forums.phpfreaks.com/topic/313528-message-board-spam/#findComment-1589002 Share on other sites More sharing options...
Klem Posted August 10, 2021 Author Share Posted August 10, 2021 I made it myself about 15 years ago. Just started, looks like ads for something or other, a lot of the same one over and over again. It's a simple site for 12 family members so I've never used any kind of registrations etc. No other anti-spam measures, never needed them till now. Quote Link to comment https://forums.phpfreaks.com/topic/313528-message-board-spam/#findComment-1589003 Share on other sites More sharing options...
Klem Posted August 11, 2021 Author Share Posted August 11, 2021 All the spam is coming from the UK. Is there a way to block UK sites from getting in? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/313528-message-board-spam/#findComment-1589026 Share on other sites More sharing options...
JacobSeated Posted August 11, 2021 Share Posted August 11, 2021 I really would not block traffic from specific IP addresses or regions, but you can do it using Maxmind free GEO-location databases; the problem is you need to update the database occasionally. I wrote a script to do that automatically, and I do actually need it for a cookie consent mechanism. Another option is to compile your own databases, because the data is made available, it is just a bit difficult if you are not used to working with that stuff. Just a few ideas: Check the database for previous spam messages posted by an IP, and reject new messages by known spammers; that would be messages that has been hidden or blocked. You don't just delete the spam, because you might want to analyze it. Check the database for exact match- and variations of messages that has been blocked. If something has been blocked before, there is no reason to allow someone to post it again. Rate-limit your incoming HTTP POST requests on certain URLs I am not sure, but I think fail2ban should be able to do rate limiting. I am only using it for e-mail servers though, since my CMS already has build-in rate-limiting. If you made this 15 years ago, then I would recommend looking into moving it to a custom Wordpress solution. There are plugins to help with rate limiting and other stuff.. Quote Link to comment https://forums.phpfreaks.com/topic/313528-message-board-spam/#findComment-1589029 Share on other sites More sharing options...
Barand Posted August 11, 2021 Share Posted August 11, 2021 24 minutes ago, Klem said: All the spam is coming from the UK. Is there a way to block UK sites from getting in? According to my IP lookup table there are around 250,000 ranges of ip addresses for the UK so you could block if it is one of those. mysql> SELECT COUNT(*) FROM ip_lookup WHERE country = 'United Kingdom'; +----------+ | COUNT(*) | +----------+ | 257455 | +----------+ Alternatively you could check if the ip address is that of one of your 12 friend/family members and allow if it is. Quote Link to comment https://forums.phpfreaks.com/topic/313528-message-board-spam/#findComment-1589031 Share on other sites More sharing options...
Klem Posted August 11, 2021 Author Share Posted August 11, 2021 Well I'm getting hundreds of these every day now and it would be impossible to block them all individually. They all have different URLs depending on what they're selling, but all from co.uk. And I know no one from the UK. Quote Link to comment https://forums.phpfreaks.com/topic/313528-message-board-spam/#findComment-1589032 Share on other sites More sharing options...
dodgeitorelse3 Posted August 11, 2021 Share Posted August 11, 2021 If it is just for family or friends why not just use a login system to be able to post anything? Quote Link to comment https://forums.phpfreaks.com/topic/313528-message-board-spam/#findComment-1589035 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.