<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>version.php</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -2,9 +2,9 @@
 Tags: comment,trackback,referrer,spam,robot,antispam
 Contributors: error, MarkJaquith, Firas, skeltoac
 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=error%40ioerror%2eus&amp;item_name=Bad%20Behavior%20%28From%20WordPress%20Page%29&amp;no_shipping=1&amp;cn=Comments%20about%20Bad%20Behavior&amp;tax=0&amp;currency_code=USD&amp;bn=PP%2dDonationsBF&amp;charset=UTF%2d8
-Requires at least: 1.5
-Tested up to: 2.6
-Stable tag: 2.0.20
+Requires at least: 2.1
+Tested up to: 2.7
+Stable tag: 2.0.21
 
 Welcome to a whole new way of keeping your blog, forum, guestbook, wiki or
 content management system free of link spam. Bad Behavior is a PHP-based
@@ -68,6 +68,11 @@ http://www.bad-behavior.ioerror.us/
 
 * Bad Behavior may be unable to protect cached pages on MediaWiki.
 
+* When upgrading from version 2.0.19 or prior on MediaWiki and WordPress,
+you must remove the old version of Bad Behavior from your system manually
+before manually installing the new version. Other platforms are not
+affected by this issue.
+
 * On WordPress when using WordPress Advanced Cache (WP-Cache) or WP-Super
 Cache, Bad Behavior requires a patch to WP-Cache 2 in order to protect
 cached pages.</diff>
      <filename>Bad-Behavior/README.txt</filename>
    </modified>
    <modified>
      <diff>@@ -37,7 +37,10 @@ $bb2_settings_defaults = array(
 	'display_stats' =&gt; true,
 	'strict' =&gt; false,
 	'verbose' =&gt; false,
-	'logging' =&gt; true
+	'logging' =&gt; true,
+	'httpbl_key' =&gt; '',
+	'httpbl_threat' =&gt; '25',
+	'httpbl_maxage' =&gt; '30',
 );
 
 // Bad Behavior callback functions.</diff>
      <filename>Bad-Behavior/bad-behavior-generic.php</filename>
    </modified>
    <modified>
      <diff>@@ -34,4 +34,18 @@ function bb2_blackhole($package) {
 	}
 	return false;
 }
