<?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>insanesecurity &#187; Discussion</title>
	<atom:link href="http://insanesecurity.info/blog/category/discussion/feed" rel="self" type="application/rss+xml" />
	<link>http://insanesecurity.info/blog</link>
	<description>security through a distorted eye</description>
	<lastBuildDate>Thu, 25 Feb 2010 22:31:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>This is got to be a joke</title>
		<link>http://insanesecurity.info/blog/this-is-got-to-be-a-joke</link>
		<comments>http://insanesecurity.info/blog/this-is-got-to-be-a-joke#comments</comments>
		<pubDate>Mon, 28 Sep 2009 05:14:32 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Discussion]]></category>
		<category><![CDATA[Fun]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=281</guid>
		<description><![CDATA[Yesterday I have read a funny article on techtarget. Funny from my perspective, because the author seemed to be real serious about the subject. In a few words the author suggest webmasters to use the html encrypter (it is actually an encoder) as an &#8220;effective deterrent&#8221;. Like people would really sacrifice the possibly index-able content [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I have read a <a href="http://itknowledgeexchange.techtarget.com/security-corner/protect-html-code-for-increased-security/">funny article on techtarget</a>.</p>
<p>Funny from my perspective, because the author seemed to be real serious about the subject. In a few words the author suggest webmasters to use the <a href="http://www.iwebtool.com/html_encrypter">html encrypter</a> (it is actually an encoder) as an &#8220;effective deterrent&#8221;.</p>
<p>Like people would really sacrifice the possibly index-able content and accessibility for a false sense of security&#8230; come on, it must be a joke.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/this-is-got-to-be-a-joke/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ImageShack was hacked&#8230;</title>
		<link>http://insanesecurity.info/blog/imageshack-was-hacked</link>
		<comments>http://insanesecurity.info/blog/imageshack-was-hacked#comments</comments>
		<pubDate>Sat, 11 Jul 2009 12:08:04 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Discussion]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Anti-sec]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=214</guid>
		<description><![CDATA[As some of you may have noticed, news about ImageShack being hacked has started to circulate today. While I tried to see this for myself, part of the damage has been fixed; I say part because the ImageShack blog still throws database connection errors&#8230; Even if this may have been worse for users who store [...]]]></description>
			<content:encoded><![CDATA[<p>As some of you may have noticed, news about <a href="http://imageshack.us">ImageShack</a> being hacked has started to circulate today. While I tried to see this for myself, part of the damage has been fixed; I say part because the <a href="http://blog.imageshack.us/">ImageShack blog</a> still throws database connection errors&#8230;</p>
<p>Even if this may have been worse for users who store their images there (myself included), there is more to it than meets the eye.<br />
<span id="more-214"></span><br />
Like the attack on <a href="http://www.cgisecurity.com/2009/06/astalavistacom-hacked.html">Astalavista</a>, this one was also performed by the anti-sec group (groups, there could be more) and only makes me think there will be more attacks.</p>
<p>The message which was present on ImageShack&#8217;s website after the attack.<br />
<img src="http://insanesecurity.info/blog/wp-content/uploads/imageshack_hacked.gif" width="500" /></p>
<p>As you may have read their manifesto, hacking ImageShack does not conform to their goal&#8230;</p>
<blockquote><p>
How do we plan to achieve this? Through the full and unrelenting, unmerciful elimination of all supporters of full-disclosure and the security industry in its present form. If you own a security blog, an exploit publication website or you distribute any exploits&#8230;
</p></blockquote>
<p>Furthermore, they don&#8217;t see the irony of their actions. The more they are going to hack security unrelated websites (like ImageShack) the more are they going to spread FUD. And it&#8217;s needles to say that more FUD equals more work for the whitehats that they so much despise.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script><br />
And they are good at spreading FUD! After the <a href="http://zone-h.org/mirror/id/8961233">Astalavista hack</a> OpenSSH exploit FUD <a href="http://news.softpedia.com/news/New-OpenSSH-Exploit-Possibly-Used-in-the-Wild-116247.shtml">spread online</a> like plague.</p>
<p>The only way I would go about vulnerability disclosure would be trough responsible one&#8230; Mentioning that I would be responsible only if the given vulnerability could affect me; otherwise I wouldn&#8217;t really care&#8230; that&#8217;s just me.</p>
<p>Even with all that said, there is one common ground where I can relay with them, concerning PoC code that script kiddies copy-pasta for mass sploitation&#8230; PoC should be only left for innovative/new techniques and not for every *dangerous* exploit out there.</p>
<p>Like any online movement it has it&#8217;s pros and cons; some didn&#8217;t/don&#8217;t understand the: VX, Zeitgeist, Anonymous (it is a movement, sort of) or any other movement; so why understand the Anti-sec one, right?</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/imageshack-was-hacked/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Regain your privacy and anonymity</title>
		<link>http://insanesecurity.info/blog/regain-your-privacy-and-anonymity</link>
		<comments>http://insanesecurity.info/blog/regain-your-privacy-and-anonymity#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:31:06 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Discussion]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Anonymity]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=58</guid>
		<description><![CDATA[Hopefully as you may have noticed, on a daily basis more and more of our (users) privacy is stripped shamelessly away by almost every website out there. And so you don&#8217;t think I am speaking in a hypocritical manner, I admit I strip as well a part from your privacy, with the simple Google tracker [...]]]></description>
			<content:encoded><![CDATA[<p>Hopefully as you may have noticed, on a daily basis more and more of our (users) privacy is stripped shamelessly away by almost every website out there.</p>
<p>And so you don&#8217;t think I am speaking in a hypocritical manner, I admit I strip as well a part from your privacy, with the simple Google tracker I have inside my web pages&#8230; but for those that do care about their anonymity this is not an issue.
</p>
<p><span id="more-58"></span></p>
<h2><a href="http://www.torproject.org">Tor</a></h2>
<p>As any other person would say, as a first step in regaining your anonymity would be installing the Tor bundle&#8230; And don&#8217;t get me that &#8220;just hackers use proxies&#8221;, because it&#8217;s not true&#8230; who would use a proxy for a <a href="http://www.liquidmatrix.org/blog/2009/04/14/commit-crime-with-a-proxy-get-25-more-buh-bye/">%25 bonus prison time if caught</a>? (they would use their own tunnels and proxies, not Tor networks)</p>
<p>There are many reasons why you would use a proxy, apart from the list which you can read on Tor projects website &#8220;<a href="http://www.torproject.org/torusers.html.en">Who uses Tor?</a>&#8220;, what better way to hide your ass when trolling people?</p>
<p>Use Tor, if possible even help out by setting up a node, and be happy of it&#8217;s extra anonymity (which I cannot have).<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<h2><a href="http://www.scroogle.org">Scroogle</a></h2>
<p>Well, in case you are a Google user I hope you know that every search you ever do is logged&#8230; If you have a Google account you may check your whole search history <a href="http://www.google.com/history">here</a>. Now you may see where Scroogle would come in pretty handy. It also comes with SSL support, so it also adds a part of privacy to it: <a href="https://ssl.scroogle.org">ssl.scroogle.org</a>.</p>
<p>In simple terms Scroogle does the search on Google for you, drops the cookie that Google tries to attach to your browser and prints you the output of the search.</p>
<h2><a href="http://www.bugmenot.com">BugMeNot</a></h2>
<p>Often enough websites ask you for a user account in your attempt to access their content, even if it&#8217;s going to be your first (and last) visit on their page. Well through <a href="http://www.bugmenot.com">BugMeNot</a> you can bypass that compulsory registration process.  <a href="http://www.bugmenot.com/faq.php#03">Why not just register?</a><br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<h2><a href="http://mailinator.com">Mailinator</a></h2>
<p>In case BugMeNot didn&#8217;t have the answer for the problem (as in bypassing compulsory registration), you can quickly set up your account without having to fear spam later on. <a href="http://mailinator.com">Mailinator</a> offers you a easy one step temporary email address for any occasion, at any time you may need it.</p>
<h2><a href="http://www.gnupg.org/">GPG</a></h2>
<blockquote><p><a href="http://www.gnupg.org/">GnuPG</a> is the GNU project&#8217;s complete and free implementation of the OpenPGP standard as defined by RFC4880 . GnuPG allows to encrypt and sign your data and communication (&#8230;)</p>
</blockquote>
<p>Using PGP encryption has many benefits, given the amount of tools built upon it.<br />
For the browser (Firefox) you got <a href="http://getfiregpg.org/">FireGPG</a> which let&#8217;s you sign, verify, encrypt and decrypt anything that you can select in your browser, this even includes email, posts and so fort. It also comes with implementation for Gmail.</p>
<h2>Firefox addons</h2>
<p>There are two addons which I know help in providing anonymity.</p>
<p>One would be <a href="https://addons.mozilla.org/en-US/firefox/addon/722">NoScript</a>, which I use to block trackers (like Google Analytics), but this is just a bonus for the main reason I use it, and I mean security.</p>
<p>The second one is <a href="https://addons.mozilla.org/en-US/firefox/addon/9727">RequestPolicy</a>, which if even would look very similar to NoScript there is a finely grained difference them. I personally use both of them, and do recommend the same if you got the patience to whitelist websites you visit.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<h2>IM Encryption</h2>
<p>The modern use of the internet is highly oriented on instant messaging, so this area of privacy should be taken care of with more interest than any other before told privacy measure.</p>
<p>For example the IM client <a href="http://pidgin.im">Pidgin</a> has a few <a href="http://developer.pidgin.im/wiki/ThirdPartyPlugins#SecurityandPrivacy">privacy and security plugins</a> from which you may choose.</p>
<p>As for IM clients like MSN and Yahoo! you may download (and use) <a href="http://www.bitdefender.com/PRODUCT-2236-en--BitDefender-Chat-Encryption.html">BitDefender Chat Encryption</a> for free.</p>
<h2>More suggestions?</h2>
<p>If there is something that you think I missed out (as in privacy and anonymity for internet users) feel free to contribute, even with alternatives for the before mentioned ones.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/regain-your-privacy-and-anonymity/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Firefox without NoScript</title>
		<link>http://insanesecurity.info/blog/firefox-without-noscript</link>
		<comments>http://insanesecurity.info/blog/firefox-without-noscript#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:27:11 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Discussion]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=54</guid>
		<description><![CDATA[That&#8217;s what many NoScript users have claimed of doing after the recent debate about NoScript circumventing ADBlockPlus for displaying the ads from its own page. One question I kept asking myself: Are these really noscript users? Before I would go further with that I should state that I appreciate very much both Firefox addons. Couldn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>That&#8217;s what many <em>NoScript</em> users have claimed of doing after the recent debate about <a href="http://adblockplus.org/blog/attention-noscript-users"><em>NoScript</em> <strong>circumventing</strong> <em>ADBlockPlus</em> for displaying the ads from its own page</a>. One question I kept asking myself: <q>Are these really noscript users?</q></p>
<p><span id="more-54"></span></p>
<p>Before I would go further with that I should state that I appreciate very much both Firefox addons. Couldn&#8217;t imagine browsing without the two of them. And this is the reason why I&#8217;ve put up that question, because once accustomed to both of these addons you just can&#8217;t go back to old fashion browsing.</p>
<p>It&#8217;s one thing that some didn&#8217;t knew how to use <em>NoScript</em> or didn&#8217;t fully understand it&#8217;s potential, and gone to use <em>YesScript</em> instead, which just made me crack.</p>
<p>And while both sides were right, I think it all started due to a misinformation or lack of it thereof. In <em>NoScript</em>&#8217;s FAQ it was stated that version 1.9.2.4 white listed Giorgio Maones domains in <em>AdBlockPlus</em>.</p>
<p>Some people probably started to fork <em>NoScript</em>, but that for another time, when we will have something that could reach the same level of protection which <em>NoScript</em> brought.</p>
<p><strong>Update:</strong> NoScript&#8217;s author <a href="http://hackademix.net/2009/05/04/dear-adblock-plus-and-noscript-users-dear-mozilla-community/">reply on the matter</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/firefox-without-noscript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Purplehats</title>
		<link>http://insanesecurity.info/blog/purplehats</link>
		<comments>http://insanesecurity.info/blog/purplehats#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:26:09 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Discussion]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=52</guid>
		<description><![CDATA[I can&#8217;t understand all the fighting about blackhats, whitehats, grayhats or any other color for that matter. Hackers have no color. Hackers have no creed. Hackers have no ethics. Hackers have free will. Hackers make things work. Hackers can handle any situation, with almost any tool (MacGuyver type of person), in almost every field&#8230; Hackers [...]]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t understand all the fighting about blackhats, whitehats, grayhats or any other color for that matter.</p>
<p>Hackers have no color.<br />
Hackers have no creed.<br />
Hackers have no ethics.<br />
Hackers have free will.<br />
Hackers make things work.</p>
<p>Hackers can handle any situation, with almost any tool (MacGuyver type of person), in almost every field&#8230;</p>
<p>Hackers do it for <big>FUN</big> <small>and profit</small>. Not vice-versa&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/purplehats/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Should I Trust You?</title>
		<link>http://insanesecurity.info/blog/should-i-trust-you</link>
		<comments>http://insanesecurity.info/blog/should-i-trust-you#comments</comments>
		<pubDate>Wed, 24 Jun 2009 06:18:00 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Discussion]]></category>
		<category><![CDATA[AV]]></category>
		<category><![CDATA[SQL Injection]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/should-i-trust-you</guid>
		<description><![CDATA[I think that everyone has heard of the recent &#8220;hacking series&#8221; against major antivirus companies. After the recent SQL injections in Kaspersky, BitDefender (here and here) and F-Secure the regular user might wonder in which company should they still trust. The anwser isn&#8217;t that simple. Based on the amount of data that could have been [...]]]></description>
			<content:encoded><![CDATA[<p>I think that everyone has heard of the recent &#8220;hacking series&#8221; against major antivirus companies. After the recent SQL injections in <a href="http://hackersblog.org/2009/02/07/usakasperskycom-hacked-full-database-acces-sql-injection/">Kaspersky</a>, BitDefender (<a href="http://hackersblog.org/2009/02/09/hackedbitdefender-portugal-exposes-sensitive-customer-data/">here </a>and <a href="http://hackersblog.org/2009/02/15/in-atentia-bitdefender/">here</a>) and <a href="http://hackersblog.org/2009/02/11/f-securecom-sql-injection-cross-site-scripting/">F-Secure</a> the regular user might wonder in which company should they still trust.</p>
<p><span id="more-46"></span><br />
The anwser isn&#8217;t that simple. Based on the amount of data that could have been leached from the websites (mentioned above) F-Secure looks the trust worthiest. Why F-Secure? Because given their defense-in-depth methodology no sensitive data could have been retrieved, just ordinary data that you may see on other several public pages.</p>
<p>As from any other attack scenario, there is something to be learned. In this case F-Secure and their methodology gave us the lesson. You should never, and I repet never, grant access to important data to a user which interacts with a visitor (in this case, a mysql database user). You will lower the threat by creating different users for different tasks.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<p>Also, I won&#8217;t go in complaining about the SQL injections, even if I should, because it&#8217;s nothing uncommon. When you have a team of developers which constantly add/remove components and which haven&#8217;t got a secure coding methodology (some might sanitize the data on request, others before the usage) SQL injection vulnerabilities (XSS vulnerabilities) will iminently pop up. I said I won&#8217;t complain about the vulnerability, but given the fact that they are in the security industry (and not some unknown players) you would expect more&#8230;</p>
<p>Another &#8220;debate&#8221; I&#8217;ve seen was based on <a href="http://www.acunetix.com/blog/web-security-articles/sql-injection-sneaks-into-kasperskys-support-website/">Acunetix article</a> which mentioned that <strong>Unu</strong> found the vulnerability in Kaspersky&#8217;s website via their scanner. Even if true, we all know that Acunetix Scanner isn&#8217;t always enough to catch all the vulnerabilities (as <strong>Unu </strong>declared also), and no such scanner can. People generally use Acunetix Scanner for a quick and dirty PRELIMINARY scan.</p>
<p>Enough said.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/should-i-trust-you/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 5.2+ Data Filtering Extension = BAD?</title>
		<link>http://insanesecurity.info/blog/php-5-data-filtering-extension-bad</link>
		<comments>http://insanesecurity.info/blog/php-5-data-filtering-extension-bad#comments</comments>
		<pubDate>Wed, 24 Jun 2009 06:15:30 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Discussion]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=44</guid>
		<description><![CDATA[Yesterday while browsing some security tagged discussions on stackoverflow.com I&#8217;ve noticed someone mentioned some filter_ prefixed PHP functions. At first I thought they were some custom written ones, but on a quick check it turned out that there really where this functions. I was shocked. Anyway, let&#8217;s digg into it&#8230; Filters In the filters extensions [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday while browsing some <a href="http://stackoverflow.com/questions/tagged/security" target="_blank">security tagged discussions on stackoverflow.com</a> I&#8217;ve noticed someone mentioned some filter_ prefixed PHP functions. At first I thought they were some custom written ones, but on a <a href="http://www.php.net/filter" target="_blank">quick check</a> it turned out that there really where this functions. I was shocked. Anyway, let&#8217;s digg into it&#8230;</p>
<p><span id="more-44"></span><script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<h2>Filters</h2>
<p>In the filters extensions we have 3 types of filters: validate, sanitize and other filters. Let&#8217;s take em each separately and see what the extension has to offer us.</p>
<ul><big><strong>Validate Filters</strong></big></p>
<li>
<ul><big><em>Data Type Validation</em></big></p>
<li><code>FILTER_VALIDATE_BOOLEAN</code>
<p>        Validates if the specified variable/value is a boolean value.
      </li>
<li><code>FILTER_VALIDATE_FLOAT</code>
<p>        Validate if the specified variable/value is of type float.
      </li>
<li><code>FILTER_VALIDATE_INT</code>
<p>        Besides the fact that it validates integers it allows you to specify a range in which the specified variable or value should be. It also allows you to validate octal and hexadecimal numbers.
      </li>
</ul>
</li>
<li>
<ul><big><em>String Validation</em></big></p>
<li><code>FILTER_VALIDATE_EMAIL</code>
<p>        Validates if the variable/value is a well formed email address.
      </li>
<li><code>FILTER_VALIDATE_IP</code>
<p>        Can be used for validating IPv4/IPv6 addresses, having flags to disallow reserved/private IP ranges.
      </li>
<li><code>FILTER_VALIDATE_REGEXP</code>
<p>        Validates variable/value with regular expressions.
      </li>
<li><code>FILTER_VALIDATE_URL</code>
<p>        Validate URL&#8217;s. I wouldn&#8217;t recommend it though, since it validates <code>'http://...'</code>. Better of with regular expressions here.
      </li>
</ul>
</li>
</ul>
<ul><big><strong>Sanitize Filters</strong></big></p>
<li><code>FILTER_SANITIZE_EMAIL</code>
<p>    I highly recommend to not use this filter, because it won&#8217;t sanitize the email address. The characters <code>!#$%&#038;'*+-/=?^_`{|}~@.[]</code> will remain intact.
  </li>
<li><code>FILTER_SANITIZE_ENCODED</code>
<p>    URL-encode string, optionally strip or encode special characters.
  </li>
<li><code>FILTER_SANITIZE_MAGIC_QUOTES</code>
<p>    Applies <code>addshashes()</code> to the specified variable/value. Seriously, shouldn&#8217;t this be extinct already. I though we    should have left them behind once we moved away from PHP 4.x. Try to not use this one, because in some SQL systems backslashes    are not escape characters.
  </li>
<li><code>FILTER_SANITIZE_NUMBER_FLOAT</code>
<p>    Remove all characters except digits, <code>+-</code> and optionally <code>.</code>,<code>eE</code>.
  </li>
<li><code>FILTER_SANITIZE_NUMBER_INT</code>
<p>    Remove all characters except digits, plus and minus sign.
  </li>
<li><code>FILTER_SANITIZE_SPECIAL_CHARS</code>
<p>    HTML-escape <code>'"&lt;&gt;&amp;</code> and characters with ASCII value less than 32, optionally strip or encode other special characters.
  </li>
<li><code>FILTER_SANITIZE_STRING</code>
<p>    Strip tags, optionally strip or encode special characters.
  </li>
<li><code>FILTER_SANITIZE_STRIPPED</code>
<p>    Alias for the above filter.
  </li>
<li><code>FILTER_SANITIZE_URL</code>
<p>    Remove all characters except letters, digits and <code>$-_.+!*'(),{}|^~[]`<>#%";/?:@&#038;=</code>.
  </li>
<li><code>FILTER_UNSAFE_RAW</code>
<p>    Do nothing, optionally strip or encode special characters.
  </li>
</ul>
<ul><big><strong>Other Filters</strong></big></p>
<li><code>FILTER_CALLBACK</code>
<p>    Call user-defined function to filter data.
  </li>
</ul>
<p>As you must have noticed the sanitizing filters are pretty bad, some even repetitive. Although haven&#8217;t marked red all of them, I surely won&#8217;t use them. For sanitizing (against XSS) I&#8217;ll use good old <a href="http://www.php.net/strip_tags" target="_blank">strip_tags</a>() combined with <a href="http://www.php.net/htmlspecialchars" target="_blank">htmlspecialchars</a>() because this way I can define quote style encoding, and charset in which to encode. As for safe SQL queries, I use db specific functions.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<h2>Functions</h2>
<p>Ok, so we had some complains about the filters. But let&#8217;s look beyond that for a moment and see what the filtering functions have to offer us.</p>
<ul>
<li><big><strong>filter_has_var</strong></big></li>
</ul>
<p>Through this function we can check if a POST, GET, ENV, SERVER, COOKIE value has been set.</p>
<pre name="code" class="php">
if(filter_has_var(INPUT_POST, 'submit')) {
  echo 'yes the submit value has been set';
}
</pre>
<p>Although this might seem similar to a <a href="http://www.php.net/isset" target="_blank">isset</a>() usage, be not fooled by it. It (probably) takes a snapshot of all the superglobals (POST, GET, ENV, SERVER, COOKIE) so&#8230;</p>
<pre name="code" class="php">
/*
 submit isn't set
*/
$_POST['submit']=1;
if(filter_has_var(INPUT_POST, 'submit')) {
  echo 'this will not be echoed';
}
</pre>
<p>Is this a good thing? Well, it depends. Haven&#8217;t seen till now somebody who controlled the flow of the application (in a script) through setting/unsetting a value in the superglobals, but I have seen hand coded register_globals implementation (for backwards compatibility) in PHPList which permitted that the SERVER['file'] (named something like that) to be overwritten and making it vulnerable to remote file inclusion. So in that particular scenario it would have helped.</p>
<ul>
<li><big><strong>filter_id and filter_list</strong></big></li>
</ul>
<p>One returns the numeric value of a filter, while the other returns a list of filters&#8230; moving on.</p>
<ul>
<li><big><strong>filter_input and filter_input_array</strong></big></li>
</ul>
<p>The (ONE) function for the &#8220;Data Filtering Extension&#8221;. I&#8217;ll post an example from the documentation.</p>
<pre name="code" class="php">

$search_html = filter_input(
    INPUT_GET,
    'search',
    FILTER_SANITIZE_SPECIAL_CHARS
);
$search_url = filter_input(
    INPUT_GET,
    'search',
    FILTER_SANITIZE_ENCODED
);

echo "You have searched for $search_html.\n";
echo "&lt;a href='?search=$search_url'&gt;Search again.&lt;/a&gt;";
</pre>
<ul>
<li><big><strong>filter_var and filter_var_array</strong></big></li>
</ul>
<p>It works in the same way as filter_input, just that now you can use the filters on variables/string&#8230; these examples are also from the documentation.</p>
<pre name="code" class="php">
// will validate
var_dump(filter_var(
    'bob@example.com',
    FILTER_VALIDATE_EMAIL
));

// will fail (return false), because it
// misses the scheme (http://)
var_dump(filter_var(
    'example.com',
    FILTER_VALIDATE_URL,
    FILTER_FLAG_SCHEME_REQUIRED
));
</pre>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<h2>Should I use it?</h2>
<p>Well, can&#8217;t say for sure. The validation filters seem pretty good unless you count the URL one&#8230; actually that could be a good filter also if you shouldn&#8217;t add 3 flags to behave like you normally would expect&#8230;</p>
<p>The other reason why I can&#8217;t pronounce a final answer (maybe someone who reads this will) because I haven&#8217;t checked the source code of the extension&#8230;</p>
<p>You have more information about it (not quite that big of a difference) from the online documentation page found <a href="http://www.php.net/manual/en/book.filter.php" target="_blank">here</a>. Waiting your opinion on this one&#8230;</p>
<p><strong>Update:</strong> Chuck Norrises was here and updated the text, removing my opinion of vulnerable code. eof!</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/php-5-data-filtering-extension-bad/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firefox: a (web application) Pen-Testers platform</title>
		<link>http://insanesecurity.info/blog/firefox-a-web-application-pen-testers-platform</link>
		<comments>http://insanesecurity.info/blog/firefox-a-web-application-pen-testers-platform#comments</comments>
		<pubDate>Wed, 24 Jun 2009 05:45:58 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Discussion]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/firefox-a-web-application-pen-testers-platform</guid>
		<description><![CDATA[Mozilla Firefox thanks to it addons can truly be a web application pen-testers platform. And this concept is not new, is it? I think that Firefox started to be seen as a potential web application pen-test platform somewhere in 2006, around the time that the article Hacking Web 2.0 Applications with Firefox popped up on [...]]]></description>
			<content:encoded><![CDATA[<p>Mozilla Firefox thanks to it addons can truly be a web application pen-testers platform. And this concept is not new, is it?<br />
<span id="more-16"></span><br />
I think that Firefox started to be seen as a potential web application pen-test platform somewhere in 2006, around the time that the article <a href="http://www.securityfocus.com/infocus/1879/1">Hacking Web 2.0 Applications with Firefox</a> popped up on  <a href="http://www.securityfocus.com">SecurityFocus</a>.</p>
<p>The second major thing that spread this concept was, after my opinion, the <a href="http://www.security-database.com/toolswatch/Security-Database-releases-FireCAT.html">FireCAT</a> (Firefox Catalog of Auditing Toolbox), which by now has reached it&#8217;s <a href="http://www.security-database.com/toolswatch/IMG/pdf/FireCAT_1.5.pdf">1.5 version</a>. It has many addons listed, but I think that for pen-testing the starred ones are enough. Although for experimenting you may use the others too.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>If you would like to try them out, I would recommend you to create a different Firefox profile&#8230; At the high number of plugins, the browser could freeze up. You could have, for example, different profiles for different sets of addons, tasks: blogging, hacking, sharing (p2p/torrents), etc.</p>
<p>For creating Firefox profiles you only have to add two parameters to the command line. The command is:</p>
<pre>firefox.exe -no-remote -ProfileManager</pre>
</p>
<p>Or modify it in the shortcut properties, after the quotes that surround the path to the <strong>firefox.exe</strong> file. If all is fine, than at every start the <strong>Profile Manager</strong> should pop up, thus letting you choose/create/delete/rename profiles.</p>
<p><img class="size-full wp-image-55" title="profilemanager" src="http://insanesecurity.info/wp-content/uploads//profilemanager.jpg" alt="Firefox Profile Manager window" width="351" height="251" /></p>
<p>I think that now that you have seen some insights on this matter you would agree that Firefox may as well be the best &#8220;platform&#8221; for web application pen-testing.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/firefox-a-web-application-pen-testers-platform/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The future of AV, or not?</title>
		<link>http://insanesecurity.info/blog/the-future-of-av-or-not</link>
		<comments>http://insanesecurity.info/blog/the-future-of-av-or-not#comments</comments>
		<pubDate>Wed, 24 Jun 2009 05:42:30 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Discussion]]></category>
		<category><![CDATA[AV]]></category>
		<category><![CDATA[Malware]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=11</guid>
		<description><![CDATA[Recently I read an article in the (IN)SECURE Magazine 19 entitled The Future Of AV: looking for the good while stopping the bad. After my opinion there should be more to be said about it, based on the article. Contrary to some industry observers, antivirus software is not dead. It is, however, undergoing a game-changing [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I read an article in the <a href="http://www.net-security.org/dl/insecure/INSECURE-Mag-19.pdf"><strong>(IN)SECURE Magazine</strong> <strong>19</strong></a> entitled <q>The Future Of AV: looking for the good while stopping the bad</q>. After my opinion there should be more to be said about it, based on the article.<br />
<span id="more-11"></span></p>
<blockquote><p>Contrary to some industry observers, antivirus software is not dead. It is, however, undergoing a game-changing transformation.</p>
</blockquote>
<p>Here should be noted that by <q>game-changing</q> the author (<a href="http://www.symantec.com/about/news/resources/press_kits/bios/bio.jsp?bioid=carey_nachenberg">Carey Nachenberg</a>) is really saying that the antivirus software will be &#8220;antivirus&#8221; software only by name.</p>
<p>What do I mean by that? To tell you honestly I think that the VX (Virus eXchange) scene is dying slowly and only a couple, or should I say handful, of viruses/worms emerge annually. Without the virus creators, there should be no future for AV, right? Wrong!</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>AV software for many years detects Malware (Spyware, Trojan, RAT, Rootkits?) and if it were not for the strong impact of the word <strong>Virus</strong> I would be really sure they would be called Anti-Malware.</p>
<blockquote><p>By some measurements, the volume of malicious software is now outpacing the production of legitimate programs. Symantec recently measured the adoption rate of new software<br />
applications and found that out of almost 55,000 unique applications deployed during a weeklong measurement period on Microsoft Windows PCs, 65 percent were malicious.</p>
</blockquote>
<p>This proves the fact that nowadays Malware  do the harm, not viruses. I know  some of you knew that, but it had to be said for those who didn&#8217;t.</p>
<blockquote><p>(&#8230;) attackers can easily circumvent most generic signatures by tweaking existing malware files, scanning them with an antivirus scanner, and repeating the process until the scanner no longer detects the infection. Such modifications can be<br />
done by hand or, unfortunately, all too easily via automation.</p>
</blockquote>
<p>That doesn&#8217;t sound so new, it reminds me of the first tutorial I read about making viruses undetectable. And it&#8217;s not a new either, it&#8217;s a tutorial that dates as back as 1991, called <a href="http://packetstormsecurity.org/mag/40hex/40HEX-01/40HEX-1.002">How To Modify A Virus So SCAN Won&#8217;t Catch It</a>.</p>
<blockquote><p>Clearly, in such an environment, traditional signature-based detection &#8211; or blacklisting &#8211; alone is not enough.</p>
</blockquote>
<p>You don&#8217;t say&#8230; What about heuristics, it&#8217;s been around for more than a decade, and great things can be done with it. I have in mind an AV program that implemented it quite well, but I don&#8217;t want to make from this article a promotive one.</p>
<blockquote><p>As the volume of malicious code continues to skyrocket, security techniques must increasingly focus less on analyzing malware and more on analyzing &#8220;goodware.&#8221;</p>
</blockquote>
<p>Whitelisting was, and is, always a better choice, in my opinion, than blacklisting.</p>
<blockquote><p>Similarly, it!s difficult for security companies to locate less<br />
popular, yet entirely legitimate, software applications and add them to a whitelist. Imagine a small software vendor that caters to just a handful of customers. What are the odds that this vendor!s software will be discovered and added to a whitelist in a timely fashion?</p>
</blockquote>
<p>About the same as winning the lottery.</p>
<blockquote><p>Perhaps the greatest benefit of a hybrid approach is that it would finally return the burden of antivirus protection from the shoulders of weary customers back to security vendors</p>
</blockquote>
<p>Perhaps&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/the-future-of-av-or-not/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
