Jump to content

[Module] Multi Ip-Range Blocker


Trip
 Share

Recommended Posts

Module developed by Jing-Shop
This modules blocks a range of IP-addresses and redirects requests from them to another side.

Tested with PS 1.1

Quick Setup
1) Unzip & upload to your modules directory
2) Edit the ip-ranges you want to block in the ips.txt in the module directory.
3) Edit

header("Location: http://www.example.com");

at the bottom of ipblock.php to the page the visitor or bot should be redirected to.
4) Install this module through Prestashop Back Office

So I don't know if someone really needs this but the module allows you easily to block ip-ranges from your shop.
So you can block tax and revenue offices :), spambots or even whole countries from accessing your site.
Important:
The format of the addresses must be like:

58.136.0.0 58.136.255.255
58.137.0.0 58.137.255.255
58.147.0.0 58.147.127.255


Every single range is one line.
NO hyphen, comments or whatever should be in the ips.txt
This module only blocks IP-ranges, not single IP's so be carefull.


If you like what I am doing (and it is working for you) buy a pants from the shop :)
post a link on your homepage, blog or whatever, follow us on twitter ;) or just say thank you to the prestateam for giving us a nice piece of software.
When you look in the code you know it is not a cakewalk to develop this (<-- I mean the prestashop code :) ).
Regards, trip

ipblock_V01.zip

Share this post


Link to post
Share on other sites

Thanks Trip.
I'm not security specialist, so I don't know if this module give the same level of security as the htaccess.

Some may answer?

And also, anybody have a ip database of knowed hacking place?

Share this post


Link to post
Share on other sites

Hi all,
I think my my script is more secure because from what I read about the function that determines the real ip is, it should be able to find it out
even if the user is using a proxy server.
That's what I read. I haven't tested it. From my point of view .htaccess should be faster but I think no one will notice a performance reduction with my script unless you maybe have a high traffic shop with lots of visitors.
I think my solution is a little bit more comfortable and targeted to unexperienced users.
A database with bad neighbourhood would be nice. Maybe someone finds something cool and than I would think about to modify the parser and maybe add a cron script to download the ip's once a day.
Regards, trip

Share this post


Link to post
Share on other sites

  • 2 weeks later...
  • 2 years later...
  • 11 months later...
  • 1 month later...
  • 1 year later...
  • 6 months later...
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More