<?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"
	>

<channel>
	<title>Matasano Chargen</title>
	<atom:link href="http://www.matasano.com/log/feed" rel="self" type="application/rss+xml" />
	<link>http://www.matasano.com/log</link>
	<description></description>
	<pubDate>Mon, 22 Jun 2009 18:18:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>Ruby for Pentesters - The Dark Side I: Ragweed</title>
		<link>http://www.matasano.com/log/1799/ruby-for-pentesters-the-dark-side-i-ragweed/</link>
		<comments>http://www.matasano.com/log/1799/ruby-for-pentesters-the-dark-side-i-ragweed/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 18:18:58 +0000</pubDate>
		<dc:creator>tduehr</dc:creator>
		
		<category><![CDATA[Apple]]></category>

		<category><![CDATA[Development]]></category>

		<category><![CDATA[Matasano]]></category>

		<category><![CDATA[Reversing]]></category>

		<guid isPermaLink="false">http://www.matasano.com/log/?p=1799</guid>
		<description><![CDATA[Last summer I was given the task of porting a Win32 Ruby scriptable debugger to OSX&#8230; a task I accomplished with some consternation. 

Over the last year of working here at Matasano, I&#8217;ve had some time to refine the code enough for release. I&#8217;ve cleaned up a bunch of the code resulting from my inexperience [...]]]></description>
			<content:encoded><![CDATA[<p>Last summer I was given the task of porting a Win32 Ruby scriptable debugger to OSX&#8230; a task I accomplished with some consternation. </p>

<p>Over the last year of working here at Matasano, I&#8217;ve had some time to refine the code enough for release. I&#8217;ve cleaned up a bunch of the code resulting from my inexperience with Ruby, implemented a couple features and fixed several bugs. Meanwhile, Chris Rohlf began a Linux port and its beginnings are included in the gem. And yes, Ragweed is now available as a gem through github. (<code>sudo gem install tduehr-ragweed</code> for the impatient with github as a gem source)</p>

<p><center><h3>Why a scriptable debugger?</h3></center></p>

<p>When reversing, the usual debugging tools for developers aren&#8217;t as useful. They&#8217;re built for stepping interactively through programs you have source code for. They don&#8217;t generally have methods to get data out. </p>

<p>Reversing also requires being able to do mean and nasty things to the running process. When tracing calls, you want to watch how they interact. The last thing you want to do is anything manual. Automation is a requirement. </p>

<p>Also helpful is the ability to automate information gathering tasks, or the ability to dynamically add, remove or change breakpoints. These features are why scriptable debuggers have been created: To play with black boxes in a more dynamic and seedier manner.</p>

<p><center><h3> What&#8217;s available already? </h3></center></p>

<p>There are already scriptable debuggers out there.  The most notable are PaiMei/PyDbg, Immunity Debugger and IDA. </p>

<p>PaiMei is written in Python, bills itself as &#8220;a reverse engineer&#8217;s swiss army knife&#8221; and uses the Python ctypes library for low level win32 calls.  </p>

<p>Immunity Debugger is a GUI debuggger for win32 that uses Python for its scripting functionality.  </p>

<p>IDA Pro is largely a win32 disassembler, but it is scriptable, again in Python, and includes a debugging module. </p>

<p>Before I get run off by a screaming mob with pitchforks, flightless birds, members of the family bovidae, etc., I will also mention GDB which has a library in development (libgdb) and can be scripted through macros. </p>

<p>With the exception of GDB which runs on most platforms and has its own macro language, these all share two common problems: Win32 and Python. Matasano is a Ruby shop. We like Ruby. It is good to us. We also wanted a tool for non-Win32 applications. But mostly, we just wanted something in Ruby.</p>

<p><center><h3>Enter Ragweed</h3></center></p>

<p>I&#8217;m going to stick to the OSX side of Ragweed for this article since I&#8217;m most familiar with it and there is still work to be done to unify the (currently) three debugging APIs &#8212;- Win32, Linux, and OSX &#8212;- inside Ragweed.</p>

<p>Under the hood, Ragweed (on OSX) uses Ruby/DL to perform the various low level system calls necessary to create a debugger. (More about that in <a href="http://www.matasano.com/log/1100/what-ive-been-doing-on-my-summer-vacation-or-it-has-to-work-otherwise-gdb-wouldnt/">my post from last year</a>). These calls are abstracted somewhat to provide a smoother, more Ruby-like interface. </p>

<p>There are two caveats for Ragweed in OSX: </p>

<ul>
<li><p>Due to the changes in Ruby 1.9 to DL, it is currently incompatible with 1.9. </p></li>
<li><p>Also, under OSX, Ragweed wants to run as root due to restrictions on <code>task_for_pid</code>.</p></li>
</ul>

<p><center><h3>A quick example (this we can do in IRB):</h3></center></p>

<div class="codesnip-container" ><div class="codesnip" style="font-family: monospace;"><span class="co1"># debugging ftp using default signal handlers, printing registers every stop and logging calls to _lpwd</span><br />
<br />
&nbsp; <span class="kw3">require</span> <span class="st0">&#8216;ragweed&#8217;</span><br />
&nbsp; <span class="kw1">class</span> DebugFtp &amp;lt; Debuggerosx<br />
<br />
&nbsp; <span class="co1"># print the registers every time the process stops</span><br />
<br />
&nbsp; &nbsp; <span class="kw1">def</span> on_stop<span class="br0">&#40;</span>signal<span class="br0">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span class="kw3">puts</span> <span class="st0">&quot;Stopped with signal #{signal}&quot;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span class="kw2">self</span>.<span class="me1">threads</span>.<span class="me1">each</span> <span class="br0">&#123;</span>|t| <span class="kw2">self</span>.<span class="me1">get_registers</span><span class="br0">&#40;</span>t<span class="br0">&#41;</span>.<span class="me1">dump</span><span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; <span class="kw1">end</span><br />
<br />
&nbsp; <span class="kw1">end</span><br />
<br />
&nbsp; <span class="co1"># no process lookup by name yet</span><br />
<br />
&nbsp; d = DebugFtp.<span class="me1">new</span><span class="br0">&#40;</span>pid<span class="br0">&#41;</span> <span class="co1"># where pid is the id of ftp for this example</span><br />
<br />
&nbsp; <span class="co1"># set breakpoint for lpwd</span><br />
<br />
&nbsp; d.<span class="me1">breakpoint_set</span><span class="br0">&#40;</span>0x420f,<span class="st0">&#8216;lpwd&#8217;</span>, <span class="br0">&#40;</span>bpl = <span class="kw3">lambda</span> <span class="kw1">do</span> | t, r, s | <span class="kw3">puts</span> <span class="st0">&quot;#{ s.breakpoints[r.eip].first.function } hit in thread #{ t }<span class="es0">\n</span>&quot;</span>; <span class="kw1">end</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
<br />
&nbsp; d.<span class="me1">install_breakpoints</span><br />
<br />
&nbsp; d.<span class="me1">continue</span><br />
<br />
&nbsp; d.<span class="kw3">loop</span> <span class="co1">#loop until child exits</span><br />
<br />
&nbsp; <span class="co1"># now go do stuff in in your other terminal window running ftp</span></div></div>

<p>That&#8217;s it. We just override the signal handlers for the signals we want to know about (or not), attach to a running process, set and install breakpoints, and it&#8217;s off to the traces. A simple hit tracer is only a CSV file and read loop away from this.</p>

<p>Want info on a region of memory?</p>

<p>d.region_info(0x0,:basic).dump</p>

<p>What about <code>thread_info</code>?</p>

<p>d.thread<em>info(thread</em>id).dump</p>

<p>Break stuff by playing with registers?</p>

<blockquote>regs = d.get_registers(thread_id)

regs.eip = 0x420f

d.set_registers(thread_id, regs)</blockquote>

<p>Grope through the child&#8217;s memory?</p>

<p><code>Ragweed::Wraposx::vm_read(d.task, address, size) #returns a string of child's memory</code></p>

<p>There you have it. It&#8217;s not pretty but it&#8217;s only begun.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matasano.com/log/1799/ruby-for-pentesters-the-dark-side-i-ragweed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ATXSec #2: June 18th, 2009</title>
		<link>http://www.matasano.com/log/1779/atxsec-2-june-18th-2009/</link>
		<comments>http://www.matasano.com/log/1779/atxsec-2-june-18th-2009/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 18:36:41 +0000</pubDate>
		<dc:creator>Dave G.</dc:creator>
		
		<category><![CDATA[Citysec]]></category>

		<guid isPermaLink="false">http://www.matasano.com/log/?p=1779</guid>
		<description><![CDATA[What

CitySec Austin is an informal meetup of information security professionals
in Austin. Unlike other meetups, you will not be expected to pay dues, &#8220;join
up&#8221;, or present a zero-day exploit to attend.

Where

Berryhill Baja Grill
3600 N Capital of TX Hwy.
Austin, TX 78746

When

The third Thursday of every month from 5:00pm until we leave.

Why

We know about ISSA, OWASP, and ISACA. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What</strong></p>

<p>CitySec Austin is an informal meetup of information security professionals
in Austin. Unlike other meetups, you will not be expected to pay dues, &#8220;join
up&#8221;, or present a zero-day exploit to attend.</p>

<p><strong>Where</strong></p>

<p>Berryhill Baja Grill<BR>
3600 N Capital of TX Hwy.<BR>
Austin, TX 78746</p>

<p><strong>When</strong></p>

<p>The third Thursday of every month from 5:00pm until we leave.</p>

<p><strong>Why</strong></p>

<p>We know about ISSA, OWASP, and ISACA. Not casual enough. We don&#8217;t want to
hang out in conference rooms. Just a chance to meet other security folks
without sitting through a sales pitch.  We also have been known to drink
beer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matasano.com/log/1779/atxsec-2-june-18th-2009/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A Working Theory About RC4</title>
		<link>http://www.matasano.com/log/1774/a-working-theory-about-rc4/</link>
		<comments>http://www.matasano.com/log/1774/a-working-theory-about-rc4/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 18:35:10 +0000</pubDate>
		<dc:creator>Thomas Ptacek</dc:creator>
		
		<category><![CDATA[Defenses]]></category>

		<guid isPermaLink="false">http://www.matasano.com/log/?p=1774</guid>
		<description><![CDATA[Via News.YC, a deep dive on the TLS handshake that&#8217;s more
good than bad, and a recommended read if you&#8217;re lucky enough not to
have to know this stuff. At the end of this article, and in the YC
discussion, an interesting issue: why RC4 vs. AES? TLS can do both.

RC4 is an older stream cipher. AES is [...]]]></description>
			<content:encoded><![CDATA[<p>Via <a href="http://news.ycombinator.com/item?id=650914">News.YC</a>, a <a href="http://www.moserware.com/2009/06/first-few-milliseconds-of-https.html">deep dive on the TLS handshake</a> that&#8217;s more
good than bad, and a recommended read if you&#8217;re lucky enough not to
have to know this stuff. At the end of this article, and in the YC
discussion, an interesting issue: why RC4 vs. AES? TLS can do both.</p>

<p>RC4 is an older stream cipher. AES is a newer block cipher. Block
ciphers encrypt in multi-byte chunks (AES&#8217;s block size is 16
bytes). Stream ciphers encrypt byte by byte. You might therefore
assume RC4 was more convenient to use than AES. RC4 is also simpler
than AES, and significantly faster on some benchmarks. </p>

<p>But the practical difference between the two is that you shouldn&#8217;t be
using RC4. RC4 has significant weaknesses, some of which have
contributed to serious breaks in 802.11 security. </p>

<p>The industry &#8220;knows&#8221; this. So why does RC4 keep popping up? Here&#8217;s a
theory.</p>

<p><center><h3>developers like stream ciphers</h3></center></p>

<p>Stream ciphers seem like what you&#8217;d want if you were building crypto
into a protocol. Most protocols send variable length messages. Block
ciphers force you to think about how to fit those messages into
fixed-size blocks. </p>

<p><center><h3>RC4 is the one stream cipher everyone knows</h3></center></p>

<p>RC4 is a famously simple algorithm. Extremely easy to implement.</p>

<p>There are lots of other stream ciphers. The <a href="http://www.ecrypt.eu.org/stream/">eSTREAM</a> project has
spent the past several years conducting Stream Cipher Thunderdome, in
which seven (7) ciphers remain standing despite the best efforts of
full-time academic cryptographers. One of them, <a href="http://en.wikipedia.org/wiki/Trivium_(cipher)">Trivium</a>, is
comparably simple to implement in C. </p>

<p>But nobody knows anything definite about these ciphers. You can still
get fired for picking one of them.</p>

<p><center><h3>people don&#8217;t get block cipher modes</h3></center></p>

<p>It seems simpler to fit RC4 into a protocol than AES. But it&#8217;s
remarkably easy to make AES act like a stream cipher: run it in
<a href="http://en.wikipedia.org/wiki/Counter_mode#Counter_.28CTR.29">Counter mode</a> (CTR). </p>

<p>In CTR, you don&#8217;t use AES to encrypt your plaintext. You use it to
encrypt a concatenated (say) 96 bit nonce and (say) 48 bit
counter to generate a <em>keystream</em>, which you simply XOR into your
plaintext. Every time you run out of keystream, you increment the
counter and generate more of it. This is secure as long as the counter
doesn&#8217;t cycle and the nonce is never reused for a new stream. </p>

<p>CTR turns block ciphers into stream ciphers.</p>

<p>CTR actually has practical benefits over RC4; because the keystream is
generated by a counter, you can seek to an arbitrary point in the
stream and start decrypting.</p>

<p>This is extremely well known to practitioners, and blessed by the 4
cryptographers at NIST. But a friend of mine recently asked a room
full of developers how many knew the difference between ECB and CBC (a
much more basic question). Almost no hands.</p>

<p><center><h3>therefore, RC4</h3></center></p>

<p>You need to encrypt variable length data. No modern stream cipher
escapes the &#8220;exotic&#8221; stigma. Nobody wants to be the developer who
picked FROG or MAGENTA instead of Rijndael before AES. Meanwhile, you don&#8217;t &#8220;get&#8221;
block cipher modes. What are you left with?</p>

<p>A bad algorithm that still occassionally gets used in real designs.</p>

<p><center><h3>a moral of this story?</h3></center></p>

<p>I suppose I&#8217;d argue that if you see a bespoke crypto design, and it
dates from after 2000, and it uses RC4, that&#8217;s an audit flag. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.matasano.com/log/1774/a-working-theory-about-rc4/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ruby for Pentesters:  A ViewState (de)serializer</title>
		<link>http://www.matasano.com/log/1739/ruby-for-pentesters-a-viewstate-deserializer/</link>
		<comments>http://www.matasano.com/log/1739/ruby-for-pentesters-a-viewstate-deserializer/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 22:25:03 +0000</pubDate>
		<dc:creator>Mike Tracy</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.matasano.com/log/?p=1739</guid>
		<description><![CDATA[intro

If you&#8217;ve ever looked under the hood of a Microsoft web app, you&#8217;ve
seen a ViewState. For the uninitiated, ViewState is Microsoft&#8217;s
workaround for the pesky fact that HTTP is stateless. It stores the
present state of web page controls in a big binary blob.

Whenever I test an ASP.NET application, I either have to pop open a VM
and [...]]]></description>
			<content:encoded><![CDATA[<p><p><center><h3>intro</p></center></h3></p>

<p>If you&#8217;ve ever looked under the hood of a Microsoft web app, you&#8217;ve
seen a ViewState. For the uninitiated, ViewState is Microsoft&#8217;s
workaround for the pesky fact that HTTP is stateless. It stores the
present state of web page controls in a big binary blob.</p>

<p>Whenever I test an ASP.NET application, I either have to pop open a VM
and use a viewstate decoding tool or slog through Burp Proxy&#8217;s
viewstate list tree to see if there&#8217;s anything interesting
inside. Neither option appeals to me.</p>

<p>Moreover, some sites I work with don&#8217;t have the ViewState MAC enabled
(to which we normally just say &#8220;hey&#8230; turn this on&#8221;). The MAC is a
cryptographic assurance that nobody but the application has tampered
with the contents of the controls. If the MAC is disabled, I want to
manipulate the viewstate to see if I can make something interesting
happen. Unfortunately, there&#8217;s no real tool that I could find out
there to do this.</p>

<p>So I wrote one.</p>

<p><p><center><h3>how does viewstate work?</p></center></h3></p>

<p>When you render an ASP.Net page with UI-enabled form controls, ASP.Net
serializes the states of those controls. </p>

<p>The resulting set of serialized objects is stored base64-encoded in a
hidden form field, which persists between POSTs (as postbacks).</p>

<p>As interesting as that is, that&#8217;s not what this post is about.</p>

<p><p><center><h3>welcome to WWMD::ViewState</p></center></h3></p>

<p>Have you seen <a href="http://github.com/miketracy/wwmd">WWMD</a>? You should
check it out. It&#8217;s my bag of Ruby web pentesting tools.</p>

<p>I spent quite a bit of time in WWMD, and this seemed like the perfect
opportunity to add a needed piece of functionality to it and also
learn something about how viewstate actually works. </p>

<p>My design goal: a parser that outputs viewstate to YAML (failure,
don&#8217;t try this at home) or XML (success! thanks Timur!)  that could be
easily read (or better yet, XPath search), manipulate and re-serialize
from XML for fuzzing purposes.</p>

<p><p><center><h3>how&#8217;d i do it?</p></center></h3></p>

<p>Searching through the state of the game on the web, I started out by
trying to reverse viewstate serializations in an attempt to get as
much of the structure as I could. I spent about 3 hours doing this and
decided that I wanted a working tool.</p>

<p>So, I popped open System.Web.UI.ObjectStateFormatter in .NET Reflector and
start porting.</p>

<p>(Have you seen Lutz Roeder&#8217;s <a href="http://www.red-gate.com/products/reflector/">.NET
Reflector</a>? You should
check it out.)</p>

<p>After some experimentation, I decided to implement an intermediate set
of Ruby objects for each type of ViewState object. Some notes:</p>

<ul>
<li><p>Deserialization takes place in what (functionally speaking) is a big
case statement (actually, there&#8217;s a lookup table to translate
each opcode into a symbol and call self.send(:symbol) with a
method defined for each type).</p></li>
<li><p>As bytes are pulled off from the binary string, a new ruby object is
created and filled with the correct values for that type,
recursively adding objects until we are done.</p></li>
<li><p>The MAC is added to the top level object if it exists
(ViewState#mac_enabled? will return boolean).</p></li>
<li><p>Each intermediate ruby object implements #serialize and #to-xml. Reading from XML is<br />
    another recursive walk through a big case statement in #from-xml.</p></li>
</ul>

<p><p><center><h3>so for example</p></center></h3></p>

<div class="codesnip-container" ><div class="codesnip" style="font-family: monospace;">wwmd<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:<span class="nu0">010</span>:<span class="nu0">0</span>&gt; page = Page.<span class="me1">new</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;nil<br />
=&gt; <span class="kw2">nil</span><br />
wwmd<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:<span class="nu0">011</span>:<span class="nu0">0</span>&gt; page.<span class="me1">get</span> <span class="st0">&quot;http://www.example.com/vstest/small.html&quot;</span><br />
=&gt; <span class="br0">&#91;</span><span class="nu0">200</span>, <span class="nu0">287</span><span class="br0">&#93;</span><br />
wwmd<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:<span class="nu0">012</span>:<span class="nu0">0</span>&gt; vs = ViewState.<span class="me1">new</span><span class="br0">&#40;</span>page.<span class="me1">get_form</span><span class="br0">&#91;</span><span class="st0">&#8217;__VIEWSTATE&#8217;</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;nil<br />
=&gt; <span class="kw2">nil</span><br />
wwmd<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:<span class="nu0">013</span>:<span class="nu0">0</span>&gt; <span class="kw3">puts</span> vs.<span class="me1">to_xml</span>.<span class="me1">pp</span><br />
&lt;ViewState version_string=<span class="st0">&#8216;ff01&#8217;</span> version=<span class="st0">&#8216;/wE=&#8217;</span>&gt;<br />
&nbsp; &lt;VSPair&gt;<br />
&nbsp; &nbsp; &lt;VSString&gt;wwmd viewstate&lt;/VSString&gt;<br />
&nbsp; &nbsp; &lt;VSString&gt;decoder&lt;/VSString&gt;<br />
&nbsp; &lt;/VSPair&gt;<br />
&lt;/ViewState&gt;<br />
=&gt; <span class="kw2">nil</span><br />
wwmd<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:<span class="nu0">014</span>:<span class="nu0">0</span>&gt; vs.<span class="me1">to_xml</span>.<span class="me1">to_s</span>.<span class="me1">write</span><span class="br0">&#40;</span><span class="st0">&quot;test.xml&quot;</span><span class="br0">&#41;</span><br />
=&gt; <span class="st0">&quot;test.xml&quot;</span><br />
wwmd<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:<span class="nu0">015</span>:<span class="nu0">0</span>&gt; vx = ViewState.<span class="me1">new</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; <span class="kw2">nil</span><br />
=&gt; <span class="kw2">nil</span><br />
wwmd<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:<span class="nu0">016</span>:<span class="nu0">0</span>&gt; vx.<span class="me1">debug</span> = <span class="kw2">true</span><br />
=&gt; <span class="kw2">true</span><br />
wwmd<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:<span class="nu0">017</span>:<span class="nu0">0</span>&gt; vx.<span class="me1">from_xml</span><span class="br0">&#40;</span><span class="kw4">File</span>.<span class="me1">read</span><span class="br0">&#40;</span><span class="st0">&quot;test.xml&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
<span class="nu0">00000002</span> <span class="br0">&#91;</span>0x0f<span class="br0">&#93;</span> pair: <span class="kw1">next</span> = <span class="kw3">string</span><br />
<span class="nu0">00000003</span> <span class="br0">&#91;</span>0x05<span class="br0">&#93;</span> <span class="kw3">string</span>: wwmd viewstate<br />
<span class="nu0">00000013</span> <span class="br0">&#91;</span>0x05<span class="br0">&#93;</span> <span class="kw3">string</span>: decoder<br />
=&gt; <span class="kw2">true</span><br />
wwmd<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:<span class="nu0">018</span>:<span class="nu0">0</span>&gt; vx.<span class="me1">b64</span><br />
=&gt; <span class="st0">&quot;/wEPBQ53d21kIHZpZXdzdGF0ZQUHZGVjb2Rlcg==&quot;</span></div></div>

<p>In debug mode, the deserializer will print out a line containing
offset [opcode] type: value. Saving this output and grepping through
it for string types (-e indexed_string: -e string:) has been quite
useful (as opposed to searching through XML).</p>

<p><p><center><h3>and there you have it.</p></center></h3></p>

<p>In about 3 full days of coding (and about another day spent debugging
and refactoring), I had a working tool that does exactly what I needed
to do. Many thanks to Jeremy (who planted the seed), Timur (for
XMLfu), <a href="http://ridiculousfish.com/hexfiend/">HexFiend</a> and <a href="http://www.cjmweb.net/vbindiff/">vbindiff</a> (try reversing anything without these
two).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matasano.com/log/1739/ruby-for-pentesters-a-viewstate-deserializer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Typing The Letters A-E-S Into Your Code? You&#8217;re Doing It Wrong!</title>
		<link>http://www.matasano.com/log/1749/typing-the-letters-a-e-s-into-your-code-youre-doing-it-wrong/</link>
		<comments>http://www.matasano.com/log/1749/typing-the-letters-a-e-s-into-your-code-youre-doing-it-wrong/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 06:05:19 +0000</pubDate>
		<dc:creator>Thomas Ptacek</dc:creator>
		
		<category><![CDATA[Defenses]]></category>

		<guid isPermaLink="false">http://www.matasano.com/log/?p=1749</guid>
		<description><![CDATA[ 
  1. INT. COFFEE SHOP, MORNING
  A &#8220;young, cool-people&#8217;s&#8221; coffee shop on the first floor of an old office building in downtown Chicago. &#8220;My band is playing&#8221; notices line the wall. A hipster in a tight t-shirt hands a cappucino to MIKE TRACY while THOMAS PTACEK waits impatiently. The coffee shop is [...]]]></description>
			<content:encoded><![CDATA[<p><p></p> 
 <p> 1. INT. COFFEE SHOP, MORNING</p>
 <p> A &#8220;young, cool-people&#8217;s&#8221; coffee shop on the first floor of an old office building in downtown Chicago. &#8220;My band is playing&#8221; notices line the wall. A hipster in a tight t-shirt hands a cappucino to MIKE TRACY while THOMAS PTACEK waits impatiently. The coffee shop is loud; Mike and Thomas raise their voices to be heard over the noise.</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> Did you see that? He worked so hard on my coffee.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> What? Right. Whatever. Let&#8217;s get&#8230;</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> He got all those little beans and put them in the thing and tamped them down and</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Whatever. Ok. We&#8217;ve gotta get ready for this interview</p> 
 <p style="text-align: center;"> MIKE TRACY (CONT&#8217;D)</p> 
 <p style="margin-left: 5em;"> and he clickity-clack clickity-clacked with the machine and</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Mike! I get it! He made the shit out of your coffee. What are we going to ask this guy?</p> 
 <p> Mike walks to a table at the side of the shop, grabbing a lid and a sleeve for his coffee.</p> 
 <p style="text-align: center;"> MIKE TRACY </p> 
 <p style="text-align: center;"> (Miffed)</p> 
 <p style="margin-left: 5em;"> I don&#8217;t know. It&#8217;s your interview. Single signon cookies?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Why SSO?</p> 
 <p> Mike is maneuvering around people entering the shop through a door leading out to the hallway. </p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> It&#8217;s got crypto in it. Everyone always fucks it up.</p> 
 <p> INT. HALLWAY - CONTINUOUS
</p> 
 <p> Thomas follows Mike, walking towards the elevators.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Yeah, that could work. We&#8217;ll have two apps. User logged into one of them, needs the other app to do something without making them log in.</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> Print an invoice.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Yeah, this will work. We&#8217;ll see if he comes up with the industry standard answer; the cookie both apps honor to let you in, encrypted so users can&#8217;t change their account to  someone else&#8217;s.</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> So, a base64 blob AES encrypted with a key both servers share? That&#8217;s pretty easy, isn&#8217;t it? Are we sure this isn&#8217;t a layup?</p> 
 <p> DING. An elevator opens. Thomas and Mike step inside.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> You&#8217;ll be surprised.</p> 
 <p style="margin-left: 5em;"></p> 
 <p style="margin-left: 5em;"></p> 
 <p style="margin-left: 5em;"></p> 
 <p style="margin-left: 5em;"></p> 
<hr style="margin-bottom: 5em; margin-top: 5em;" />
 <p> 2. INT. OFFICE - LATER THAT MORNING
</p> 
 <p> An unadorned off-white office lined with Ikea desks, piled with books, papers, and in one case a pile of random electronics tools (soldering iron, multi, etc). An EASEL PAD stands next to a large window looking out on a brick wall. Thomas and Mike sit office chairs with THE CANDIDATE.
</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> So you&#8217;d have app &#8216;A&#8217; set a cookie with your account ID in it,  right, but how would you keep the user from switching their account by messing with the cookie?</p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="margin-left: 5em;"> Uh, I&#8217;d encrypt the cookie?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Show us how on the pad?</p> 
 <p> Thomas hands The Candidate a dry erase marker, as The Candidate walks to the easel pad. </p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="margin-left: 5em;"> Does it matter what language I write it in?</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> Whatever you&#8217;re comfortable with.</p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="text-align: center;"> (Writing awkwardly, addressing the easel)</p> 
 <p style="margin-left: 5em;"> Ok, so in C#, I&#8217;d use Response.Cookies, and</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> You can just do the part where you encrypt the cookies.</p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="margin-left: 5em;"> Oh, ok.</p> 
 <p> The Candidate writes on the pad, slowly:</p> </p>

<div class="codesnip-container" ><div class="codesnip" style="font-family: monospace;">public <span class="kw4">static</span> <span class="kw4">string</span> Encrypt<span class="br0">&#40;</span><span class="kw4">string</span> toEncrypt, <span class="kw4">string</span> key, bool useHashing<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
<br />
&nbsp; &nbsp; byte<span class="br0">&#91;</span><span class="br0">&#93;</span> keyArray = UTF8Encoding.<span class="me1">UTF8</span>.<span class="me1">GetBytes</span><span class="br0">&#40;</span>key<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; byte<span class="br0">&#91;</span><span class="br0">&#93;</span> toEncryptArray = UTF8Encoding.<span class="me1">UTF8</span>.<span class="me1">GetBytes</span><span class="br0">&#40;</span>toEncrypt<span class="br0">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>useHashing<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; keyArray = new MD5CryptoServiceProvider<span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">ComputeHash</span><span class="br0">&#40;</span>keyArray<span class="br0">&#41;</span>;<br />
<br />
&nbsp; &nbsp; var tdes = new TripleDESCryptoServiceProvider<span class="br0">&#40;</span><span class="br0">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span> Key = keyArray, Mode = CipherMode.<span class="me1">ECB</span>, Padding = PaddingMode.<span class="me1">PKCS7</span> <span class="br0">&#125;</span>;<br />
<br />
&nbsp; &nbsp; ICryptoTransform cTransform = tdes.<span class="me1">CreateEncryptor</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; byte<span class="br0">&#91;</span><span class="br0">&#93;</span> resultArray = cTransform.<span class="me1">TransformFinalBlock</span><span class="br0">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; toEncryptArray, <span class="nu0">0</span>, toEncryptArray.<span class="me1">Length</span><span class="br0">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span class="kw1">return</span> Convert.<span class="me1">ToBase64String</span><span class="br0">&#40;</span>resultArray, <span class="nu0">0</span>, resultArray.<span class="me1">Length</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></div></div>

<p><p></p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="margin-left: 5em;"> Sorry.</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> No worries, writing code during interviews sucks.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Can you walk us through what that code is doing?</p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="margin-left: 5em;"> Sure. So I&#8217;m Triple-DES encrypting the cookie, which  is the &#8220;toEncrypt&#8221; function argument.</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> Triple DES? Seriously?</p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="margin-left: 5em;"> Ah, yeah, you&#8217;re right, in my last job we had to use Triple DES for campatibility, but I&#8217;d use AES now.</p> 
 <p> The Candidate starts correcting the text on the pad.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Don&#8217;t worry about it, keep going. But yeah, don&#8217;t use Triple DES for anything. It has a bunch of problems, but also an 8 byte block size, which is tiny.</p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="margin-left: 5em;"> Ok, so, I take the key and I turn it into an AES key by  MD5&#8217;ing it.</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> You know MD5 is broken, right?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Yeah, that&#8217;s not really the problem there though.</p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="margin-left: 5em;"> Oh, I could just use SHA-1.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> SHA-1 is really fast. Can you see why that&#8217;s a problem here?</p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="text-align: center;"> (Haltingly)</p> 
 <p style="margin-left: 5em;"> Um. Not really? Don&#8217;t I want this to be fast?</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> What&#8217;s in the cookie you&#8217;re encrypting again?</p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="margin-left: 5em;"> A string of URL arguments&#8230;</p> 
 <p> The Candidate starts writing on the pad, &#8220;userId=39493&#038;role=user&#038;timestamp=1414919&#8221;</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> So what&#8217;s to stop me from just running a dictionary through MD5, generating a key, and trying to decrypt the cookie? I&#8217;ll  know I won when I get clean ASCII.</p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="margin-left: 5em;"> And how do I keep that from happening? You should use strong passwords anyways. And I use a salt with the key anyways.</p> 
 <p> Mike vomits onto the floor.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Gross.</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="text-align: center;"> (Wiping mouth)</p> 
 <p style="margin-left: 5em;"> A salt doesn&#8217;t do anything here!</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Just put a &#8220;for&#8221; loop around SHA-1 and run it 1000 times to generate the key; that&#8217;ll at least slow down a brute force attack. SHA-1 is lightning fast. By itself, it&#8217;s a  crappy way to generate a key.</p> 
 <p style="text-align: center;"> (To Mike)</p> 
 <p style="margin-left: 5em;"> Clean that up?</p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="margin-left: 5em;"> Well, I guess. Wait, why should we use a password here at  all? I could just use a random string of bytes&#8230;</p> 
 <p> The Candidate writes again on the whiteboard</p> </p>

<div class="codesnip-container" ><div class="codesnip" style="font-family: monospace;">new RNGCryptoServiceProvider<span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">GetBytes</span><span class="br0">&#40;</span>keyArray<span class="br0">&#41;</span>;</div></div>

<p><p></p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> That is much better. Sometimes it&#8217;s a lot more convenient to use a readable string. If you do, the loop around SHA-1 is similar to what PBKDF does, which is I guess a best practice here. But if you can keep structure out of your crypto keys, that&#8217;s much better.</p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="margin-left: 5em;"> Ok. Should I keep going?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Your encryption function. Do you know what the &#8220;ECB&#8221; thing there means?</p> 
 <p style="text-align: center;"> THE CANDIDATE </p> 
 <p style="margin-left: 5em;"> Oh, fuck! You&#8217;re right, that should be CBC. </p> 
 <p style="text-align: center;"> (Pausing)</p> 
 <p style="margin-left: 5em;"> Sorry for swearing.</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> S&#8217;okay. You&#8217;ll fit right in.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> You know the difference between ECB and CBC?</p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="margin-left: 5em;"> Yeah, like, each block feeds into the next one?</p> 
 <p> The candidate draws on the easel.</p> 
<a href="http://www.matasano.com/log/wp-content/uploads/2009/06/cbc1.png"><img src="http://www.matasano.com/log/wp-content/uploads/2009/06/cbc1.png" alt="" title="cbc1" width="257" height="173" class="aligncenter size-full wp-image-1750" /></a>
 <p></p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Why&#8217;s that a win?</p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="margin-left: 5em;"> Because if any of the blocks repeat, you can see them repeat?</p> 
 <p> Mike has opened his laptop and is typing.</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="text-align: center;"> (To the laptop)</p> 
 <p style="margin-left: 5em;"> We have a picture of that somewhere. Oh, here.</p> 
 <p> Mike raises the laptop up to show The Candidate</p> 
<img src="http://www.matasano.com/log/wp-content/uploads/2006/07/ecb.jpg" />
 <p></p> 
 <p style="text-align: center;"> MIKE TRACY (CONT&#8217;D)</p> 
 <p style="margin-left: 5em;"> The top part is unencrypted. The bottom part is encrypted ECB. You&#8217;re like Jack from Heat Vision and Jack. </p> 
 <p style="text-align: center;"> THE CANDIDATE</p> 
 <p style="margin-left: 5em;"> I know EVERYTHING! Right, because one bunch of 16 &#8220;black&#8221; bytes is the same as the next, so they show up the same in the picture. Neat. Also, in ECB mode you can cut and paste the blocks, right? He could take the &#8220;userid&#8221; out of your cookie and put it in his own?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Sure. That&#8217;s a good answer. Let&#8217;s move on. Say you&#8217;re implementing a web server. What do you think, processes or threads?</p> 
 <p style="margin-left: 5em;"></p> 
 <p style="margin-left: 5em;"></p> 
 <p style="margin-left: 5em;"></p> 
<hr style="margin-bottom: 5em; margin-top: 5em;" />
 <p> 3. INT. OFFICE CONFERENCE ROOM - AFTERNOON
</p> 
 <p> A room in the same office, roughly the same size, with an oversized brown kitchen table in the middle, littered with paper and McDonalds wrappers. Thomas and Mike sit at the table, talking to a CONFERENCE  PHONE.
</p> 
 <p style="text-align: center;"> CONFERENCE PHONE</p> 
 <p style="margin-left: 5em;"> So how&#8217;d he do?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Pretty much aced it.</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> What? He bombed the cookie part. He used ECB, MD5, and Triple DES!</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> I&#8217;m impressed that he could spell ECB, MD5, or Triple DES. And it wouldn&#8217;t have mattered if he had used CBC, SHA-256, and AES-256. His code still would have been  broken.</p> 
 <p style="text-align: center;"> CONFERENCE PHONE</p> 
 <p style="margin-left: 5em;"> How so?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> He didn&#8217;t authenticate the message. Encryption isn&#8217;t &#8212;-</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="text-align: center;"> (Chanting)</p> 
 <p style="margin-left: 5em;"> Encryption - isn&#8217;t - authentication. </p> 
 <p style="text-align: center;"> CONFERENCE PHONE</p> 
 <p style="margin-left: 5em;"> Don&#8217;t you mean integrity? </p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> No, Dave, I mean authentication. They&#8217;re called message authentication codes.</p> 
 <p style="text-align: center;"> CONFERENCE PHONE</p> 
 <p style="margin-left: 5em;"> Ok, Tom. But he screwed that up?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Yeah, but who cares? I&#8217;m surprised he even knew what CBC was. But we just asked that to see how he thinks. We&#8217;re never going to let him implement crypto code anyways. </p> 
 <p style="text-align: center;"> CONFERENCE PHONE</p> 
 <p style="margin-left: 5em;"> I guess we don&#8217;t even let you write crypto code.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Sure, and when I asked him about processes and threads&#8230;</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> Can I stop you both here for a second?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Yeah?</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> This room is pretty fucking boring. We&#8217;re in a screenplay, right?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Oh, yeah, you&#8217;re right. Let&#8217;s fix that. </p> 
 <p style="text-align: center;"> (Shouting)</p> 
 <p style="margin-left: 5em;"> Wings of silver!</p> 
 <p style="text-align: center;"> CONFERENCE PHONE</p> 
 <p style="margin-left: 5em;"> Nerves of steel!</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> Thundercats go!</p> 
 <p> EXT. HURTLING THROUGH SPACE - CONTINUOUS
</p> 
 <p> The office melts away around them, revealing a starfield hurtling past as if moving at awesome speed. Meanwhile, the conference phone transforms into a UNICORN WITH LASER HORN. </p> 
 <p style="text-align: center;"> DAVE THE LASER UNICORN</p> 
 <p style="margin-left: 5em;"> It&#8217;s &#8220;Silverhawks&#8221;, jackass.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Where were we?</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> Authentication?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Oh yeah. Even if he had done AES-256-CBC. His code is still busted. I can make his messages say whatever I want them to.</p> 
 <p style="text-align: center;"> DAVE THE LASER UNICORN</p> 
 <p style="margin-left: 5em;"> How do you do that? Isn&#8217;t that the point of CBC mode? Anything you change in the ciphertext randomizes the output. What can  an attacker do with that?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> First of all, sometimes randomizing the output is all you  need. If one of the key-value pairs in the cookie is your role, and the default role is &#8220;admin&#8221;, but the server always generates a &#8220;role=user&#8221; field&#8230;</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> Yikes. Yeah, that&#8217;s bad. Have you ever seen that bug in the wild?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Garbling a block to confuse an app? I found a similar problem recently. Login generates an encrypted cookie. Inside the cookie, comma-seperated key-value pairs. If you put a comma in your user name, the server doesn&#8217;t want you to inject your own key-value pairs, like &#8220;bob comma admin equals yes&#8221;. So it quotes the commas. You can mess up a block to eat the quote character.</p> 
 <p style="text-align: center;"> DAVE THE LASER UNICORN</p> 
 <p style="margin-left: 5em;"> How do you know what block to mess up?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> It&#8217;s a cookie. You get unlimited tries. Each time, you add  another &#8216;A&#8217; to the login name, or mess with a different block. Eventually you line things up just right so that you&#8217;ve garbled the quote character but not the comma. Here, let me show you.</p> 
 <p> Thomas puts his hand to his forehead, and a beam of light emerges from his forehead, projecting a picture, because it&#8217;s my script dammit.</p> 
<a href="http://www.matasano.com/log/wp-content/uploads/2009/06/cbc2.png"><img src="http://www.matasano.com/log/wp-content/uploads/2009/06/cbc2.png" alt="" title="cbc2" width="499" height="410" class="aligncenter size-full wp-image-1751" /></a>
 <p></p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Top hexdump. The plaintext of the cookie. Nothing&#8217;s been done to it. Second hexdump. The encrypted cookie. Key doesn&#8217;t matter. Third hexdump. I&#8217;ve flipped a bit in the second AES block.</p> 
 <p style="text-align: center;"> DAVE THE LASER UNICORN</p> 
 <p style="margin-left: 5em;"> Convenient how AES blocks and hexdump lines are the same width.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Fourth hexdump. The decrypted output, after flipping that bit in the ciphertext. Notice that flipping one bit totally garbled the second block &#8212;- and ate my quote character.</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> Doesn&#8217;t the app reject the cookie because of the  garbled stuff in the middle of it?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Probably not. Why would it? C# and Java and Ruby and Python don&#8217;t care what go in your strings. And hey, if it does reject them, flip a different bit. Totally different output. You get 2^128 tries.</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> Good point. What&#8217;s with the red &#8220;B&#8221; in the decrypted hexdump?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Getting to that. Turns out, I can make the cookie say whatever I want. It&#8217;s a property of CBC.</p> 
 <p style="margin-left: 5em;"></p> 
 <p style="margin-left: 5em;"> The property is this: take a ciphertext block and flip bit 0 (or 2, or N). The resulting plaintext for that block? Garbage. But the next block is normal&#8230; except has that bit flipped. Not good!</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> So you sacrifice one block and flip bits in the second block?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Yeah. Although let&#8217;s stop calling it &#8220;flipping bits&#8221; and call it &#8220;rewriting&#8221;, because that&#8217;s what you&#8217;re doing.</p> 
 <p style="text-align: center;"> DAVE THE LASER UNICORN</p> 
 <p style="margin-left: 5em;"> If you know what bits to flip.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> You always know what the bits are.</p> 
 <p style="text-align: center;"> DAVE THE LASER UNICORN</p> 
 <p style="margin-left: 5em;"> How? </p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Because the bits are always 0x41414141.</p> 
 <p style="text-align: center;"> DAVE THE LASER UNICORN</p> 
 <p style="margin-left: 5em;"> Huh?</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> Because that&#8217;s what he stuffed them with. He logged in as bob A-A-A-A-A-A-A-A-A.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Right. An SSO cookie is usually, what, 100 bytes? If I stuff 1000 A&#8217;s after my login name, and the cookie grows to 1100 bytes? Almost all of those bytes are known to me. Here.</p> 
 <p> Again with the forehead beam thing.</p> 
<a href="http://www.matasano.com/log/wp-content/uploads/2009/06/cbc3.png"><img src="http://www.matasano.com/log/wp-content/uploads/2009/06/cbc3.png" alt="" title="cbc3" width="500" height="387" class="aligncenter size-full wp-image-1752" /></a>
 <p></p> 
 <p style="margin-left: 5em;"> AES encrypt something that I partially control. Doesn&#8217;t matter what the key is. Now XOR that block into the ciphertext. Decrypt it, and somewhere in it you get a random block and &#8220;&#038;admin=yes&#038;x=AAAAA&#8221;.</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> Not good.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> If you&#8217;re encrypting something it&#8217;s usually somehow user-controlled. I&#8217;ll find that by plugging 100 A&#8217;s into each form field and waiting for the cookie to grow. </p> 
 <p style="text-align: center;"> DAVE THE LASER UNICORN</p> 
 <p style="margin-left: 5em;"> How will you know if the cookie is AES?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Same way Chris Eng said to. Add A&#8217;s one at a time, see what increments the cookie grows in. 16 bytes at a time? AES.</p> 
 <p style="text-align: center;"> DAVE THE LASER UNICORN</p> 
 <p style="margin-left: 5em;"> And CBC?</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> If you&#8217;re encrypting all A&#8217;s, the ciphertext blocks will  repeat.</p> 
 <p style="text-align: center;"> DAVE THE LASER UNICORN</p> 
 <p style="margin-left: 5em;"> And how do you know the format to write into the cookie?</p> 
 <p style="text-align: center;"> MIKE TRACY</p> 
 <p style="margin-left: 5em;"> Who cares? Trial and error.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Yeah. Point is, you thought encryption protected the contents of the cookie. It doesn&#8217;t. Oh look, we&#8217;re almost there.</p> 
 <p> Thomas, Mike, and Dave hurtle towards a star system, a solar system, a planet, powers-of-ten-style, towards the Michigan shore, converging eventually on an office building, and then</p> 
 <p> INT. OFFICE CONFERENCE ROOM - AFTERNOON
</p> 
 <p style="text-align: center;"> CONFERENCE PHONE</p> 
 <p style="margin-left: 5em;"> That was really fucking anticlimactic.</p> 
 <p style="margin-left: 5em;"></p> 
 <p style="margin-left: 5em;"></p> 
<hr style="margin-bottom: 5em; margin-top: 5em;" /></p>

<p><p> 4. EXT. PARKING GARAGE - EARLY EVENING
</p> 
 <p> Thomas stands next to his car, a black Volvo 850 held together with duct tape, talking on a cell phone to NATE LAWSON.</p> 
 <p style="text-align: center;"> NATE LAWSON</p> 
 <p style="margin-left: 5em;"> You know this scene is a really bad setup for a movie, right? </p> 
 <p style="text-align: center;"> (Pausing)</p> 
 <p style="margin-left: 5em;"> And I&#8217;m not really OK with you putting words in my mouth. </p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Yeah yeah, whatever. Shut up before I turn you into a claymation character. So yeah, it&#8217;s amazing how you can be a top tier vuln researcher for over a decade and not really get how bad it is not to have a MAC.</p> 
 <p style="text-align: center;"> NATE LAWSON</p> 
 <p style="margin-left: 5em;"> A MAC doesn&#8217;t necessarily save you either. </p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> How so?</p> 
 <p style="text-align: center;"> NATE LAWSON</p> 
 <p style="margin-left: 5em;"> There&#8217;s still a bunch of things you can do wrong. Like I  was just saying, Google Keyczar did almost everything right, but compared the MAC using a timeable comparison function. You could tell how many bytes of the MAC matched by watching how long the function took. People make that mistake all the time. An even more common mistake is to generate an error message when your padding is wrong. If you do that, you can decrypt messages.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> I&#8217;ve heard about that. The Bleichenbacher PKCS thing, and the Vaudenay paper.</p> 
 <p style="text-align: center;"> NATE LAWSON</p> 
 <p style="margin-left: 5em;"> This was a major TLS finding too.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> I&#8217;ve never really been all that clear on how this works.</p> 
 <p style="text-align: center;"> NATE LAWSON</p> 
 <p style="margin-left: 5em;"> Well you know how PKCS 7 padding works, right?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Yeah, you have 2 bytes, you need to fill 16 bytes for an AES block, so you fill the remaining 14 bytes with 0xe.</p> 
 <p style="text-align: center;"> NATE LAWSON</p> 
 <p style="margin-left: 5em;"> So if you tack a random block onto a CBC message, what happens when the receiver decrypts it?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> It comes out random.</p> 
 <p style="text-align: center;"> NATE LAWSON</p> 
 <p style="margin-left: 5em;"> And the padding?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Broken.</p> 
 <p style="text-align: center;"> NATE LAWSON</p> 
 <p style="margin-left: 5em;"> Right. And if you send an error when that happens, you know the padding failed. Now if you keep trying different random blocks, what&#8217;s eventually going to happen?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Uh&#8230;</p> 
 <p style="text-align: center;"> NATE LAWSON</p> 
 <p style="margin-left: 5em;"> You&#8217;ll get a message with valid padding. Valid padding might be 0x3 0x3 0x3. Or it might be 0x4 0x4 0x4 0x4. But if you&#8217;re  basically generating random blocks, what&#8217;s the mostly likely padding you&#8217;re going to get that will pass the check?</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> 0x1.</p> 
 <p style="text-align: center;"> NATE LAWSON</p> 
 <p style="margin-left: 5em;"> Right. And you&#8217;re randomizing the output by tacking a random block in front of real ciphertext, which gets XOR&#8217;d during decryption. So you know the last byte of your random block&#8230;</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> And the 0x1 that you know the padding is, and so that random byte XOR the last byte of the plaintext is 0x1, and so you know the last byte of the plaintext.</p> 
 <p style="text-align: center;"> (Pausing)</p> 
 <p style="margin-left: 5em;"> And now that you know the last byte of the plaintext, you can make the padding come out to 0x2 and try randomizing the other 15 bytes to find out the next byte, and so on?</p> 
 <p style="text-align: center;"> NATE LAWSON</p> 
 <p style="margin-left: 5em;"> Close enough.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> That is fucked up. All you did wrong was show me the exception your library generated when you decrypted the block, and I could decrypt a block. You got to reason byte by byte instead of block by block.</p> 
 <p style="text-align: center;"> NATE LAWSON</p> 
 <p style="margin-left: 5em;"> You can decrypt whole messages that way. It&#8217;s called an error oracle. You can&#8217;t show clients discernable errors. You can&#8217;t  even take different amounts of time to do things! You can watch the system with random inputs and measure how much time things take. </p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> There&#8217;s no way any programmer is ever going to get this stuff right.</p> 
 <p style="text-align: center;"> NATE LAWSON</p> 
 <p style="margin-left: 5em;"> Professional crypto people don&#8217;t even get this stuff right. But if you have to encrypt something, you might as well use something that has already been tested. </p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> GPG for data at rest. TLS for data in motion. </p> 
 <p style="text-align: center;"> NATE LAWSON</p> 
 <p style="margin-left: 5em;"> You can also use Guttman&#8217;s cryptlib, which has a sane API. Or Google Keyczar. They both have really simple interfaces, and they try to make it hard to do the wrong thing. What we need are fewer libraries with higher level interfaces. But we also need more testing for those libraries.</p> 
 <p style="text-align: center;"> THOMAS PTACEK</p> 
 <p style="margin-left: 5em;"> Like I&#8217;ve been saying, if you have to type the letters &#8220;A-E-S&#8221; into your source code, you&#8217;re doing it wrong.</p> 
 <p style="text-align: center;"> NATE LAWSON</p> 
 <p style="margin-left: 5em;"> Uh. Ok. Whatever you say, Tom.</p> </p>

<p style="margin-left: 5em;"></p> 

<p style="margin-left: 5em;"></p> 

<hr style="margin-bottom: 5em; margin-top: 5em;" />

<p>5. FADE TO BLACK</p>

<p></p>

<p>Fade in epilogue:</p>

<p style="margin-left: 5em;">The next day, Thomas&#8217; planet was destroyed. Have you guessed the name of his planet? <b>It was EARTH</b>! DON&#8217;T DATE ROBOTS.</p> 
]]></content:encoded>
			<wfw:commentRss>http://www.matasano.com/log/1749/typing-the-letters-a-e-s-into-your-code-youre-doing-it-wrong/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Announcing Playbook 2.5 With Integrated Ticketing, Change Review, And Audit</title>
		<link>http://www.matasano.com/log/1719/announcing-playbook-25-with-integrated-ticketing-change-review-and-audit/</link>
		<comments>http://www.matasano.com/log/1719/announcing-playbook-25-with-integrated-ticketing-change-review-and-audit/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 16:55:04 +0000</pubDate>
		<dc:creator>Max Caceres</dc:creator>
		
		<category><![CDATA[Feature]]></category>

		<category><![CDATA[Matasano]]></category>

		<category><![CDATA[Playbook]]></category>

		<guid isPermaLink="false">http://www.matasano.com/log/?p=1719</guid>
		<description><![CDATA[Right from the get-go our vision for Playbook was to provide a no-frills integrated view of the complete life cycle of every rule on every firewall under management. From the moment a change request is submitted until it is finally fulfilled by rule edits deployed to your firewalls. Coupled with version control and transparent branching, [...]]]></description>
			<content:encoded><![CDATA[<p>Right from the get-go our vision for Playbook was to provide a no-frills integrated view of the complete life cycle of every rule on every firewall under management. From the moment a change request is submitted until it is finally fulfilled by rule edits deployed to your firewalls. Coupled with version control and transparent branching, Playbook&#8217;s ticketing not only helps you manage incoming requests &#8212; which any ticketing system can do &#8212; but allows you to review changes before they hit any firewalls, and provides critical information to the firewall management process by <a href="http://www.matasano.com/log/1657/what-is-the-left-fielders-name-oh-no-no-what-is-on-second-base/">linking multiple rule changes to the request that originated them</a>.</p>

<p>The complete change history behind every line on every firewall ruleset &#8212; who requested it, why, what were the suggested changes and who approved them &#8212; is then available at the click of a button. We think that&#8217;s pretty cool.</p>

<p>We are very excited about 2.5 and hope you are too. Check the updated <a href="http://runplaybook.com/new">Playbook&#8217;s site</a> to see what&#8217;s new in 2.5.</p>

<div style="margin-left:auto; margin-right:auto; text-align:center;"><a href="http://runplaybook.com/new"><img class="aligncenter size-medium wp-image-1725" title="pb25www" src="http://www.matasano.com/log/wp-content/uploads/2009/06/pb25www.png" alt="" width="242" height="300" /></a></div>

<p><br/>
<a href="http://runplaybook.com/signup">Sign up</a> today to learn more about Playbook.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matasano.com/log/1719/announcing-playbook-25-with-integrated-ticketing-change-review-and-audit/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Matasano PFI (as seen on TV!)</title>
		<link>http://www.matasano.com/log/1693/matasano-pfi-as-seen-on-tv/</link>
		<comments>http://www.matasano.com/log/1693/matasano-pfi-as-seen-on-tv/#comments</comments>
		<pubDate>Fri, 22 May 2009 20:17:45 +0000</pubDate>
		<dc:creator>stephen</dc:creator>
		
		<category><![CDATA[Bitching About Protocols]]></category>

		<category><![CDATA[Development]]></category>

		<category><![CDATA[Matasano]]></category>

		<category><![CDATA[Reversing]]></category>

		<guid isPermaLink="false">http://www.matasano.com/log/?p=1693</guid>
		<description><![CDATA[Do you ever find yourself on a reversing or pen-testing project with the need to peek into a TCP stream and modify a little bit of data?

Do you find yourself annoyed,  feeling that you&#8217;ve hacked together code to do this many times before, but simply can&#8217;t find it?

Do you find yourself hobbling together other tools [...]]]></description>
			<content:encoded><![CDATA[<p>Do you ever find yourself on a reversing or pen-testing project with the need to peek into a TCP stream and modify a little bit of data?</p>

<p>Do you find yourself annoyed,  feeling that you&#8217;ve hacked together code to do this many times before, but simply can&#8217;t find it?</p>

<p>Do you find yourself hobbling together other tools to do what you need? Do you find yourself wishing you had a <a href="http://portswigger.net/proxy/" target="_blank">Burp</a> for raw TCP connections?</p>

<p>No MORE! Using Matasano&#8217;s <a href="http://github.com/s7ephen/projects/tree/master" target="_blank">Port Forwarding Interceptor</a> you have the tool you need right at your fingertips! Lets take a closer look at this exciting new tool shall we? </p>

<p>Let&#8217;s say you are watching your favorite 15 minute ANSI art rendition of Star Wars on <a href="telnet://towel.blinkenlights.nl" target="_blank">telnet://towel.blinkenlights.nl</a> . You think to yourself:</p>

<p><em>&#8220;Man I sure wish I could get in-between my telnet client and the server and begin reversing this Star Wars protocol&#8221;</em>.</p>

<p>Then you remember you got <a href="http://github.com/s7ephen/projects/tree/master" target="_blank">Matasano&#8217;s PFI</a> off of <a href="https://github.com/" target="_blank">Github</a> earlier today!</p>

<p>You take a look at the usage and it seems pretty self explanatory&#8230;</p>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/pfi_usage.jpg"><img class="aligncenter size-full wp-image-1695" src="http://www.matasano.com/log/wp-content/uploads/2009/05/pfi_usage.jpg" alt="" width="500" height="207" /></a></p>

<p>So then you decide to try it out by running something like this:</p>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/starting_pfi.jpg"><img class="aligncenter size-full wp-image-1694" src="http://www.matasano.com/log/wp-content/uploads/2009/05/starting_pfi.jpg" alt="" width="500" height="81" /></a></p>

<p>(This sets up <a href="http://github.com/s7ephen/projects/tree/master" target="_blank">PFI</a> as a TCP port forward listening on the loopback interface on <a href="http://en.wikipedia.org/wiki/Telnet" target="_blank">port 23</a> and forwarding traffic to <a href="telnet://towel.blinkenlights.nl" target="_blank">towel.blinkenlights.nl</a> on <a href="http://en.wikipedia.org/wiki/Telnet" target="_blank">port 23</a>, but you knew that already of course, thats why you ran it&#8230;)</p>

<p>You are then greeted by the comforting and familiar <a href="http://github.com/s7ephen/projects/tree/master" target="_blank">PFI</a> GUI windows. And hey, you didn&#8217;t even have to install any weird python modules or dependencies!</p>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/pfistartupscreens.jpg"><img class="aligncenter size-full wp-image-1696" src="http://www.matasano.com/log/wp-content/uploads/2009/05/pfistartupscreens.jpg" alt="" width="500" height="542" /></a></p>

<p>You take a minute to notice how simple and self-explanatory it all is. One window displays the intercepted text, and allows you to choose whether to intercept. The other window allows you to edit the intercepted data before it is passed on through the tunnel. How easy! It <strong>is </strong>like a &#8220;<a href="http://portswigger.net/proxy/" target="_blank">Burp</a>&#8221; for raw TCP!</p>

<p>You then decide to try it out by connecting through the tunnel:</p>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/telnet_through_pfi.jpg"><img class="aligncenter size-full wp-image-1697" src="http://www.matasano.com/log/wp-content/uploads/2009/05/telnet_through_pfi.jpg" alt="" width="500" height="88" /></a></p>

<p>And begin watching your ANSI art show:</p>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/telnet_through_pfi1.jpg"><img class="aligncenter size-full wp-image-1698" src="http://www.matasano.com/log/wp-content/uploads/2009/05/telnet_through_pfi1.jpg" alt="" width="500" height="314" /></a></p>

<p>So the tunnel works! You look back at your <a href="http://github.com/s7ephen/projects/tree/master" target="_blank">PFI</a> main window and see that data <strong>is</strong> in fact passing through <a href="http://github.com/s7ephen/projects/tree/master" target="_blank">PFI</a>.</p>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/main_display_window.jpg"><img class="aligncenter size-full wp-image-1699" src="http://www.matasano.com/log/wp-content/uploads/2009/05/main_display_window.jpg" alt="" width="500" height="391" /></a></p>

<p>You select the &#8220;Intercept&#8221; check boxes and begin intercepting and editing data across the tunnel.</p>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/traffic_editor_window.jpg"><img class="aligncenter size-full wp-image-1700" src="http://www.matasano.com/log/wp-content/uploads/2009/05/traffic_editor_window.jpg" alt="" width="500" height="328" /></a></p>

<p>And as you begin reversing the complex  ANSI Star Wars protocol you cant help but feel yourself awash with gratitude that <a href="http://github.com/s7ephen/projects/tree/master" target="_blank">Matasano PFI</a> saved you the trouble of having to dig out all your old scripts and programs. You give your monitor a thumbs up and say: &#8220;Thanks PFI!&#8221;</p>

<p>Then you remember that <a href="http://www.matasano.com/download/blackbag-0.9.1.tgz" target="_blank">Matasano Blackbag</a> also had a similar tool (called replug) and then you feel silly, not just about neglecting Blackbag but also that you gave your monitor a thumbs up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matasano.com/log/1693/matasano-pfi-as-seen-on-tv/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Security Implications Of Google Native Client</title>
		<link>http://www.matasano.com/log/1674/the-security-implications-of-google-native-client/</link>
		<comments>http://www.matasano.com/log/1674/the-security-implications-of-google-native-client/#comments</comments>
		<pubDate>Fri, 15 May 2009 06:19:35 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[New Findings]]></category>

		<guid isPermaLink="false">http://www.matasano.com/log/?p=1674</guid>
		<description><![CDATA[What would it look like if Google tried to unseat Flash and obsolete
all desktop applications?

It would look a lot like Google Native Client (NaCl): a mechanism to
download a game written in C/C++ from Id Software and run it in your
browser, without giving Id Software the ability to take control of
your computer. 

Google NaCl is, on [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What would it look like if Google tried to unseat Flash and obsolete
all desktop applications?</strong></p>

<p>It would look a lot like Google <a href="http://code.google.com/p/nativeclient/?tbbrand=GZEZ&#038;utm_campaign=en&#038;utm_source=en-et-osrcblog&#038;utm_medium=et">Native Client</a> (<a href="http://nativeclient.googlecode.com/svn/trunk/nacl/googleclient/native_client/documentation/nacl_paper.pdf">NaCl</a>): a mechanism to
download a game written in C/C++ from Id Software and run it in your
browser, without giving Id Software the ability to take control of
your computer. </p>

<p>Google NaCl is, on its face, a crazy-talk idea. It&#8217;s a browser plugin
that downloads native x86 code from a website and runs it on your
machine. If this sounds familiar, it&#8217;s because Microsoft tried it over
a decade ago with ActiveX. If you&#8217;re skeptical about the idea, it&#8217;s
because <a href="http://www.cs.princeton.edu/sip/java-vs-activex.html">ActiveX was a security calamity</a>; O.K. an ActiveX control, and
it owns your machine almost completely.</p>

<p>So the primary obstacle between Google and the future of software
delivery is security. Google has a lot of interesting ideas about how
to overcome that obstacle. But security people unlikely to take
Google&#8217;s word for it. <a href="http://code.google.com/contests/nativeclient-security/">So Google held a contest</a>: &#8220;we&#8217;ll publish the
source code, you&#8217;ll find flaws. The winner gets $0x2000 USD.&#8221;</p>

<p>We took the bait. And things were looking great for us.</p>

<p>Then Skynet noticed Google, decided it was a threat, and sent a Mark
Dowd unit back through time to terminate it. The contest winner hasn&#8217;t
been declared yet, but as we aren&#8217;t a murderous robot made out of
liquid metal, we&#8217;re guessing we didn&#8217;t take first place.</p>

<p>But we learned lots of stuff in the process, and so we have stuff to
say. And when you get right down to it, isn&#8217;t that worth a lot more
than money? Think about that, while we share some lessons about NaCl
and cry into our discount beers.</p>

<h2>What is NaCl, and why do I care?</h2>

<p>Absent any innovations in browsers or HTML, within 5 years, every
application normal people use will be run off a web server and
rendered via Javascript, HTML, or Flash. That trend is inexorable. You
know it and I know it.</p>

<p>But what if we want to ship a game title? We need a faster runtime,
real graphics, and a decent interaction model. Until recently, if we
wanted to run &#8220;real&#8221; programs behind a browser, we had two options:
ActiveX and Java. </p>

<p><center><b>.</b></center></p>

<p>Consider ActiveX. It&#8217;s a really simple idea. In your HTML code, you
can specify a URI to a library file. The same kind of libraries your
desktop applications use. They&#8217;re written in whatever language makes
sense to the authors, but they&#8217;re delivered as native X86
instructions. They talk to your computer the same way any application
does. </p>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/ax.png"><img src="http://www.matasano.com/log/wp-content/uploads/2009/05/ax.png" alt="" title="ax" width="300" height="202" class="alignnone size-medium wp-image-1676" /></a></p>

<p>This is a powerful concept. Virtually anything a desktop app can do,
an ActiveX control can do. Unfortunately, read that last sentence
again. </p>

<p>So that&#8217;s a problem. Most security-conscious people aren&#8217;t willing to
trust random native executables running on their computers off web
pages.</p>

<p><center><b>.</b></center></p>

<p>Consider Java.</p>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/java.png"><img src="http://www.matasano.com/log/wp-content/uploads/2009/05/java.png" alt="" title="java" width="300" height="237" class="alignnone size-medium wp-image-1678" /></a></p>

<p>Java does something that ups the security ante significantly. Instead
of delivering raw X86 opcodes, it&#8217;s delivering JVM bytecode. The Java
plugin either interprets or compiles that bytecode, but either way,
the actual instructions executing on your computer and talking to your
OS belong to Java. You only have to trust the one native program.</p>

<p>But wait, there&#8217;s more! Because Java programs don&#8217;t execute directly
on the CPU, there&#8217;s an architectural opportunity to improve security:
you can put a security layer in between the program and the operating
system. Java calls this the &#8220;applet sandbox&#8221;. The applet sandbox
basically says, &#8220;applets can&#8217;t talk directly to the OS; instead, they
have to use a set of interfaces we created specifically for allowing
applets to talk directly to the OS&#8221;.</p>

<p>You can&#8217;t do this with ActiveX, because you&#8217;re executing raw X86
instructions. From userland, on an X86 chip, with any reasonable
performance, there&#8217;s no way to put a layer between Win32 userland (or
OS X) and the kernel. If you want that layer there, you have to not
execute code off the Internet directly on the CPU.</p>

<p>But wait, there&#8217;s still more! Because the JVM designers got to design
their own virtual machine and controlled the whole runtime, they were
able to make Java bytecode very &#8220;regular&#8221; and very easy to
analyze. Java is so easy to analyze that 99% of compiled Java binaries
can be decompiled right back to source code.</p>

<p>X86 is not regular and easy to analyze.</p>

<p>For one thing, X86 instructions come in various shapes and sizes. The
shortest X86 instructions (such as &#8220;INCR EAX&#8221;, or &#8220;add 1 to the EAX
register&#8221;) are one byte long. Because X86 instructions can accept
prefixes that change their meanings, the largest X86 instructions are
over 10 bytes long. </p>

<p>The irregularity of X86 instruction lengths does more than just make
instructions tedious to recognize. It also means that, unlike in a
RISC architecture where instructions are always, say, 32 bits long, an
X86 instruction is not necessarily at an aligned offset in the
file. Byte 1024 of an X86 executable is as likely to be the middle of
an instruction as it is the beginning of one. </p>

<p>Why does this matter?</p>

<p>You can&#8217;t easily put a layer between a bare-metal X86 program and the
OS kernel to keep that program from calling &#8220;execve&#8221; and running any
program it wants. So, instead say you wanted to write an X86
&#8220;verifier&#8221; that would check programs you ran to make sure they don&#8217;t
try to call &#8220;execve&#8221;. You&#8217;d have some problems.</p>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/middle.png"><img src="http://www.matasano.com/log/wp-content/uploads/2009/05/middle.png" alt="" title="middle" width="300" height="141" class="alignnone size-medium wp-image-1679" /></a></p>

<p>For starters, because X86 programs can jump pretty much anywhere in
their instruction streams, even if you disassembled the program and
checked for calls to execve, a malicious program could make a series
of innocuous instructions which, when the program jumped into the
middle of them, actually executed execve.</p>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/data.png"><img src="http://www.matasano.com/log/wp-content/uploads/2009/05/data.png" alt="" title="data" width="300" height="192" class="alignnone size-medium wp-image-1677" /></a></p>

<p>Second, as anyone who&#8217;s ever written overflow shellcode knows, X86
programs can execute out of data. So even if you verified the
instruction stream perfectly, the program could use innocuous
instructions to create malicious instructions in data that the
verifier couldn&#8217;t reasonable check.</p>

<p><center><b>.</b></center></p>

<p>And now we come to the part where we explain why we&#8217;re telling you all
of this.</p>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/nacl.png"><img src="http://www.matasano.com/log/wp-content/uploads/2009/05/nacl.png" alt="" title="nacl" width="300" height="231" class="alignnone size-medium wp-image-1680" /></a></p>

<p>Behold, Google NaCl!</p>

<p>Repurposing an <a href="http://crypto.stanford.edu/cs155/papers/sfi.pdf">idea from the mid-&#8217;90s</a>, NaCl employs a very simple
trick to make native X86 programs reliably verifiable. And if you can
verify an X86 program, you don&#8217;t need a layer between the program and
the OS: you can just have rules, and refuse programs that break the
rules. </p>

<p>The trick is: restrict X86 programs to those that are verifiable.</p>

<p>What are those programs? Well, among other things:</p>

<ul>
<li><p>They must admit to simple disassembly, yielding a stream of
recognizable opcodes. This wouldn&#8217;t be a strict requirement
for an X86 program, but most programs adhere to it anyways.</p></li>
<li><p>Those opcodes must not jump to anything but the beginning of an
instruction recognized by that simple disassembly. Easy to
say, tricky to implement, but not a huge design change for
most X86 code.</p></li>
<li><p>They can&#8217;t modify the program text itself.</p></li>
</ul>

<p>(<em>Note that we&#8217;re butchering this concept a little; in the literature,
it makes a big difference whether you patch a candidate program to
safety, or whether you detect unsafeness and halt. But we digress.</em>)</p>

<p>With those constraints in place, it turns out NaCl can reliably
analyze X86 instructions. The verifier can then add rules:</p>

<ul>
<li><p>You can&#8217;t muck with memory management to fool the verifier.</p></li>
<li><p>You can&#8217;t talk directly to the operating system. Instead, you
    can call into trusted code in the first 64k of the binary that
    will make selected system calls for you, just like with a Java
    applet. </p></li>
</ul>

<p>There is a very important difference between what NaCl is doing and
what Java is doing. Java&#8217;s security measures are chaperones. They&#8217;re
always there and always checking your actions. NaCl&#8217;s mechanisms are
just rules. They&#8217;re checked once, and then the program is on its own.
NaCl promises to be faster than Java.</p>

<p>More importantly, to build a NaCl program for your customers browsers,
you don&#8217;t have to port to Java; you just have to use the NaCl build
environment (a patched GCC that targets a simple ELF module) on your
existing C code.</p>

<p>Google, for instance, ported Quake.</p>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/quake.png"><img src="http://www.matasano.com/log/wp-content/uploads/2009/05/quake.png" alt="" title="quake" width="186" height="143" class="alignnone size-medium wp-image-1681" /></a></p>

<p><center><b>.</b></center></p>

<p>It is worth mentioning here &#8212;- and this is to NaCl&#8217;s credit &#8212;- that
this isn&#8217;t a new idea. The fundamental approach dates back to <a href="http://crypto.stanford.edu/cs155/papers/sfi.pdf">Wahbe et al</a>, 
from SOSP in 1993 (!). The core ideas that make the approach work
on X86 (Write/Jump sandboxing vs. full Read/W/J isolation) are in an
<a href="http://people.csail.mit.edu/smcc/projects/pittsfield/pubs/tr-2005/pittsfield-tr.pdf">05 MIT TR and Usenix article</a> by Stephen McCamant (then a grad student
at MIT) and Greg Morrisett at Harvard. And in 2008, Bryan Ford and
Russ Cox released a version of the same idea, <a href="http://pdos.csail.mit.edu/papers/vx32:usenix08.pdf">called Vx32</a>, that runs
on Linux and FreeBSD. </p>

<p>Google NaCl would be the first mainstream implementation of the idea.</p>

<p>That&#8217;s a bit scary, but if you generalize a little bit, the ideas
at play here aren&#8217;t really all that different from the ideas VMWare
relied on; in fact, Vx32 runs code out of basic block caches just like
VMWare (and <a href="http://www.cag.lcs.mit.edu/dynamorio/">DynamoRIO</a> before it) and oh my god we need to stop geeking
out about this now.</p>

<h2>What could possibly go wrong?</h2>

<p><center><b>.</b></center></p>

<p>First: assume the X86 verification all just worked. You&#8217;re still
doomed. </p>

<p>That&#8217;s because X86 ELF modules are much more complex than most of the
file formats browsers already deal with. Any of a million little
mistakes in the parser and loader code are going to be game-over
security vulnerabilities. Remember Mark Dowd&#8217;s 
<a href="http://www.matasano.com/log/1032/this-new-vulnerability-dowds-inhuman-flash-exploit/">crazy Flash vulnerability</a> from last year? The core problem was just a silly parser
bug. </p>

<p>We <a href="http://code.google.com/p/nativeclient/issues/detail?id=85">found</a> <a href="http://code.google.com/p/nativeclient/issues/detail?id=44">several</a> of these <a href="http://code.google.com/p/nativeclient/issues/detail?id=70">types</a> of problems. So did <a href="http://code.google.com/p/nativeclient/issues/detail?id=86">Dowd&#8217;s team</a>. They
were what we focused on.</p>

<p>It&#8217;s worth noting that Java had these types of vulnerabilities
too. But Java is over a decade old, and this part of Java&#8217;s attack
surface has been pretty heavily tested. We don&#8217;t think it scares
security people that much anymore in 2009 (these are famous last words).</p>

<p><center><b>.</b></center></p>

<p>Second: assume the loader code is audited several times over, and that
it reaches the same level of trustworthiness as the image loading code
in your browser already. You&#8217;re still doomed.</p>

<p>That&#8217;s because NaCl programs still need to be able to talk to the
operating system to draw and communicate and manage memory. The NaCl
verifier rules keep programs from doing this directly; instead, NaCl
programs use virtual system calls through special callgates in a small
block of trusted code. </p>

<p>This trusted code base is architecturally similar to the system
interfaces in the JVM, but it&#8217;s also in many ways more
complicated. The JVM needs to provide services to Java programs in
terms of Java classes and data types, which is a straightforward
prospect. NaCl needs to provide many of those same services in terms
of raw memory and state. Screw any of this up, and the contract that
keeps NaCl programs bound up in the sandbox can be broken. Programs
can escape the sandbox.</p>

<p>Dowd&#8217;s team found one of these problems. The NaCl SDK exposes mmap()
and munmap(), and allows it to unmap and remap the text segment. But
by the time these calls were executed, the program had already been
verified. By remapping in code, it was possible to get code into the
text segment that wasn&#8217;t verified, and could contain real system
calls. </p>

<p>Now again, it&#8217;s worth noting that Java has these problems too. Most
famously, Dino Dai Zovi <a href="http://www.matasano.com/log/806/hot-off-the-matasano-sms-queue-cansec-macbook-challenge-won/">found a really bad integer mishandling problem</a>
in the Java QuickTime extensions that would allow Java programs to
directly manipulate raw memory. And unlike the loader bugs, which
might be sussed out of the JVM by now, there are probably more
problems like this in Java. There&#8217;s a lot of action in this part of
the attack surface.</p>

<p><center><b>.</b></center></p>

<p>Third: assume the loader works and the trusted code base that gates
the operating system works. But stop assuming the verifier works
right. Because it might not.</p>

<p>In what&#8217;s probably the best finding of the contest, Dowd&#8217;s team broke
the verifier. </p>

<p>As we mentioned earlier, X86 instructions can carry prefixes that
alter their operating. The most notable things these prefixes do is
change the way the CPU interprets addresses mentioned by the
instructions. For instance, the <a href="http://pdos.csail.mit.edu/6.828/2006/readings/i386/s03_06.htm">segment override prefixes</a> can tell the
CPU to refer to offsets into the data segment (outside the sandbox)
instead of the code segment.</p>

<p>So you don&#8217;t want to allow those prefixes in NaCl jump
instructions. And NaCl didn&#8217;t allow them. For jumps with 8 bit
relative addressing. But the 16/32 bit addressing variants &#8212;- the two
byte ones that start with 0Fh? Not so much. Missed that one. In the
contest build, there were instruction sequences found that could
jailbreak you from the sandbox.</p>

<p>Now if you go through the history of the Java applet sandbox, there
are comparably bad flaws &#8212;- though none have been found in
awhile. But you could also argue that NaCl is at a disadvantage here,
because they aren&#8217;t implementing the operation of the entire X86
instruction set, but rather a security retrofit of it. When they miss
problems like this, they&#8217;ll end up with verifier-level jailbreaks.</p>

<p>On the other hand, there&#8217;s nothing in the CS literature that suggests
those jailbreaks will be that much harder to fix than bugs in the
trusted code base. So you could argue that they&#8217;re at increased risk
of implementation flaws because of this design, but that the design
itself isn&#8217;t really in any way flawed.</p>

<p><center><b>.</b></center></p>

<p>Fourth: Get everything else right, and you still have an
architectural flaw: side channels.</p>

<p>Now our lawyers instruct us that we&#8217;re required to inform you that
Google disclaimed side channel attacks, saying NaCl in its current
incarnation was specifically not designed to handle them. Side channel
attacks were excluded from the contest rules. </p>

<p>But that doesn&#8217;t mean they aren&#8217;t a problem. What&#8217;s that problem? NaCl
programs have access to fine-grained time, and raw access to memory
for instructions and data. </p>

<p>The problem is that for the past 6-odd years, crypto-systems
researchers (like Dan Boneh, Eran Tromer, Dan Bernstein, Onur Aciicmez
and Colin Percival) have been generating research results showing how
attackers can extract private keys from systems using fine-grained
timers. Some of the most interesting work in this vein shows what
attackers that reside on the same hardware as their targets (like in a
shared hosting environment) can do by timing microarchitecture
features like caches.</p>

<p>Concrete example? Ok. You&#8217;re a NaCl program running alongside an SSL
implementation being coerced into running over and over again. The SSL
code is deciding to jump to different locations in its code based on
bits in a secret key. The X86 caches branch targets to implement
branch prediction. NaCl programs can&#8217;t &#8212;- in fact no program can &#8212;-
directly access the BTB caches. But they can implement code sequences
that will time differently depending on what&#8217;s in them.</p>

<p><a href="http://www.matasano.com/log/460/modern-cpu-architecture-threat-or-menace-the-case-of-branch-prediction/">In the canonical exploit</a>, the attacker writes a &#8220;spy&#8221; program that
continuously generates traces based on predicted cache contents. Those
traces can be downloaded and used to reconstruct guesses about private
keys. They don&#8217;t need to be exactly right; they just need to
drastically reduce the search space of a brute-force attack.</p>

<p>The contest rules didn&#8217;t stop <a href="http://code.google.com/p/nativeclient/issues/detail?id=84&#038;can=1&#038;sort=-id">Ralf Philipp Weinmann from submitting</a> a
side channel bug (the obvious one, that NaCl exposes the RDTSC
instruction for 64 bit fine-grained cycle timings). Google
disqualified the finding. We&#8217;re looking forward to seeing how that
plays out, and we have more to say about this problem. </p>

<h2>What does it all mean?</h2>

<p>To our knowledge, flaws were found in all the exposed attack surface
except for the secure ELF loader. So, that happened.</p>

<p>But what did we expect? The <a href="http://www.matasano.com/log/989/thoughts-on-ten-years-of-qmail-security/">smartest people in the world</a> can&#8217;t get
software 100% correct, even when security is the key design goal, and
the software is tested for over 10 years. </p>

<p>It&#8217;s too early to say whether we like the NaCl approach more than the
Java approach, or the Flash approach. It might be fair to summarize
the approaches as follows:</p>

<ul>
<li><p>Java and Flash have a more resilient architecture, but a
    lot of moving parts.</p></li>
<li><p>NaCl has fewer moving parts &#8212;- most of the work is done by
    content-controlled x86 code &#8212;- but those parts are at greater
    risk.</p></li>
</ul>

<p>What&#8217;s hard to argue right now is that NaCl&#8217;s code is at an early
stage. It&#8217;s not secure yet. </p>

<p>So was it smart for Google to hold this contest?</p>

<p>We reserve judgement on the marketing side of things, but from a
practical perspective, we&#8217;re very glad Google did this. We can all put
a bead on where the NaCl implementation is today, and more
importantly, the NaCl team has a good idea of what the hotspots are
for shoring up security and improving dev practices.</p>

<p>Does NaCl matter? After all, it&#8217;s just a beta research project! Well,
it has the potential to bring thousands of preexisting C/C++
applications straight to the browser. Think of it this way: all Google
has to do is convince one top-tier game developer to release a title
on NaCl exclusively for a couple months. It&#8217;ll hit critical mass. </p>

<p>Whether it matters or not, wow is it fun stuff. Getting to spend a day
on the clock going through SOSP program transformation papers, looking
at compilers, and thinking about verification: this is why we got into
the business. So as security researchers, we have to thank Google for
the opportunity.</p>

<p>The winners of the contest haven&#8217;t been announced yet, but unless Dowd
disqualifies his team by staging an assault on the Googleplex with
automatic weapons in an attempt to defend Skynet from a future Google
threat, you&#8217;ve gotta assume they&#8217;re taking this one. Our congrats to
Mark Dowd and Ben Hawkes. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.matasano.com/log/1674/the-security-implications-of-google-native-client/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Next Playbook Release: What Is The Left Fielder&#8217;s Name? Oh, No, No. What Is On Second Base.</title>
		<link>http://www.matasano.com/log/1657/what-is-the-left-fielders-name-oh-no-no-what-is-on-second-base/</link>
		<comments>http://www.matasano.com/log/1657/what-is-the-left-fielders-name-oh-no-no-what-is-on-second-base/#comments</comments>
		<pubDate>Wed, 13 May 2009 22:59:43 +0000</pubDate>
		<dc:creator>Max Caceres</dc:creator>
		
		<category><![CDATA[Feature]]></category>

		<category><![CDATA[Playbook]]></category>

		<guid isPermaLink="false">http://www.matasano.com/log/?p=1657</guid>
		<description><![CDATA[When discussing firewall management pain points with Playbook customers and prospects two common themes keep coming up: &#8220;we want to be able to review rule changes before they hit our firewalls&#8221;, and perhaps more importantly, &#8220;I want to know why this rule is here 6, 12, and 18 months from now.&#8221;

The next Playbook release includes [...]]]></description>
			<content:encoded><![CDATA[<p>When discussing firewall management pain points with <a href="http://runplaybook.com">Playbook</a> customers and prospects two common themes keep coming up: &#8220;we want to be able to review rule changes before they hit our firewalls&#8221;, and perhaps more importantly, &#8220;I want to know <strong>why</strong> this rule is here 6, 12, and 18 months from now.&#8221;</p>

<p>The next Playbook release includes a new feature aimed at addressing both of them. We call it &#8220;request and approval workflow&#8221;, or just &#8220;ticketing&#8221; (or &#8220;the left fielder&#8221;, Because is center field).</p>

<p>Here&#8217;s a brief walkthrough of Playbook&#8217;s ticketing feature as a preview of the upcoming release:</p>

<ul>
<li>Change requests are entered as tickets, accessible through a new Tickets tab.</li>
</ul>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/left1.png" target="_blank"><img class="size-medium wp-image-1658 alignnone" title="left1" src="http://www.matasano.com/log/wp-content/uploads/2009/05/left1.png" alt="" width="523" height="406" /></a></p>

<ul>
<li>Each ticket can have multiple customizable fields, each field can have specific characteristics (e.g., protocol fields can cross reference protocol pages in the wiki, user fields can only contain valid users, etc).</li>
</ul>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/left2.png" target="_blank"><img class="alignnone size-thumbnail wp-image-1659" title="left2" src="http://www.matasano.com/log/wp-content/uploads/2009/05/left2.png" alt="" width="523" height="406" /></a></p>

<ul>
<li>New requests go into the Unassigned queue, where users can pick them up.</li>
</ul>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/left3.png" target="_blank"><img class="alignnone size-medium wp-image-1660" title="left3" src="http://www.matasano.com/log/wp-content/uploads/2009/05/left3.png" alt="" width="523" height="406" /></a></p>

<ul>
<li>Engineers working on a ticket can easily search their current rules for firewalls to change, or the wiki for all mentions of a requested protocol.</li>
</ul>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/left4.png" target="_blank"><img class="alignnone size-medium wp-image-1661" title="left4" src="http://www.matasano.com/log/wp-content/uploads/2009/05/left4.png" alt="" width="523" height="406" /></a></p>

<ul>
<li>Rule changes for a ticket are staged into a <em>ticket branch</em>. These changes do not hit your firewalls until they are approved, allowing for others to continue working on other requests without trouble.</li>
</ul>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/left5.png" target="_blank"><img class="alignnone size-medium wp-image-1662" title="left5" src="http://www.matasano.com/log/wp-content/uploads/2009/05/left5.png" alt="" width="523" height="406" /></a></p>

<ul>
<li>Tickets submitted for approval include diffs for all suggested rule changes for approvers to review</li>
</ul>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/left6.png" target="_blank"><img class="alignnone size-medium wp-image-1663" title="left6" src="http://www.matasano.com/log/wp-content/uploads/2009/05/left6.png" alt="" width="523" height="406" /></a></p>

<ul>
<li>When a ticket is approved all its associated changes are merged into the main branch and will be pushed to your firewalls during the next sync. An annotated rule view tells you not only who&#8217;s behind each line in your rules but also why is the line there, by linking to the ticket with all the history behind the original request.</li>
</ul>

<p><a href="http://www.matasano.com/log/wp-content/uploads/2009/05/left9.png" target="_blank"><img class="alignnone size-medium wp-image-1664" title="left9" src="http://www.matasano.com/log/wp-content/uploads/2009/05/left9.png" alt="" width="523" height="406" /></a></p>

<p><a href="http://runplaybook.com/signup/">Sign up today</a> to test drive Playbook and its new ticketing feature.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matasano.com/log/1657/what-is-the-left-fielders-name-oh-no-no-what-is-on-second-base/feed/</wfw:commentRss>
		</item>
		<item>
		<title>We Are Hiring!</title>
		<link>http://www.matasano.com/log/1554/we-are-hiring/</link>
		<comments>http://www.matasano.com/log/1554/we-are-hiring/#comments</comments>
		<pubDate>Tue, 12 May 2009 21:21:11 +0000</pubDate>
		<dc:creator>Dave G.</dc:creator>
		
		<category><![CDATA[Matasano]]></category>

		<guid isPermaLink="false">http://www.matasano.com/log/?p=1554</guid>
		<description><![CDATA[Us: Rapidly growing security company that rocks out on a wide range of security work including, but not limited to: network and app penetration testing (not just web apps, but proprietary protocols and reversing), architecture/design reviews, and even the occasional training.  

You: Awesome at penetration testing and ready to kick ass in either New York [...]]]></description>
			<content:encoded><![CDATA[<p>Us: Rapidly growing security company that rocks out on a wide range of security work including, but not limited to: network and app penetration testing (not just web apps, but proprietary protocols and reversing), architecture/design reviews, and even the occasional training.  </p>

<p>You: Awesome at penetration testing and ready to kick ass in either New York or Chicago.  You know travel is a part of the job, and are comfortable testing apps other than web apps.  In your free time, you still like doing this stuff.  Ideally, you can be dropped into an engagement, and hit the ground running.  Great if you have arch/design review and training experience, but by no means a requirement.   We would consider relocation to NY or CHI, but are not currently able to sponsor H1Bs.  </p>

<p>Send email to careers.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.matasano.com/log/1554/we-are-hiring/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
