|
Ban IP Address and Range is a small system plugin for Joomla! 1.5 that provides the ability to blacklist (block) IP addresses and ranges or whitelist (block all but those notated). Each entry is specified on its own line and ranges are specified using CIDR formatting (e.g. 192.168.1.0/24). Both administrator and site can be blocked or permitted using different lists or modes.
From version 1.5.3, the plugin has the ability to support comments in the params by prefixing the entries with a hash character (#) at the start of the line.
From version 1.5.2, the plugin has two modes of operation determined by the "Configuration Source" parameter. The first is the mode that uses the IP List for the Site and Administrator from the parameters configured in this screen. In the sample to the left this is the configuration offered. When table mode is selected the banip_entries table
From version 1.5.1, a "redirect location" can be set to send the user to a different location automatically.
In the sample to the left, the site is in blacklist only mode. This means that any access from the IP range listed (172.19.1.0/24) will be blocked with the message "Your IP address has been blocked".
The administrator is in whitelist only mode which means that the user has to come from the IP address 172.19.5.40 or the network 172.19.10/24.
JDiagnostic provides a testing interface to validate IP address combinations prior to applying them enabling you to test if you will be locked out of your site.
Check it out and get the latest version from the extensions site >>>
Note: If you find that you are locked out of your site because of incorrect settings, renaming the /plugins/system/banip.php file to something else (e.g. banip.php.old) will disable this plugin and grant you access to your site again. Remember to rename it back to banip.php after you have fixed your settings to re-enable the plugin.
Table Mode Details
For the table mode, the following table is required:
CREATE TABLE `#__banip_entries` (
`entry` varchar(30) NOT NULL,
`type` INT NOT NULL,
`client` INT NOT NULL,
PRIMARY KEY (`entry`, `type`, `client`)
)
CHARACTER SET utf8
COMMENT = 'Ban IP Address/Range';
The first field has the entry. This is in the same format that each line would be (e.g. 172.168.1.2 or 139.86.0.0/16). The second is an integer flag for the type of entry, 1 for IP address and 2 for ranges. The last is the client which matches the site (0) and administrator (1).
So to block users from the 139.86.0.0/16 subnet from accessing the administrator area the following SQL would be used:
INSERT INTO #__banip_entries VALUES('139.86.0.0/16', 2, 1);
To block a particular problem user from the front end:
INSERT INTO #__banip_entries VALUES('127.0.0.1',1,0);
|