Have a look at http://ipinfodb.com/ip_location_api.php - it will give you a country based upon an IP address. A little bit of scripting should allow you to only enable your "Contact Us" form to work for the countries you select. There's even a bit of PHP to get you started ...
Greg
On 18 November 2011 09:25, Ian Douglas aluger@k1ngph1cher.com wrote:
For about a month one of my websites (or rather the "Contact Us" form on that website) has been under regular, daily, attack from hackers. The attacks are consistently coming from IP Addresses in Rumania and Russia. Each time an attack occurs I use my webhost's cPanel to manually add the IP to my cPanel "IP Deny Manager" list. This is however becoming rather tedious and time consuming and seems the wrong way round to do things as I am denying IP Addresses AFTER they have tried to hack in rather than blocking them BEFORE they attempt it.
Is there a way I can simply deny access to my website (or, better, just it's home-made PHP based "Contact Us" form) to all Eastern European visitors?
Alternatively, since my website is primarily focused on UK customers, would there be an easier way to deny all visitors access unless they came from UK, USA Canada, Eire or Australia?
I realise that this is not specifically a Linux question but any suggestions would be welcome.
Ian.
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!