The Joomla! Extensions Directory ™


Ban IP Address/Range for 1.5 Plugin

This simple plugin installs into your 1.5 site to blacklist or whitelist IP addresses and ranges for either the administrator or the site. The settings can be used interchangeably so the administrator can be set to white list mode and the site can be set to black list mode.

Added in 1.5.3 is the ability to define comments in the params by prefixing the line with a pound character.

Added in 1.5.2 there is the ability to use a table to define entries. The table create statement is at the top of the banip.php file. An XML install for Table Editor (part of the Advanced Tools project) is available to modify the table in a GUI style interface.

Note: If you wish to test your ranges before applying them, check out the IP Checker in my JDiagnostics kit: http://sammoffatt.com.au/os/index.php/joomla-15-products/13-jdiagnostic/29-jdiagnostic-ip-checker


If this extension is misconfigured it may prevent access to your site. It is recommended that you utilise the JDiagnostic IP Checker before publishing the extension. Additionally, you can rename the /plugins/system/banip.php file to diasble the extension temporarily to allow access to the administrator if you have enabled that option in error.

Report

2012-01-07
Reviews: 3
A few sites have been under attack now for the last couple of weeks. I implemented this extension and I am very impressed with it.
A must have tool for every webmaster. A big thank you to the developer of this plugin.
2011-08-25
Reviews: 3
Been using this for a few weeks now and its very easy to use once you get the hang of it. I've amassed quite a few IP's from Spammers now and they have slowed down, I think they are getting the message. I did, however lock myself out... oops! I used a program called Hotspot Shield (HSS) that creates a VPN service so you can surf prawn anonymously hehehe!

AnyHoo, I had set Ban IP to use the White list for Admin with my IP address in it. HSS kind of spoofs your IP so consequently Ban IP blocked me and I got the redirect page.

So I got my FTP up and renamed the banip.php to banip.php.old and tried to login, same redirect page, ok lets have a clean out, CCleaner to the rescue, ran CCleaner, started Firefox and luckily I got the login page.

Phew! that was close,

Went to the plugins manager
Clicked on System - Ban IP Address
Chose "Enabled - NO"
Saved the settings
Went to my ftp, renamed banip.php.old back to banip.php
Went back to the plugins manager and opened System - Ban IP Address
Changed the administrator block mode to black list only
set the Enabled: to Yes and saved the settings.

Drama over lol! I'm still learning... obviously and the information could be a bit more noob friendly, consequently I kind of stumble around piecing bits of info together, this is one of the reasons I've done this to maybe help others that make my mistake.
2011-04-02
Reviews: 3
Thanks to developer. Great "piece of code"
2011-03-31
Reviews: 5
This is one of my favorite Joomla plugins. A real must have! Couldn't be more simple to set up and it's very reliable.

I wonder if there will be an updated version for J 1.6... I'd love to see that! :)
2011-03-16
Reviews: 4
...for your work on this extension! It's easy to configure and works flawlessly. I'm even using it in "whitelist mode" for a multi-node intranet site, essentially negating the need for a vpn. Thanks again!!
2010-12-23
Reviews: 15
It does exactly what is says, exactly the way you need it. Fast and easy to install and configure. MUCH easier than messing around with the .htaccess file!
2010-12-06
Reviews: 3
What more can I say - perfect !

I was / am getting so tired of all these Spam Bots. Seems close to 80% of forms I have to deal with are bogus - and most clients DO NOT what to use a 'catcha'.

This little plugin has done the trick.

PS - not sure how anyone accidentally locks their IP out from the Admin - you literally have to try and make such a mistake with this plug-in.
2010-09-21
Reviews: 1
I have by mistake block the administrator login page. How i will fix this? When i type www.site.com/administrator it says "Your IP address has been blocked."....Help!!
Owner's reply

You can rename the file in the file system (/plugins/system/banip.php) or you can edit the database to disable the extension. I suggest renaming the PHP file, logging in and reconfiguring the plugin. I also suggest using JDiagnostic to test prior to enabling the extension.