+
+function bb2_httpbl($settings, $package) {
+	if (!$settings['httpbl_key']) return false;
+
+	$find = implode('.', array_reverse(explode('.', $package['ip'])));
+	$result = gethostbynamel($settings['httpbl_key'].&quot;.${find}.dnsbl.httpbl.org.&quot;);
+	if (!empty($result)) {
+		$ip = explode('.', $result[0]);
+		if ($ip[0] == 127 &amp;&amp; ($ip[3] &amp; 7) &amp;&amp; $ip[2] &gt;= $settings['httpbl_threat'] &amp;&amp; $ip[1] &gt;= $settings['httpbl_maxage']) {
+			return '2b021b1f';
+		}
+	}
+	return false;
+}
 ?&gt;</diff>
      <filename>Bad-Behavior/bad-behavior/blackhole.inc.php</filename>
    </modified>
    <modified>
      <diff>@@ -10,10 +10,12 @@ function bb2_blacklist($package) {
 		&quot;adwords&quot;,		// referrer spam
 		&quot;autoemailspider&quot;,	// spam harvester
 		&quot;blogsearchbot-martin&quot;,	// from honeypot
+		&quot;CherryPicker&quot;,		// spam harvester
+		&quot;core-project/&quot;,	// FrontPage extension exploits
+		&quot;Diamond&quot;,		// delivers spyware/adware
 		&quot;Digger&quot;,		// spam harvester
 		&quot;ecollector&quot;,		// spam harvester
 		&quot;EmailCollector&quot;,	// spam harvester
-		&quot;Email Extractor&quot;,	// spam harvester
 		&quot;Email Siphon&quot;,		// spam harvester
 		&quot;EmailSiphon&quot;,		// spam harvester
 		&quot;grub crawler&quot;,		// misc comment/email spam
@@ -26,7 +28,7 @@ function bb2_blacklist($package) {
 		&quot;LWP&quot;,			// spambot scripts
 		&quot;Microsoft URL&quot;,	// spam harvester
 		&quot;Missigua&quot;,		// spam harvester
-		&quot;MJ12bot&quot;,		// crawls MUCH too fast
+		&quot;MJ12bot/v1.0.8&quot;,	// malicious botnet
 		&quot;Movable Type&quot;,		// customised spambots
 		&quot;Mozilla &quot;,		// malicious software
 		&quot;Mozilla/4.0(&quot;,		// from honeypot
@@ -40,6 +42,7 @@ function bb2_blacklist($package) {
 		&quot;PycURL&quot;,		// misc comment spam
 //		&quot;Shockwave Flash&quot;,	// spam harvester
 //		WP 2.5 now has Flash; FIXME
+		&quot;Super Happy Fun &quot;,	// spam harvester
 		&quot;TrackBack/&quot;,		// trackback spam
 		&quot;user&quot;,			// suspicious harvester
 		&quot;User Agent: &quot;,		// spam harvester
@@ -58,6 +61,7 @@ function bb2_blacklist($package) {
 		&quot;compatible ; MSIE&quot;,	// misc comment/email spam
 		&quot;compatible-&quot;,		// misc comment/email spam
 		&quot;DTS Agent&quot;,		// misc comment/email spam
+		&quot;Email Extractor&quot;,	// spam harvester
 		&quot;Gecko/25&quot;,		// revisit this in 500 years
 		&quot;grub-client&quot;,		// search engine ignores robots.txt
 		&quot;hanzoweb&quot;,		// very badly behaved crawler
@@ -74,6 +78,7 @@ function bb2_blacklist($package) {
 		&quot;Windows NT 5.0;)&quot;,	// wikispam bot
 		&quot;Windows NT 5.1;)&quot;,	// wikispam bot
 		&quot;Windows XP 5&quot;,		// spam harvester
+		&quot;WordPress/4.01&quot;,	// pingback spam
 		&quot;\\\\)&quot;,		// spam harvester
 	);
 </diff>
      <filename>Bad-Behavior/bad-behavior/blacklist.inc.php</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,16 @@ function bb2_protocol($settings, $package)
 	return false;
 }
 
+function bb2_cookies($settings, $package)
+{
+	// Enforce RFC 2965 sec 3.3.5 and 9.1
+	// Bots wanting new-style cookies should send Cookie2
+	if (strpos($package['headers_mixed']['Cookie'], '$Version=0') !== FALSE &amp;&amp; !array_key_exists($package['headers_mixed']['Cookie2'])) {
+		return '6c502ff1';
+	}
+	return false;
+}
+
 function bb2_misc_headers($settings, $package)
 {
 	$ua = $package['headers_mixed']['User-Agent'];
@@ -116,9 +126,10 @@ function bb2_misc_headers($settings, $package)
 	}
 	
 	// &quot;uk&quot; is not a language (ISO 639) nor a country (ISO 3166)
-	if (preg_match('/\buk\b/', $package['headers_mixed']['Accept-Language'])) {
-		return &quot;35ea7ffa&quot;;
-	}
+	// oops, yes it is :( Please shoot any Ukrainian spammers you see.
+#	if (preg_match('/\buk\b/', $package['headers_mixed']['Accept-Language'])) {
+#		return &quot;35ea7ffa&quot;;
+#	}
 
 	return false;
 }</diff>
      <filename>Bad-Behavior/bad-behavior/common_tests.inc.php</filename>
    </modified>
    <modified>
      <diff>@@ -137,9 +137,14 @@ function bb2_start($settings)
 		require_once(BB2_CORE . &quot;/blacklist.inc.php&quot;);
 		bb2_test($settings, $package, bb2_blacklist($package));
 
+		// Check the http:BL
+		require_once(BB2_CORE . &quot;/blackhole.inc.php&quot;);
+		bb2_test($settings, $package, bb2_httpbl($settings, $package));
+
 		// Check for common stuff
 		require_once(BB2_CORE . &quot;/common_tests.inc.php&quot;);
 		bb2_test($settings, $package, bb2_protocol($settings, $package));
