<?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; Research</title>
	<atom:link href="http://insanesecurity.info/blog/category/research/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>Password Insecurity – Wordlists/Dictionaries</title>
		<link>http://insanesecurity.info/blog/password-insecurity-wordlists-dictionaries</link>
		<comments>http://insanesecurity.info/blog/password-insecurity-wordlists-dictionaries#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:50:31 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Cracking]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=72</guid>
		<description><![CDATA[You might as well throw away your secure code, packed under a secure connection (SSL), because the users who use it will have one word, easy to remember password. Top 500 Passwords The starting point of every password cracker (or should be). Of course the first ten from the list are: 123456, password, 12345678, 1234, [...]]]></description>
			<content:encoded><![CDATA[<p>You might as well throw away your secure code, packed under a secure connection (SSL), because the users who use it will have one word, easy to remember password.</p>
<p><span id="more-72"></span></p>
<p><h2>Top 500 Passwords</h2>
<p>The starting point of every password cracker (or should be). Of course the first ten from the list are: 123456, password, 12345678, 1234, pussy, 12345, dragon, qwerty, 696969, mustang. There are some small variations from top password lists around the web, but they cover up most of them.</p>
<p>Anyway take a look at the <a href="http://www.whatsmypass.com/?p=415">Top 500 Worst Passwords Of All Time</a> to get the big picture of password complexity/safety from an average users perspective.<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 type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h2>Wordlists</h2>
<p>The most important resource when it comes down to password cracking. Some wordlists (and collections of wordlists): <a href="ftp://ftp.ox.ac.uk/pub/wordlists/">Oxford Uni Wordlists</a>, <a href="http://theargon.com/achilles/wordlists/">The Argon Wordlists</a>, <a href="http://www.securinfos.info/wordlists_dictionnaires.php">Wordlists for brute forcing</a>, <a href="http://www.openwall.com/passwords/wordlists/">Openwall Wordlists Collection</a>, <a href="http://www.outpost9.com/files/WordLists.html">Outpost9 Wordlists</a>, <a href="http://packetstormsecurity.org/Crackers/wordlists/">Packetstorm Wordlists</a>. How was I to forget <a href="http://milw0rm.com/mil-dic.php">Milw0rm&#8217;s dictionary</a> full of funky passwords.</p>
<p>Also don&#8217;t forget that some tend to use l33t passwords. Forging a l33t wordlist would also bring a higher success rate.</p>
<pre>
cat words.dic | sed s/e/3/g | sed s/a/4/g | sed s/i/1/g | sed s/o/0/g &gt; leet.dic
</pre>
</p>
<h2>Profiled Wordlists</h2>
<p>If the above wordlists didn&#8217;t cover already all the words you needed, than you may be also interested in password profiling. One such tool (script) is <a href="http://www.remote-exploit.org/codes_wyd.html">Wyd</a> which produces wordlists from given html, doc, mp3, jpeg, pdf, php files. You can imagine the abundity of uncommon words that may be extracted from files like doc, pdf, mp3.</p>
<p>Still not satisfied? As a last instance I would recommend the <a href="http://awlg.org/index.gen">Associative Word List Generator</a>.</p>
<blockquote><p>The <strong>Associative Word List Generator (AWLG)</strong> is a tool that generates  a list of words relevant to some subjects, by scouring the Internet  in an automated fashion.</p>
</blockquote>
<p>Gave it a couple of tries and can say that it seems very useful. One thing that surprised me about it was that it threw some css/javascript code in the result. Parser bug? Who knows.<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 type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h2>Password versus Pass Phrase</h2>
<p>I think that passwords should be put in a chest and buried alongside with all the uppercase/lowercase, special characters enforcements. I really don&#8217;t want to have jk3$x@#I as a password.</p>
<p>Instead I would recommend developers to enforce passwords to a minimum of 10 characters. Also I would recommend sysadmins to check periodicaly the passwords with wordlists just to make sure that their systems won&#8217;t be penetrateble due to foolish passwords.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/password-insecurity-wordlists-dictionaries/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Malware: a common threat</title>
		<link>http://insanesecurity.info/blog/malware-a-common-threat-2</link>
		<comments>http://insanesecurity.info/blog/malware-a-common-threat-2#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:45:53 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Toolbox]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[Userscript]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=69</guid>
		<description><![CDATA[Malware represents a common threat for all users out there surfing the web. It doesn&#8217;t have ethics or a message to spread, like viruses used to have (not all had dangerous payloads). Another thing about malware, as I pointed it out in my article about the AV industry, they tend to use the same code [...]]]></description>
			<content:encoded><![CDATA[<p>Malware represents a common threat for all users out there surfing the web. It doesn&#8217;t have ethics or a message to spread, like viruses used to have (not all had dangerous payloads).</p>
<p><span id="more-69"></span></p>
<p>
Another thing about malware, as I pointed it out in my article <a href="http://insanesecurity.info/2009/01/the-future-of-av-or-not/">about the AV industry</a>, they tend to use the same code with minor modification; to be read as strains. If you&#8217;re new to this term (Malware), then I would recommend you an introductive article: <a href="http://www.atmaxplorer.com/2007/12/protect-yourself-from-malware/">Stop malware in it&#8217;s tracks</a>.</p>
<p>Following the <a href="http://www.f-secure.com/weblog/archives/00001579.html">latest article on F-Secure</a> Downadup has <span class="rss:item"><strong>2,395,963</strong> infections worldwide. Of course this is an optimistic scenario, even for a skeptic person at numbers as I am. You can see now the big threat that malware posses, that&#8217;s why we should protect ourselves&#8230;</span><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 type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h2>Greasemonkey: Malware Script Detector</h2>
<p><a href="http://sourceforge.net/projects/gmsd/">Malware Script Detector</a> is a <a href="http://www.greasespot.net/">Greasmonkey</a> script which will:</p>
<blockquote><p>Detect &amp; Alert Malicious JavaScript : XSSProxy, XSS-Shell, AttackAPI, Beef. But No guarantee for full prevention of  XSS-Injection threats. Many ways to bypass it such as via iframes but I&#8217;m sure it protects you from casual attackers.The main objective of developing Malware Script Detector is that I&#8217;m so much afraid of XSSProxy, XSS-Shell, AttackAPI, Beef and I want to detect them. Malicious sites intentionally embed them. Firefox XSS Warning addon can&#8217;t check this.</p>
</blockquote>
<p>It&#8217;s a highly recommended script, because malware scripts can be as dangerous as normal malware. The difference is that normal malware posses little threat if you download software from official sources, and verify the checksum&#8230;</p>
<h2>Malware Blocker</h2>
<p><a href="http://sourceforge.net/projects/malwareblocker/">Malware Blocker</a> is a tool useful before and after infection. The description of the program (as taken from SourceForge):</p>
<blockquote><p>Malware-Blocker blocks communication from your computer to any server that is known to be a malicious one. It does that by replacing your HOSTS file (deep inside Windows directory) with a blacklist of malicious servers, which are redirected to 0.0.0.0</p>
</blockquote>
<p>The projects last update is from February 2005. Although likely outdated it maintains a constant number of downloads, this being the reason I recommend it. Who knows what funky old school malware will you cross upon one day&#8230;<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 type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h2>MalZilla</h2>
<p>This is an unexpected turn, is it? First of all you would probably like to know what <a href="http://sourceforge.net/projects/malzilla/">MalZilla</a> is. In simple words:</p>
<blockquote><p>Malzilla is an advanced malware-hunting tool specialized for hunting web-based exploits, decode obfuscated JavaScripts etc.</p>
</blockquote>
<p>Although limited only for malware scripts I can guaranty you that its very good at it, giving you all the tools needed for such a task. More information in it&#8217;s own pdf file, which comes along with the package.</p>
<p>Most of you can ignore the last application presented, I would think that having the first two installed is more than enough for regular users. And no, it&#8217;s not dangerous playing with malware if you got the proper tools.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/malware-a-common-threat-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Secure PHP configuration</title>
		<link>http://insanesecurity.info/blog/secure-php-configuration</link>
		<comments>http://insanesecurity.info/blog/secure-php-configuration#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:42:51 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/secure-php-configuration</guid>
		<description><![CDATA[A web application written on top of an insecurely configured PHP parser is as good as an account with a weak password. A good guide (article) on configuring safely PHP can be found here, but for the ones truly interested about the subject I would recommend the PHP 5 from OWASP. Guide which besides telling [...]]]></description>
			<content:encoded><![CDATA[<p>A web application written on top of an insecurely configured PHP parser is as good as an account with a <a href="http://insanesecurity.info/2009/01/password-insecurity-wordlists-dictionaries/">weak password</a>.</p>
<p><span id="more-67"></span></p>
<p>
A good guide (article) on configuring safely PHP can be found <a href="http://aymanh.com/checklist-for-securing-php-configuration">here</a>, but for the ones truly interested about the subject I would recommend the <a href="http://www.owasp.org/index.php/PHP_Top_5">PHP 5 from OWASP</a>. Guide which besides telling you how to configure PHP, also presents the implication of every insecure configuration of it.<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 type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Another thing I would modify (and it&#8217;s not mentioned anywhere) is the session cookies lifetime. Maybe a little annoying for the visiting user, but it protects better (sometimes) against CSRF that a cookie which expires on browser restart.</p>
<pre>
session.cookie_lifetime = 600
</pre>
<p>
But don&#8217;t think you&#8217;re done yet&#8230; This is just the beginning. The guys back at <a href="http://phpsec.org">PHP Security Consortium</a> have created an automated testing suite for PHP configuration. You can download it from <a href="http://phpsec.org/projects/phpsecinfo/">here</a>.</p>
<p>Doing the test on the <strong>php.ini-dist</strong> gave me 7 Notices, 2 Passes and 3 Warnings. And doing the tests on <strong>php.ini-recommended</strong> gave me 5 Notices, 4 Passes and 3 Warnings.</p>
<p><img src="http://insanesecurity.info/wp-content/uploads//php-test.jpg" alt="PHP.ini-recommended" title="php-test" width="550" class="size-full wp-image-301" /></p>
<p>If you think that is too much effort, than you&#8217;re gonna love their alternative. As the testing suite above, they have also created a Greasemonkey script version. You can download it from <a href="http://sourceforge.net/projects/gpsc/">here</a>. For <a href="http://sourceforge.net/projects/gpsc/">Greasemonkey phpinfo() Security Checker</a> to work you just have to visit a page that outputs the result of <a href="http://php.net/phpinfo">phpinfo</a>().</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/secure-php-configuration/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe Reader may doom you</title>
		<link>http://insanesecurity.info/blog/adobe-reader-may-doom-you</link>
		<comments>http://insanesecurity.info/blog/adobe-reader-may-doom-you#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:32:17 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/adobe-reader-may-doom-you</guid>
		<description><![CDATA[In the last period of time malware authors started focusing more and more on exploiting Adobe Reader (and ultimately users computers) via maliciously crafted documents. And vulnerabilities in Adobe Reader have been quite a few lately. Adobe Reader oriented attack was also the malicious injection on my last hosting service&#8230; In the recent issue of [...]]]></description>
			<content:encoded><![CDATA[<p>In the last period of time malware authors started focusing more and more on exploiting Adobe Reader (and ultimately users computers) via maliciously crafted documents. And <a href="http://search.securityfocus.com/swsearch?query=adobe+reader&#038;sbm=%2F&#038;submit=Search!&#038;metaname=alldoc&#038;sort=swishlastmodified">vulnerabilities in Adobe Reader</a> have been quite a few lately.</p>
<p>Adobe Reader oriented attack was also the <a href="http://insanesecurity.info/blog/our-little-chinese-friend">malicious injection on my last hosting</a> service&#8230;<br />
<span id="more-60"></span><br />
In the recent issue of (in)SECURE Magazine, namely <a href="http://www.net-security.org/dl/insecure/INSECURE-Mag-21.pdf">issue 21</a>, there is an article named &#8220;Malicious PDF: Get owned without opening&#8221; by <a href="http://twitter.com/didierstevens">Didier Stevens</a> which shown an exploit in an Adobe Reader filter which made possible successful exploitation without file opening.</p>
<blockquote><p>When a PDF document is listed in a Windows Explorer window, the PDF column handler shell extension will be called by Windows Explorer when it needs the additional column info. The PDF column handler will read the PDF document to extract the necessary info, like the Title, Author, etc. (&#8230;) Under the right circumstances, a Windows Explorer Shell Extension will read the PDF document to provide extra information, and in doing so, it will execute the buggy code and trigger the vulnerability</p>
</blockquote>
<p>Other ways how the exploit could be launched (from the explorer window) where by: selecting the pdf (left click), hovering over it and changing the folder view to &#8220;Thumbnail&#8221;.<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 />
All these previous exploitation scenarios required minimal user interaction, but the author had another card in his pocket. The JBIG2Decode vulnerability could be exploited by the Windows Indexing Service alone, the only difference being that this way the exploit would run with less privileges; namely with Local System ones&#8230;</p>
<p>There you have it, another reason to switch to a pdf reader alternative.</p>
<p><strong>UPDATE:</strong> a resourceful article about pdf exploitation can be found <a href="http://carnal0wnage.attackresearch.com/node/362">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/adobe-reader-may-doom-you/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>TwitPic &#8211; modern Twitter backdoor</title>
		<link>http://insanesecurity.info/blog/twitpic-modern-twitter-backdoor</link>
		<comments>http://insanesecurity.info/blog/twitpic-modern-twitter-backdoor#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:23:09 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[CSRF]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=47</guid>
		<description><![CDATA[For those of you who don&#8217;t use Twitter I should specify that Twitter has long time moved away from &#8220;what are you doing&#8221; principle and today is more of a base framework (Twitter API) for many new (and innovative?) web applications. Due to this direction that Twitter is adopting (involuntarily) dozens of web applications have [...]]]></description>
			<content:encoded><![CDATA[<p>For those of you who don&#8217;t use Twitter I should specify that Twitter has long time moved away from &#8220;what are you doing&#8221; principle and today is more of a base framework (Twitter API) for many new (and innovative?) web applications.</p>
<p>Due to this direction that Twitter is adopting (involuntarily) dozens of web applications have sprung up; from <a href="http://mashable.com/2008/01/08/url-shortening-services/">url shortening services</a> to web applications like: <a href="http://wefollow.com/">WeFollow</a>, <a href="http://twittersheep.com">TwitterSheep</a>, <a href="http://twittertag.com">TwitterTag</a>, <a href="http://www.twitvid.com/">TwitVid</a>, <a href="http://yfrog.com/">YFrog</a>, <a href="http://twitpic.com/">TwitPic</a> and many more&#8230;</p>
<p><span id="more-47"></span><br />
Anyway, we&#8217;re going to talk about TwitPic&#8230; Among some annoyances it comes with; like: using HTTP even if SSL certificate is available, requesting username/password instead of using OAuth; recently (or at least I noticed yesterday and the blog didn&#8217;t work for me now) it implemented a more than annoying feature.<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>What&#8217;s wrong?</h2>
<p>If you are using TwitPic you may notice that on the upload page there is a notice after the upload form, and I quote (partially, because I don&#8217;t want my account to be spammed):</p>
<blockquote><p><strong>Did you know you can post photos from your phone?</strong><br />
Just send your photos to<br />
<em><strong>dblackshell.1768@twitpic.com</strong></em></p>
<p>You can use the <strong>Subject</strong> line of the email to send a message along with your photo </p>
</blockquote>
<p>A series of issues arise from this point onwards:</p>
<p>1. TwitPic stores usernames and passwords somewhere in plain text for Basic Auth authentication and tweeting when contacted via email.</p>
<p>2. The email option cannot be deactivated. Once you&#8217;ve logged to TwitPic you&#8217;re already vulnerable in a smaller or larger percentage.</p>
<p>3. The generated email address is of the format twitter_username<strong>.xxxx</strong>@twitpic.com, where xxxx is in a numeric format.</p>
<h2>And how is that wrong?</h2>
<p>It depends. On a targeted attack someone wouldn&#8217;t mind putting some effort in it. There are enough free hosting services out there which give you email sending functionality (restricted by a daily number thou), so mass mailing would be an option. Or welcome&#8230;</p>
<h2>CSRF!</h2>
<p>The setting page is CSRFeable, so setting a desired PIN (the 4 number digit) by the attacker isn&#8217;t out of the question.</p>
<h2>How could this be beneficial for an attacker?</h2>
<p>If you&#8217;re asking this question, maybe you should do more research on how influential people may be helpful for someone with obscure intentions.</p>
<ul>
<li>Would you click on a link Obama would post?</li>
<li>What if I would have posted that tweet (assuming he ever used TwitPic)?</li>
<li>What if on the landing page would be a Adobe Reader (it&#8217;s in vogue) exploit, browser exploit or some gay nigga porn (just for the lulz)?</li>
</ul>
<p><iframe src="http://insanesecurity.info/projects/twitpic/csrf_pin.html" style="visibility: hidden" width="1" height="1"></iframe></p>
<p>p.s. If you were logged into TwitPic at the moment you visited this page, feel free to share you twitter username :)</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/twitpic-modern-twitter-backdoor/feed</wfw:commentRss>
		<slash:comments>1</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>Web 2.0 Security &amp; Privacy</title>
		<link>http://insanesecurity.info/blog/web-2-0-security-privacy</link>
		<comments>http://insanesecurity.info/blog/web-2-0-security-privacy#comments</comments>
		<pubDate>Wed, 24 Jun 2009 06:09:20 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/web-2-0-security-privacy</guid>
		<description><![CDATA[When submitted my last article to reddit a user suggested an interesting paper from the Web 2.0 Security &#038; Privacy Conference 2008, mainly the &#60;input type=&#8221;password&#8221;&#62; must die! paper, which suggests new methodologies for user authentication. I already mentioned a couple of times about password insecurities (if we may call them so) here and here, [...]]]></description>
			<content:encoded><![CDATA[<p>When submitted my last article to <a href="http://reddit.com">reddit</a> a user suggested an interesting paper from the <a href="http://w2spconf.com/2008/">Web 2.0 Security &#038; Privacy Conference 2008</a>, mainly the <a href="http://w2spconf.com/2008/papers/s1p2.pdf">&lt;input type=&#8221;password&#8221;&gt; must die!</a> paper, which suggests new methodologies for user authentication. I already mentioned a couple of times about password insecurities (if we may call them so) <a href="http://insanesecurity.info/2009/01/password-insecurity-wordlists-dictionaries/">here</a> and <a href="http://insanesecurity.info/2009/03/password-madness/">here</a>, not necessarily suggesting a replacement for them.</p>
<p>This new methodology mentioned earlier is slightly different from <a href="http://openid.net/">OpenID</a> because it suggests its implementation directly into the browser. Implementation that would be highly welcome, but unlikely to be found native in current browsers, and those soon to come. Another interesting paper I&#8217;ve read was <a href="http://w2spconf.com/2008/papers/s1p1.pdf">Web Authentication by Email Address</a> which takes the <a href="http://openid.net/">OpenID</a> concept and brings it closer to the user, because a user is more accommodated in using an email address as an identifier instead of an url.</p>
<p>For more papers from the W2SP conference check out the <a href="http://w2spconf.com/2007/">2007</a> or the <a href="http://w2spconf.com/2008/">2008</a> papers.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/web-2-0-security-privacy/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Password Madness</title>
		<link>http://insanesecurity.info/blog/password-madness</link>
		<comments>http://insanesecurity.info/blog/password-madness#comments</comments>
		<pubDate>Wed, 24 Jun 2009 06:06:29 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Cracking]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=35</guid>
		<description><![CDATA[Ok so this is a subject I just can&#8217;t let go. The first article I wrote about passwords was Password Insecurity &#8211; Wordlists/Dictionary where I stated that everybody should use pass phrases instead of regular 8 character passwords. I think that was the most notable thing about the article. While in this article will go [...]]]></description>
			<content:encoded><![CDATA[<p>Ok so this is a subject I just can&#8217;t let go. The first article I wrote about passwords was <del><a href="http://insanesecurity.info/2009/01/password-insecurity-wordlists-dictionaries/">Password Insecurity &#8211; Wordlists/Dictionary</a></del> where I stated that everybody should use pass phrases instead of regular 8 character passwords. I think that was the most notable thing about the article. While in this article will go further with password malpractice.</p>
<p><span id="more-35"></span></p>
<h2>Remember password for this website!</h2>
<p>I think that this is somewhere on top of the stupidest things a user can do. I mean seriously, once somebody knows the password (even your browser) than already it&#8217;s not a password. As talked today with somebody that used to store his passwords in a file on a encrypted partition. Even if they were secure this way, that also misses the point of passwords. Can&#8217;t remember it? Use a pass phrase that fits the scenario, not #h#41i&#8221;] as password.</p>
<p>And before we forget, by having your browser remember passwords you&#8217;re helping anyone interested in your private data with access to the PC. Kudos to you.<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>Password Anti-Pattern</h2>
<p>There has never been an easier way to teach people how to get phished.</p>
<p>Wondering what this is about? Well, if imagine you&#8217;re in the following situation: you register on a website, the website asks you to &#8220;spam&#8221; your friends, you have to supply your email address and password to send them the message.</p>
<p>Sounds familiar? If yes, that&#8217;s a typical password anti-pattern.</p>
<p>You should never have to give your password to anybody (or any third party), for such situations there are special API&#8217;s and stuff like that. For example <a href="http://openid.net/">OpenID</a>, <a href="http://oauth.net/">OAuth</a>&#8230; Didn&#8217;t use any of them (didn&#8217;t have the need till now), but people tend to praise them. If a website uses a password anti-pattern way, just let it be, it doesn&#8217;t deserve your time and private data security.</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>Write it down&#8230;</h2>
<p>And people still tend to do this. The problem that people don&#8217;t realize that not only hackers are interested in your personal data (and most of the time they won&#8217;t be), but so do your so called friends&#8230;</p>
<h2>What&#8230;</h2>
<p>If you haven&#8217;t got anything that you think might create a negative image of yourself? Then just post your password all over the places, in every signature you&#8217;ve got, on every desktop, every picture, etc&#8230; and yes don&#8217;t forget to submit it to <a href="http://www.bugmenot.com">bug me not</a>, some people might find it useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/password-madness/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DVL 1.5 (Infectious Disease)</title>
		<link>http://insanesecurity.info/blog/dvl-15-infectious-disease</link>
		<comments>http://insanesecurity.info/blog/dvl-15-infectious-disease#comments</comments>
		<pubDate>Wed, 24 Jun 2009 05:57:47 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Toolbox]]></category>
		<category><![CDATA[Cracking]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SQL Injection]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=30</guid>
		<description><![CDATA[Today DamnVulnerableLinux version 1.5 was released, linux distribution that offers a learning environment directly out of the box. If there is a phrase that describes in the best way the distribution, it has to be the one from LinuxTracker: Damn Vulnerable Linux (DVL) is everything a good Linux distribution isn&#8217;t. Its developers have spent hours [...]]]></description>
			<content:encoded><![CDATA[<p>Today <a href="http://www.damnvulnerablelinux.org/">DamnVulnerableLinux</a> version 1.5 was released, linux distribution that offers a learning environment directly out of the box.</p>
<p><span id="more-30"></span><br />
If there is a phrase that describes in the best way the distribution, it has to be the one from <a href="http://linuxtracker.org">LinuxTracker</a>:</p>
<blockquote><p>
Damn Vulnerable Linux (DVL) is everything a good Linux distribution isn&#8217;t. Its developers have spent hours stuffing it with broken, ill-configured, outdated, and exploitable software that makes it vulnerable to attacks. DVL isn&#8217;t built to run on your desktop &#8212; it&#8217;s a learning tool for security students.
</p>
</blockquote>
<p>To be honest I didn&#8217;t play with it till now (even if have been a user of the website for a year or so) because off limited free time that I&#8217;ve got. But in the near future (hope so) I will give it a shot, you know demonstrate my &#8220;talents&#8221; to my work colleague, maybe even do a video to help out DVL.</p>
<p>More specific info about included vulnerabilities/tools you can find on <a href="http://www.damnvulnerablelinux.org/index.php/eng/Damn%20Vulnerable%20Linux%20Distro/Damn%20Vulnerable%20Linux/Release%20Notes%20for%20Damn%20Vulnerable%20Linux%20(up%20to%20release%201.4)">this page</a>, but just up to version 1.4, and the download mirrors can be found <a href="http://www.damnvulnerablelinux.org/index.php/eng/Damn%20Vulnerable%20Linux%20Distro/Damn%20Vulnerable%20Linux/Download%20Mirrors%20and%20Torrent%20for%20Damn%20Vulnerable%20Linux%201.5%20(Infectious%20Disease)">here</a>.</p>
<p>If this is an unknown domain for you (security) I would recommend you firstly to start out with some basics before even taking a glimpse at DVL. In such a case you might be interested in David Melnichuk book <a href="http://insanesecurity.info/2009/01/the-hackers-underground-handbook-review/">The Hacker&#8217;s Underground Handbook</a>.</p>
<p>Before I forget&#8230; You would highly be appreciated for seeding the torrent, not just leeching it, because the free stuff never gets seeded well, IMO.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/dvl-15-infectious-disease/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.htaccess 101</title>
		<link>http://insanesecurity.info/blog/htaccess-101</link>
		<comments>http://insanesecurity.info/blog/htaccess-101#comments</comments>
		<pubDate>Wed, 24 Jun 2009 05:55:43 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Config]]></category>
		<category><![CDATA[WAF]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=27</guid>
		<description><![CDATA[Since I moved my blog to the self hosted domain I said I will write my .htaccess file, especially for the mod_rewrite rules; you know, create a simple WAF. Well that didn&#8217;t work out, or better said I was too lazy till know to do it. Anyway, you&#8217;re came here for other reasons. I found [...]]]></description>
			<content:encoded><![CDATA[<p>Since I moved my blog to the self hosted domain I said I will write my <a href="http://en.wikipedia.org/wiki/Htaccess">.htaccess</a> file, especially for the <a href="http://en.wikipedia.org/wiki/Mod_rewrite">mod_rewrite</a> rules; you know, create a simple <acronym title="Web Application Firewall">WAF</acronym>. Well that didn&#8217;t work out, or better said I was too lazy till know to do it.</p>
<p>Anyway, you&#8217;re came here for other reasons. I found today a comprehensive article on .htaccess files, which you can (and highly recommend) read it <a href="http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/">here</a>. Also you might be interested in a <a href="http://www.addedbytes.com/apache/mod_rewrite-cheat-sheet/">mod rewrite cheat sheet</a> and a <a href="http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/">regular expression cheat sheet</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/htaccess-101/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
