Bad Behavior - Version 2.0.22

Version Description

Download this release

Release Info

Developer error
Plugin Icon wp plugin Bad Behavior
Version 2.0.22
Comparing to
See all releases

Code changes from version 2.0.21 to 2.0.22

README.txt CHANGED
@@ -2,9 +2,9 @@
2
  Tags: comment,trackback,referrer,spam,robot,antispam
3
  Contributors: error, MarkJaquith, Firas, skeltoac
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=error%40ioerror%2eus&item_name=Bad%20Behavior%20%28From%20WordPress%20Page%29&no_shipping=1&cn=Comments%20about%20Bad%20Behavior&tax=0&currency_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8
5
- Requires at least: 2.1
6
  Tested up to: 2.7
7
- Stable tag: 2.0.21
8
 
9
  Welcome to a whole new way of keeping your blog, forum, guestbook, wiki or
10
  content management system free of link spam. Bad Behavior is a PHP-based
@@ -73,6 +73,11 @@ you must remove the old version of Bad Behavior from your system manually
73
  before manually installing the new version. Other platforms are not
74
  affected by this issue.
75
 
 
 
 
 
 
76
  * On WordPress when using WordPress Advanced Cache (WP-Cache) or WP-Super
77
  Cache, Bad Behavior requires a patch to WP-Cache 2 in order to protect
78
  cached pages.
2
  Tags: comment,trackback,referrer,spam,robot,antispam
3
  Contributors: error, MarkJaquith, Firas, skeltoac
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=error%40ioerror%2eus&item_name=Bad%20Behavior%20%28From%20WordPress%20Page%29&no_shipping=1&cn=Comments%20about%20Bad%20Behavior&tax=0&currency_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8
5
+ Requires at least: 1.2
6
  Tested up to: 2.7
7
+ Stable tag: 2.0.22
8
 
9
  Welcome to a whole new way of keeping your blog, forum, guestbook, wiki or
10
  content management system free of link spam. Bad Behavior is a PHP-based
73
  before manually installing the new version. Other platforms are not
74
  affected by this issue.
75
 
76
+ * The basic functionality of Bad Behavior on WordPress requires version 1.2
77
+ or later. The management page for WordPress, which allows browsing Bad
78
+ Behavior's logs, requires version 2.1 or later. Users of older versions should
79
+ use phpMyAdmin to browse Bad Behavior's logs, or upgrade WordPress.
80
+
81
  * On WordPress when using WordPress Advanced Cache (WP-Cache) or WP-Super
82
  Cache, Bad Behavior requires a patch to WP-Cache 2 in order to protect
83
  cached pages.
bad-behavior-wordpress-admin.php CHANGED
@@ -3,6 +3,8 @@
3
  require_once("bad-behavior/responses.inc.php");
4
 
