<?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>Blog Drainware</title>
	<atom:link href="http://blog.drainware.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.drainware.com</link>
	<description>Drainware Content Filter Blog</description>
	<lastBuildDate>Sun, 01 Jan 2012 20:59:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Drainware Filtering Platform preview</title>
		<link>http://blog.drainware.com/drainware-filtering-platform-preview/</link>
		<comments>http://blog.drainware.com/drainware-filtering-platform-preview/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 22:49:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.drainware.com/?p=179</guid>
		<description><![CDATA[These days we are working really hard to finish Drainware 2.0. Our solution is now prepared to satisfy all your ...]]></description>
			<content:encoded><![CDATA[<p>These days we are working really hard to finish Drainware 2.0. Our solution is now prepared to satisfy all your needs from a filtering scope.The backend is based on NoSQL for managing huge amount of data and is pretty scalable.</p>
<p>The filters are written on C and C++ packed into an icap server or webservices, for systems scripting we choosed python and for the web interface PHP5 + JQuery integrated into a customized MVC framework from scratch. We also have developed an SMTP proxy and a Microsoft Windows client to cover more leak vectors.</p>
<p><span id="more-179"></span></p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.30.32.png"><img class="aligncenter size-medium wp-image-195" title="Blocking Page fot SSL" src="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.30.32-300x153.png" alt="" width="300" height="153" /></a></p>
<p style="text-align: center;">Analyzing ssl</p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.31.15.png"><img class="aligncenter size-medium wp-image-194" title="Blocking Page for exploit detected inside PDF file" src="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.31.15-300x153.png" alt="" width="300" height="153" /></a></p>
<p style="text-align: center;">Malware detection</p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.36.48.png"><img class="aligncenter size-medium wp-image-193" title="Interface after login" src="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.36.48-300x259.png" alt="" width="300" height="259" /></a></p>
<p style="text-align: center;">Drainware Dynamic Interface preview</p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.41.31.png"><img class="aligncenter size-medium wp-image-182" title="Modules view" src="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.41.31-300x255.png" alt="" width="300" height="255" /></a></p>
<p style="text-align: center;">Modules configuration</p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.37.08.png"><img class="aligncenter size-medium wp-image-192" title="Configuration options" src="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.37.08-300x288.png" alt="" width="300" height="288" /></a></p>
<p style="text-align: center;">General configuration</p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.39.04.png"><img class="aligncenter size-medium wp-image-191" title="Importing groups from LDAP or Active Directory" src="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.39.04-300x201.png" alt="" width="300" height="201" /></a></p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.39.18.png"><img class="aligncenter size-medium wp-image-190" title="Importing Group" src="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.39.18-300x249.png" alt="" width="300" height="249" /></a></p>
<p style="text-align: center;">Importing groups from Active Directory</p>
<p>&nbsp;</p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.39.32.png"><img class="aligncenter size-medium wp-image-189" title="Configuration Wizard" src="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.39.32-300x209.png" alt="" width="300" height="209" /></a></p>
<p style="text-align: center;">Configuration Wizard</p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.40.16.png"><img class="aligncenter size-medium wp-image-188" title="Isolation of networks" src="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.40.16-300x107.png" alt="" width="300" height="107" /></a></p>
<p style="text-align: center;">Network Segment isolation</p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.40.23.png"><img class="aligncenter size-medium wp-image-187" title="Unlocking isolated netwworks" src="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.40.23-300x105.png" alt="" width="300" height="105" /></a></p>
<p style="text-align: center;">Releasing isolated segment</p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.40.35.png"><img class="aligncenter size-medium wp-image-186" title="Routes configuration" src="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.40.35-300x154.png" alt="" width="300" height="154" /></a></p>
<p style="text-align: center;">Network routes configuration</p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.40.50.png"><img class="aligncenter size-medium wp-image-185" title="Webfilter Reports" src="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.40.50-300x287.png" alt="" width="300" height="287" /></a></p>
<p style="text-align: center;">Webfilter reporting</p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.41.05.png"><img class="aligncenter size-medium wp-image-184" title="Data Leak Prevention Rules" src="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.41.05-300x135.png" alt="" width="300" height="135" /></a></p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.41.14.png"><img class="aligncenter size-medium wp-image-183" title="Data leak prevention regex details" src="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.41.14-300x269.png" alt="" width="300" height="269" /></a></p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.42.14.png"><img class="aligncenter size-medium wp-image-181" title="DLP File registration" src="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.42.14-300x149.png" alt="" width="300" height="149" /></a></p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.42.33.png"><img class="aligncenter size-medium wp-image-180" title="File Acces Policy for DLP" src="http://blog.drainware.com/wp-content/uploads/2011/12/Captura-de-pantalla-2011-12-30-a-las-23.42.33-300x271.png" alt="" width="300" height="271" /></a></p>
<p style="text-align: center;">DLP Configuration</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.drainware.com/drainware-filtering-platform-preview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Malware analysis with cuckoo sandbox</title>
		<link>http://blog.drainware.com/malware-analysis-with-cuckoo-sandbox/</link>
		<comments>http://blog.drainware.com/malware-analysis-with-cuckoo-sandbox/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 12:52:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.drainware.com/?p=174</guid>
		<description><![CDATA[&#160; Cuckoo Sandbox started as a Google Summer of Code project in 2010 within The Honeynet Project. It was designed and developed ...]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p><strong>Cuckoo Sandbox</strong> started as a <a href="http://www.google-melange.com/">Google Summer of Code</a> project in 2010 within <a href="http://www.honeynet.org/">The Honeynet Project</a>.<br />
It was designed and developed by <em>Claudio “nex” Guarnieri</em>, who still mantains it and coordinates all efforts from joined contributors.</p>
<p>&nbsp;<br />
&nbsp;</p>
<p><iframe src="http://player.vimeo.com/video/23801978?title=0&amp;byline=0&amp;portrait=0" width="400" height="223" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<p>&nbsp;<br />
&nbsp;</p>
<p><iframe src="http://player.vimeo.com/video/24128028?title=0&amp;byline=0&amp;portrait=0" width="400" height="230" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.drainware.com/malware-analysis-with-cuckoo-sandbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compile mongodb 2.0.1 as shared library</title>
		<link>http://blog.drainware.com/compile-mongodb-2-0-1-as-shared-library/</link>
		<comments>http://blog.drainware.com/compile-mongodb-2-0-1-as-shared-library/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 12:38:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.drainware.com/?p=168</guid>
		<description><![CDATA[&#160; If you need compile mongodb 2.0.1 as shared library,you have to make some modifications in the code. We needed ...]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>If you need compile mongodb 2.0.1 as shared library,you have to make some modifications in the code. We needed so we are sharing with you the patch</p>
<p><a title="Patch" href="http://pastebin.com/ZxKwjeNi">http://pastebin.com/ZxKwjeNi</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.drainware.com/compile-mongodb-2-0-1-as-shared-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jsunpack-n A generic JavaScript unpacker</title>
		<link>http://blog.drainware.com/jsunpack-n-a-generic-javascript-unpacker/</link>
		<comments>http://blog.drainware.com/jsunpack-n-a-generic-javascript-unpacker/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 21:59:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.drainware.com/?p=141</guid>
		<description><![CDATA[jsunpack-n emulates browser functionality when visiting a URL. It&#8217;s purpose is to detect exploits that target browser and browser plug-in ...]]></description>
			<content:encoded><![CDATA[<p>jsunpack-n emulates browser functionality when visiting a URL. It&#8217;s purpose is to detect exploits that target browser and browser plug-in vulnerabilities. It accepts many different types of input:</p>
<ul>
<li>PDF files &#8211; samples/sample-pdf.file</li>
<li>Packet Captures &#8211; samples/sample-http-exploit.pcap</li>
<li>HTML files</li>
<li>JavaScript files</li>
<li>SWF files</li>
</ul>
<p><span id="more-141"></span></p>
<p><strong>Get the sourcecode</strong></p>
<blockquote><p>svn checkout http://jsunpack-n.googlecode.com/svn/trunk/ jsunpack-n-read-only</p></blockquote>
<p>Users can upload files, or enter script contents and URLs to decode. If you choose to install jsunpack-n on your own system, you can run it with the following command to fetch and decode a URL:</p>
<p>&nbsp;</p>
<blockquote><p>$ ./jsunpackn.py -u URL</p></blockquote>
<p>&nbsp;</p>
<p>Optionally, you can specify the -a option, which fetches further decoded URLs or paths. If you wish to decode a local file instead, you can simply run:</p>
<p>&nbsp;</p>
<blockquote><p>$ ./jsunpackn.py samples/sample-pdf.file</p></blockquote>
<p>&nbsp;</p>
<p>Other samples of malicious files exist within the samples directory.</p>
<p>One common problem running jsunpack-n is when there is no output. This means that there are no signature matches but it could mean that the file was decoded. You have the choice to use -v (verbose) or -V (veryverbose) to get more information in case jsunpack-n outputs nothing.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.drainware.com/jsunpack-n-a-generic-javascript-unpacker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>libemu – x86 Shellcode Emulation</title>
		<link>http://blog.drainware.com/libemu-%e2%80%93-x86-shellcode-emulation/</link>
		<comments>http://blog.drainware.com/libemu-%e2%80%93-x86-shellcode-emulation/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 21:48:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.drainware.com/?p=134</guid>
		<description><![CDATA[libemu is a small library written in C  (by Paul Baecher and Markus Koetter) offering basic x86 emulation and shellcode ...]]></description>
			<content:encoded><![CDATA[<p>libemu is a small library written in C  (by Paul Baecher and Markus Koetter) offering basic x86 emulation and shellcode detection using GetPC heuristics. It is designed to be used within network intrusion/prevention detections and honeypots.</p>
<p><span id="more-134"></span></p>
<p>libemu supports:</p>
<ul>
<li>Executing x86 instructions
<ul>
<li>Reading x86 binary code</li>
<li>Register emulation</li>
<li>Basic FPU emulation</li>
</ul>
</li>
<li>Shellcode execution
<ul>
<li>Shellcode detection
<ul>
<li>Using GetPC heuristics</li>
<li>Static analysis</li>
<li>Binary backwardstraversal</li>
</ul>
</li>
<li>Win32 API hooking</li>
</ul>
</li>
</ul>
<p>With libemu one can:</p>
<ul>
<li>Detect shellcodes</li>
<li>Execute the shellcodes</li>
<li>Profile shellcode behaviour</li>
</ul>
<p>&nbsp;</p>
<h3>Obtaining libemu via Git</h3>
<blockquote>
<pre>git clone git://git.carnivore.it/libemu.git</pre>
</blockquote>
<p>&nbsp;</p>
<h2 id="exampleprog">Example Programs</h2>
<h3>cpurun</h3>
<p>cpurun is a small utility allowing to write code to the emulations memory and executing the code written, basics.<br />
<strong>Download:</strong><br />
<a href="http://src.carnivore.it/libemu/tree/testsuite/cpu_run.c">View Code</a><br />
<a href="http://src.carnivore.it/libemu/plain/testsuite/cpu_run.c">Download Code</a></p>
<h3>emunids</h3>
<p>emunids is a small intrusion detection system using libnids for tcp stream reassembly and libemu to detect shellcodes in streams. Due too libnids bad performance it does not scale on links (much) faster than 2MBit/s, but it is still a good example howto use libemu.</p>
<p><strong>Download:</strong><br />
<a href="http://src.carnivore.it/libemu/tree/testsuite/emunids.c">View Code</a><br />
<a href="http://src.carnivore.it/libemu/plain/testsuite/emunids.c">Download Code</a></p>
<h3>sctest</h3>
<p>sctest is part of the libemu testsuite and very usefull when testing new features. Even though the code is <em>historically tainted</em> it may be a usefull source for those who want to setup shellcode emulation allowing win32 api calls and offering hooks on these calls. sctest is not the best example, the code is nerved by the logic for graphing the callflow, but for now it has to work.<br />
<strong>Location:</strong><br />
<a href="http://src.carnivore.it/libemu/tree/tools/sctest/">View Code</a></p>
<h2 id="exampleuc">Example Use Cases</h2>
<h3>Metasploit linux/x86/shell_bind_tcp</h3>
<p>This is a linux shellcode, provided by the Metasploit Framework. The payload was constructed using</p>
<blockquote>
<pre>./msfpayload linux/x86/shell_bind_tcp r | \
./msfencode -a x86 -e x86/shikata_ga_nai -t raw</pre>
</blockquote>
<p><a href="http://libemu.carnivore.it/images/msf_linux_x86_shell_bind_tcp.png"></a><a href="http://libemu.carnivore.it/images/msf_linux_x86_shell_bind_tcp.png"></a></p>
<h2 id="hacking"><a href="http://blog.drainware.com/wp-content/uploads/2011/10/msf_linux_x86_shell_bind_tcp.png"><img class="aligncenter size-medium wp-image-138" title="msf_linux_x86_shell_bind_tcp" src="http://blog.drainware.com/wp-content/uploads/2011/10/msf_linux_x86_shell_bind_tcp-100x300.png" alt="" width="100" height="300" /></a></h2>
<p>&nbsp;</p>
<h2>Hacking libemu</h2>
<h3>Win32 API Hooks</h3>
<p>Hooking calls to (supported) windows dll&#8217;s is very easy.<br />
Look at sctest within the <a href="http://libemu.carnivore.it/#examples">examples section</a> to see how the <kbd>user_hook_ExitThread</kbd> is implemented and gets installed.</p>
<h3>Adding Support For More DLLs</h3>
<p>Currently libemu uses a static approach which DLLs can be loaded, as they are hardcoded within the Win32 environment.<br />
To support a new DLL, you have to have a copy of the DKK, load the DLL into process memory in Windows, and dump the required sections. Then, these required sections have be written to memory in libemu once the DLL gets loaded. If you want to support a different DLL, contact us, we will add support for the DLL and extend this guide to allow others supporting <em>their</em> DLLs too.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.drainware.com/libemu-%e2%80%93-x86-shellcode-emulation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Didier Stevens version of SpiderMonkey</title>
		<link>http://blog.drainware.com/didier-stevens-version-of-spidermonkey/</link>
		<comments>http://blog.drainware.com/didier-stevens-version-of-spidermonkey/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 21:09:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.drainware.com/?p=117</guid>
		<description><![CDATA[Some time ago, NJ Verenini post on Websense’s Blog were he explains how to use SpiderMonkey to deobfuscate Javascript? As SpiderMonkey has no ...]]></description>
			<content:encoded><![CDATA[<p>Some time ago, NJ Verenini <a href="http://securitylabs.websense.com/content/Blogs/2574.aspx">post</a> on Websense’s Blog were he explains how to use <a href="http://www.mozilla.org/js/spidermonkey/" target="_blank">SpiderMonkey</a> to deobfuscate Javascript? As SpiderMonkey has no document object, Verenini shows a way to define your own document object to support document.write()</p>
<p><span id="more-117"></span></p>
<p>Didier Stevens has modified version of SpiderMonkey <a href="http://www.mozilla.org/js/spidermonkey/" target="_blank">Mozilla’s C implementation of JavaScript</a>, with some extra functions to help with malware analysis.</p>
<p>Additional functionality:</p>
<ul>
<li>document.write</li>
<li>eval(arg) writes arg to a file</li>
<li>window.navigate</li>
</ul>
<p>&nbsp;</p>
<p><a href="http://blog.drainware.com/wp-content/uploads/2011/10/spidermonkey3.png"><img class="size-medium wp-image-118 aligncenter" style="border: 3px solid black;" title="spidermonkey3" src="http://blog.drainware.com/wp-content/uploads/2011/10/spidermonkey3-300x180.png" alt="" width="300" height="180" /></a></p>
<p>&nbsp;</p>
<p>Didier has adapted the SpiderMonkey source code to include the document object. Not that my method is better than Verenini’s, I just wanted to play with SpiderMonkey. An upcoming “Virus Lab” post will explain how I use this adapted SpiderMonkey, but for now I want to explain how I proceeded to modify SpiderMonkey.</p>
<p>If you’re not familiar with the SpiderMonkey source-code, were do you start? I want to implement a document object with a write method. Is there something similar in JavsScript? Take a look at the Math object.</p>
<blockquote><p>js<br />
js&gt;Math<br />
[object Math]</p>
<p>The Math object has several methods, like sin:<br />
js&gt; Math.sin(3.1415926/2)<br />
0.9999999999999997</p>
<p>document does not exist:<br />
js&gt; document<br />
2: ReferenceError: document is not defined</p></blockquote>
<p>The trick is to add a document object that has the same behaviour as the Math object (i.e. same members), and if this works, we adapt the document object by removing all Math members and adding a write method.</p>
<p>Greping for Math in the source code reveals that the object is defined in jsmath.c and jsmath.h. This is good, the Math object is defined in it’s own source files. So we will make our own source files for document based on Math: copy jsmath.[ch] to jsdocument.[ch]. Then edit jsdocument.[ch] and replace Math with document (there are some execeptions, like math.h).</p>
<p>Then we add jsdocument.[ch] to the makefile.<br />
Greping for jsmath.h reveals that it’s included in jsapi.c. A quick search for<br />
Math in jsapi.c reveals this code:</p>
<blockquote><p>js_InitMathClass(cx, obj) &amp;&amp;<br />
{js_InitMathClass, ATOM_OFFSET(Math)},</p></blockquote>
<p>We add our own code:</p>
<blockquote><p>js_InitDocumentClass(cx, obj) &amp;&amp;<br />
{js_InitDocumentClass, ATOM_OFFSET(Document)},</p></blockquote>
<p>Now when we build, we’ll get an error because we use a Document ATOM that we didn’t define. A bit of searching in the source code shows that atoms are defined in jsatom.[ch]. We search for Math and add extra code for Document.<br />
And now the build succeeds!</p>
<blockquote><p>js<br />
js&gt; document<br />
[object document]<br />
js&gt; document.sin(3.1415926/2)<br />
0.9999999999999997</p></blockquote>
<p>Now we have to remove all members and add our own write method, but this is for another post, where I’ll publish my modified spidermonkey (it’s GPLed).</p>
<p>Reversing with the commented source code is not so difficult as reversing binaries, especially the patching process. If you want to add a new feature, look for an existing similar feature and do an “intelligent” copy-paste of the source code.</p>
<p>&nbsp;</p>
<p>Download source code:</p>
<p><a href="http://www.didierstevens.com/files/software/js-1.7.0-mod.tar.gz">js-1.7.0-mod.tar.gz</a> (<a href="https://www.didierstevens.com/files/software/js-1.7.0-mod.tar.gz">https</a>)</p>
<p>MD5: A64B079FAEFD6BA23CAC3FCC7EF41AC7</p>
<p>SHA-256: 74DD063F13647505ABB11FA3D1A5D44DA35A3F73F18FE973F93FBA5E349B8BA9<br />
<a href="http://www.didierstevens.com/files/software/js-1.5-mod-0.3.tar.gz">js-1.5-mod-0.3.tar.gz</a> (<a href="https://www.didierstevens.com/files/software/js-1.5-mod-0.3.tar.gz">https</a>)</p>
<p>MD5: 59D7C7F67903A00AFC97C9BEDD7E1F54</p>
<p>SHA256: B1B51F3FD357635AD6BE90D183416DAA7783972F9BAF15E36B0A5B9BF748A570</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.drainware.com/didier-stevens-version-of-spidermonkey/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Analyzing a Malicious PDF File</title>
		<link>http://blog.drainware.com/analyzing-a-malicious-pdf-file/</link>
		<comments>http://blog.drainware.com/analyzing-a-malicious-pdf-file/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 20:54:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.drainware.com/?p=115</guid>
		<description><![CDATA[Didier Stevens has developed a few tools for malware analyze of pdf files. Searching for keyword javascript yields 2 indirect ...]]></description>
			<content:encoded><![CDATA[<p>Didier Stevens has developed a few tools for malware analyze of pdf files. Searching for keyword javascript yields 2 indirect objects referencing /JavaScript objects. The JavaScript is executed through an automatic annotation (/AA) when the page is rendered (e.g. when the PDF document is opened, as it contains only one page). Decompressing the second /JavaScript object (34) displays the code.</p>
<p><span id="more-115"></span></p>
<p>collectEmailInfo is an undocument Adobe Acrobat JavaScript method with a vulnerability (fixed in Adobe Acrobat Reader 8.1.2). <a href="http://blog.drainware.com/didier-stevens-version-of-spidermonkey/">Didier&#8217;s Spidermonkey version</a> helps to extract the shell code.</p>
<div align="center">
<iframe src="http://player.vimeo.com/video/2020268?title=0&amp;byline=0&amp;portrait=0" width="400" height="302" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe>
</div>
<p><strong>pdf-parser.py</strong></p>
<p>This tool will parse a PDF document to identify the <a href="http://blog.didierstevens.com/2008/04/09/quickpost-about-the-physical-and-logical-structure-of-pdf-files/" target="_self">fundamental elements</a> used in the analyzed file. It will not render a PDF document. The code of the parser is quick-and-dirty, I’m not recommending this as text book case for PDF parsers, but it gets the job done.</p>
<p>Download:</p>
<p><a href="http://www.didierstevens.com/files/software/pdf-parser_V0_3_7.zip">pdf-parser_V0_3_7.zip</a> (<a href="https://www.didierstevens.com/files/software/pdf-parser_V0_3_7.zip">https</a>)</p>
<p>MD5: BDC0E5A82EB6D7C287E7360D8901023D</p>
<p>SHA256: C83D39F8938A00A3EB2BDE3134EFAF3A2BE11E72C2C8A92841D4E1E82366D7E1</p>
<p><strong>make-pdf tools</strong><br />
make-pdf-javascript.py allows one to create a simple PDF document with embedded JavaScript that will execute upon opening of the PDF document. It’s essentially glue-code for the mPDF.py module which contains a class with methods to create headers, indirect objects, stream objects, trailers and XREFs.</p>
<p>If you execute it without options, it will generate a PDF document with JavaScript to display a message box (calling app.alert).</p>
<p>To provide your own JavaScript, use option –javascript for a script on the command line, or –javascriptfile for a script contained in a file.</p>
<p>Download:</p>
<p><a href="http://www.didierstevens.com/files/software/make-pdf_V0_1_1.zip">make-pdf_V0_1_1.zip</a> (<a href="https://www.didierstevens.com/files/software/make-pdf_V0_1_1.zip">https</a>)</p>
<p>MD5: 9AF2E343B78553021C989E8E22355531</p>
<p>SHA256: C604679ABEB0469C1463159E02E74F12487B2755A6096B416A8F4F638DEB8AA9</p>
<p><strong>pdfid.py</strong><br />
This tool is not a PDF parser, but it will scan a file to look for certain PDF keywords, allowing you to identify PDF documents that contain (for example) JavaScript or execute an action when opened. PDFiD will also handle <a href="http://blog.didierstevens.com/2008/04/29/pdf-let-me-count-the-ways/" target="_self">name obfuscation</a>.</p>
<p>Download:</p>
<p><a href="http://www.didierstevens.com/files/software/pdfid_v0_0_11.zip">pdfid_v0_0_11.zip</a> (<a href="https://www.didierstevens.com/files/software/pdfid_v0_0_11.zip">https</a>)</p>
<p>MD5: 99BFA4916EC5E005953E3D9D8AD96C83</p>
<p>SHA256: C831569C8139D5CA5709600B987C929716FE58B1DD6B65F18EC84473A83B4075</p>
<p><strong>PDFTemplate.bt</strong><br />
This is a <a href="http://www.sweetscape.com/010editor/">010 Editor</a> template for the PDF file format.<br />
It’s particularly useful for malformed PDF files, like this example with PDFUnknown structures:</p>
<div>
<p>Download:</p>
<p><a href="http://www.didierstevens.com/files/software/PDFTemplate.zip">PDFTemplate.zip</a> (<a href="https://www.didierstevens.com/files/software/PDFTemplate.zip">https</a>)</p>
<p>MD5: C124200C3317ACA9C17C2AE2579FCFEB</p>
<p>SHA256: 24C4FEAD2CABAD82EC336DDCFD404915E164D7B48FBA7BA1295E12BBAF8EB15D</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.drainware.com/analyzing-a-malicious-pdf-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fighting Advanced Persistent Threats</title>
		<link>http://blog.drainware.com/fighting-advanced-persistent-threat-apt-with-open-source-tools/</link>
		<comments>http://blog.drainware.com/fighting-advanced-persistent-threat-apt-with-open-source-tools/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 20:37:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.drainware.com/?p=106</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<div style="width:425px" id="__ss_3576119"><iframe src="http://www.slideshare.net/slideshow/embed_code/3576119" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> </div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.drainware.com/fighting-advanced-persistent-threat-apt-with-open-source-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drainware Comments Filter Plugin for WordPress</title>
		<link>http://blog.drainware.com/drainware-comments-filter-plugin-for-wordpress/</link>
		<comments>http://blog.drainware.com/drainware-comments-filter-plugin-for-wordpress/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 11:04:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.drainware.com/?p=89</guid>
		<description><![CDATA[Drainware Comments Filter will keep your blog free of undesirable comments (bad words, pornography, violence, intolerant words) using our Content ...]]></description>
			<content:encoded><![CDATA[<p>Drainware Comments Filter will keep your blog free of undesirable comments (bad words, pornography, violence, intolerant words) using our Content Filter Engine (CFE) and everything absolutely FREE.</p>
<p>Is a GPL plugin based on Akismet and using our FREE API. Our API will check each comment is written in your WordPress Blog and will determine with our intelligent content filter engine if that comment is allowed for your website.</p>
<p><strong>Install</strong></p>
<ol>
<li>Download plugin and unzip.</li>
<li>Upload the plugin file to your WordPress plugins directory inside of wp-content.</li>
<li>Activate it from the plugins menu inside of WordPress.</li>
<li>Forget that undesirable comments was ever a problem.</li>
</ol>
<p>&nbsp;</p>
<p><strong>Download <a href="http://www.drainware.net/drainware.comments.filter.zip">Drainware comments filter (drainware.comments.filter.zip)</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.drainware.com/drainware-comments-filter-plugin-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rooted 2011 &#8211; NoSQL Security</title>
		<link>http://blog.drainware.com/rooted-2011-nosql-security/</link>
		<comments>http://blog.drainware.com/rooted-2011-nosql-security/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 12:22:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sin categoría]]></category>
		<category><![CDATA[Sin categoría @en]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.drainware.com/?p=14</guid>
		<description><![CDATA[&#160; &#160;]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://player.vimeo.com/video/25200743?title=0&amp;byline=0&amp;portrait=0" width="400" height="300" frameborder="0"></iframe>
<p>&nbsp;</p>
<p><strong>
<div id="__ss_7285962" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><br />
</strong><object id="__sse7285962" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=rooted-nosqlsecurity-110316141700-phpapp01&amp;stripped_title=rooted-2011-nosql-security&amp;userName=jpalanco" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=rooted-nosqlsecurity-110316141700-phpapp01&amp;stripped_title=rooted-2011-nosql-security&amp;userName=jpalanco" allowfullscreen="true" allowscriptaccess="always" name="__sse7285962"></embed></object>&nbsp;</p>
</div>
<p><script src="http://b.scorecardresearch.com/beacon.js?c1=7&amp;c2=7400849&amp;c3=1&amp;c4=&amp;c5=&amp;c6="></script><script src="http://b.scorecardresearch.com/beacon.js?c1=7&amp;c2=7400849&amp;c3=1&amp;c4=&amp;c5=&amp;c6="></script></p>
<p><script src="http://b.scorecardresearch.com/beacon.js?c1=7&amp;c2=7400849&amp;c3=1&amp;c4=&amp;c5=&amp;c6="></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.drainware.com/rooted-2011-nosql-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