2 of 2 people found this review helpful
2010-08-10
Reviews: 1
Thanks for a great plugin. I really like the ranging capability. I was having difficulty with a register bot from a particular country and I think this has stopped him cold. I found a great resource for IP's by country that will let you cut and paste multiple blocks into this tool. Check it out: http://www.countryipblocks.net/country-blocks/
2010-07-28
Reviews: 4
Great plugin.It worked in 2 minutes. I think that it would be a nice addon to put a log file so you can monitor if a banned ip is still trying to access the webpage. Great job.
2010-07-26
Reviews: 24
Been looking for something like this for a while.

I have had a few lamers from known ips who have been targeting me lately.

normally I just ban their usernames when I see the familiar IP or the shenanagins on the site.

but this lets me Rick Roll them or send a sweet message while they are logged.

love the redirect...
"life is like a box of tinyurl redirects, you never know what your gonna get"

HA!
5 stars by far!
2010-05-28
Reviews: 6
Had it working in under a minute. Thanks for a gem of a tool to help keep spammers OUT of my website.
2010-03-31
Reviews: 16
Hello, the functionality itself is great. You can add a list of IPs just by copying them into the field.

I have encountered a few disadvantages though, which I would like to see removed in another version:

All the IPs are stored as parameters in the jos_plugins table, which makes the data access slow. This might not be the problem with a few IPs but becomes a tremendous challenge with about 6000 IPs.

Not only is the data field a text field in the jos_plugins table, which cuts all the entries after a specific length, but all the data needs to be retrieved for the plugin to work. (OK, I adjusted the field type manually to longtext to store all the data in the field.)

I suggest that an additional table be inserted into the database, which contains all the IPs. Then it would be one fast query to see, whether an IP is in the table or not. But the user wouldn't have to wait until 6000 or more records are loaded.

Thanks,
Kelley
2010-01-16
Reviews: 1
Works out of the box. Great! It's enabled me to block a spambot's data centre and I look forward to the next attempt to misuse my site :-)
2009-09-28
Reviews: 1
Great tool, works well and easy+fast to install! I recommend to put "link removed" as redirect link! =D
2009-04-02
Reviews: 3
This plug-in is very nice. Save me from editing an htaccess file by allowing me to ban ip's right from in the admin panel.

The only request I would have is that there be a broader range in the octave set rather then simply banning or white listing a C class, have it so that we can ban B and even A classes.

I could give scenarios as to why such an additional function/feature would be needed - helpful - or even wanted...but would save that for the right forum...

All in all a very simple plug-in to install and very easy to use!!! Well done and thank you for building the tool.
Owner's reply

You can put any CIDR formatted range, you could do a /16, a /8 or even if you want something like a /31 and all should be blocked/permitted properly. The /24 is documented because its a popular choice, I might put some other examples up there as well.

2008-12-20
Reviews: 33
Great job Sam! Love the app and thanks for having easy docs explaining the range. Perfect!
1 of 1 people found this review helpful
2008-11-03
Reviews: 2
If you're working on a project that you don't want anyone to see until its finished, this great little extension is simple and easy to use.
My only feature request for the average user would be: upon saving the parameters, if the $_SERVER['REMOTE_ADDR'] == 'ONE OF THE IPS IN THE BLACKLIST' then a message saying 'you are blacklisting' your IP, are you sure you want to do that?'
This would give users who are not database savvy a chance not to lock themselves out of their CMS.

GREAT JOB though Sam!!!
Owner's reply

As this is a plugin there is no way to easily check the values of it when it saves. When I get some time I'm planning on building a component that will have a better user interface and permit extra checks. The plugin will then have the ability to use the component's configuration or stand alone in its own right.

2 of 2 people found this review helpful
2008-08-25
Reviews: 1
simple to use and great plugin
1 of 1 people found this review helpful
2008-07-15
Reviews: 23
I use easybook, but didnt install capcha due to problem with template, so i was getting the normal spammers (viagra etc), hitting my site i had to turn of post live, but then realised its a program to search out these type of programs got tried of deleteing every day in backend.
The guestbook lists the IP address, install ban address end of problem.

Does the job! Thanks
Page 1 of 2