+		bb2_test($settings, $package, bb2_cookies($settings, $package));
 		bb2_test($settings, $package, bb2_misc_headers($settings, $package));
 
 		// Specific checks</diff>
      <filename>Bad-Behavior/bad-behavior/core.inc.php</filename>
    </modified>
    <modified>
      <diff>@@ -24,11 +24,16 @@ function bb2_post($settings, $package)
 	// Catch a few completely broken spambots
 	foreach ($request_entity as $key =&gt; $value) {
 		$pos = strpos($key, &quot;	document.write&quot;);
-		if ($pos !== FAlSE) {
+		if ($pos !== FALSE) {
 			return &quot;dfd9b1ad&quot;;
 		}
 	}
 
+	// If Referer exists, it should refer to a page on our site
+	if (array_key_exists($package['headers_mixed']['Referer']) &amp;&amp; stripos($package['headers_mixed']['Referer'], $package['headers_mixed']['Host']) === FALSE) {
+		return &quot;cd361abb&quot;;
+	}
+
 	// Screen by cookie/JavaScript form add
 	if (isset($_COOKIE[BB2_COOKIE])) {
 		$screener1 = explode(&quot; &quot;, $_COOKIE[BB2_COOKIE]);</diff>
      <filename>Bad-Behavior/bad-behavior/post.inc.php</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,7 @@ function bb2_get_response($key) {
 		'17566707' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'An invalid request was received from your browser. This may be caused by a malfunctioning proxy server or browser privacy software.', 'log' =&gt; 'Required header \'Accept\' missing'),
 		'17f4e8c8' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'You do not have permission to access this server.', 'log' =&gt; 'User-Agent was found on blacklist'),
 		'21f11d3f' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'An invalid request was received. You claimed to be a mobile Web device, but you do not actually appear to be a mobile Web device.', 'log' =&gt; 'User-Agent claimed to be AvantGo, claim appears false'),
+		'2b021b1f' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'You do not have permission to access this server. Before trying again, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.', 'log' =&gt; 'IP address found on http:BL blacklist'),
 		'2b90f772' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'You do not have permission to access this server. If you are using the Opera browser, then Opera must appear in your user agent.', 'log' =&gt; 'Connection: TE present, not supported by MSIE'),
 		'35ea7ffa' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'You do not have permission to access this server. Check your browser\'s language and locale settings.', 'log' =&gt; 'Invalid language specified'),
 		'408d7e72' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'You do not have permission to access this server. Before trying again, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.', 'log' =&gt; 'POST comes too quickly after GET'),
@@ -17,6 +18,7 @@ function bb2_get_response($key) {
 		'57796684' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'You do not have permission to access this server. Before trying again, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.', 'log' =&gt; 'Prohibited header \'X-Aaaaaaaaaa\' or \'X-Aaaaaaaaaaaa\' present'),
 		'582ec5e4' =&gt; array('response' =&gt; 400, 'explanation' =&gt; 'An invalid request was received. If you are using a proxy server, bypass the proxy server or contact your proxy server administrator. This may also be caused by a bug in the Opera web browser.', 'log' =&gt; '&quot;Header \'TE\' present but TE not specified in \'Connection\' header'),
 		'69920ee5' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'An invalid request was received from your browser. This may be caused by a malfunctioning proxy server or browser privacy software.', 'log' =&gt; 'Header \'Referer\' present but blank'),
+		'6c502ff1' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'You do not have permission to access this server.', 'log' =&gt; 'Bot not fully compliant with RFC 2965'),
 		'799165c2' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'You do not have permission to access this server.', 'log' =&gt; 'Rotating user-agents detected'),
 		'7a06532b' =&gt; array('response' =&gt; 400, 'explanation' =&gt; 'An invalid request was received from your browser. This may be caused by a malfunctioning proxy server or browser privacy software.', 'log' =&gt; 'Required header \'Accept-Encoding\' missing'),
 		'7ad04a8a' =&gt; array('response' =&gt; 400, 'explanation' =&gt; 'The automated program you are using is not permitted to access this server. Please use a different program or a standard Web browser.', 'log' =&gt; 'Prohibited header \'Range\' present'),
