<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Dan Kaminsky&#039;s Blog</title>
	<atom:link href="http://dankaminsky.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dankaminsky.com</link>
	<description>(Or:  The Blog Formerly Known As DoxPara Research)</description>
	<lastBuildDate>Sat, 19 Jan 2013 10:03:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dankaminsky.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Dan Kaminsky&#039;s Blog</title>
		<link>http://dankaminsky.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dankaminsky.com/osd.xml" title="Dan Kaminsky&#039;s Blog" />
	<atom:link rel='hub' href='http://dankaminsky.com/?pushpress=hub'/>
		<item>
		<title>On Brinksmanship</title>
		<link>http://dankaminsky.com/2013/01/18/on-brinksmanship/</link>
		<comments>http://dankaminsky.com/2013/01/18/on-brinksmanship/#comments</comments>
		<pubDate>Fri, 18 Jan 2013 04:25:43 +0000</pubDate>
		<dc:creator>Dan Kaminsky</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://dankaminsky.com/?p=2528</guid>
		<description><![CDATA[Reality is what refuses to go away when you stop believing in it. The reality – the ground truth—is that Aaron Swartz is dead. Now what. Brinksmanship is a terrible game, that all too many systems evolve towards.  The suicide of Aaron Swartz is an awful outcome, an unfair outcome, a radically out of proportion [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2528&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Reality is what refuses to go away when you stop believing in it.</p>
<p>The reality – the ground truth—is that Aaron Swartz is dead.</p>
<p>Now what.</p>
<p>Brinksmanship is a terrible game, that all too many systems evolve towards.  The suicide of Aaron Swartz is an awful outcome, an unfair outcome, a <i>radically out of proportion outcome</i>.   As in all negotiations to the brink, it represents a scenario in which all parties lose.</p>
<p>Aaron Swartz lost.  He paid with his life.  This is no victory for Carmen Ortiz, or Steve Heymann, or JSTOR, MIT, the United States Government, or society in general.  In brinksmanship, <i>everybody loses</i>.</p>
<p>Suicide is a horrendous act and an even worse threat.  But let us not pretend that a set of charges covering the majority of Aaron’s productive years is not also fundamentally noxious, with ultimately a deeply similar outcome.  Carmen Ortiz (and, presumably, Steve Heymann) are almost certainly telling the truth when they say – they had no intention of demanding thirty years of imprisonment from Aaron.  This did not stop them from in fact, demanding thirty years of imprisonment from Aaron.</p>
<p>Brinksmanship.  It’s just negotiation.  Nothing personal.</p>
<p>Let’s return to ground truth.  MIT was a mostly open network, and the content “stolen” by Aaron was itself mostly open.  You can make whatever legalistic argument you like; the reality is there simply wasn’t much offense taken to Aaron’s actions.  He wasn’t stealing credit card numbers, he wasn’t reading personal or professional emails, he wasn’t extracting design documents or military secrets.  These were academic papers he was ‘liberating’.<i></i></p>
<p>What he was, was easy to find.</p>
<p>I have been saying, for some time now, that we have three problems in computer security.  First, we can’t authenticate.  Second, we can’t write secure code.  Third, we can’t bust the bad guys.  What we’ve experienced here, is a failure of the third category.  Computer crime exists.  <i>Somebody</i> caused a huge amount of damage – and made a lot of money – with a Java exploit, and is going to get away with it.  That’s hard to accept.  Some of our rage from this ground truth is sublimated by blaming Oracle.  But some of it turns into pressure on prosecutors, to find somebody, anybody, who can be made an example of.</p>
<p>There are two arguments to be made now.  Perhaps prosecution by example is immoral – people should only be punished for their own crimes.  In that case, these crimes just weren’t offensive enough for the resources proposed (prison isn’t free for society).  Or perhaps prosecution by example is <i>how the system works, don’t be naïve</i> – well then.</p>
<p>Aaron Swartz’s antics were absolutely annoying to somebody at MIT and somebody at JSTOR.  (Apparently someone at PACER as well.)  That’s not good, but that’s not enough.  Nobody who we actually have significant consensus for prosecuting, models himself after Aaron Swartz and thinks “Man, if they go after him, they might go after me”.</p>
<p>The hard truth is that this should have gone away, quietly, ages ago.  Aaron should have received a restraining order to avoid MIT, or perhaps some sort of fine.  Instead, we have a death.  There will be consequences to that – should or should not doesn’t exist here, it is simply a statement of fact.  Reality is what refuses to go away, and this is the path by which brinksmanship is disincentivized.</p>
<p>My take on the situation is that we need a higher class of computer crime prosecution.  We, the computer community in general, must engage at a higher level – both in terms of legislation that captures our mores (and funds actual investigations – those things ain’t free!), and operational support that can provide a critical check on who is or isn’t punished for their deeds.  Aaron’s law is an excellent start, and I support it strongly, but it excludes faux law rather than including reasoned policy.  We can do more.  I will do more.</p>
<p>The status quo is not sustainable, and has cost us a good friend.  It’s so out of control, so desperate to find somebody – anybody! – to take the fall for unpunished computer crime, that it’s almost entirely become about the raw mechanics of being able to locate and arrest the individual instead of about their actual actions.</p>
<p>Aaron Swartz should be alive today.  Carmen Ortiz and Steve Heymann should have been prosecuting somebody else.  They <i>certainly</i> should not have been applying a 60x multiple between the amount of time they wanted, and the degree of threat they were issuing.  The system, in all of its brinksmanship, has failed.  It falls on us, all of us, to fix it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dakami1.wordpress.com/2528/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dakami1.wordpress.com/2528/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2528&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dankaminsky.com/2013/01/18/on-brinksmanship/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6563ffebc0ac78f3aa00369630a3c966?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dakami1</media:title>
		</media:content>
	</item>
		<item>
		<title>Actionable Intelligence:  The Mouse That Squeaked</title>
		<link>http://dankaminsky.com/2012/12/14/mouse/</link>
		<comments>http://dankaminsky.com/2012/12/14/mouse/#comments</comments>
		<pubDate>Fri, 14 Dec 2012 21:35:10 +0000</pubDate>
		<dc:creator>Dan Kaminsky</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://dankaminsky.com/?p=2521</guid>
		<description><![CDATA[[Obligatory disclosures -- I've consulted for Microsoft, and had been doing some research on Mouse events myself.] So one of the more important aspects of security reporting is what I&#8217;ve been calling Actionable Intelligence. Specifically, when discussing a bug &#8212; and there are many, far more than are ever discovered let alone disclosed &#8212; we [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2521&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>[Obligatory disclosures -- I've consulted for Microsoft, and had been doing some research on Mouse events myself.]</p>
<p>So one of the more important aspects of security reporting is what I&#8217;ve been calling Actionable Intelligence. Specifically, when discussing a bug &#8212; and there are many, far more than are ever discovered let alone disclosed &#8212; we have to ask:</p>
<p><strong>What can an attacker do today, that he couldn&#8217;t do yesterday, for what class attacker, to what class victim?</strong></p>
<p>Spider.IO, a fraud analytics company, recently disclosed that under Internet Explorer attackers can capture mouse movement events from outside an open window. What is the Actionable Intelligence here? It&#8217;s moderately tempting to reply: We have a profound new source of modern art.</p>
<p><a href="http://dankaminsky.com/2012/12/14/mouse/psmap/" rel="attachment wp-att-2522"><img class="aligncenter size-full wp-image-2522" alt="psmap" src="http://dakami1.files.wordpress.com/2012/12/psmap.png?w=595"   /></a><br />
(Credit: <a href="http://iographica.com/">Anatoly Zenkov&#8217;s IOGraph</a> tool)</p>
<p>I exaggerate, but not much. The simple truth is that there are simply not many situations where mouse movements are security sensitive. Keyboard events, of course, would be a different story &#8212; but mouse? As more than a few people have noted, they&#8217;d be more than happy to publish their full movement history for the past few years.</p>
<p>It is interesting to discuss the case of the &#8220;virtual keyboard&#8221;. There has been a movement (thankfully rare) to force credential input via mouse instead of keyboard, to stymie keyloggers. This presupposes a class of attacker that has access to keyboard events, but not mouse movements or screen content. No such class actually exists; the technique was never protecting much of anything in the first place. It&#8217;s just pain-in-the-butt-as-a-feature.  More precisely, it&#8217;s another example of Rick Wash&#8217;s profoundly interesting turn of phrase, <a href="http://www.rickwash.com/papers/rwash-homesec-soups10-final.pdf">Folk Security</a>. Put simply, there is a belief that if something is hard for a legitimate user, it&#8217;s even harder for the hacker. Karmic security is (unfortunately) not a property of the universe.</p>
<p>(What about the attacker with an inline keylogger? Not only does he have physical access, he&#8217;s not actually constrained to just emulating a keyboard. He&#8217;s on the USB bus, he has many more interesting devices to spoof.)</p>
<p>That&#8217;s not to say spider.io has not found a bug. Mouse events should only come from the web frame for which script has dominion over, in much the same way CNN should not be receiving Image Load events from a tab open to Yahoo. But the story of the last decade is that bugs are not actually rare, and that from time to time issues will be found in everything. We don&#8217;t need to have an outright panic when a small leak is found. The truth is, every remote code execution vulnerability can also capture full screen mouse motion. Every universal cross site scripting attack (in which CNN can inject code into a frame owned by Yahoo) can do similar, though perhaps only against other browser windows.</p>
<p>I would like to live in a world where this sort of very limited overextension of the web security model warrants a strong reaction. It is in fact nice that we do live in a world where browsers effectively expose the most nuanced and well developed (if by fire) security model in all of software. Where else is even the proper scope of mouse events even a comprehensible discussion?</p>
<p>(Note that it&#8217;s a meaningless concept to say that mouse events within the frame shouldn&#8217;t be capturable. Being able to &#8220;hover&#8221; on items is a core user interface element, particularly for the highly dynamic UI&#8217;s that Canvas and WebGL enable. The depth of damage one would have to inflict on the browser usability model, to &#8216;secure&#8217; activity in what&#8217;s actually the legitimate realm of a page, would be profound. When suggesting defenses, one must consider whether the changes required to make them reparable under actual assault ruins the thing being defended in the first place. We can&#8217;t go off destroying villages in order to save them.)</p>
<p>So, in summary: Sure, there&#8217;s a bug here with these mouse events. I expect it will be fixed, like tens of thousands of others. But it&#8217;s not particularly significant.  What can an attacker do today, that he couldn&#8217;t do yesterday?  Not much, to not many.  Spider.io&#8217;s up to interesting stuff, but not really this.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dakami1.wordpress.com/2521/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dakami1.wordpress.com/2521/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2521&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dankaminsky.com/2012/12/14/mouse/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6563ffebc0ac78f3aa00369630a3c966?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dakami1</media:title>
		</media:content>

		<media:content url="http://dakami1.files.wordpress.com/2012/12/psmap.png" medium="image">
			<media:title type="html">psmap</media:title>
		</media:content>
	</item>
		<item>
		<title>DakaRand 1.0:  Revisiting Clock Drift For Entropy Generation</title>
		<link>http://dankaminsky.com/2012/08/15/dakarand/</link>
		<comments>http://dankaminsky.com/2012/08/15/dakarand/#comments</comments>
		<pubDate>Wed, 15 Aug 2012 21:28:19 +0000</pubDate>
		<dc:creator>Dan Kaminsky</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://dankaminsky.com/?p=2512</guid>
		<description><![CDATA[&#8220;The generation of random numbers is too important to be left to chance.&#8221; &#8211;Robert R. Coveyou &#8220;One out of 200 RSA keys in the field were badly generated as a result of standard dogma.  There&#8217;s a chance this might fail less.&#8221; &#8211;Me [Note:  There are times I write things with CIO's in mind.  This is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2512&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>&#8220;The generation of random numbers is too important to be left to chance.&#8221;<br />
&#8211;<a href="http://en.wikipedia.org/wiki/Pseudorandom_number_generator">Robert R. Coveyou</a></p>
<p>&#8220;One out of 200 RSA keys in the field were <a href="https://factorable.net/weakkeys12.conference.pdf">badly generated</a> as a result of standard dogma.  There&#8217;s a chance this might fail less.&#8221;<br />
&#8211;Me</p>
<p>[Note:  There are times I write things with CIO's in mind.  This is not one of those times.]</p>
<p><a href="http://dakami1.files.wordpress.com/2012/08/dakarand.png"><img class="aligncenter size-full wp-image-2515" title="dakarand" src="http://dakami1.files.wordpress.com/2012/08/dakarand.png?w=595" alt=""   /></a></p>
<p>So, I&#8217;ve been playing with userspace random number generation, as per Matt Blaze and D.P. Mitchell&#8217;s <a href="http://cfs.sourcearchive.com/documentation/1.4.1-19/truerand_8c-source.html">TrueRand</a> from 1996.  (Important:  Matt Blaze has essentially disowned this approach, and seems to be honestly horrified that I&#8217;m revisiting it.)  The basic concept is that any system with two clocks has a hardware number generator, since clocks jitter relative to one another based on physical properties, particularly when one is operating on a slow scale (like, say, a human hitting a keyboard) while another is operating on a fast scale (like a CPU counter cycling at nanosecond speeds).  Different tolerances on clocks mean more opportunities for unmodelable noise to enter the system.  And since the core lie of your computer is that it&#8217;s just one computer, as opposed to a small network of independent nodes running on their own time, there should be no shortage of bits to mine.</p>
<p>At least, that&#8217;s the theory.</p>
<p>As announced at Defcon 20 / Black Hat, here&#8217;s <a title="DakaRand 1.0" href="http://s3.amazonaws.com/dmk/dakarand-1.0.tgz">DakaRand 1.0</a>.  Let me be the first to say, I don&#8217;t know that this works.  Let me also be the first to say, I don&#8217;t know that it doesn&#8217;t.  DakaRand is a collection of modes that tries to convert the difference between clocks into enough entropy that, whether or not it survives academic attack, would certainly force me (as an actual guy who breaks stuff) to go attack something else.</p>
<p>A proper post on DakaRand is reserved, I think, for when we have some idea that it actually works.  Details can be seen in the <a href="http://dankaminsky.com/2012/08/06/bo2012/">slides</a> for the aforementioned talk; what I&#8217;d like to focus on now is recommendations for trying to break this code.  The short version:</p>
<p>1) Download DakaRand, untar, and run &#8220;sh build.sh&#8221;.<br />
2) Run dakarand -v -d out.bin -m [0-8]<br />
3) Predict out.bin, bit for bit, in less than 2^128 work effort, on practically any platform you desire with almost any level of active manipulation you wish to insert.</p>
<p>The slightly longer version:</p>
<ol>
<li>DakaRand essentially tries to force the attacker into having no better attack than brute force, and then tries to make that work effort at least 2^128.  As such, the code is split into generators that acquire bits, and then a masking sequence of SHA-256, Scrypt, and AES-256-CTR that expands those bits into however much is requested.  (In the wake of Argyros and Kiayias&#8217;s excellent and underreported &#8220;<a href="https://media.blackhat.com/bh-us-12/Briefings/Argyros/BH_US_12_Argyros_PRNG_WP.pdf">I Forgot Your Password:  Randomness Attacks Against PHP Applications</a>&#8220;, I think it&#8217;s time to deprecate <em>all</em> RNG&#8217;s with invertable output.  At the point you&#8217;re asking whether an RNG should be predictable based on its history, you&#8217;ve already lost.)  The upshot of this is that the actual target for a break is not the direct output of DakaRand, but the input to the masking sequence.  Your goal is to show that you can predict this particular stream, with perfect accuracy, at less than 2^128 work effort.  Unless you think you can glean interesting information from the masking sequence (in which case, you have more interesting things to attack than my RNG), you&#8217;re stuck trying to design a model of the underlying clock jitter.</li>
<li>There are nine generators in this initial release of DakaRand.  Seriously, they can&#8217;t <em>all</em> work.</li>
<li>You control the platform.  Seriously &#8212; embedded, desktop, server, VM, whatever &#8212; it&#8217;s fair game.  About the only constraint that I&#8217;ll add is that the device has to be powerful enough to run Linux.  Microcontrollers are about the only things in the world that <em>do</em> play the nanosecond accuracy game, so I&#8217;m much less confident against those.  But, against anything ARM or larger, real time operation is simply not a thing you get for free, and even when you pay dearly for it you&#8217;re still operating within tolerances far larger than DakaRand needs to mine a bit.  (Systems that are basically cycle-for-cycle emulators don&#8217;t count.  Put Bochs and your favorite ICE away.  Nice try though!)</li>
<li>You <em>seriously</em> control the platform.  I&#8217;ve got no problem with you remotely spiking the CPU to 100%, sending arbitrary network traffic at whatever times you like, and so on.  The one constraint is that you can&#8217;t <em>already</em> have root &#8212; so, no physical access, and no injecting yourself into my gathering process.  It&#8217;s something of a special case if you&#8217;ve got non-root local code execution.  I&#8217;d be <em>interested</em> in such a break, but multitenancy is a lie and there&#8217;s just so many  interprocess leaks (like this if-it&#8217;s-so-obvious-why-didn&#8217;t-you-do-it example of <a href="http://goo.gl/YmFsC">cross-VM communication</a>).</li>
<li>Virtual machines get special rules:  You&#8217;re allowed to suspend/restore right up to the execution of DakaRand.  That is the point of atomicity.</li>
<li>The code&#8217;s a bit hinky, what with globals and a horde of dependencies.  If you&#8217;d like to test on a platform that you just can&#8217;t get DakaRand to build on, that makes things more interesting, not less.  <a href="mailto:dan@doxpara.com">Email me</a>.</li>
<li>All data generated is mixed into the hash, but bits are &#8220;counted&#8221; when Von Neumann debiasing works.  Basically, generators return integers between 0 and 2^32-1.  Every integer is mixed into the keying hash (thus, you having to predict out.bin bit for bit).  However, each integer is also measured for the number of 1&#8242;s it contains.  An even number yields a 0; an odd number, a 1.  Bits are only counted when two sequential numbers have either a 10 or a 01, and as long as there&#8217;s less than 256 bits counted, the generator will continue to be called.  So your attack needs to model the absolute integers returned (which isn&#8217;t so bad) <em>and</em> the amount of generator calls it takes for a Von Neumann transition to occur <em>and</em> whether the transition is a 01 or a 10 (since I put that value into the hash too).</li>
<li>I&#8217;ve got a default &#8220;gap&#8221; between generator probes of just 1000us &#8212; a millisecond.  This is probably not enough for all platforms &#8212; my assumption is that, if anything has to change, that this has to become somewhat dynamic.</li>
</ol>
<p>Have fun!  Remember, &#8220;it might fail somehow somewhere&#8221; just got trumped by &#8220;it actually <em>did</em> fail all over the place&#8221;, so how about we investigate a thing or two that we&#8217;re not so sure in advance will actually work?</p>
<p>(Side note:  Couple other projects in this space:  <a href="http://www.finnie.org/2012/08/14/twuewand-2-0-released/">Twuewand</a>, from Ryan Finnie, has the chutzpah to be pure Perl.  And of course, <a href="http://www.vanheusden.com/te/">Timer Entropyd</a>, from Folkert Van Heusden.  Also, my recommendation to kernel developers is to do what I&#8217;m hearing they&#8217;re up to anyway, which is to monitor all the interrupts that hit the system on a nanosecond timescale.  Yep, that&#8217;s probably more than enough.)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dakami1.wordpress.com/2512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dakami1.wordpress.com/2512/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2512&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dankaminsky.com/2012/08/15/dakarand/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6563ffebc0ac78f3aa00369630a3c966?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dakami1</media:title>
		</media:content>

		<media:content url="http://dakami1.files.wordpress.com/2012/08/dakarand.png" medium="image">
			<media:title type="html">dakarand</media:title>
		</media:content>
	</item>
		<item>
		<title>Black Ops 2012</title>
		<link>http://dankaminsky.com/2012/08/06/bo2012/</link>
		<comments>http://dankaminsky.com/2012/08/06/bo2012/#comments</comments>
		<pubDate>Mon, 06 Aug 2012 00:07:42 +0000</pubDate>
		<dc:creator>Dan Kaminsky</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://dankaminsky.com/?p=2507</guid>
		<description><![CDATA[Here’s my slides from Black Hat and Defcon for 2012.  Pile of interesting heresies — should make for interesting discussion.  Here’s what we’ve got: 1) Generic timing attack defense through network interface jitter 2) Revisiting Random Number Generation through clock drift 3) Suppressing injection attacks by altering variable scope and per-character taint 4) Deployable mechanisms [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2507&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<iframe src='http://www.slideshare.net/slideshow/embed_code/13880536' width='595' height='488'></iframe>
<p>Here’s my slides from Black Hat and Defcon for 2012.  Pile of interesting heresies — should make for interesting discussion.  Here’s what we’ve got:</p>
<p>1) Generic timing attack defense through network interface jitter<br />
2) Revisiting Random Number Generation through clock drift<br />
3) Suppressing injection attacks by altering variable scope and per-character taint<br />
4) Deployable mechanisms for detecting censorship, content alteration, and certificate replacement<br />
5) Stateless TCP w/ payload retrieval</p>
<p>I<em> hate</em> saying “code to be released shortly”, but I want to post the slides and the code’s pretty hairy.  <a href="mailto:dan@doxpara.com" target="_parent">Email me</a> if you want to test anything, particularly if you’d like to try to break this stuff or wrap it up for release.  I&#8217;ll also be at Toorcamp, if you want to chat there.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dakami1.wordpress.com/2507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dakami1.wordpress.com/2507/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2507&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dankaminsky.com/2012/08/06/bo2012/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6563ffebc0ac78f3aa00369630a3c966?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dakami1</media:title>
		</media:content>
	</item>
		<item>
		<title>RDP and the Critical Server Attack Surface</title>
		<link>http://dankaminsky.com/2012/03/18/rdp/</link>
		<comments>http://dankaminsky.com/2012/03/18/rdp/#comments</comments>
		<pubDate>Sun, 18 Mar 2012 03:11:51 +0000</pubDate>
		<dc:creator>Dan Kaminsky</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://dankaminsky.com/?p=2494</guid>
		<description><![CDATA[MS12-020, a use-after-free discovered by Luigi Auriemma, is roiling the Information Security community something fierce. That&#8217;s somewhat to be expected &#8212; this is a genuinely nasty bug. But if there&#8217;s one thing that&#8217;s not acceptable, it&#8217;s the victim shaming. As people who know me, know well, nothing really gets my hackles up like blaming the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2494&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://technet.microsoft.com/en-us/security/bulletin/ms12-020">MS12-020</a>, a use-after-free discovered by <a href="http://aluigi.org/adv/termdd_1-adv.txt">Luigi Auriemma</a>, is roiling the Information Security community something fierce.  That&#8217;s somewhat to be expected &#8212; this <i>is</i> a genuinely nasty bug.  But if there&#8217;s one thing that&#8217;s not acceptable, it&#8217;s the victim shaming.</p>
<p>As people who know me, know well, nothing really gets my hackles up like blaming the victims of the cybersecurity crisis.  &#8220;Who could possibly be so stupid as to put RDP on the open Internet&#8221;, they ask.  Well, here&#8217;s some actual data:</p>
<p>On 16-Mar-2012, I initiated a scan across approximately 8.3% of the Internet (300M IPs were probed; the scan is ongoing).  415K of ~300M IP addresses showed evidence of speaking the RDP protocol (about twice as many had listeners on 3389/tcp &#8212; <i>always be sure to speak a bit of the protocol before citing connectivity!</i>)</p>
<p>Extrapolating from this sample, we can see that there&#8217;s approximately <b>five million</b> RDP endpoints on the Internet today.</p>
<p>Now, some subset of these endpoints are patched, and some (very small) subset of these endpoints aren&#8217;t actually the Microsoft Terminal Services code at all.  But it&#8217;s pretty clear that, yes, RDP is actually an enormously deployed service, across most networks in the world (21767 of 57344 /16&#8242;s, at 8.3% coverage).  </p>
<p>There&#8217;s something larger going on, and it&#8217;s the relevance of a bug on what can be possibly called the <b>Critical Server Attack Surface</b>.  Not all bugs are equally dangerous because not all code is equally deployed.  Some flaws are simply more accessible than others, and RDP &#8212; as the primary mechanism by which Windows systems are remotely administered &#8212; is a lot more accessible than a lot of people were aware of.</p>
<p>I think, if I had to enumerate the CSAS for the global Internet, it would look something like (<i>in no particular order &#8212; thanks Chris Eng, The Grugq!</i>):</p>
<ul>
<li>HTTP (Apache, Apache2, IIS, maybe nginx)</li>
<li>Web Languages (ASPX, ASP, PHP, maybe some parts of Perl/Python.  <i>Maybe</i> rails.)</li>
<li>TCP/IP (Windows 2000/2003/2008 Server, Linux, FreeBSD, IOS)</li>
<li>XML (libxml, MSXML3/4/6)</li>
<li>SSL (OpenSSL, CryptoAPI, maybe NSS)</li>
<li>SSH (OpenSSH, maybe dropbear)</li>
<li><strike>telnet (bsd telnet, linux telnet)</strike> (not enough endpoints)</li>
<li>RDP (Terminal Services)</li>
<li>DNS (BIND9, maybe BIND8, MSDNS, Unbound, NSD)</li>
<li>SNMP</li>
<li>SMTP (Sendmail, Postfix, Exchange, Qmail, whatever GMail/Hotmail/Yahoo run)</li>
</ul>
<p>I haven&#8217;t exactly figured out where the line is &#8212; certainly we might want to consider web frameworks like Drupal and WordPress, FTP daemons, printers, VoIP endpoints and SMB daemons, not to mention the <i>bouillabaisse</i> that is the pitiful state of VPNs all the way into 2012 &#8212; but the combination of &#8220;unfirewalled from the Internet&#8221; and &#8220;more than 1M endpoints&#8221; is a decent rule of thumb.  Where people are maybe blind, is in the dramatic underestimation of just how many Microsoft shops there really are out there.</p>
<p>We actually had the opposite situation a little while ago, with this <a href="http://security.freebsd.org/advisories/FreeBSD-SA-11:08.telnetd.asc">widely discussed bug in telnet</a>.  Telnet was the old way Unix servers were maintained on the Internet.  SSH rather completely supplanted it, however &#8212; <a href="http://dankaminsky.com/2011/12/29/telnetd/">the actual data</a> revealed only 180K servers left, with but 20K even potentially vulnerable.</p>
<p>RDP&#8217;s just on a different scale.</p>
<p>I&#8217;ve got more to say about this, but for now it&#8217;s important to get these numbers out there.  There&#8217;s a very good chance that your network is exposing some RDP surface.  If you have any sort of crisis response policy, and you aren&#8217;t completely sure you&#8217;re safe from the RDP vulnerability, I advise you to invoke it as soon as possible.</p>
<p>(Disclosure:  I do some work with Microsoft from time to time.  This is obviously being written in my personal context.)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dakami1.wordpress.com/2494/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dakami1.wordpress.com/2494/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2494&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dankaminsky.com/2012/03/18/rdp/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6563ffebc0ac78f3aa00369630a3c966?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dakami1</media:title>
		</media:content>
	</item>
		<item>
		<title>Open For Review: Web Sites That Accept Security Research</title>
		<link>http://dankaminsky.com/2012/02/26/review/</link>
		<comments>http://dankaminsky.com/2012/02/26/review/#comments</comments>
		<pubDate>Sun, 26 Feb 2012 18:18:28 +0000</pubDate>
		<dc:creator>Dan Kaminsky</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://dankaminsky.com/?p=2480</guid>
		<description><![CDATA[So one of the core aspects of my mostly-kidding-but-no-really White Hat Hacker Flowchart is that, if the target is a web page, and it&#8217;s not running on your server, you kind of need permission to actively probe for vulnerabilities. Luckily, there are actually a decent number of sites that provide this permission. Paypal Facebook 37 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2480&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>So one of the core aspects of my mostly-kidding-but-no-really <a href="http://dankaminsky.com/whitehat">White Hat Hacker Flowchart</a> is that, if the target is a web page, and it&#8217;s not running on your server, you kind of need permission to actively probe for vulnerabilities.</p>
<p>Luckily, there are actually a decent number of sites that provide this permission.</p>
<p><a href="https://cms.paypal.com/cgi-bin/marketingweb?cmd=_render-content&amp;content_ID=security/reporting_security_issues">Paypal</a><br />
<a href="https://www.facebook.com/whitehat">Facebook</a><br />
<a href="http://37signals.com/security-response">37 Signals</a><br />
<a href="http://www.salesforce.com/company/privacy/disclosure.jsp">Salesforce</a><br />
<a href="http://www.theregister.co.uk/2008/04/21/microsoft_oks_online_flaw_finding/">Microsoft</a><br />
<a href="http://www.google.com/about/company/security.html">Google</a><br />
<a href="https://support.twitter.com/groups/33-report-a-violation/topics/122-reporting-violations/articles/477159-how-to-report-xss-api-and-other-security-vulnerabilities">Twitter</a><br />
<a href="http://www.mozilla.org/security/bug-bounty.html">Mozilla</a><br />
UPDATE 1:<br />
<a href="http://pages.ebay.com/securitycenter/Researchers.html">eBay</a><br />
<a href="https://www.adobe.com/support/security/bulletins/securityacknowledgments.html">Adobe</a><br />
UPDATE 2, courtesy of Neal Poole:<br />
<a href="http://code.reddit.com/wiki/help/whitehat">Reddit</a> (this is particularly awesome)<br />
<a href="http://help.github.com/responsible-disclosure/">GitHub</a><br />
UPDATE 3:<br />
<a href="http://www.constantcontact.com/about-constant-contact/security/report-vulnerability.jsp">Constant Contact</a></p>
<p>One could make the argument that you can detect who in the marketplace has a crack security team, by who&#8217;s willing and able to commit the resources for an open vulnerability review policy.</p>
<p>Some smaller sites have also jumped on board (mostly absorbing and reiterating Salesforce&#8217;s policy &#8212; cool!):</p>
<p><a href="http://www.zeggio.com/">Zeggio</a><br />
<a href="http://simplify-llc.com/simplify-security.html">Simplify, LLC</a><br />
<a href="http://www.teamunify.com/__corp__/security.php">Team Unify</a><br />
<a href="http://www.skoodat.com/Security">Skoodat</a><br />
<a href="http://relaso.com/disclosure">Relaso</a><br />
<a href="http://www.moduscsr.com/security_statement.php">Modus CSR</a><br />
<a href="http://cloudnetz.com/Legal/vulnerability-testing-policy.html">CloudNetz</a><br />
UPDATE 2:<br />
<a href="http://www.emptrust.com/Security.aspx">EMPTrust</a><br />
<a href="http://www.apriva.com/security">Apriva</a></p>
<p>There&#8217;s some interesting implications to all of this, but for now lets just get the list out there.  Feel free to post more in the comments!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dakami1.wordpress.com/2480/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dakami1.wordpress.com/2480/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2480&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dankaminsky.com/2012/02/26/review/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6563ffebc0ac78f3aa00369630a3c966?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dakami1</media:title>
		</media:content>
	</item>
		<item>
		<title>White Hat Hacker Flowchart</title>
		<link>http://dankaminsky.com/2012/02/20/whitehat/</link>
		<comments>http://dankaminsky.com/2012/02/20/whitehat/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 23:00:11 +0000</pubDate>
		<dc:creator>Dan Kaminsky</dc:creator>
				<category><![CDATA[lulz]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://dankaminsky.com/?p=2472</guid>
		<description><![CDATA[For your consideration. Rather obviously not to be taken as legal advice. Seems to be roughly what&#8217;s evolved over the last decade.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2472&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>For your consideration.  <b>Rather obviously not to be taken as legal advice.</b>  Seems to be roughly what&#8217;s evolved over the last decade.<br />
<a href="http://dakami1.files.wordpress.com/2012/02/whitehat-0-3.png"><img src="http://dakami1.files.wordpress.com/2012/02/whitehat-0-3.png?w=595" alt="" title="whitehat-0.3"   class="aligncenter size-full wp-image-2473" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dakami1.wordpress.com/2472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dakami1.wordpress.com/2472/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2472&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dankaminsky.com/2012/02/20/whitehat/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6563ffebc0ac78f3aa00369630a3c966?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dakami1</media:title>
		</media:content>

		<media:content url="http://dakami1.files.wordpress.com/2012/02/whitehat-0-3.png" medium="image">
			<media:title type="html">whitehat-0.3</media:title>
		</media:content>
	</item>
		<item>
		<title>#Nerdflix.  Because LOL</title>
		<link>http://dankaminsky.com/2012/02/19/nerdflix/</link>
		<comments>http://dankaminsky.com/2012/02/19/nerdflix/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 08:40:36 +0000</pubDate>
		<dc:creator>Dan Kaminsky</dc:creator>
				<category><![CDATA[lulz]]></category>

		<guid isPermaLink="false">http://dankaminsky.com/?p=2457</guid>
		<description><![CDATA[So, one of my goals for 2012 has been to write quite a bit more &#8212; more code, and more long form analysis. So far, so good. Doesn&#8217;t mean it&#8217;s all going to be about security, or even that it&#8217;s all going to be all that serious. My whole #Protolol thing worked out pretty amusingly&#8230;and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2457&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>So, one of my goals for 2012 has been to write quite a bit more &#8212; more code, and more long form analysis. So far, so good.</p>
<p>Doesn&#8217;t mean it&#8217;s all going to be about security, or even that it&#8217;s all going to be all that serious. My whole <a href="http://protolol.com/">#Protolol</a> thing worked out pretty amusingly&#8230;and so, here&#8217;s <a href="https://twitter.com/#!/search/realtime/%23nerdflix">#nerdflix</a>.</p>
<p>LOL. Some highlights. I can&#8217;t even imagine the horrible punnery I&#8217;m going to wake up to.</p>
<p>UPDATE 1: Apparently at some point #nerdflix was trending worldwide? It&#8217;s certainly taken San Francisco by storm <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
<a href="http://dakami1.files.wordpress.com/2012/02/trends.png"><img class="aligncenter size-full wp-image-2463" title="trends" src="http://dakami1.files.wordpress.com/2012/02/trends.png?w=595" alt=""   /></a><br />
Anyway, here&#8217;s <a href="#more">more</a>.</p>
<p>Update 2: Also, Germany.  This is not surprising.<br />
<a href="http://dakami1.files.wordpress.com/2012/02/germans1.png"><img src="http://dakami1.files.wordpress.com/2012/02/germans1.png?w=595" alt="" title="germans"   class="aligncenter size-full wp-image-2470" /></a></p>
<hr />
<p>@dakami: Memory Resident Evil<br />
@dakami: Driving Miss Daisy Chain (h/t @wadebaker)<br />
@dakami: Raiders of the Lost ARP (h/t @quadling)<br />
@dakami: &#8211;wx&#8212;&#8212; (h/t @ennor)<br />
@AtheistHacker: A Beautiful BIND<br />
@RySub Desperate house wifi&#8217;s<br />
@JGoldOrlando: no SALT<br />
@johngineer: Ohm Alone<br />
@kickfroggy: I Now Pronounce You PCI Compliant<br />
@kickfroggy: There&#8217;s Something About Mary&#8217;s Code<br />
@KrisPaget: Full Metal Packet<br />
@l0qii: Beverly Hills Pcap<br />
@marshray: Batman Returns-into-libc<br />
@mratzlaff: Extremely pwned and Incredibly hosed<br />
@otanistudio: ~/alone<br />
@otanistudio: HTML5 Gordon<br />
@plaverty24: Born on December 31, 1969<br />
@redtwitdown: The Kaminsky Code (cc @dakami)<br />
@wadebaker: Gone with the rm Memorable line: &#8220;frankly Scarlet, -rf&#8221;<br />
@Walshman23: Girl, Interrupt-driven<br />
@jadedsecurity: Apache Down<br />
@chenb0x: The Netbook<br />
@manzuik: Whitehats Can&#8217;t Code.<br />
@afabmedia: Magnum, 3.1415926535897932384626433832795028841971693993751058209<br />
@felipeLvalero: RT @Mackaber: RT @Voulnet: Despicable WindowsME / Lol<br />
@0x17h: Gone with the Windows<br />
@vogon: @dakami The SHA-1 Redemption<br />
@vogon: @dakami 1U Over the Cuckoo&#8217;s Nest<br />
@ThemsonMester: Oceans 802.11<br />
@enriquereyes: 500 days of evaluation period<br />
@a_r_w: The TEMPEST (staring Van Eck)<br />
@marshray: Batman Returns-into-libc<br />
@marshray: The Bitcoin Miner&#8217;s Daughter<br />
@gbrunkhorst: The Little Endian in the Cupboard<br />
@bm_: RT @_jtmelton: @dakami Lost in Machine Translation<br />
@kickfroggy: Paul Blart: Mall CISSP &lt;&lt; lol<br />
@0x17h: The Deprecated<br />
@0x17h: All About Eve Online<br />
@afabmedia: So I Married a VAX Murderer<br />
@infojeff: Pink Floyd The Wall of Sheep<br />
@jdunck: Referer never dies /cc @kevinmarks<br />
@kickfroggy: Fast Times at 802.3bg<br />
@kickfroggy: How to Train Your User<br />
@liambeeton: Firewall Club<br />
@longobord: Schindler&#8217;s Linked List<br />
@mfukar: reinterpret_cast Away<br />
@obscuresec: Inglorious Hackers<br />
@obscuresec: Toy Story 2++ <em>(should be Toy Story ++2, actually. &#8211;Dan)</em><br />
@pageman: The preg_replace ment Killers<br />
@rattis: hackers on a plane (come one, someone had to do it). (HOAP, is a real thing).<br />
@RySub: Puss in boot sector<br />
@someara: @dakami Oh Backup Where Art Thou<br />
@theharmonyguy: @dakami XSS in the City, with sequel XSS in the City: alert(2)<br />
@ThemsonMester: Oceans 802.11<br />
@Twirrim: 12 Angry Sysadmins<br />
@redtwitdown: @Twirrim Saving Private Ryan [XX...................] 5.7% 16h47m remaining.<br />
@0x17h: Twelve Code Monkeys<br />
@davehull: APT Pupil<br />
@Mackaber: The Angry Birds<br />
@spridel11: $ whoami Legend<br />
@Pickering: The King&#8217;s Speech Recognition Software<br />
@BrightApollo: Saving Private Keys<br />
@fkorling: Apocalype System.currentTimeMillis()<br />
@OhAxi: Teenage Mutant Logo Turtles<br />
@andreasudo: Planet of the APIs<br />
@Ryallcowling: #00FF00 Lantern<br />
@Pickering: The FIOS Connection<br />
@andreasudo: Citizen DANE<br />
@courtneyBolton: Gone with the Meme<br />
@danvesma: Sense and adSensibility<br />
@fkorling: In Her Majesty&#8217;s SQL Server<br />
@ThemsonMester: To Kill an AWKing Bird books to movie&#8230;<br />
@eikonoklastic: I Know What You Did Last Summer of Code<br />
@mfukar: Port Knocked Up<br />
@mfukar: Fantastic ARCFOUR<br />
@ennor: Top GNU<br />
@SecurityHumor: Two Macs One CUPS<br />
@Madrox: Harry Potter and the Order Of Operations<br />
@hmier: The Manchurian release candidate<br />
@rogueclown: Kernighan and Ritchie do America<br />
@alanpdx: Death Race Condition 2000<br />
@hmier: A beautiful BIND<br />
@Tylos: The Ring 0<br />
@Tylos: ulimitless<br />
@0x17h: The Hunchback of Notre DOM<br />
@afabmedia: Information Technology Came from Outer Space<br />
@Voulnet: BackTrack Mountain<br />
@scottymuse: Sopadish<br />
@davidgropper: The Girl With The Snapdragon Tattoo (cc: @0x17h)<br />
@liambeeton: Independence 0day<br />
@johngineer: 2 Fast 2 Fourier<br />
@l0qii: elements[4]<br />
@Slanderous23: Beauty and the BSD<br />
@dakami: The A* Team (h/t @GKokoris)<br />
@GKokoris: Jurassic PARC<br />
@drb0n3z: James and the Giant Peach Fuzzer<br />
@Mackaber: Indiana Jones and the Last Cross-site scripting<br />
@artisan002: DIMM and DIMMer<br />
@yawnbox: Stateless in Seattle<br />
@addelindh: Low Orbit Ion Canonball Run<br />
@buckstwits: Sudo The Right Thing<br />
@ma1: A Phisher Called from Rwanda<br />
<a name="more"></a>@speno: Enemy Minecraft<br />
@Rzieher: Sheldon Island<br />
@Rzieher: The Men Who Stare at Goatse<br />
@damphi: The good, the bad and the code you inherited from your predecessor<br />
@damphi: Python on a plane<br />
@agnat: 007 &#8211; License to &#8230; read, write and execute<br />
@b4seb4nd: A League of Their Chown<br />
@damphi: Deep Packet Inspector Gadget<br />
@damphi: RoboCopy<br />
@hvcco: Terminate and stay resident evil<br />
@Nightwolf42: rm -rf / now<br />
@0x17h: How to Train Your Dragon NaturallySpeaking<br />
@FnordZilla: The Breakpoint Club<br />
@0x17h: Paypal It Forward<br />
@bocki_nbg: monty.py<br />
@ArchangelAmael: Guess Who&#8217;s coming to Audit<br />
@aymro: Google Intentions 2.0<br />
@alech: When Alice Met Bob.<br />
@stronate: We Need to Talk About Kelvin<br />
@ArchangelAmael: The Birth of an Exploit<br />
@meznak: vi for vendetta<br />
@j4rkiLL: Alien vs. Administrator<br />
@ArchangelAmael: The Grapes of $PATH<br />
@artisan002: Two and a Half Men in the Middle<br />
@angbor3D: Wall-E The Garbagecollector<br />
@SeveQ: The Hills have iPhones<br />
@ThemsonMester: Zack and Miri Configure, Make, Make Install a Porno<br />
@artisan002: Dirty Twisted Pair<br />
@swiftruss: Cowboys and Alienware<br />
@mechtroid: Crank IPv4: Chev must surf the internet constantly. If he doesn&#8217;t find something funny every minute, he goes into cardiac arrest.<br />
@eikonoklastic: How Stella Got Her Algorithm Back<br />
@Nightwolf42: It&#8217;s a wonderful runtime<br />
@KlaasJohansen: The Big Kernel Lock Theory #ReplaceFilmTitlesWithKernel<br />
@Megaglest: Four web browsers and an Internet<br />
@j0sema: LDAP Confidential<br />
@FnordZilla: Clock Generator Orange<br />
@TeethGrind3r: Crouching Tigerteam, Hidden Night Dragon<br />
@_7and6_: &#8220;We can&#8217;t stop here, this is bash-country!&#8221; &#8211; Fear and Loathing in /usr/bin #nerdflix<br />
@TeethGrind3r: Citizen Cain &amp; Abel<br />
@damphi: Dick Tracert<br />
@_7and6_: Sex, Lies and Avi-Files<br />
@yooogan: Watchdogmen<br />
@stevelord: No country for old code<br />
@_c_v_e_n: The Seven Layer Itch<br />
@0x17h: Annie Hall-effect sensor<br />
@apilosov: Da Vixie Code<br />
@ArchangelAmael: The Magnificent Seven; layers of the OSI model<br />
@xomexx: One overflow the cuckoo&#8217;s nest<br />
@krizzzn: SELECT American FROM London WHERE wolf = 1<br />
@GoddamnGeek: @dakami EIP Man<br />
@0x17h: Malcolm X11<br />
@imlxgr: The Bucket Sort<br />
@ArchangelAmael: Who &gt;iFramed&lt; Roger Rabbit<br />
@Meihrenfacht: @wlet @BeerweasleDev Lost in compilation ROFL<br />
@ex1up: momopeche: Weekend At Bernoulli&#8217;s<br />
@SubwayDealer: SHA Wars<br />
@Voulnet: Batman BEGINS; DECLARES;<br />
@Voulnet: netcat in the Hat<br />
@fmiffal: grep -c &#8220;Monte Cristo&#8221;<br />
@ira_victor: Monty Python and The Advanced Persistent Grail<br />
@HamdanD: Sharepoint must die<br />
@mrdaiber: wget -shorty / i See Deadpeople / wag the .doc / ctrl-s &#8216;lastdance.txt&#8217;<br />
@HeshamAboElMagd: Pulp Function<br />
@EmadMokhtar: RT @Voulnet: this.IsSparta();<br />
@Ahmad_Hadeed: The Matrix[][]<br />
@juphoff: Tim Cook, the Thief, His Wife &amp; Her Lover.<br />
@Voulnet: VBScript She Wrote<br />
@old_man_mose: Indiana Jones and the Mountain of Dew<br />
@Ibrahimism: How I hacked your mother<br />
@f70r1: Grave of the Firefoxes<br />
@otac0nFluX: the /x41 team<br />
@mrdaiber: Alice in WLANd<br />
@jochenWolters: Family GUI<br />
@saschaleib: 0&#215;20, the final frontier #NotAMovieTitle<br />
@MagnusRevang: Enemy of the Statemachine<br />
@f70r1: American History XML &#8211; an experienced coder wants to prevent his young colleague from taking the same wrong path that he did.<br />
@cmhscout: Rear Windows 3.1<br />
@imlxgr: 2038<br />
@yeahyeahyens: dude, where&#8217;s my cdr?<br />
@deepsec: Game of Inodes.<br />
@lnxkid: The XORcist<br />
@f70r1: The Old Man and the C<br />
@webtonull: Ah, forgot &#8220;NoSQL for old men&#8221;<br />
@mrngm: gcc -Wall -E<br />
@mrdaiber: my big fat32 Greek wedding<br />
@mrdaiber: revenge of the sithadmin<br />
@kinesias: Mozilla (by Roland Emmerich)<br />
@bluehavana: Sk!diocracy<br />
@Politik2_0: 9 1/2 leaks<br />
@SwieSchnubb: The Hurt Logger<br />
@brx0: I dream of JNI<br />
@mbeison: Murder on the Object Orient Express<br />
@robotviki: Das BOOTP<br />
@0xerror: How I Met Your Motherboard<br />
[redacted]: Break Point<br />
@Bashar3A: She&#8217;s Out Of My Scope<br />
@JarrarM: AJAX Shrugged<br />
@brx0: Spongebob O(N^2)Pants</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dakami1.wordpress.com/2457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dakami1.wordpress.com/2457/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2457&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dankaminsky.com/2012/02/19/nerdflix/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6563ffebc0ac78f3aa00369630a3c966?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dakami1</media:title>
		</media:content>

		<media:content url="http://dakami1.files.wordpress.com/2012/02/trends.png" medium="image">
			<media:title type="html">trends</media:title>
		</media:content>

		<media:content url="http://dakami1.files.wordpress.com/2012/02/germans1.png" medium="image">
			<media:title type="html">germans</media:title>
		</media:content>
	</item>
		<item>
		<title>Primal Fear:  Demuddling The Broken Moduli Bug</title>
		<link>http://dankaminsky.com/2012/02/17/primalfear/</link>
		<comments>http://dankaminsky.com/2012/02/17/primalfear/#comments</comments>
		<pubDate>Fri, 17 Feb 2012 10:05:33 +0000</pubDate>
		<dc:creator>Dan Kaminsky</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://dankaminsky.com/?p=2429</guid>
		<description><![CDATA[There&#8217;s been a lot of talk about this supposed vulnerability in RSA, independently discovered by Arjen Lenstra and James P. Hughes et al, and Nadia Heninger et al. I wrote about the bug a few days ago, but that was before Heninger posted her data. Lets talk about what&#8217;s one of the more interesting, if [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2429&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>There&#8217;s been a lot of talk about this supposed vulnerability in RSA, independently discovered by <a href="http://eprint.iacr.org/2012/064.pdf">Arjen Lenstra and James P. Hughes</a> et al, and <a href="https://freedom-to-tinker.com/blog/nadiah/new-research-theres-no-need-panic-over-factorable-keys-just-mind-your-ps-and-qs">Nadia Heninger</a> et al.  I <a href="http://dankaminsky.com/ronwhit">wrote about the bug</a> a few days ago, but that was before Heninger posted her data.  Lets talk about what&#8217;s one of the more interesting, if misunderstood, bugs in quite some time.</p>
<hr />
<a href="#summary">SUMMARY</a><br />
<a href="#introduction">INTRODUCTION</a><br />
<a href="#attack">THE ATTACK</a><br />
<a href="#notronwhit">IT&#8217;S NOT ABOUT RON AND WHIT</a><br />
<a href="#whomatters">WHO MATTERS</a><br />
<a href="#failure">FAILURE TO ENROLL</a><br />
<a href="#actualthreat">THE ACTUAL THREAT</a><br />
<a href="#actionable">ACTIONABLE INTELLIGENCE</a><br />
<a href="#conclusion">CONCLUSION</a></p>
<hr />
<p><a name="summary"><b>SUMMARY</b></a></p>
<ul>
<li>The &#8220;weak RSA moduli&#8221; bug is almost (and possibly) exclusively found within certificates that were already insecure (i.e. expired, or not signed by a valid CA).</li>
<li>This attack almost certainly affects not a single production website.</li>
<li>The attack utilizes a property of RSA whereby if half the private key material is shared between two public keys, the private key is leaked.  Researchers scaled this method to cross-compare every RSA key on the Internet against every other RSA key on the Internet.</li>
<li>The flaw has nothing to do with RSA or &#8220;multi-secret&#8221; systems.  The exact same broken random number generator would play just as much havoc, if not more, with &#8220;single-secret&#8221; algorithms such as ECDSA.</li>
<li>DSA, unlike RSA, leaks the private key with every signature under conditions of faulty entropy.  That is arguably worse than RSA which leaks its private key only during generation, only if a similar device emits the same key, and only if the attacker finds both devices&#8217; keys.</li>
<li>The first major finding is that most devices offer no crypto at all, and even when they do, the crypto is easily man-in-the-middled due to a presumption that nobody cares whether the right public key is in use.</li>
<li>Cost and deployment difficulty drive the non-deployment of cryptographic keys even while almost all systems acquire enough configuration for basic connectivity.</li>
<li>DNSSEC will dramatically reduce this cost, but can do nothing if devices themselves are generating poor key material and expecting DNSSEC to publish it.</li>
<li>The second major finding is that it is very likely that these findings are only the low hanging fruit of easily discoverable bad random number generation flaws in devices.  It is specifically unlikely that only a third of one particular product had bad keys, and the rest managed to call quality entropy.</li>
<li>This is a particularly nice attack in that no knowledge of the underlying hardware or software architecture is required to extract the lost key material.</li>
<li>Recommendations:
<ol>
<li>Don&#8217;t panic about websites.  This has very little to absolutely nothing to do with them.</li>
<li>When possible and justifiable, generate private key material outside your embedded devices, and push the keys into them.  Have their surrouding certificates signed, if feasible.</li>
<li>Audit smartcard keys.</li>
<li>Stop buying or building CPUs without hardware random number generators.</li>
<li>Revisit truerand, an entropy source that only requires two desynchronized clocks, possibly integrating it into OpenSSL and libc.</li>
<li>When doing global sweeps of the net, be sure to validate that a specific population is affected by your attack before including it in the vulnerability set.</li>
<li>Start seriously looking into DNSSEC.  You are deploying a tremendous number of systems that nobody can authenticate.</li>
</ol>
</ul>
<hr />
<a name="introduction"><b>INTRODUCTION</b></a><br />
If there&#8217;s one thing to take away from this entire post, it&#8217;s the following line from Nadia Heninger&#8217;s writeup:</p>
<blockquote><p>Only one of the factorable SSL keys was signed by a trusted certificate authority and it has already expired.</p></blockquote>
<p>What this means, in a nutshell, is that there was never any security to be lost from crackable RSA keys; due to failures in key management, almost certainly <i>all</i> of the affected keys were vulnerable to being silently &#8220;swapped out&#8221; by a Man-In-The-Middle attacker.  It isn&#8217;t merely the fact that all the headlines proclaiming &#8220;0.2% of websites using RSA are insecure&#8221; are straight up false, because the flaws are concentrated on devices.  It&#8217;s also the case that the devices themselves were already using RSA insecurely to begin with, merely by being deployed outside a key management system.</p>
<p>If there&#8217;s a second thing to take away, it&#8217;s that this is important research with real actions that should be taken by the security community in response.  There&#8217;s no question this research is pointing to things that are very wrong with the systems we depend on.  Do not make the mistake of discounting this work as merely academic.  We have a problem with random numbers, that is even larger than Lenstra and Hughes and Heninger are finding with their particular mechanism.</p>
<hr />
<a name="attack"><b>THE ATTACK</b></a></p>
<p>To grossly simplify, RSA works by:</p>
<p>1) Generating two random primes, p and q.  These are private.<br />
2) Multiplying p ad q together into n.  This becomes public, because figuring out the exact primes used to create n is Hard.<br />
3) Content is signed or decrypted with p and q.<br />
4) Content is verified or encrypted with n.</p>
<p>It&#8217;s obvious that if p is not random, q can be calculated:  n/p==q, because p*q==n.  What&#8217;s slightly less obvious, however, is that if either p or q is repeated across multiple n&#8217;s, then the repeated value can be trivially extracted using an ancient algorithm by Euclid called the Greatest Common Denominator test.  The trick looks something like this (you can follow along with Python, if you like):</p>
<blockquote><p>&gt;&gt;&gt; from gmpy import *<br />
&gt;&gt;&gt; p=next_prime(rand(&#8220;next&#8221;))<br />
&gt;&gt;&gt; q=next_prime(rand(&#8220;next&#8221;))<br />
&gt;&gt;&gt; p<br />
mpz(136093819)<br />
&gt;&gt;&gt; q<br />
mpz(118190411)<br />
&gt;&gt;&gt; n=p*q<br />
&gt;&gt;&gt; n<br />
mpz(16084984402169609)
</p></blockquote>
<p>Now we have two primes, multiplied into some larger n.</p>
<blockquote><p>&gt;&gt;&gt; q2=next_prime(rand(&#8220;next&#8221;))<br />
&gt;&gt;&gt; n2=p*q2<br />
&gt;&gt;&gt; n2<br />
mpz(289757928023349293)
</p></blockquote>
<p>Ah, now we have n2, which is the combination of a previously used p, and a newly generated q2.  But look what an attacker with n and n2 can do:</p>
<blockquote><p>&gt;&gt;&gt; gcd(n,n2)<br />
mpz(136093819)<br />
&gt;&gt;&gt; p<br />
mpz(136093819)
</p></blockquote>
<p>Ta-da!  p falls right out, and thus q as well (since again, n/p==q).  So what these teams did was gcd every RSA key on the Internet, against every other RSA key on the Internet.  This would of course be quite slow &#8212; six million keys times six million keys is thirty six trillion comparisons &#8212; and so they used a clever algorithm to scale the attack such that multiple keys could be simultaneously compared against one another.  It&#8217;s not clear what Lenstra and Hughes used, but Heninger&#8217;s implementation leveraged some 2005 research from (who else?) <a href="http://cr.yp.to/lineartime/dcba-20040404.pdf">Dan Bernstein.</a></p>
<p>That is the <i>math</i>.  What is the <i>impact</i>, upon computer security?  What is the <i>actionable intelligence</i> we can derive from these findings?</p>
<p>Uncertified public keys or not, there&#8217;s a lot to worry about here.  But it&#8217;s not at all where Lenstra and Hughes think.</p>
<hr />
<a name="notronwhit"><b>IT&#8217;S NOT ABOUT RON AND WHIT</b></a></p>
<p>Lenstra and Hughes, in arguing that <a href="http://eprint.iacr.org/2012/064.pdf">&#8220;Ron was Wrong, Whit was right&#8221;</a>, declare:</p>
<blockquote><p>
Our conclusion is that the validity of the assumption is questionable and that generating keys in the real world for &#8220;multiple-secrets&#8221; cryptosystems such as RSA is signicantly riskier than for &#8220;single-secret&#8221; ones such as ElGamal or (EC)DSA which are based on Die-Hellman.</p></blockquote>
<p>The argument is essentially that, had those 12,000 keys been ECDSA instead of RSA, then they would have been secure.  In my <a href="http://dankaminsky.com/ronwhit">previous post</a> on this subject (a post RSA Inc. itself <a href="http://spectrum.ieee.org/tech-talk/telecom/security/update-rsa-responds-to-flaw-finding">is linking to</a>!) I argued that this paper, while chock-full of useful and important data, failed to make the case that the blame could be laid at the feet of the &#8220;multiple-secret&#8221; RSA.  Specifically:</p>
<ul>
<li>Risk in cryptography is utterly dominated, not by cipher selection, but by key management.  It does not matter the strength of your public key if nobody knows to demand it.  Whatever the differential risk is that is introduced by the choice of RSA vs. ECDSA pales in comparison to whether there&#8217;s any reason to believe the public key in question is the actual key of the desired target.  (As it turns out, few if any of the keys with broken moduli, had any reason to trust them in the first place.)
<li>There aren&#8217;t enough samples of DSA <i>in the same kind of deployments</i> to compare failure rates from one asymmetric cipher to another.</li>
<li>If one is going to blame a cipher for implementation failures in the field, it&#8217;s hard to blame the maybe dozens of implementations of RSA that caused 12,000 failures, while ignoring the one implementation of ECDSA that broke millions upon millions of Playstation 3&#8242;s.</li>
</ul>
<p>But it wasn&#8217;t until I read the (thoroughly excellent) blog post from Heninger that it became clear that, no, there&#8217;s no rational way this bug can be blamed on multi-secret systems in general or RSA in particular.</p>
<blockquote><p>However, some implementations add additional randomness between generating the primes p and q, with the intention of increasing security:</p>
<p><code>prng.seed(seed)<br />
p = prng.generate_random_prime()<br />
prng.add_randomness(bits)<br />
q = prng.generate_random_prime()<br />
N = p*q</code></p>
<p>If the initial seed to the pseudorandom number generator is generated with low entropy, this could result in multiple devices generating different moduli which share the prime factor p and have different second factors q. Then both moduli can be easily factored by computing their GCD: p = gcd(N1, N2).</p>
<p>OpenSSL&#8217;s RSA key generation functions this way: each time random bits are produced from the entropy pool to generate the primes p and q, the current time in seconds is added to the entropy pool. Many, but not all, of the vulnerable keys were generated by OpenSSL and OpenSSH, which calls OpenSSL&#8217;s RSA key generation code.</p></blockquote>
<p>Would the above code become secure, if the asymmetric cipher selected was the single-secret ECDSA instead of the multi-secret RSA?</p>
<blockquote><p>prng.seed(seed);<br />
ecdsa_private_key=prng.generate_random_integer();
</p></blockquote>
<p>No.  All public keys emitted would be identical (as identical as they&#8217;d be with RSA, anyway).  I suppose it&#8217;s possible we could see the following construction instead:</p>
<blockquote><p>prng.seed(seed);<br />
first_half=prng.generate_random_integer();<br />
prng.add_randomness(bits);<br />
second_half=prng.generate_random_integer();<br />
ecdsa_private_key=concatenate(first_half, second_half);
</p></blockquote>
<p>&#8230;but I don&#8217;t think anyone would claim that ECDSA, DSA, or ElGamel is secure in the circumstance where half its key material has leaked.  (Personal note:  Prodded by Heninger, I&#8217;ve <i>personally</i> cracked a variant of RSA-1024 where all bits set to 1 were revealed.  It wasn&#8217;t difficult &#8212; cryptosystems fail quickly when their fundamental assumptions are violated.)</p>
<p>Hughes has made the argument that RSA is unique here because the actions of someone else &#8212; publishing n composed of your p and his q &#8212; impact an innocent you.  Alas, you&#8217;re no more innocent than he is; you&#8217;re republishing his p, and exposing his q2 as much as he&#8217;s exposing your q.  Not to mention, in DSA, unlike RSA, you don&#8217;t need someone else&#8217;s help to expose your private key.  A single signature, emitted without a strong RNG, is sufficient.  <a href="http://www.debian.org/security/2008/dsa-1571">As we saw</a> from the last major RNG flaw, involving Debian:</p>
<blockquote><p>Furthermore, all DSA keys ever used on affected Debian systems for signing or authentication purposes should be considered compromised; the Digital Signature Algorithm relies on a secret random value used during signature generation.</p></blockquote>
<p>The fact that Lenstra and Hughes found a different vulnerability rate for DSA keys than RSA keys comes from the radically different generator for the former &#8212; PGP keys as generated by GNU Privacy Guard or PGP itself.  This is not a thing commonly executed on embedded hardware.</p>
<p>There <i>is</i> a case to be made for the superiority of ECDSA over RSA.  Certainly this is the conclusion of various government entities.  I don&#8217;t think anyone would be surprised if the latter was broken before the former.  But this situation, this particular flaw, reflects nothing about any particular asymmetric cipher.  Under conditions of broken random number generation, all ciphers are suspect.</p>
<p>Can we dismiss these findings entirely, then?  </p>
<p>Lets talk about that.</p>
<hr />
<a name="whomatters"><b>WHO MATTERS</b></a></p>
<p>The headlines have indeed been grating.  &#8220;Only 99.8% of the worlds PKI uses secure randomness&#8221;, said <a href="http://www.jupiterbroadcasting.com/17013/first-day-fail-techsnap-45/">TechSnap.</a>  &#8220;EFF: Tens of thousands of websites&#8217; SSL &#8220;offers effectively no security&#8221; from <a href="http://boingboing.net/2012/02/14/eff-tens-of-thousands-of-webs.html">Boing Boing</a>.  And, of course, from the <a href="http://www.nytimes.com/2012/02/15/technology/researchers-find-flaw-in-an-online-encryption-method.html?_r=2">New York Times</a>:</p>
<blockquote><p>
The operators of large Web sites will need to make changes to ensure the security of their systems, the researchers said.</p>
<p>The potential danger of the flaw is that even though the number of users affected by the flaw may be small, confidence in the security of Web transactions is reduced, the authors said.<br />
&#8230;<br />
“Some people may say that 99.8 percent security is fine,” he added. That still means that approximately as many as two out of every thousand keys would not be secure.</p></blockquote>
<p>The operators of large web sites will not need to make any changes, as they are excluded from the population that is vulnerable to this flaw.  It is <i>not</i> two out of <i>every</i> thousand keys that is insecure.  Out of those keys that had any hope of being secure to begin with &#8212; those keys that participate in the (flawed, but bear with me) Certificate Authority system &#8212; <i>approximately none of these keys are threatened by this attack</i>.</p>
<p>It is not two out of every 1000 <i>already insecure</i> keys that are insecure.  It is 1000 of 1000.  But that is not changed by the existence of broken RSA moduli.</p>
<p>To be clear, these numbers do not come from Lenstra and Hughes, who have cautiously refused to disclose the population of certificates, nor from the EFF, who have apparently removed those particular certificates from the SSL Observatory (interesting side project:  Diff against the local copy).  They come from Heninger&#8217;s <a href="https://freedom-to-tinker.com/blog/nadiah/new-research-theres-no-need-panic-over-factorable-keys-just-mind-your-ps-and-qs">research</a>, which not only discloses who isn&#8217;t affected (&#8220;Don&#8217;t worry, the key for your bank&#8217;s web site is probably safe&#8221;), but analyzes the population that is:</p>
<blockquote><p>Firewall product X:<br />
52,055 hosts in our SSL dataset<br />
6,730 share public keys<br />
12,880 have factorable keys</p>
<p>Consumer-grade router Y:<br />
26,952 hosts in our SSL dataset<br />
9,345 share public keys<br />
4,792 have factorable keys</p>
<p>Enterprise remote access solution Z:<br />
1,648 hosts in our SSL dataset<br />
24 share public keys<br />
0 factorable</p></blockquote>
<p>Finally, we get to why this research matters, and what actions should be taken in response to it.  Why are large numbers of devices &#8212; of security devices, even! &#8212; not even pretending to successfully manage keys?  And worse, why are the keys they do generate (even if nobody checks them) so insecure?</p>
<hr />
<a name="failure"><b>FAILURE TO ENROLL</b></a></p>
<p>Practically every device on a network is issued an IP address.  Most of them also receive DNS names.  Sometimes assignment is dynamic via DHCP, and sometimes (particularly on corporate/professionally managed networks) addressing is managed statically through various solutions, but basic addressing and connectivity across devices from multiple vendors is something of a solved problem.</p>
<p>Basic key management, by contrast, is a disaster.</p>
<p>You don&#8217;t have to like the Certificate Authority system.  I certainly don&#8217;t; while I respect the companies involved, they&#8217;re pretty clearly working with a flawed technology.  (I&#8217;ve been talking about this since 2009, see the <a href="http://www.slideshare.net/dakami/black-opspki-2">slides here</a>.  Slide 22 talks about the very intermediate certificate issuance that people are now worrying about with respect to <a href="https://lwn.net/Articles/480291/">Trustwave</a> and <a href="www.trustico.com/material/DS_GeoRoot_0205.pdf">GeoTrust</a>)  However&#8230;</p>
<p>Out of hundreds of millions of servers on the Internet with globally routable IP addresses, only about six million present public keys to be authenticated against.  And of those with keys, only a relatively small portion &#8212; maybe a million? &#8212; are actually enrolled into the global PKI managed by the Certificate Authorities.</p>
<p>The point is not that the CA&#8217;s don&#8217;t work.  The point is that, for the most part, <b><i>clients don&#8217;t care, nothing is checking the validity of device certificates in the first place</i></b>.  Most devices, even security devices, are popping these huge errors every time the user connects to their SSL ports.  Because this is legitimate behavior &#8212; because there&#8217;s no reason to trust the provenance of a public key, right or wrong &#8212; users click through.</p>
<p>And why are so many devices, even in the rare instance that they have key material on their administrative interfaces, unenrolled in PKI?  Because it requires this chain of cross organizational interaction to be followed.  The manufacturer of the device could generate a key at the factory, or on first boot, but they&#8217;re not the customer so they can&#8217;t have certificates signed in a customers namespace (which might change, anyway).  Meanwhile, the customer, who can easily assign IP addresses and DNS names without constantly asking for anyone&#8217;s permission, has to integrate with an external entity, extract key material from the manufacturer&#8217;s generated content, provide it to that entity, integrate the response back into the device, pay the entity, and do it all over again within a year or three.  Repeat for every single device.</p>
<p>Or, they could just not do all that.  Much easier to simply not use the encrypted interface (it&#8217;s the Internal Network, after all), or to ignore the warning prompts when they come up.</p>
<p>One of the hardest things to convince people of in security, is that it&#8217;s not enough to make security better.  Better doesn&#8217;t mean anything, it&#8217;s a measure without a metric.  No, what&#8217;s important is making security <i>cheaper</i>.  How do we start actually delivering value, without imagining that customers have an infinite budget to react with?  How do we even measure cost?</p>
<p>I can propose at least one metric:  How many meetings need to be held, to deploy a particular technology?  Money is one thing but the sheer time required to get things done is a remarkably effective barrier to project completion.  And the further away somebody is from a deploying organization &#8212; another group, another company, another company that needs to get paid thus requiring a contract and Purchasing&#8217;s involvement &#8212; the worst things are.</p>
<p>Devices are just not being enrolled into the CA system.  Heninger found 19,610 instances of a single firewall &#8212; a security device &#8212; and not one of those instances was even pretending to be secure.  That&#8217;s a success rate not of 99.8%, but of 0.00%.</p>
<p>Whatever good we&#8217;ve done on production websites has been met with deafening silence across, &#8220;firewalls, routers, VPN devices, remote server administration devices, printers, projectors, and VOIP phones&#8221;.  Believe me, this abject security failure cares not a whit about the relative merits of RSA vs. ECDSA.  The key management penalty is just too damn high.</p>
<p><a href="http://www.slideshare.net/dakami/phreebird-suite-10-introducing-the-domain-key-infrastructure">The solution, of course, is DNSSEC.</a>  It&#8217;s not entirely true that third parties aren&#8217;t involved with IP assignment; it&#8217;s just that once you&#8217;ve got your IP space, you don&#8217;t have to keep returning to the well.  It&#8217;s the same with DNS &#8212; while yes, you need to maintain your registration for whatever.com, you don&#8217;t need to interact with your registrar every time you add or remove a host (unless you&#8217;d like to, anyway).  In the future, you&#8217;ll register keys in your own DNS just as you register IP addresses.  It will not be drama.  It will not be a particularly big deal.  It will be a simple, straightforward, and relatively inexpensive mechanism by which devices are brought into your network, and then if you so choose, recognized as yours worldwide.</p>
<p>This will be very exciting, and hopefully, quite boring.</p>
<p>It&#8217;s not quite so simple, though.  DNSSEC offers a very nice model &#8212; one that will be completely vulnerable to the findings of Lenstra, Hughes, and Heninger, unless we start dealing with these badly generated private keys.</p>
<hr />
<a name="actualthreat"><b>THE ACTUAL THREAT</b></a></p>
<p>DNSSEC will make key management scale.  That is not actually a good thing, if the keys it&#8217;s spreading are in fact insecure!  What we&#8217;re finding here is that a lot of small devices are generating keys insecurely.  The biggest mistake we can make here is thinking that only the keys vulnerable to this particular attack, were badly generated.</p>
<p>There are many ways to fail at key generation, that aren&#8217;t nearly as trivially discoverable as a massive group GCD.  Heninger found that Firewall Vendor Z had over a third of their keys either crackable via GCD or repeated elsewhere (as you&#8217;d expect, if both p and q were emitted from identical entropy).  One would have to be delusional to expect that the code is perfectly secure two thirds of the time, and only fails in this manner every once in a while.  The primary lesson from this incident is that there&#8217;s a lot more from where the Debian flaw came from.  According to Heninger, much of the hardware they saw was actually running OpenSSL, pretty much the gold standard in available libraries for open cryptographic work.</p>
<p>It still failed.</p>
<p>This particular attack is nice, in that it&#8217;s independent of the particular vagaries of a device implementation.  As long as any two nodes share either p or q, both p and q will be disclosed.  But this is a canary in the coal mine &#8212; if this went wrong, so too must a lot more have.  What I predict is that, when we crack devices open, we&#8217;re going to see mechanisms that rarely repeat, but still have an insufficient amount of entropy to &#8220;get the job done&#8221; &#8212; nodes seeding with MAC addresses (far fewer than 48 bits of entropy, when you think about it), the ever classic clock seeds, even fixed &#8220;entropic starting points&#8221; stored on the file system are going to be found.</p>
<p>Tens of thousands of random keys being not quite so random is one thing.  But that a generic mechanism found this many issues, strongly implies a device specific mechanism will be even more effective.  We should have gone looking after the Debian bug.  I&#8217;m glad Lenstra, Hughes, and Heninger et al. did.</p>
<hr />
<a name="actionable"><b>ACTIONABLE INTELLIGENCE</b></a></p>
<p>So what to do?  Here is my advice.</p>
<p>1) Obviously, don&#8217;t panic about any website being vulnerable.  This is pretty much a web interface problem.</p>
<p>2) When possible and justifiable, generate private key material outside your embedded devices, and push the keys into them.  Have their surrouding certificates signed, if feasible.</p>
<p>This is cryptographic heresy, of course.  Private keys should not be moved, as bits are cheap.  But, you know, some bits are cheaper than others, and I&#8217;ve got a lot more faith now in a PC generating key material at this point than some random box.  (No way I would have argued this a few weeks ago.  Like I said from the beginning, this is excellent work.)  In particular, I&#8217;d regenerate keys used to authenticate clients to servers.</p>
<p>3) Audit smartcard keys.</p>
<p>The largest population of key material that Lenstra, Hughes, and Heninger could never have looked at, are the public keys contained within the world&#8217;s smartcard population.  Unless you&#8217;re the manufacturer, you have no way to &#8220;look inside&#8221; to see if the private keys are being reasonably generated.  But you do have access to the public keys, and most likely you don&#8217;t have so many of them that the slow mechanism (gcd&#8217;ing each moduli against each other moduli) is infeasibly slow.  Ping me if you&#8217;re interested in doing this.</p>
<p>4) Stop buying or building CPUs without hardware random number generators.</p>
<p>Alright, CPU vendors.  There&#8217;s not many of you, and it&#8217;s time for you to stop being so deterministic.  By 2014, if your CPU does not support cryptographically strong random number generation, it really doesn&#8217;t belong in anything trying to be secure.  Since at this point, that&#8217;s everything, please start providing a simple instruction that isn&#8217;t hidden in some random chipset somewhere for developers and kernels to use to seed proper entropy.  It doesn&#8217;t even need to be fast.</p>
<p>I hear Intel is adding a Hardware RNG to &#8220;Ivy Bridge&#8221;.  One would also be nice for Atom.</p>
<p>5) Revisit <a href="http://cfs.sourcearchive.com/documentation/1.4.1-19/truerand_8c-source.html">truerand</a>, an entropy source that only requires two desynchronized clocks, possibly integrating it into OpenSSL and libc.</p>
<p>This is the most controversial advice I&#8217;ve ever given, and most of you have no idea what I&#8217;m talking about.  From the code, written originally seventeen years ago by D. P. Mitchell and modified by the brilliant Matt Blaze (who&#8217;s probably going to kill me):</p>
<blockquote><p> * Truerand is a dubious, unproven hack for generating &#8220;true&#8221; random<br />
 * numbers in software.  It is at best a good &#8220;method of last resort&#8221;<br />
 * for generating key material in environments where there is no (or<br />
 * only an insufficient) source of better-understood randomness.  It<br />
 * can also be used to augment unreliable randomness sources (such as<br />
 * input from a human operator).<br />
 *<br />
 * The basic idea behind truerand is that between clock &#8220;skew&#8221; and<br />
 * various hard-to-predict OS event arrivals, counting a tight loop<br />
 * will yield a little bit (maybe one bit or so) of &#8220;good&#8221; randomness<br />
 * per interval clock tick.  This seems to work well in practice even<br />
 * on unloaded machines&#8230;</p>
<p> * Because the randomness source is not well-understood, I&#8217;ve made<br />
 * fairly conservative assumptions about how much randomness can be<br />
 * extracted in any given interval.  Based on a cursory analysis of<br />
 * the BSD kernel, there seem to be about 100-200 bits of unexposed<br />
 * &#8220;state&#8221; that changes each time a system call occurs and that affect<br />
 * the exact handling of interrupt scheduling, plus a great deal of<br />
 * slower-changing but still hard-to-model state based on, e.g., the<br />
 * process table, the VM state, etc.  There is no proof or guarantee<br />
 * that some of this state couldn&#8217;t be easily reconstructed, modeled<br />
 * or influenced by an attacker, however, so we keep a large margin<br />
 * for error.  The truerand API assumes only 0.3 bits of entropy per<br />
 * interval interrupt, amortized over 24 intervals and whitened with<br />
 * SHA.</p></blockquote>
<p>Disk seek time is often unavailable on embedded hardware, because there simply is no disk.  Ambient network traffic rates are often also unavailable because the system is not yet on a production network.  And human interval analysis (keystrokes, mouse clicks) may not be around, because there is no human.  (Remember, strong entropy is required all the time, not just during key generation.)</p>
<p>what&#8217;s also not around on embedded hardware, however, is a hypervisor that&#8217;s doling out time slices.  And consider:  What makes humans an interesting thing to build randomness off of, is that we&#8217;re operating on a completely different clock and frequency than a computer.  We are a &#8220;slow oscillator&#8221; that chaotically interacts with a fast one.</p>
<p>Well, most every piece of hardware has at least two clocks, and they are not in sync:  The CPU clock, and the Real Time Clock.  You can add a third, in fact, if you include system memory.  All three may be made &#8220;slow oscillators&#8221; relative to the rest, if only by running in loops.  At the extreme scale, you&#8217;re going to find slight deviations that can only be explained not through deterministic processes but through the chaotic and limited tolerances of different clocks running at different frequencies and different temperatures.</p>
<p>On the one hand, I might be wrong.  Perhaps this research path only ends in tears.  On the other hand, it is the most persistent delusion in all of computing that there&#8217;s only one computer inside your computer, rather than a network of vaguely cooperative subsystems &#8212; each with their own clocks that are in no way synchronized against one another.</p>
<p>It wouldn&#8217;t be the first time asynchronous behavior made a system non-deterministic.</p>
<p>Ultimately, the truerand approach can&#8217;t make things <i>worse</i>.  One of the very nice things about entropy sources is that you can stir all sorts of total crap in there, and as long as there&#8217;s at least 80 or so bits that are actually difficult to predict, you&#8217;ve won.  I see no reason we shouldn&#8217;t investigate this path, and possibly integrate it as another entropy source to OpenSSL and maybe libc as well.</p>
<p>(Why am I not suggesting &#8216;switch your apps over to /dev/random?  Because if your developers did enough to break what is already enabled by default in OpenSSL, they did so because tests showed the box freezing up, and aren&#8217;t going to appreciate some security yutz telling them to ship something that locks on boot.)</p>
<p>6) When doing global sweeps of the net, be sure to validate that a specific population is affected by your attack before including it in the vulnerability set.</p>
<p>7) Start seriously looking into DNSSEC.  You are deploying a tremendous number of systems that nobody can authenticate.</p>
<hr />
<a name="conclusion"><b>CONCLUSION</b></a></p>
<p>It&#8217;s 2012, and we&#8217;re still having problems with Random Number Generators.  Crazy, but we&#8217;re still suffering (mightily) from SQL injection and that&#8217;s a &#8220;fixed problem&#8221; too.  This research, even if accompanied by some flawed analysis, is truly important.  There are more dragons down this path, and it&#8217;s going to be entertaining to slay them.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dakami1.wordpress.com/2429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dakami1.wordpress.com/2429/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2429&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dankaminsky.com/2012/02/17/primalfear/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6563ffebc0ac78f3aa00369630a3c966?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dakami1</media:title>
		</media:content>
	</item>
		<item>
		<title>Survey is good.  Thesis is strange.</title>
		<link>http://dankaminsky.com/2012/02/14/ronwhit/</link>
		<comments>http://dankaminsky.com/2012/02/14/ronwhit/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 23:47:52 +0000</pubDate>
		<dc:creator>Dan Kaminsky</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://dankaminsky.com/?p=2413</guid>
		<description><![CDATA[(UPDATE: I&#8217;ve written quite a bit more about this subject, in the wake of Nadia Heninger posting some fantastic data on the subject.) Recently, Arjen Lenstra and James Hughes et al released some excellent survey work in their &#8220;Ron Was Wrong, Whit Was Right&#8221; paper regarding the quality of keys exposed on the global Internet. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2413&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>(UPDATE:  I&#8217;ve written <a href="http://dankaminsky.com/primalfear">quite a bit more</a> about this subject, in the wake of Nadia Heninger posting <a href="freedom-to-tinker.com/blog/nadiah/new-research-theres-no-need-panic-over-factorable-keys-just-mind-your-ps-and-qs">some fantastic data</a> on the subject.)</p>
<hr />
Recently, Arjen Lenstra and James Hughes et al released some <a href="http://eprint.iacr.org/2012/064.pdf">excellent survey work</a> in their &#8220;Ron Was Wrong, Whit Was Right&#8221; paper regarding the quality of keys exposed on the global Internet.  Rather than just assume proper generation of public key material, this survey looked at 11.7 million public keys in as much depth as possible.</p>
<p>The conclusion they reached was that RSA, because it has two secrets (the two primes, p and q), is &#8220;significantly riskier&#8221; than systems using &#8220;single-secrets&#8221; like (EC)DSA or ElGamel.</p>
<p><i>What?</i></p>
<p>Let me be clear.  This is a mostly great paper, with lots of solid data on the state of key material on the Internet.  We&#8217;re an industry that really operates without data, and with this work, we see (for example) that there&#8217;s not an obvious Debian-class time bomb floating around out there.</p>
<p>But there&#8217;s just no way we get from this survey work, to the thesis that surrounds it.</p>
<p>On the most basic level, risk in cryptography is utterly dominated, not by cipher selection, but by key management.  The study found 12,720 public keys.  It also found approximately 2.94 million expired certificates.  And while the study didn&#8217;t discuss the number of certificates that had no reason to be trusted in the first place (being self signed), it did find 5.4M PGP keys.</p>
<p>It does not matter the strength of your public key if nobody knows to demand it.  What the data from this survey says, unambiguously, is that most keys on the Internet today have no provenance that can be trusted, not even through whatever value the CA system affords.  Key Management &#8212; as Whit Diffie himself has said &#8212; is The Hard Problem now for cryptography.</p>
<p>Whether you use RSA or DSA or ECDSA, that differential risk is utterly dwarfed by our problems with key management.</p>
<p>Is all this risk out of scope?  Given that public key cryptography is <i>itself</i> a key management technology for symmetric algorithms like AES or 3DES, and that the paper is specifically arguing for one technology over another, it&#8217;s hard to argue that.  But suppose we were to say key management is orthogonal to cryptographic analysis, like buffer overflows or other implementation flaws.</p>
<p>This is a paper based on survey work, in which the empirically validated existence of an implementation flaw (12,720 crackable public keys) is being used to justify a design bias (don&#8217;t use a multi-secret algorithm).  The argument is that multi-secret algorithms cause crackable public keys.</p>
<p>You don&#8217;t just get to cite implementation flaws when they&#8217;re convenient.</p>
<p>More importantly, correlation is not causation.  That we see a small number of bad keys at the same time we see RSA does not mean the latter caused the former.  Alas, this isn&#8217;t even correlation.  Out of 6,185,372 X.509 certificates seen by the survey, 6,185,230 of them used RSA.  That&#8217;s all of 142 certificates that didn&#8217;t.  We clearly do not have a situation where the choice of RSA vs. otherwise is random.  Indeed, cipher selection is driven by network effects, historical patents, and government regulation, not the roll of the dice even mere correlation would require.</p>
<p>Finally, if we were to say that a cipher that created 12,720 broken instances had to be suspect, could we ever touch ECDSA again?    Sony&#8217;s <a href="http://www.bbc.co.uk/news/technology-12116051">Playstation 3 ECDSA Fixed Nonce</a> hit millions of systems around the world.  Thus the fault with this whole &#8220;multi-secret&#8221; complaint &#8212; <i>every</i> cipher has moving parts that can break down.  &#8220;Nothing is foolproof because fools are so ingenious&#8221;, as they say.  Even if one accepted the single-sample link between multi-secret and RSA, the purportedly safe &#8220;single-secret&#8221; systems have also failed in the past, in quite larger numbers when you get down to it.</p>
<p>I don&#8217;t mean to be too hard on this paper, which again, has some excellent data and analysis inside.  I&#8217;ve been strongly advocating for the collection of data in security, as I think we operate more on assumption and rumor than we&#8217;d like to admit.  The flip side is that we must take care not to fit our data to those assumptions.</p>
<hr />
Apparently this paper escaped into the <a href="http://t.co/EDvFDt7A">popular press</a>.</p>
<p>I think the most important question to be asked is &#8212; if 0.2% of the global population of RSA moduli are insecure, what about those attached to unexpired certificates with legitimate issuers?  Is that also 0.2%, or less?  </p>
<p>(There&#8217;s no security differential if there was no security to begin with.)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dakami1.wordpress.com/2413/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dakami1.wordpress.com/2413/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dankaminsky.com&#038;blog=18023203&#038;post=2413&#038;subd=dakami1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dankaminsky.com/2012/02/14/ronwhit/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6563ffebc0ac78f3aa00369630a3c966?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dakami1</media:title>
		</media:content>
	</item>
	</channel>
</rss>
