<?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>Abysssec Security Research &#187; python</title>
	<atom:link href="http://www.abysssec.com/blog/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.abysssec.com/blog</link>
	<description>Security Researches , Advisories , Coding , Projects , Reversing , Exploitation , Fuzzing</description>
	<lastBuildDate>Tue, 31 Jan 2012 15:52:34 +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>writing a Browser fuzzer !!!</title>
		<link>http://www.abysssec.com/blog/2009/08/21/how-to-write-browser-fuzzer/</link>
		<comments>http://www.abysssec.com/blog/2009/08/21/how-to-write-browser-fuzzer/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 16:12:12 +0000</pubDate>
		<dc:creator>daphne</dc:creator>
				<category><![CDATA[Fuzzing / Auditing]]></category>
		<category><![CDATA[0day]]></category>
		<category><![CDATA[browser fuzzing]]></category>
		<category><![CDATA[FireFox Exploit]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[fuzzer]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[tag]]></category>

		<guid isPermaLink="false">http://www.abysssec.com/blog/?p=368</guid>
		<description><![CDATA[Hello all in this post , i wanna talk about web browser Fuzzing  and auditing. web browsers , such as FireFox , Opera , Internet Explorer  and etc .. , are very convertible with new web technologies. For example : when html5 comes , Firefox added html5 features to itself too.  and a clever Attacker [...]]]></description>
			<content:encoded><![CDATA[<p>Hello all<br />
in this post , i wanna talk about web browser Fuzzing  and auditing.<br />
web browsers , such as FireFox , Opera , Internet Explorer  and etc .. , are very convertible with new web technologies.</p>
<p><strong>For example : </strong><br />
when html5 comes , Firefox added html5 features to itself too.  and a clever Attacker could recognizing  this change and we will be able to find Security holes .</p>
<p>for more information please read :</p>
<p>w3.org publish paper with this title: HTML 5 differences from HTML 4<br />
<a href="http://www.w3.org/TR/2009/WD-html5-diff-20090212/">http://www.w3.org/TR/2009/WD-html5-diff-20090212/</a><br />
and take HTML5 Overview :<br />
<a href="http://dev.w3.org/html5/spec/Overview.html">http://dev.w3.org/html5/spec/Overview.html</a></p>
<p>please  pay attention to differences between FF3 &amp; FF3.5 :</p>
<blockquote><p>These changes include support for the &lt;video&gt; and &lt;audio&gt; tags as defined in the HTML 5 specification, with a goal to offer video playback without being encumbered by patent issues associated with many video technologies.</p>
<p>Cross-site XMLHttpRequests (XHR), which can allow for more powerful web applications and an easier way to implement mashups, are also implemented in 3.5.</p>
<p>A new global JSON object contains native functions to efficiently and safely serialize and deserialize JSON objects, as specified by the ECMAScript 3.1 draft.</p>
<p>Full CSS 3 selector support has been added. Firefox 3.5 uses the Gecko 1.9.1 engine, which includes a few features that were not included in the 3.0 release. Multi-touch support was also added to the release, including gesture support like pinching for zooming and swiping for back and forward.</p></blockquote>
<p>and then milw0rm.com publish new exploit in &#8220;Firefox font tag !&#8221;<br />
<a href="http://www.milw0rm.com/exploits/9137">http://www.milw0rm.com/exploits/9137</a></p>
<p>we are not bloodsucker , we try to act like a  real hacker , Real hacker (Pen-tester i mean)  think about how to find  this type of bug .</p>
<p>since we know about all of  new  features in  new web browsers  such as of FF  and we can test features as a security researcher as well.</p>
<p>Browser Vulnerability Assessment  has tree  step :</p>
<p>1 &#8211; Find <strong>HTML </strong>or <strong>XML </strong>or <strong>javascript </strong>&lt;tag&gt; browser can support , for example :<br />
<a href="http://msdn.microsoft.com/en-us/library/ms533050%28VS.85%29.aspx">http://msdn.microsoft.com/en-us/library/ms533050%28VS.85%29.aspx</a> [IE]</p>
<p>2- find  Properties , Methods , Collections , Events ,Constants , Prototypes , HTML Elements for each &lt;tag&gt; .</p>
<p>3- misuse property of &lt;tag&gt; or fuzzed tag for buffer-overflow and other memory corruption vulnerabilities (in this case)</p>
<p>for example :<br />
we want find memory corruption vulnerability using ,  unbound check in  &lt;font&gt; tag,  in  Internet explorer 8 !:<br />
<span style="text-decoration: underline;"><em> &lt;font color=&#8221;#727272&#8243;&gt;test&lt;/font&gt;</em></span></p>
<p>take a look at  &#8220;MSDN&#8221; :<br />
<a href="http://msdn.microsoft.com/en-us/library/ms535248%28VS.85%29.aspx">http://msdn.microsoft.com/en-us/library/ms535248%28VS.85%29.aspx</a></p>
<p>second : find &#8220;Attribute&#8221; and &#8220;property&#8221; of &lt;font&gt; tag , such as :<br />
&#8216;color&#8217;, &#8216;face&#8217;, &#8216;size&#8217;, &#8216;class&#8217;, &#8216;id&#8217;, &#8216;style&#8217;, &#8216;title&#8217;, &#8216;dir&#8217;, &#8216;lang&#8217;, &#8216;accesskey&#8217;, &#8216;tabindex&#8217;</p>
<p>third  : build random character for &#8220;overflows &#8221; , &#8220;FormatString&#8221;  , and other memory corruptions &#8230;</p>
<p><span style="color: #ff6600;">for example to be more clear i wrote a really basic fuzzer in python :<br />
</span></p>
<p><span style="color: #ff6600;">(for sure this is not a commercial fuzzer)<br />
</span></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># Abysssec Inc public material</span>
<span style="color: #808080; font-style: italic;"># Simple Browser Fuzzer</span>
<span style="color: #808080; font-style: italic;"># www.Abysssec.com</span>
<span style="color: #808080; font-style: italic;">#garbage char</span>
overflows = <span style="color: black;">&#91;</span><span style="color: #483d8b;">'A'</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">10</span>, <span style="color: #483d8b;">'A'</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">20</span>, <span style="color: #483d8b;">'A'</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">100</span>, <span style="color: #483d8b;">'A'</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">200</span><span style="color: black;">&#93;</span>
fmtstring = <span style="color: black;">&#91;</span><span style="color: #483d8b;">'%n%n%n%n%n'</span>, <span style="color: #483d8b;">'%p%p%p%p%p'</span>, <span style="color: #483d8b;">'%s%s%s%s%s'</span>, <span style="color: #483d8b;">'%d%d%d%d%d'</span>, <span style="color: #483d8b;">'%x%x%x%x%x'</span><span style="color: black;">&#93;</span>
numbers   = <span style="color: black;">&#91;</span><span style="color: #483d8b;">'0'</span>, <span style="color: #483d8b;">'-0'</span>, <span style="color: #483d8b;">'1'</span>, <span style="color: #483d8b;">'-1'</span>, <span style="color: #483d8b;">'32767'</span>, <span style="color: #483d8b;">'-32768'</span>, <span style="color: #483d8b;">'2147483647'</span>, <span style="color: #483d8b;">'-2147483647'</span>, <span style="color: #483d8b;">'2147483648'</span>, <span style="color: #483d8b;">'-2147483648'</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># FONT property</span>
fontpropery = <span style="color: black;">&#91;</span><span style="color: #483d8b;">'color'</span>, <span style="color: #483d8b;">'face'</span>, <span style="color: #483d8b;">'size'</span>, <span style="color: #483d8b;">'class'</span>, <span style="color: #483d8b;">'id'</span>, <span style="color: #483d8b;">'style'</span>, <span style="color: #483d8b;">'title'</span>, <span style="color: #483d8b;">'dir'</span>, <span style="color: #483d8b;">'lang'</span>, <span style="color: #483d8b;">'accesskey'</span>, <span style="color: #483d8b;">'tabindex'</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#basic Automated Fuzzer :</span>
i = <span style="color: #ff4500;">0</span> 
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> x <span style="color: #ff7700;font-weight:bold;">in</span> fontpropery:
     <span style="color: #ff7700;font-weight:bold;">for</span> y <span style="color: #ff7700;font-weight:bold;">in</span> overflows:
    	tag = <span style="color: #483d8b;">&quot;&lt;span&gt;TEST&lt;/span&gt;&quot;</span>
    	i = i + <span style="color: #ff4500;">1</span>
	<span style="color: #008000;">file</span> = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span> <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>i<span style="color: black;">&#41;</span> + <span style="color: #483d8b;">&quot;.html&quot;</span>,<span style="color: #483d8b;">&quot;w&quot;</span><span style="color: black;">&#41;</span>
	<span style="color: #008000;">file</span>.<span style="color: black;">writelines</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span><span style="color: black;">&#41;</span>
	<span style="color: #008000;">file</span>.<span style="color: black;">writelines</span><span style="color: black;">&#40;</span>tag<span style="color: black;">&#41;</span>
	<span style="color: #008000;">file</span>.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
     <span style="color: #ff7700;font-weight:bold;">for</span> y <span style="color: #ff7700;font-weight:bold;">in</span> fmtstring:
    	tag =  <span style="color: #483d8b;">&quot;&lt;span&gt;TEST&lt;/span&gt;&quot;</span>
    	i = i + <span style="color: #ff4500;">1</span>
	<span style="color: #008000;">file</span> = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span> <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>i<span style="color: black;">&#41;</span> + <span style="color: #483d8b;">&quot;.html&quot;</span>,<span style="color: #483d8b;">&quot;w&quot;</span><span style="color: black;">&#41;</span>
	<span style="color: #008000;">file</span>.<span style="color: black;">writelines</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span><span style="color: black;">&#41;</span>
	<span style="color: #008000;">file</span>.<span style="color: black;">writelines</span><span style="color: black;">&#40;</span>tag<span style="color: black;">&#41;</span>
	<span style="color: #008000;">file</span>.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
     <span style="color: #ff7700;font-weight:bold;">for</span> y <span style="color: #ff7700;font-weight:bold;">in</span> numbers:
    	tag =  <span style="color: #483d8b;">&quot;&lt;span&gt;TEST&lt;/span&gt;&quot;</span>
    	i = i + <span style="color: #ff4500;">1</span>
	<span style="color: #008000;">file</span> = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span> <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>i<span style="color: black;">&#41;</span> + <span style="color: #483d8b;">&quot;.html&quot;</span>,<span style="color: #483d8b;">&quot;w&quot;</span><span style="color: black;">&#41;</span>
	<span style="color: #008000;">file</span>.<span style="color: black;">writelines</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span><span style="color: black;">&#41;</span>
	<span style="color: #008000;">file</span>.<span style="color: black;">writelines</span><span style="color: black;">&#40;</span>tag<span style="color: black;">&#41;</span>
	<span style="color: #008000;">file</span>.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>for start fuzzing , add refresh page with next page . [for start fuzz click 1.html]</p>
<p><strong>another way :</strong></p>
<p>&#8220;Jeremy Brown&#8221;  developed this a fuzzer for general browser fuzzing&#8221; :</p>
<ol>
<li>Written in PERL</li>
<li>CSS/DOM/HTML/JS fuzzing comprehensive</li>
<li>Specialized functions for fuzz page generation &amp; writing</li>
<li>Decent file structure easily supporting add/del/modification</li>
<li>3rd generation [unlimited style, web] fuzzing oracle implemented</li>
</ol>
<p><a href="http://www.krakowlabs.com/dev/fuz/bf2/bf2.pl.txt">http://www.krakowlabs.com/dev/fuz/bf2/bf2.pl.txt</a></p>
<p>this fuzzer is good but it&#8217;s really simple too and can&#8217;t find new vulnerabilities without modifying but   you can extend it for new method of browser &lt;tag &gt; fuzz .</p>
<p>more info :</p>
<p><a href="http://www.krakowlabs.com/dev/fuz/bf2/bf2_doc.txt">http://www.krakowlabs.com/dev/fuz/bf2/bf2_doc.txt</a></p>
<p><strong>Browser Auditing :</strong></p>
<p>browser source code auditing  is actually white-box testing  and only is useful when you have  an open source browser like  Firefox  and &#8230;. .</p>
<p>source code auditing is really practical , but need higher then  knowledge in programming (always C/C++)<br />
for example , in firefox :<br />
you can download all versions  source code from here :<br />
<a href="ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases">ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases</a></p>
<p>more source code of FF written by C++ , my interested  C++ source code Auditor is : CPPcheck<br />
<a href="http://sourceforge.net/apps/mediawiki/cppcheck">http://sourceforge.net/apps/mediawiki/cppcheck</a></p>
<p>Important point that we understand from this Post :<br />
why we can&#8217;t found bugs from this ways ?<br />
i try to answer this question in future post .</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>and this write-up is for  tell you we are &#8220;not dead&#8221;</p>
<p>wait for out new advisories + exploits soon as soon possible</p>
<p>god speed you</p>
<p>Daphne<br />
&#8212;&#8212;&#8212;&#8211;<br />
unfortunately  , we had mistake in our simple fuzzer , now edit &amp; repaired .<br />
thanks .<br />
Daphne /</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abysssec.com/blog/2009/08/21/how-to-write-browser-fuzzer/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