5
  function bb2_admin_pages() {
 
 
6
  if (function_exists('current_user_can')) {
7
  // The new 2.x way
8
  if (current_user_can('manage_options')) {
@@ -18,7 +20,9 @@ function bb2_admin_pages() {
18
 
19
  if ($bb2_is_admin) {
20
  add_options_page(__("Bad Behavior"), __("Bad Behavior"), 8, 'bb2_options', 'bb2_options');
21
- add_management_page(__("Bad Behavior"), __("Bad Behavior"), 8, 'bb2_manage', 'bb2_manage');
 
 
22
  @session_start();
23
  }
24
  }
@@ -162,7 +166,7 @@ Displaying all <strong><?php echo $totalcount; ?></strong> records<br/>
162
  if ($httpbl) echo "<br/><br/>http:BL:<br/>$httpbl\n";
163
  echo "</td>\n";
164
  $headers = str_replace("\n", "<br/>\n", htmlspecialchars($result['http_headers']));
165
- if (strpos($headers, $result['user_agent']) !== FALSE) $headers = substr_replace($headers, "<a href=\"" . add_query_arg("user_agent", rawurlencode($result["user_agent"]), remove_query_arg("paged", $request_uri)) . "\">" . $result['user_agent'] . "</a>", strpos($headers, $result['user_agent']), strlen($result['user_agent']));
166
  if (strpos($headers, $result['request_method']) !== FALSE) $headers = substr_replace($headers, "<a href=\"" . add_query_arg("request_method", rawurlencode($result["request_method"]), remove_query_arg("paged", $request_uri)) . "\">" . $result['request_method'] . "</a>", strpos($headers, $result['request_method']), strlen($result['request_method']));
167
  echo "<td>$headers</td>\n";
168
  echo "<td>" . str_replace("\n", "<br/>\n", htmlspecialchars($result["request_entity"])) . "</td>\n";
3
  require_once("bad-behavior/responses.inc.php");
4
 
5
  function bb2_admin_pages() {
6
+ global $wp_db_version;
7
+
8
  if (function_exists('current_user_can')) {
9
  // The new 2.x way
10
  if (current_user_can('manage_options')) {
20
 
21
  if ($bb2_is_admin) {
22
  add_options_page(__("Bad Behavior"), __("Bad Behavior"), 8, 'bb2_options', 'bb2_options');
23
+ if ($wp_db_version >= 4772) { // Version 2.1 or later
24
+ add_management_page(__("Bad Behavior"), __("Bad Behavior"), 8, 'bb2_manage', 'bb2_manage');
25
+ }
26
  @session_start();
27
  }
28
  }
166
  if ($httpbl) echo "<br/><br/>http:BL:<br/>$httpbl\n";
167
  echo "</td>\n";
168
  $headers = str_replace("\n", "<br/>\n", htmlspecialchars($result['http_headers']));
169
+ if (@strpos($headers, $result['user_agent']) !== FALSE) $headers = substr_replace($headers, "<a href=\"" . add_query_arg("user_agent", rawurlencode($result["user_agent"]), remove_query_arg("paged", $request_uri)) . "\">" . $result['user_agent'] . "</a>", strpos($headers, $result['user_agent']), strlen($result['user_agent']));
170
  if (strpos($headers, $result['request_method']) !== FALSE) $headers = substr_replace($headers, "<a href=\"" . add_query_arg("request_method", rawurlencode($result["request_method"]), remove_query_arg("paged", $request_uri)) . "\">" . $result['request_method'] . "</a>", strpos($headers, $result['request_method']), strlen($result['request_method']));
171
  echo "<td>$headers</td>\n";
172
  echo "<td>" . str_replace("\n", "<br/>\n", htmlspecialchars($result["request_entity"])) . "</td>\n";
bad-behavior-wordpress.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Bad Behavior
4
- Version: 2.0.21
5
  Description: Deny automated spambots access to your PHP-based Web site.
6
  Plugin URI: http://www.bad-behavior.ioerror.us/
7
  Author: Michael Hampton
1
  <?php
2
  /*
3
  Plugin Name: Bad Behavior
4
+ Version: 2.0.22
5
  Description: Deny automated spambots access to your PHP-based Web site.
6
  Plugin URI: http://www.bad-behavior.ioerror.us/
7
  Author: Michael Hampton
bad-behavior/blacklist.inc.php CHANGED
@@ -21,6 +21,7 @@ function bb2_blacklist($package) {
21
  "grub crawler", // misc comment/email spam
22
  "HttpProxy", // misc comment/email spam
23
  "Internet Explorer", // XMLRPC exploits seen
 
24
  "Jakarta Commons", // custommised spambots
25
  "Java 1.", // definitely a spammer
26
  "Java/1.", // definitely a spammer
21
  "grub crawler", // misc comment/email spam
22
  "HttpProxy", // misc comment/email spam
23
  "Internet Explorer", // XMLRPC exploits seen
24
+ "ISC Systems iRc", // spam harvester
25
  "Jakarta Commons", // custommised spambots
26
  "Java 1.", // definitely a spammer
27
  "Java/1.", // definitely a spammer
bad-behavior/common_tests.inc.php CHANGED
@@ -24,7 +24,7 @@ function bb2_cookies($settings, $package)
24
  {
25
  // Enforce RFC 2965 sec 3.3.5 and 9.1
26
  // Bots wanting new-style cookies should send Cookie2
27
- if (strpos($package['headers_mixed']['Cookie'], '$Version=0') !== FALSE && !array_key_exists($package['headers_mixed']['Cookie2'])) {
28
  return '6c502ff1';
29
  }
30
  return false;
24
  {
25
  // Enforce RFC 2965 sec 3.3.5 and 9.1
26
  // Bots wanting new-style cookies should send Cookie2
27
+ if (strpos($package['headers_mixed']['Cookie'], '$Version=0') !== FALSE && !array_key_exists('Cookie2', $package['headers_mixed'])) {
28
  return '6c502ff1';
29
  }
30
  return false;
bad-behavior/post.inc.php CHANGED
@@ -30,7 +30,7 @@ function bb2_post($settings, $package)
30
  }
31
 
32
  // If Referer exists, it should refer to a page on our site
33
- if (array_key_exists($package['headers_mixed']['Referer']) && stripos($package['headers_mixed']['Referer'], $package['headers_mixed']['Host']) === FALSE) {
34
  return "cd361abb";
35
  }
36
 
30
  }
31
 
32
  // If Referer exists, it should refer to a page on our site
33
+ if (array_key_exists('Referer', $package['headers_mixed']) && stripos($package['headers_mixed']['Referer'], $package['headers_mixed']['Host']) === FALSE) {
34
  return "cd361abb";
35
  }
36
 
bad-behavior/version.inc.php CHANGED
@@ -1,3 +1,3 @@
1
  <?php if (!defined('BB2_CWD')) die("I said no cheating!");
2
- define('BB2_VERSION', "2.0.21");
3
  ?>
1
  <?php if (!defined('BB2_CWD')) die("I said no cheating!");
2
+ define('BB2_VERSION', "2.0.22");
3
  ?>