@@ -30,6 +32,7 @@ function bb2_get_response($key) {
 		'b7830251' =&gt; array('response' =&gt; 400, 'explanation' =&gt; 'Your proxy server sent an invalid request. Please contact the proxy server administrator to have this problem fixed.', 'log' =&gt; 'Prohibited header \'Proxy-Connection\' present'),
 		'b9cc1d86' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'The proxy server you are using is not permitted to access this server. Please bypass the proxy server, or contact your proxy server administrator.', 'log' =&gt; 'Prohibited header \'X-Aaaaaaaaaa\' or \'X-Aaaaaaaaaaaa\' present'),
 		'c1fa729b' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'You do not have permission to access this server. Before trying again, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.', 'log' =&gt; 'Use of rotating proxy servers detected'),
+		'cd361abb' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'You do not have permission to access this server. Data may not be posted from offsite forms.', 'log' =&gt; 'Referer did not point to a form on this site'),
 		'd60b87c7' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'You do not have permission to access this server. Before trying again, please remove any viruses or spyware from your computer.', 'log' =&gt; 'Trackback received via proxy server'),
 		'dfd9b1ad' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'You do not have permission to access this server.', 'log' =&gt; 'Request contained a malicious JavaScript or SQL injection attack'),
 		'e4de0453' =&gt; array('response' =&gt; 403, 'explanation' =&gt; 'An invalid request was received. You claimed to be a major search engine, but you do not appear to actually be a major search engine.', 'log' =&gt; 'User-Agent claimed to be msnbot, claim appears to be false'),</diff>
      <filename>Bad-Behavior/bad-behavior/responses.inc.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,3 @@
 &lt;?php if (!defined('BB2_CWD')) die(&quot;I said no cheating!&quot;);
-define('BB2_VERSION', &quot;2.0.20&quot;);
+define('BB2_VERSION', &quot;2.0.21&quot;);
 ?&gt;</diff>
      <filename>Bad-Behavior/bad-behavior/version.inc.php</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,14 @@ CHANGELOG
 ================================================================================
 
 --------------------------------------------------------------------------------
-2008-01-28  -  v0.3
+2008-08-05  -  v0.4
+--------------------------------------------------------------------------------
+* Update Bad-Behavior to v2.0.21
+* Fixed CHANGELOG dates in release v0.3
+* Add version.php
+
+--------------------------------------------------------------------------------
+2008-08-02  -  v0.3
 --------------------------------------------------------------------------------
 * Update Bad-Behavior to v2.0.20
 </diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -18,10 +18,12 @@
 
 if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
 
-$name='CPG-BadBehavior Plugin';
-$description='Get out spammers of you gallery using project Bad-Behavior v2.0.20.';
-$author='Mario Oyorzabal Salgado';
-$version='0.1';
+include &quot;version.php&quot;;
+
+$name = 'CPG-BadBehavior Plugin';
+$description = 'Get out spammers of you gallery using project Bad-Behavior v' . CPG_BADBEHAVIOR_VERSION_CORE;
+$author = 'Mario Oyorzabal Salgado';
+$version = CPG_BADBEHAVIOR_VERSION;
 
 /*
  * $extra_info is displayed with the title of a plugin that is NOT installed and</diff>
      <filename>configuration.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>69b88d30471a45e6bd3235a79b99a4ede0b4b85f</id>
    </parent>
  </parents>
  <author>
    <name>Mario Oyorzabal Salgado</name>
    <email>tuxsoul@tuxsoul.com</email>
  </author>
  <url>http://github.com/tuxsoul/cpg-badbehavior/commit/5d730bf75684520a2aaea7df51b1d56766f92045</url>
  <id>5d730bf75684520a2aaea7df51b1d56766f92045</id>
  <committed-date>2008-08-05T20:27:50-07:00</committed-date>
  <authored-date>2008-08-05T20:27:50-07:00</authored-date>
  <message>Update to v0.4, minor changes.

Signed-off-by: Mario Oyorzabal Salgado &lt;tuxsoul@tuxsoul.com&gt;</message>
  <tree>743153277f3c50b8f76d64271d1dff5d5ef70445</tree>
  <committer>
    <name>Mario Oyorzabal Salgado</name>
    <email>tuxsoul@tuxsoul.com</email>
  </committer>
</commit>
