Changeset 1256133
- Timestamp:
- 09/29/2015 10:04:16 PM (11 years ago)
- Location:
- botnet-blocker
- Files:
-
- 1 added
- 5 edited
-
assets/screenshot-1.png (added)
-
trunk/botnet-blocker.php (modified) (5 diffs)
-
trunk/class.bnblocker-admin.php (modified) (1 diff)
-
trunk/class.bnblocker-config.php (modified) (2 diffs)
-
trunk/languages/botnet-blocker-en_US.po (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
botnet-blocker/trunk/botnet-blocker.php
r1256105 r1256133 5 5 Description: Free botnet IP blocker according to public DNSBL bases. Based on public DNSBL class. 6 6 Author: Dennis Wallace 7 Version: 1. 1.07 Version: 1.2.0 8 8 License: GPLv2 or later 9 9 */ … … 137 137 } 138 138 139 // If we have nothing to do, skip the expensive checks. 140 $all_lists = array_merge( $whitelist, $blacklist, $whitelist_dns, $blacklist_dns ); 141 if ( empty( $all_lists ) && ( $this->config->rbl == 'none' ) ) { 142 return $result; 143 } 144 139 145 foreach ( $ips as $ip ) { 140 146 if ( empty( $ip ) ) { … … 142 148 } 143 149 144 if ( $this->netmatch_array( $ip, $skiplist ) ) { 145 continue; 150 if ( ! empty( $skiplist ) ) { 151 if ( $this->netmatch_array( $ip, $skiplist ) ) { 152 continue; 153 } 146 154 } 147 155 148 if ( $this->netmatch_array( $ip, $whitelist ) ) { 149 $whitelisted = true; 150 continue; 156 if ( ! empty( $whitelist ) ) { 157 if ( $this->netmatch_array( $ip, $whitelist ) ) { 158 $whitelisted = true; 159 continue; 160 } 151 161 } 152 162 153 if ( $this->netmatch_array( $ip, $blacklist ) ) { 154 $blacklisted = true; 155 continue; 163 if ( ! empty( $blacklist ) ) { 164 if ( $this->netmatch_array( $ip, $blacklist ) ) { 165 $blacklisted = true; 166 continue; 167 } 156 168 } 157 169 … … 160 172 $dns = gethostbyaddr( $ip ); 161 173 if ( $this->config->debug == 'on' ) { 162 // $dns = 'ec2-54-151-46-163.us-west-1.compute.amazonaws.com'; // for testing only.163 174 header( 'X-BotnetBlocker-Debug-DNSLookup: ' . $dns ); 164 175 } 165 176 if ( ( $dns !== false ) && ( $dns != $ip ) ) { 166 177 // We have a DNS address for the IP. Check it! 167 if ( $this->dnsmatch_array( $dns, $whitelist_dns ) ) { 168 $whitelisted = true; 169 continue; 178 if ( ! empty( $whitelist_dns ) ) { 179 if ( $this->dnsmatch_array( $dns, $whitelist_dns ) ) { 180 $whitelisted = true; 181 continue; 182 } 170 183 } 171 184 172 if ( $this->dnsmatch_array( $dns, $blacklist_dns ) ) { 173 $blacklisted = true; 174 continue; 185 if ( ! empty( $blacklist_dns ) ) { 186 if ( $this->dnsmatch_array( $dns, $blacklist_dns ) ) { 187 $blacklisted = true; 188 continue; 189 } 175 190 } 176 191 } … … 179 194 if ( ( $whitelisted || $blacklisted || $result ) == false ) { 180 195 // Only check for botnet membership if we've not already decided 181 if ( $this->config->dnsbl->CheckSpamIP( $ip ) ) { 182 $result = true; 196 if ( $this->config->rbl != 'none' ) { 197 if ( $this->config->dnsbl->CheckSpamIP( $ip ) ) { 198 $result = true; 199 } 183 200 } 184 201 } -
botnet-blocker/trunk/class.bnblocker-admin.php
r1256105 r1256133 72 72 'type' => 'select', 73 73 'options' => $this->config->get_rbl_list(), 74 'default' => $this->config->dnsbl->GetDefaultChecker()74 'default' => 'none' 75 75 ), 76 76 array( -
botnet-blocker/trunk/class.bnblocker-config.php
r1256105 r1256133 164 164 165 165 $this->dnsbl = new DNSBL(); 166 $default_checker = $this->dnsbl->GetDefaultChecker(); 167 168 $this->rbl = $this->get_option( 'bnblocker_rbl', 'bnblocker_core', $default_checker ); 169 if( $this->rbl != $default_checker ) { 166 $this->rbl = $this->get_option( 'bnblocker_rbl', 'bnblocker_core', 'none' ); 167 if( $this->rbl != 'none' ) { 170 168 $this->dnsbl->SetDefaultChecker( $this->rbl ); 171 169 } … … 176 174 */ 177 175 public function get_rbl_list() { 178 $array = array( 'all' => __( 'All valid blacklists', 'botnet-blocker' ) ); 176 $array = array( 177 'none' => __( 'Ignore all RBLs', 'botnet-blocker' ), 178 'all' => __( 'All valid blacklists', 'botnet-blocker' ), 179 ); 179 180 foreach ( $this->dnsbl->GetCheckers() as $b ) { 180 181 $array[$b] = __( $b, 'botnet-blocker' ); -
botnet-blocker/trunk/languages/botnet-blocker-en_US.po
r1256105 r1256133 90 90 msgstr "Choose File" 91 91 92 msgid "Ignore all RBLs" 93 msgstr "Ignore all RBLs" 94 95 msgid "All valid blacklists" 96 msgstr "All valid blacklists" 97 92 98 #: class.settings-api.php:352 93 99 msgid "spamhaus_xbl" -
botnet-blocker/trunk/readme.txt
r1256105 r1256133 1 1 === Botnet Blocker === 2 Contributors: znaeff, achbed2 Contributors: achbed, znaeff 3 3 Tags: comments, spam, blocking, DNSBL, spamhaus, spamcop, free 4 Requires at least: 4.0.0 4 5 Tested up to: 4.3.1 5 Stable tag: 1.1.0 6 Stable tag: 1.2.0 7 License: GPLv2 6 8 7 Botnet IP checker using public DNSBL bases and a hardcoded whitelist/blacklist.9 Botnet identifier using public DNSBL bases and a hardcoded whitelist/blacklist. 8 10 9 11 == Description == … … 17 19 1. Activate the plugin through the 'Plugins' menu in WordPress 18 20 1. In your template, theme, or plugin, do something similar to the following: 19 ``` 20 <?php 21 22 `<?php 21 23 global $wp_plugin_bnblocker; 22 24 if ( method_exists( $wp_plugin_bnblocker, 'is_botnet' ) ) { … … 25 27 } 26 28 } 27 ?> 28 ``` 29 ?>` 29 30 30 31 == Frequently Asked Questions == … … 34 35 Because I haven't found any decent free plugins that uses spam blocking lists that present a decent API. 35 36 This plugin is designed to give you a quick and easy way to check the spam lists and do something creative 36 without locking you into a "block all" scheme. 37 without locking you into a "block all" scheme. It's there if you want it, but it's not required. 38 39 == Upgrade Notice == 40 41 = 1.2.0 = 42 Allows ignoring all RBLs 43 44 = 1.1.0 = 45 Adds DNS-based lists and an early-load blocking option 37 46 38 47 == Screenshots == 39 48 40 There are no screenshots yet.49 1. The admin interface. 41 50 42 51 == Changelog == 43 52 53 = 1.2.0 = 54 * Added "none" option for the RBLs (so you can use white/black lists but ignore the RBLs) 55 * Added checks to improve performance where possible 56 * Fixed the readme, added screenshot 57 44 58 = 1.1.0 = 45 Added DNS-based white and blacklists as an option46 Added option to block bots during the plugins_loaded timeframe47 Corrected the main blocked() function to use 404 instead of 40648 Reversed order of changelog in the readme59 * Added DNS-based white and blacklists as an option 60 * Added option to block bots during the plugins_loaded timeframe 61 * Corrected the main blocked() function to use 404 instead of 406 62 * Reversed order of changelog in the readme 49 63 50 64 = 1.0.1 = 51 Refactored to allow for support for language packs65 * Refactored to allow for support for language packs 52 66 53 67 = 1.0.0 = 54 Complete refactor of the Plugin 55 Now has an admin section for modifying white/black/skip lists within the UI 56 Allows choosing which RBL in the UI 57 Revised logic to improve speed 58 Now uses CIDR-formatted netmasks for better maintenance 59 BREAKING CHANGE: Global object has been renamed from $BOTNETBLOCKER_OBJ to $wp_plugin_bnblocker 68 * Complete refactor of the Plugin 69 * Now has an admin section for modifying white/black/skip lists within the UI 70 * Allows choosing which RBL in the UI 71 * Revised logic to improve speed 72 * Now uses CIDR-formatted netmasks for better maintenance 73 * Removed hard-coded proxy network lists - use the whitelist instead 74 * BREAKING CHANGE: Global object has been renamed from $BOTNETBLOCKER_OBJ to $wp_plugin_bnblocker 60 75 61 76 = 0.2.0 = 62 Added extensive URL-based debugging and reply headers when in debug mode63 Added a hard coded white/black/skip list system64 Added timing checks for debugging speed issues65 Added Sucuri network addresses to skip list77 * Added extensive URL-based debugging and reply headers when in debug mode 78 * Added a hard coded white/black/skip list system 79 * Added timing checks for debugging speed issues 80 * Added Sucuri network addresses to skip list 66 81 67 82 = 0.1.1 = 68 Fixed issue where DNSBL class used a short opening tag (broke some installations)83 * Fixed issue where DNSBL class used a short opening tag (broke some installations) 69 84 70 85 = 0.1.0 = 71 First version.86 * First version. 72 87
Note: See TracChangeset
for help on using the changeset viewer.