<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Perimeter Grid &#187; crypto</title>
	<atom:link href="http://perimetergrid.com/wp/category/crypto/feed/" rel="self" type="application/rss+xml" />
	<link>http://perimetergrid.com/wp</link>
	<description>Building Security in a Networked World</description>
	<lastBuildDate>Thu, 12 Aug 2010 17:28:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>BlackHat 2010: Day 1</title>
		<link>http://perimetergrid.com/wp/2010/08/12/blackhat-2010-day-1/</link>
		<comments>http://perimetergrid.com/wp/2010/08/12/blackhat-2010-day-1/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 17:28:48 +0000</pubDate>
		<dc:creator>Grant Bugher</dc:creator>
				<category><![CDATA[attacks]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[industry]]></category>
		<category><![CDATA[mitigations]]></category>
		<category><![CDATA[products]]></category>

		<guid isPermaLink="false">http://perimetergrid.com/wp/?p=115</guid>
		<description><![CDATA[I&#8217;ve just returned from a trip to BlackHat Briefings USA 2010 and DefCon 18. As always, it was an enjoyable week in Las Vegas learning about the latest research, networking with the surprisingly small world of security professionals, and generally having fun hanging out with a lot of interesting people with the hacker mindset. BlackHat [...]<p>a</p>
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just returned from a trip to <a href="http://blackhat.com/html/bh-us-10/bh-us-10-home.html">BlackHat Briefings USA 2010</a> and <a href="http://defcon.org/html/defcon-18/dc-18-index.html">DefCon 18</a>.  As always, it was an enjoyable week in Las Vegas learning about the latest research, networking with the surprisingly small world of security professionals, and generally having fun hanging out with a lot of interesting people with the hacker mindset.</p>
<p>BlackHat started out with a <a href="http://blackhat.com/html/bh-us-10/bh-us-10-keynote.html">keynote from Jane Holl Lute, Deputy Secretary of Homeland Security</a>.  She gave the sort of banal, predictable speech we expect from a political appointee &#8212; the country needs a secure homeland, dynamic economy, and the rule of law.  &#8220;Cyberspace&#8221; isn&#8217;t a warzone, because wars happen somewhere, kill people, are lawless, and &#8220;cyberspace&#8221; isn&#8217;t like this.  (The one sure sign you&#8217;re listening to a government official is the constant use of the prefix &#8220;cyber-&#8221;.  An even more sure sign is the use of &#8220;cyber&#8221; as a noun by itself, which so far as I can tell is done <em>only</em> by feds.)</p>
<p>She states that the five essential missions of DHS are to prevent terrorist attack, secure borders (while expediting trade &amp; travel), enforce immigration laws, ensure the safety &amp; security of &#8220;cyberspace,&#8221; and help build a resilient society.  While I really like the emphasis on resilience in her rhetoric, I do wish DHS had more visible efforts in that direction rather than appearing to be wholly focused on prevention.  She also laments that billions have been spent in cybersecurity, but the most fundamental problems still aren&#8217;t fixed, and claims that the administration wants to build a cybersecurity strategy and vision for the nation.  I find this claim curious for two reasons: first of all, billions have been spent on physical security, too, and yet we don&#8217;t seem to have &#8220;fixed&#8221; crime and violence, so why should we expect information security to be any different?  And second, DHS saying we <em>need</em> a &#8220;cybersecurity&#8221; strategy implies that they don&#8217;t <em>have</em> one.</p>
<p>Jeff Moss seemed far more excited about this talk than its content warranted.  Simple politeness to a speaker, or the effect of his presence on the Homeland Security Advisory Council?  Also, during Q&amp;A one person asked her why, given that the TSA is the laughingstock of the world, we should expect DHS to do any better with the Internet.  (While the question is admittedly a cheap shot and not an actual argument, her response &#8212; which was to say that the TSA is just fine and not mocked throughout the world at all &#8212; did not exactly inspire confidence either.)</p>
<p>My first session after the keynote was called <a href="http://blackhat.com/html/bh-us-10/bh-us-10-briefings.html#Grugq">Base Jumping, by the Grugq</a>.  This was one of two major talks about cell phone hacking on GSM this year.  The GSM protocol specification runs dozens of documents and thousands of pages, but according to the Grugq, the important one is GSM 04 08, which defines layer 3.</p>
<p>GSM is based on TDMA (Time Division Multiple Access,) so decoding is based on time &#8212; the clock in a phone must be synced with the clock in the base station.  Only a tiny amount of data is sent per timeslot.  There are only 23 bytes in a timeslot, so you can do a complete exhaustion fuzzing in 3 days (and he did.)</p>
<p>Communication is done over a variety of named channels.  BCCH (broadcast control channel) is how a base station sends out its information messages. PCH (paging channel) announces incoming SMS or phone calls. RACH (random access channel) is used by the phone to request a channel, which it gets back over AGCH (access granted channel.)  Opening a channel is slow &#8211; it takes 2-3 seconds.  Since it&#8217;s based on timeslots, can take quite a while for the base station to have an open slot of the appropriate channel to reply in.</p>
<p>Collisions are frequent since channel number is just 25 bits, and some cheap phones actually hardcode a list of random numbers instead of generating them (apparently generating a 25-bit number is just too hard for them.)</p>
<p>Police sometimes use IMSI catchers, which impersonate the network and make the phones all hand over their IMSI (International Mobile Subscriber Identifier &#8212; your ID off your SIM card that tells the phone company who you are.)  The protocol is flawed &#8212; the phone authenticates with the network, but the network does not authenticate to the phone, and thus can be impersonated.</p>
<p>A German group built an open-source baseband for a common, cheap cell phone (the Motorola C118 or C123, about 5 Euro on eBay.).  This can then be hacked to send arbitrary GSM traffic.  Among the Grugq&#8217;s apps were:</p>
<p>RACHell: request channel allocation, then flood the base station with requests.  This will DoS the entire cell by using all the channels.  A cell can only hold about 1000 users.  Since the cell is backed up to a base station controller (BSC), this attack may take down the BSC as well (which shuts down the whole tower for half a day.)</p>
<p>IMSI Flood: send IMSI ATTACH messages, indicating a user coming online.  These are sent pre-authentication, and if you send too many random numbers as IMSIs, it can overwhelm the HLR/VLR infrastructure (the database that tells which tower has which phones attached to it) and takes down the whole network.  This could also be used to make police IMSI catchers pretty much useless.  I got the idea that the Grugq had not actually tested this, since taking down a cell network might get a little unwanted attention.</p>
<p>IMSI DETACH: When phones are turned off, they tell the network they&#8217;re no longer available via sending a single unauthenticated frame.  If you have someone&#8217;s IMSI (which you can look up by phone number for $0.006,) you can send one for someone else, which disables that phone from receiving calls or SMS and cuts off any in-progress phone calls.  The victim can still make new calls, however, which will reattach them to the network &#8212; but if you&#8217;re sending DETACHes every 5 seconds, this will do little good.</p>
<p>Baseband fuzzing: fuzzing the baseband (the radio in individual phones) by impersonating the tower pretty much causes every phone available to crash.  However, lacking the code for the basebands, the Grugq didn&#8217;t find any remote exploits here.  However, the overall point is that GSM is no longer a walled garden &#8212; anyone can send GSM traffic with minimal equipment now, and protocol security is required.</p>
<p>The next session I attended was <a href="http://blackhat.com/html/bh-us-10/bh-us-10-briefings.html#KaneParry">More Bugs in More Places, by David Kane-Parry of Leviathan Security</a>.  This was an overview of the SDKs and security models for Android, Windows Phone 7, BlackBerry, and iPhone.  There was nothing particularly new here, nor did he come to any conclusion as to the superiority or inferiority of any one of the platforms, so I&#8217;m not going to go into details.</p>
<p>The next talk was <a href="http://blackhat.com/html/bh-us-10/bh-us-10-briefings.html#Jack">Barnaby Jack of IOActive with the wildly popular topic of jackpotting ATMs</a>.</p>
<p>Current ATM attacks are mostly skimmers, physical theft, Ram raids (dragging the ATM away with a truck,) card trapping and shoulder surfing PINs, or frontal attack via safe cutting or even explosives.  Barnaby Jack wanted to instead attack the software.  Most new model ATMs are Windows CE based, with an ARM/Xscale processor, remote connection via TCP/IP or dial-up, with SSL support and a Triple DES encrypted PIN pad.  Since the developers of Windows CE developers concerned were more concerned with protection (in the process sense) than security, this provides an opportunity.</p>
<p>To reverse engineer this, he bought a couple of ATMs and had them delivered to his house (which the delivery people found rather bizarre, but did.)  ATMs boot directly to a proprietary ATM application.  In order to get a shell, he connected a JTAG interface for full debugging access to the processor core, set a breakpoint on CreateProcess(), and replaced the target ATM executable string with explorer.exe.  With explorer, he could connect a USB disk and keyboard and copy files off for offline research, make registry changes permanent (so as to always boot Explorer), create a debugging environment, then set up remote app debugging in Visual Studio.</p>
<p>The external attack surface is limited to the card reader, keypad, network, and motherboard inputs.  This leads to two possible attack plans &#8212; remote over the network ,or a walk-up attack.  It turns out the walk-up attack is quite possible, since while the cash is protected by a two-inch-thick steel safe, the motherboard is protected by <em>a one-key-fits-all lock you can buy keys for on the Internet</em>.</p>
<p>With motherboard accessible, you can access USB, SecureDigital, and CompactFlash slots.  On boot, the app code checks these drives for firmware upgrades and applies them.  (And there&#8217;s a reboot switch on the motherboard, too!)</p>
<p>From a remote perspective, ATMs support remote monitoring and configuration to allow changing splash screens, cash denominations, etc., or even do remote firmware upgrades.  There are multiple levels of authentication, but Barnaby Jack found a vulnerability in this authentication process allowing for a remote authentication bypass.  (He did not disclose his authentication bypass, but said he found it by fuzzing, so this work will probably be duplicated by others.)</p>
<p>He demonstrated two tools &#8212; one was Dillinger, a remote ATM attack and administration tool which exploits the remote authentication bypass.  It&#8217;s reliable on dial-up or TCP/IP, and exchange scanning with a VoIP wardriver like WarVox is possible.  Dillinger allows management of unlimited ATMs, can test remote bypass, retrieve location &amp; master passwords, upload rootkits, and even retrieve the track data from all the cards that have been inserted into the machine.</p>
<p>Scrooge, an ATM rootkit, runs on the device hidden in background, activated by special key sequence or custom card.  It runs on any ARM/Xscale ATM, or Intel ones with some tweaks, but must be customized for different ATM models.  It has a keyboard filter that hooks the ATM keypad &amp; side buttons &#8212; SetWindowsHook() is undocumented on CE but still works.  A special key sequence (or a card whose track data spells out &#8220;GIMMEDALOOT&#8221;) launches a menu.  Scrooge captures track data and pin-pad input, and can issue remote commands.</p>
<p>This is better seen than described.  Here&#8217;s some video of remote ATM hacking with Dillinger:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/qwMuMSPW3bU&amp;hl=en_US&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="640" height="385" src="http://www.youtube.com/v/qwMuMSPW3bU&amp;hl=en_US&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>And here we have the aftermath of a physical attack, where he opened the ATM with a key, stuck in a USB drive, and hit the reset button on the motherboard:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/fS3Z8Xv-vUc&amp;hl=en_US&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="640" height="385" src="http://www.youtube.com/v/fS3Z8Xv-vUc&amp;hl=en_US&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>The &#8220;777 Jackpot!&#8221; on the screen and the peppy music are a nice touch.</p>
<p>As for how to prevent these sorts of vulnerabilities in the future, he recommends that ATM vendors offer upgrade options on the physical locks (say to at least making the key unique), implement binary signing at the kernel level to prevent unauthorized firmware upgrades, and disabling remote management on the device.</p>
<p>For the final presentation of the day, I attended <a href="http://blackhat.com/html/bh-us-10/bh-us-10-briefings.html#Kaminsky">Dan Kaminsky&#8217;s talk</a>, which was actually not the talk described in the BlackHat documentation at all, but rather an entirely different talk on using DNSSEC to implement public key infrastructure, due to the fact that the DNSSEC root was finally signed (after only 18 years&#8230;) three weeks ago.</p>
<p>Dan seeks to use DNSSEC to solve a variety of problems, by creating what he calls a Domain Key Infrastructure:</p>
<ul>
<li>For users: when you receive an email, you can actually know for certain who it came from.
</li>
<li>For infrastructure buyers: we need strong authentication as much today as we did when trying (and failing) to create PKI in the past, and with DNSSEC we can actually create a working PKI.  60% of security breaches are credential-related.
</li>
<li>For infrastructure builders: DKI will make security products scale, and allow devices to validate the identity of peers.  You can build scalable federated systems.
</li>
<li>For hackers and penetration testers: Dan&#8217;s new company will be actively supporting an aggressive public audit of all DNSSEC and DKI technologies.
</li>
</ul>
<p>Dan&#8217;s definitely right about one thing &#8212; we aren&#8217;t going to get security via moralizing about user education or waiting for regulation. Will have to deliver a better product as judged by the people who have to run it.</p>
<p>DNSSEC is simple &#8212; it works just like DNS, but referrals and authoritative records are signed.  Thus, when referred elsewhere, you&#8217;re told not only where the server to ask is, but also how to recognize it.  Keys can lead to other keys.  </p>
<p>DNSsec was complex to deploy because it was designed to allow &#8220;key in a vault&#8221; security, where keys are offline and not generated on demand.  When it was proposed <em>eighteen years ago</em>, CPUs were slow, and some installations are incredibly large (e.g. .com)  Offline keying is cumbersome.  However, there&#8217;s an alternative that&#8217;s relatively simple to deploy.</p>
<p>Phreebird is a DNSSEC server that&#8217;s simple because it uses online keysigning, just like SSL, SSH, and IPsec.  There is some risk here, of course, but we seem to accept it everywhere else, as everyone keeps keys online for some protocols.  Those who are really concerned about security can use a hardware security module.  Phreebird works as a proxy, and has effectively nothing to configure &#8212; you change the port of the DNS server, run Phreebird, and then supply the signature to your DNS registrar.  It&#8217;s presently implemented as a UDP port forwarder, but they&#8217;re rebuilding it as a Linux mangle table.  It&#8217;s very fast; according to Dan, it&#8217;s an order of magnitude faster than the DNS servers it&#8217;s proxying, so there should be almost no load.  For performance, it caches signed responses, but always passes queries to the real nameserver so that all scenarios work &#8212; but if it gets the same thing, it pulls up the cached signed response instead of resigning.  Phreebird is open source and will be out in the next few weeks.</p>
<p>Distributed authentication is only interesting if it&#8217;s end-to-end.  The current methods of DNSSEC lookups, chasing &#038; tracing, are blocked by various types of servers, which makes operational implementation difficult.  Phreebird also supports wrapping DNS (and DNSSEC) in HTTP, using a custom DNS server that exposes an HTTP endpoint and takes base64-encoded DNS requests.  They claim there is no performance hit.</p>
<p>Likewise, while X.509 is flawed (since a certificate just has to chain to one of a few hundred root CAs by way of thousands of untrustworthy intermediaries, and there is no exclusion or delegation,) it can still be used to wrap DNSSEC &#8212; high performance, easy tunneling via DNS over X.509 over SSL.  When one of these certificates is received, you just need to extract all the keys from the trust chain and validate it all.</p>
<p>From here, Dan got into the more interesting stuff &#8212; what he calls DKI (Domain Key Infrastructure.)  What if you could use DNSSEC to create a working PKI system?  Since DNSSEC lets you strongly authenticate a domain, you can then ask that domain to authenticate users, and trust the response since you have a key for the domain.  To demonstrate this, he presented PhreeShell: federated identity for OpenSSH.  With this modification, .ssh/authorized_keys2 contains identities (e.g. grant@perimetergrid.com) rather than keys &#8212; it makes delegating access trivially easy.</p>
<p>Trusting DNSSEC eliminates the scaling issues of federated PKI.  Really, you&#8217;re not trusting DNSSEC so much as ICANN, but it seems a fairly good choice for a single root keyholder in that it has external political constraints and a delegation system designed to prevent operational dependency.</p>
<p>So how do we implement DKI everywhere?  Eventually, by adding the functionality to everything &#8212; link in LDNS or libunbound.  On Linux, you can make most things work by patching X509_verify_cert in OpenSSL, because practically everything calls out to it for crypto, but there&#8217;s nothing so simple in the browser world, where IE uses CryptoAPI, Firefox and Chrome use NSS, and most apps are cross-platform.  For this, Dan has an app called Phoxie, which is a remote validation proxy for production browsers that allows certificate verification against DNSsec in current browsers.  It&#8217;s also possible to make self-certifying URLs, but they look horrible and become unusable if the certificate ever expires or needs rotated, so they&#8217;re not a good solution.</p>
<p>Finally, we may get secure email out of this.  If we can verify what server sent an email (which with DNSSEC we can), we can also in many cases be sure who sent it (as if the email came from a &#8220;respectable&#8221; domain it wouldn&#8217;t let users send mail as each other.)  Right now the user experience around secure email is minimal, but our faith in it has been low &#8212; if most email could be verified, we could easily get to a world where email clients only stated mail was &#8220;From&#8221; someone if this fact had been cryptographically verified, and otherwise used some suspicion-inducing verbiage (e.g. the X-Supposedly-From header.)</p>
<p>Overall, Dan&#8217;s talk was interesting, but I find my enthusiasm is rather limited by lack of faith any of this stuff will be <em>used</em>.  DNSSEC has been around for 18 years and no one uses it yet; having the root signed is a wonderful step and I hope it leads to the revolution in PKI Dan&#8217;s touting, but I also feel like I&#8217;ll believe it when I see it.</p>
<p>After all the talks, I dropped in on parties thrown by Mandiant, IOActive, and NetWitness, but unfortunately had to skip Tenable and Rapid7.  There are so many parties, receptions, and events that it&#8217;s impossible to visit all or even most of them.</p>
<p>a</p>
]]></content:encoded>
			<wfw:commentRss>http://perimetergrid.com/wp/2010/08/12/blackhat-2010-day-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BlackHat 2009, Day 2</title>
		<link>http://perimetergrid.com/wp/2009/08/13/blackhat-2009-day-2/</link>
		<comments>http://perimetergrid.com/wp/2009/08/13/blackhat-2009-day-2/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 21:04:57 +0000</pubDate>
		<dc:creator>Grant Bugher</dc:creator>
				<category><![CDATA[anonymity]]></category>
		<category><![CDATA[attacks]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[industry]]></category>
		<category><![CDATA[legal]]></category>
		<category><![CDATA[networks]]></category>
		<category><![CDATA[passwords]]></category>
		<category><![CDATA[risk]]></category>
		<category><![CDATA[society]]></category>

		<guid isPermaLink="false">http://perimetergrid.com/wp/?p=92</guid>
		<description><![CDATA[The Thursday keynote was given by Bob Lentz, a Deputy Assistant Secretary of Defense for the United States. His main point was the paradigm shift from network-centric security to what he called content-centric security, and the fact that this devalues the protections around network perimeters. Static defenses don&#8217;t work when all the services being used [...]<p>a</p>
]]></description>
			<content:encoded><![CDATA[<p>The Thursday keynote was given by Bob Lentz, a Deputy Assistant Secretary of Defense for the United States.  His main point was the paradigm shift from network-centric security to what he called content-centric security, and the fact that this devalues the protections around network perimeters.  Static defenses don&#8217;t work when all the services being used are distributed and not found behind your firewall; the adversary is effectively always inside your firewall.  Other notable but less positive things from the speech included that the Department of Defense considers &#8220;reducing anonymity&#8221; a strategic goal, and that the government still likes to prefix &#8220;cyber-&#8221; on everything, creating &#8220;cyberczar,&#8221; &#8220;cybertime,&#8221; &#8220;cyber green movement,&#8221; and even &#8220;cyber&#8221; as a standalone noun.</p>
<p>This year, BlackHat had an entire Cloud Computing track, running all day on Thursday, of which I attended a great deal.  Part of my job involves protecting cloud computing services, so it seemed very relevant, and it&#8217;s certainly a hot topic in the industry right now.  It began with <a href="http://www.blackhat.com/html/bh-usa-09/bh-usa-09-speakers.html#Stamos">Alex Stamos, Nathan Wilcox, and Andrew Becherer</a> presenting a lecture on cloud computing models and vulnerabilities.</p>
<p>They defined cloud computing as not just virtualization, but including general-purpose hosts, central management, application mobility, distributed data, low-touch provisioning, and soft failover.  They looked at three different cloud models: Software as a Service, Platform as a Service, and Infrastructure as a Service, and the differences &amp; vulnerabilities in each.</p>
<p>The Software as a Service (SaaS) model is to outsource everything.  From a security perspective it&#8217;s not necessarily a bad idea &#8212; the cloud provider probably has a lot more security people than the average company.  On the other hand, you also outsource all your data &#8212; the recent Twitter &#8220;breach&#8221; via somebody logging into Twitter&#8217;s Google Docs account shows the risks this can entail.  You lose the perimeter, endpoint management, the ability to use better authentication than simple passwords, credential quality controls, password reset processes, and realtime anomaly detection (though you hope the cloud provider has some of these things.)  It puts all your eggs in one basket &#8212; if someone can read your email, they can access all your data.  SaaS products include Office Live, Google Apps, and Salesforce.com.  None of these have decent audit &amp; rollback capability; Google Apps at least provides login history (though you have to write code &amp; call an API to get at it) but still no read/write level auditing.  Salesforce.com offers some write logging.  However, the biggest flaw with SaaS models may well be authentication &#8212; all your security relies on a password, with all the vulnerability that entails, and you can&#8217;t even set a strong password policy (for all the good it would do you.)  Google Apps actually lets you use a SAML-based SSO system; with other SaaS apps the best you can do is set a strong password policy via employee education.</p>
<p>Another issue with SaaS providers is the legal concerns &#8212; the cloud service EULAs tend to promise basically nothing and disclaim all liability.  Also, they forbid malicious traffic &#8212; even pentesting your own app.  There&#8217;s also decreased protection from search and subpoena.  Since the data is stored with someone else, there&#8217;s no Constitutional protection from search, and even statutory protection is usually only for &#8220;communication.&#8221;  Are Google Docs communication?  Courts haven&#8217;t really defined this yet.  The net result of this is that there&#8217;s no need for a warrant, probable cause, or even notice of a search &#8212; you can&#8217;t fight a seizure before it happens, but only after the fact.</p>
<p>Platform as a Service (PaaS) is the model of having a common development platform provided, yet allowing people to customize their applications.  This is the model of Google AppEngine, Force.com, and (maybe) Windows Azure.  (Azure is a unique case, kind of halfway between PaaS and IaaS; I&#8217;ll come back to this.)  This section of the presentation was rather odd, as they really looked at the common web vulnerabilities (CSRF, XSS, SQL injection) and investigated how the platform protected you from them.  In short, the answer is that they don&#8217;t.  Some of the platforms have some inherent protection available (e.g. Windows Azure apps are typically ASP.NET, which has some built-in XSRF protection via ViewStateUserKey, XSS protection via encoders, and SQL injection via LINQ), but it&#8217;s up to the developer to actually use them.  I found this section somewhat lacking, because it wasn&#8217;t really about the cloud platforms at all, but rather the common web technologies sitting on them.</p>
<p>The Infrastructure as a Service (IaaS) model is that taken by Amazon EC2 and similar services.  It provides virtual machines with short-lived instances, non-persistent local storage, and available helper services.  Though the presenters thought of Azure as very much a PaaS model, I think it&#8217;s a little fuzzier here &#8212; while Azure does not allow you to choose an operating system (the Windows Azure OS runs on every VM), it does not constrain you to anywhere near the degree of Google AppEngine or Force.com, as you can run arbitrary native code on it.  It would be impossible to use AppEngine or Force.com to run anything but a web site; Azure is like EC2 in that it could be used for any flexible computing task, not just web sites.</p>
<p>The problems with IaaS services are usually hypervisor flaws or problems in the helper services.  However, they brought up something very new here that I don&#8217;t think any of the current cloud providers consider &#8212; lack of entropy.  Virtual hardware has mostly deterministic timings &#8212; input events don&#8217;t exist and block device events are abstracted.  Thus, entropy is generated very slowly if at all.  What&#8217;s more, in the case of Amazon EC2, since OS images are available to everyone, an attacker can get a copy of the stored entropy pool you&#8217;re using (which will never update after the image is originally created, thus depriving the system of another source of entropy) and eliminate it as well.  The net result of this is that pseudo-random number generators &#8212; even cryptographically strong ones &#8212; are unreliable and may be predictable.  This attack may or may not be practical given the specifics of the system in question, but for now you may not want to build your online casino or public key infrastructure in an IaaS environment!  Cloud providers may actually have to have random number generation as a helper service as well, supported by <a href="http://en.wikipedia.org/wiki/Hardware_random_number_generator">quantum hardware</a>.</p>
<p>Next, <a href="http://www.blackhat.com/html/bh-usa-09/bh-usa-09-speakers.html#Grossman">Jeremiah Grossman and Trey Ford</a> presented a sequel to last year&#8217;s talk on &#8220;making money the black hat way.&#8221;  Essentially, it was a survey of interesting hacks-for-profit that have been carried out recently.  They noted that hacking activity is up this year (layoffs create more hackers?) and that 69% of attacks are discovered only because a 3rd party tells the company it&#8217;s been hacked.</p>
<p>Some of the interesting ones: eBay gave away 1000 items for $1 in a &#8220;Holiday Doorbusters&#8221; promotion.  However, almost 100% of them were bought by bots, which was evident because the items were purchased before the item description page was even viewed.  StrongWebmail.com had a contest to give $10,000 to whoever could hack into the CEO&#8217;s webmail account; rather than attacking the servers, the winners of the contest sent the CEO phishing mail with an XSRF in it that stole the contents of the account.  (Amusingly, they got him to open the mail by labeling it &#8220;I think I won.&#8221;)  Grossman &amp; Ford also brought up cookie-stuffing, a type of affiliate fraud that&#8217;s been around for many years; it&#8217;s a well-known technique in the affiliate marketing world (basically you spoof the referrer while iframing the advertiser&#8217;s site on your site, then drive traffic to your site in ways that would not please the advertiser if they knew about it) but was apparently new to most of the BlackHat audience.  They also brought up the technique of using embedded site search to fake authority links, another well-known &#8220;black hat&#8221; SEO technique.  Marketers have apparently also begun spamming Google Maps with fake businesses, so as to come up first in &#8220;local searches&#8221; with their web-based and not-remotely-local businesses.  A man in Britain used Google Earth to find all the lead roofs in London, then steal the lead tile in the middle of the night.</p>
<p>Some of the more ambitious hacks were more intriguing, though.  One man discovered that you could order &#8220;advance replacements&#8221; for broken iPods from Apple just by giving them a credit card number as collateral; he used low-balance anonymous Visa gift cards to get 9,000 iPods.  Another group put their garage band music in the Amazon and iTunes stores using Tunecore, then bought hundreds of downloads of their own album with stolen credit cards (thus getting a big check from Tunecore.)  One thing to note is that these people got caught only because <em>they weren&#8217;t trying not to</em>.  The iPod guy shipped all 9,000 to his home address; the Tunecore fraud was so blatant as to get this garage band&#8217;s album onto Amazon and iTunes top-10 bestsellers.</p>
<p>Finally, in South America, the system for getting logging permits for the Amazon rain forest was put online.  An investigation discovered that <em>107 different logging companies</em> had hired hackers to compromise the site, which was full of common web vulnerabilities.  All told, 1.7 million cubic feet of lumber were smuggled out of the country.  Scary permit systems in the United States that are now protected only by a web site: entrance visas, hazardous material transport, and open burning permits.</p>
<p>Next, <a href="http://www.blackhat.com/html/bh-usa-09/bh-usa-09-speakers.html#Meer">Haroon Meer, Nick Arvanitis, and Marco Slaviero</a> presented a talk on &#8220;Clobbering the Cloud.&#8221;  This SensePost talk covered much of the same material as the iSec Partners talk earlier in the day.  Their primary risk factors for cloud computing were as follows: lack of transparency from cloud providers (opaque EULAs), people don&#8217;t want to store regulated data in the cloud, vendor lock-in especially if the vendor goes out of business or stops offering the service, availability concerns (not just servers being down, but also things like password lockout from DoS attacks), monoculture issues (worms and cascading compromise are a big concern when you have thousands of perfectly-identical boxes), and trust in the cloud provider &#8212; you have to trust your cloud provider implicitly not to lose your data or have system failures.  In addition, there&#8217;s the problem that the cloud is available to the bad guys, too &#8212; cloud boxes can be used for click fraud, DoS, or spamming (for a short time Amazon EC2 was the net&#8217;s #1 spammer.)  Finally, the security of your environment is all in the hands of the account owner, who authenticates with nothing more than a password, and is (in most companies) probably a non-technical executive.  Breaking into the CIO&#8217;s email now makes you the global administrator of the company&#8217;s entire infrastructure.</p>
<p>The presenters then went into more detail about attacks on Amazon Web Services (EC2, S3, SQS, and DevPay) in particular.  I can understand why they chose AWS; due to its flexibility, it&#8217;s certainly the most fun of the cloud services for a hacker to play with (though Windows Azure is getting there, too.)  EC2 is based on a modified Xen hypervisor, and supports running any OS you want that can run in that environment.  Amazon provides 47 OS images, but users have contributed over 72,000 more, and an EC2 user can choose to boot any of them.  Sometimes user images have interesting things in them, like other user&#8217;s EC2 credentials, for example.</p>
<p>Scanning EC2 is prohibited, but you can start up one of the images and scan it yourself via an SSH tunnel (or even have the machine scan itself.)  They found 646 Nessus critical vulns in Amazon&#8217;s public images; you can also steal Amazon&#8217;s own Windows activation keys off their images.  The DevPay system is interesting; it&#8217;s supposed to allow a user to make an image then charge other users for its use (e.g. to resell an application on EC2.)  However, the presenters found you could get a DevPay image and modify its ancestor info (stored in the image itself) so as to credit use of it to you rather than the original author, then reregister it for others to use.</p>
<p>Simply putting up pre-owned (pun intended) images for others&#8217; use can be an attack on AWS.  If you prop up a box with a good name (e.g. &#8220;Ubuntu 9.04 Standard Image, All Patches&#8221;) and a low-numbered ID (so it shows up at the top of the list), and people will use your image to host their apps!  You can get a low-numbered ID simply by registering repeatedly; since it&#8217;s a hash, eventually you&#8217;ll get lucky and have one start with zero.  You can only have 20 images per account, but you can create 20 accounts in 3 minutes, so there&#8217;s no effective limit.</p>
<p>After that talk, I went over to the mobile track to hear <a href="http://www.blackhat.com/html/bh-usa-09/bh-usa-09-speakers.html#Burns">Jesse Burns</a> talk about Android.  Android interests me because I&#8217;d really like a phone that behaves like a computer (i.e. a device I own) rather than like a toy the phone company is reluctantly allowing me to touch, and Android&#8217;s open-source nature has real potential to give me that.  It&#8217;s not that I trust Google any more than any other wireless provider, just that the platform seems much more hackable and thus inherently harder to control.</p>
<p>Android has a dual security model &#8212; Android permissions on various privileges, plus Linux permissions on the filesystem.  Applications have their own UIDs/GIDs and are thus somewhat isolated from each other. A package (application) is made up of Activities (GUIs,) Services (background tasks,) Broadcast Receivers (event handlers,) Content Providers (databases,) and Instrumentations (used for testing.)  For interprocess communication, there are Intents, which are sets of name-value pairs with routing information.  Applications are written in Java, but they&#8217;re not applets (i.e. no Java sandbox.)</p>
<p>Available attack surfaces for a malicious app include other apps, system services under privileged accounts (like the clipboard or the surfaceflinger, which draws the UI and owns the screen,) the binder (the inter-process communication system, similar to domain sockets,) and anonymous shared memory.  There are a variety of tools available &#8212; one can just install a bash shell on Android (either interactively or over the wire or network,) use logcat to look at logs, view Android system properties, check the /proc and /sys filesystems, run dmesg to get kernel output, and all the usual Linux attacks.  There&#8217;s also a file in /data/system/packages.xml that contains data about every installed app, including the location of the app and its manifest.  /proc/binder contains a transaction log of the inter-process communication, and /proc/binder/proc contains data of all the processes themselves.</p>
<p>Another interesting detail about Android is the &#8220;secret code&#8221; handler.  When you dial *#*#somenumber#*#*, this triggers the secret code handler for that number, which can do pretty much whatever an app wants it to do.  The only secret codes on &#8220;stock&#8221; Android are 8351 and 8350, which turn voice dialer logging on and off, respectively.  However, wireless providers may add additional codes &#8212; the presenter found some in T-Mobile&#8217;s MyFaves app, for example.  Finally, the presenter had a series of Android hacking apps he&#8217;d developed &#8212; Manifest Explorer (to view the system manifest and the manifest of each app, such as to see what events they react to,) Package Play (to see the parts of a package or to directly activate Activities,) Intent Sniffer (to view Intents as they&#8217;re routed at runtime,) and Ill Intent (an Intent fuzzer.)</p>
<p>The last presentation of the day was <a href="http://www.blackhat.com/html/bh-usa-09/bh-usa-09-speakers.html#Schneier">Bruce Schneier</a>, whose talk was entitled Reconceptualizing Security.  Mostly, he gave the same speech he always does, about fear, psychology, security vs. security theater, why we mis-estimate risk, etc.; pick up a copy of <em>Beyond Fear</em> or <em>Secrets and Lies</em> if you want the details.  However, during Q&amp;A he did also talk about the attack on AES-256 that was just demonstrated.  It&#8217;s a feasible attack on 10 rounds of AES-256 (out of 14,) in 2<sup>42</sup> time.  It&#8217;s a related-key attack that works only on 256-bit keys (not on shorter ones,) so there&#8217;s no reason to panic right now, but it does show that the margin of safety on AES is smaller than we thought.  There may need to be a Double-AES in the same way Triple-DES was devised as a stopgap until a new cryptosystem is developed.  Alternately, the standard could be changed to increase the number of rounds, but that would require replacing or updating all the AES-based crypto hardware out there.</p>
<p>And that wrapped up BlackHat 2009.  Overall, there was nothing as Earth-shattering as last year&#8217;s DNS exploit, though it turns out that the SSL issues are pretty nasty.  After BlackHat, I hit the Microsoft Security Researcher Appreciation Party at Christian Audigier, which was actually a pretty good party this year without any of the problems of previous years.  It&#8217;s only drawback was that it only ran two hours.  However, at this point DefCon festivities had begun, so there was still plenty going on; my next post will get into DefCon 17.</p>
<p>a</p>
]]></content:encoded>
			<wfw:commentRss>http://perimetergrid.com/wp/2009/08/13/blackhat-2009-day-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>BlackHat 2009, Day 1</title>
		<link>http://perimetergrid.com/wp/2009/08/01/blackhat-2009-day-1/</link>
		<comments>http://perimetergrid.com/wp/2009/08/01/blackhat-2009-day-1/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 07:01:45 +0000</pubDate>
		<dc:creator>Grant Bugher</dc:creator>
				<category><![CDATA[attacks]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[industry]]></category>
		<category><![CDATA[passwords]]></category>
		<category><![CDATA[risk]]></category>

		<guid isPermaLink="false">http://perimetergrid.com/wp/?p=89</guid>
		<description><![CDATA[The annual Vegas security conference is upon us again, and there have been plenty of interesting presentations. Last year, it felt like WiFi was the &#8220;theme&#8221; of the year &#8212; this year, the most interesting (and well-attended) briefings were on SSL and mobile devices. The Wednesday keynote was presented by Douglas Merrill, the COO of [...]<p>a</p>
]]></description>
			<content:encoded><![CDATA[<p>The annual Vegas security conference is upon us again, and there have been plenty of interesting presentations.  Last year, it felt like WiFi was the &#8220;theme&#8221; of the year &#8212; this year, the most interesting (and well-attended) briefings were on SSL and mobile devices.</p>
<p>The Wednesday keynote was presented by Douglas Merrill, the COO of EMI Records, formerly of Google, RAND Corporation, and several other places.  He spoke on a popular topic for security conference keynotes &#8212; risk assessment and innovation.  80% of CEOs believe they&#8217;ve had a data breach, even though the statistics show that it&#8217;s basically impossible for the actual rate to be that high.  And most of the breaches that do happen are trivial &#8212; looking at Privacy Watch&#8217;s statistics, 16% are lost laptops, 11% are paper that&#8217;s thrown away, etc.  Actual hacker activity accounts for only a small percentage of the breaches &#8212; certainly not enough to justify what we spend on security.  We constantly try as an industry to come up with &#8220;security ROI&#8221; metrics to show execs, but most of them are just nonsense; we make up numbers, then multiply them by numbers we also made up, and that&#8217;s how much you saved in the security breaches that didn&#8217;t happen but might have.</p>
<p>The #1 driver of security for CEOs is BCP (business continuity planning) &#8212; they just want to make sure things keep running no matter what.  For security people, the #1 driver tends to be compliance &#8212; because it&#8217;s a stick with which we can make executives spend money even when they don&#8217;t want to.  Due to the huge downside of a breach for us (since our job is preventing them, having one happen looks really bad), we overinvest in prevention.</p>
<p>Merrill&#8217;s point was that this overinvestment in security can stifle innovation, especially when perimeters (my favorite thing to hate, I know) are involved.  People use consumer tools because the enterprise tools restrict them too much.  Giving people control of their machines promotes innovation, and companies where people are free to innovate are more profitable &#8212; but giving people control makes endpoint security impossible, and reduces control by security and IT.  We risk our jobs by doing the right thing for the company, and so we continue to do the &#8220;safe&#8221; thing even when it doesn&#8217;t make sense.  Overall, it was a pretty good keynote &#8212; nothing revolutionary in it, but certainly food for thought for an audience of security professionals.</p>
<p>The second talk I attended to was three &#8220;mini-talks&#8221; about new <a href="http://www.metasploit.org/">Metasploit</a> functionality, presented by <a href="http://www.blackhat.com/html/bh-usa-09/bh-usa-09-speakers.html#Daizovi">Dino Dai Zovi</a>, <a href="http://www.blackhat.com/html/bh-usa-09/bh-usa-09-speakers.html#Kershaw">Mike Kershaw</a>, and <a href="http://www.blackhat.com/html/bh-usa-09/bh-usa-09-speakers.html#Gates">Chris Gates</a>.</p>
<p>Dai Zovi adapted Meterpreter for the Mac.  He created a Mach-O function resolver, and found one in the OS that wasn&#8217;t covered by the library randomization.  His payload injects a remote execution loop, creates a bundle in RAM, then loads and executes it (neat trick, very hard to do in Windows but apparently easy on a Mac.)  This can be used to load either Dai Zovi&#8217;s CocoaSequenceGrabber payload (which forces the webcam to take photos and send them to the hacker), or Macterpreter, a Meterpreter port by Charlie Miller.  Pretty much all of Meterpreter works except process migration (processes owned by the same user can&#8217;t write to each other on Macs), so it should be good for all your Mac-hacking needs.  He&#8217;s also added 4 exploits from the Mac Hacker&#8217;s Handbook to Metasploit.</p>
<p>Kershaw sought to adapt all the old shared-media attacks (i.e. what we did in the 80&#8242;s and 90&#8242;s on hub-based Ethernet) to WiFi.  His LORCON2 library translates between 802.11 (WiFi) and 802.3 (Ethernet), so you can spoof ARP, DNS, even TCP connections.  This gives you the airpwn attack in Metasploit &#8212; you can spoof, say, urchin.js or other common embedded JS files, give them a cache lifetime of a decade, and have someone&#8217;s browser calling home for a good long time even when they move off the unsafe network.  Open and WEP networks literally can&#8217;t be secured against this, since you can spoof the AP to the client (so no AP-based defenses can be effective &#8212; the AP doesn&#8217;t even see the attack.)  If you have the key, you can even do this on WPA-PSK (by forcing deauths and spoofing the AP.)</p>
<p>Gates essentially ported every Oracle attack of the last 10 years to Metasploit (all 11 of &#8216;em.)  Since Oracle charges for updates, there are tons of vulnerable servers out there (albeit not usually on the Internet.)  There&#8217;s a TNS mixin, and an Oracle DB access plugin that executes queries via Oracle Instant Client (on Linux and Mac OS only, though Chris offered a reward to anyone who would port it to Windows this weekend.)  It can grab the SID from the server on Oracle 9, or brute-force it on Oracle 10 (or sometimes grab it, depending on what Oracle modules are loaded.)  All of these exploits were old, but they&#8217;re now really easy to perform.</p>
<p><a href="http://www.blackhat.com/html/bh-usa-09/bh-usa-09-speakers.html#VelaNava">David Lindsey and Eduardo Vela</a> gave a talk on bypassing XSS filters. They weren&#8217;t looking at escaping/sanitizing functions, but rather HTTP IDS and other external anti-XSS measures.</p>
<p>They went through a long list of HTML tricks that can be done to evade these filters.  Omitting whitespace, using / for spaces (did you know &lt;img/src=&#8221;file.gif&#8221;alt=&#8221;text&#8221;&gt; &#8212; no spaces &#8212; is treated as valid HTML by most browsers?), roundabout parameters (using separate&lt;param&gt; tags for everything even when you don&#8217;t have to), using data= rather than src= in tags that support it, embedding JavaScript in weird tags like &lt;isindex&gt;, prepending useless namespaces on tags (e.g. &lt;x:script xmlns x=&#8230;.&gt;), using alternate syntax (why say &#8220;document.cookie&#8221; when &#8220;document[cookie]&#8221; or &#8220;with(document)alert(cookie)&#8221; will do), etc.</p>
<p>They even went into truly strange things, like using the ternary operator to make strings that were valid as both HTML and JavaScript but had different meanings in each, or using deprecated or broken syntaxes (which tends to be browser-specific.)  Adding multiple parameters with the same name has undefined behavior, but works in some browsers.  With Unicode, you can pad small (one-byte) characters out to extra bytes, which shouldn&#8217;t work but is accepted by some Unicode implementations (including Java and PHP.)</p>
<p>Perhaps most interestingly, filters could often be bypassed by ridiculous measures &#8212; such as using prompt() instead of alert() when testing for XSS, or using &#8216; or &#8217;2&#8242;=&#8217;2&#8242; instead of &#8216; or &#8217;1&#8242;=&#8217;1&#8242; to test for SQL injection, or /etc/x/../passwd instead of /etc/passwd.  Some badly implemented filters just look for specific attacks, not general patterns.</p>
<p><a href="http://www.blackhat.com/html/bh-usa-09/bh-usa-09-speakers.html#Kaminsky">Dan Kaminsky</a> had managed to keep his talk secret this year, so we went into it knowing nothing but that it was &#8220;something about network security.&#8221;  His talk was entitled &#8220;Black Ops of PKI,&#8221; and covered some vulnerabilities involving X.509 certificates (a theme I&#8217;ll revisit a lot when I do my DefCon writeup.)  60% of data breaches are not due to vulnerabilities, but just bad password handling &#8212; and PKI, based on X.509 certs, was supposed to fix all that.  Of course, what&#8217;s actually been implemented is not really what most of us mean by PKI &#8212; the universal directory of distinguished names was never built &#8212; but certificates are everywhere now.</p>
<p>For those of you not familiar with them, X.509 certs are the basis of SSL/TLS and many other encrypted protocols.  A certificate is supposed to indicate that the entity presenting it really is the entity named in the certificate.  These are signed by various Certificate Authorities, which all themselves have certificates signed by other authorities, chaining all the way to the Root CAs, which have their certificates just built in to your browser &amp; other software.  As long as you trust the root CAs to validate other CAs, and trust those CAs to only sign legitimate certs, the system should work.  But&#8230; that&#8217;s a lot of trust.</p>
<p>The problem is, X.509 can&#8217;t exclude &#8212; every CA can issue certs for every name.  It&#8217;s too hard to interoperate with private CAs, so companies promise to behave and root CAs like VeriSign give them a signed intermediate certificate, allowing them to give out valid certs for anyone.  What&#8217;s more, these certificates depend on various hashing algorithms for their security (since the hashes are what gets signed.)  RapidSSL used MD5 for its signatures, and last year some security researchers took advantage of known issues in MD5 to create their own intermediate cert that was &#8220;signed&#8221; by RapidSSL&#8217;s signature.  Luckily, that group had no intent to abuse the cert, so RapidSSL moved to a better hash and all was well.</p>
<p>Kaminsky discovered that one of VeriSign&#8217;s own certs is self-signed with MD2.  There&#8217;s not even any good reason to self-sign a root cert, but they always do (because people &#8212; and programs &#8212; just expect a cert to be signed.)  MD2, like MD5, has known vulnerabilities &#8212; it&#8217;s subject to a <a href="http://en.wikipedia.org/wiki/Preimage_attack">preimage attack</a> that will eventually let someone create their own root cert that VeriSign&#8217;s self-signature works on.  The complexity of this attack is outside our capabilities right now (2<sup>73</sup>), but won&#8217;t be for much longer.  This certificate was replaced by VeriSign (with one signed in SHA-1), but it will still probably be a long time before every client gets it off the list.</p>
<p>Much more interesting, though, were attacks on CAs themselves via PKCS#10 (the protocol by which you request a certificate to be issued to you.)  When you request a certificate, you provide a &#8220;distinguished name&#8221;, part of which is the &#8220;common name&#8221; (domain name, in the case of SSL certs), as a specially-formatted string (it&#8217;s fixed-length, not null-terminated), in a binary package.  Originally, requesting a cert was a manual process with lots of in-depth verification, but now it&#8217;s all automated.  Kaminsky asked&#8230; what happens if you have multiple common names in one distinguished name?  (Undefined; different CAs and clients do different things.)  The identifier for common name is 2.5.4.3&#8230; what if you provide 2.5.4.03?  Is that the same?  The strange binary protocol means it may be, and 2.5.4.2<sup>64</sup>+3 might be, too.  What if there&#8217;s a null in the name?  Since the protocol uses Pascal strings (length specified) rather than C strings (null-terminated), nulls in the name are valid, but practically every SSL client there is blows up at them.</p>
<p>And that was about it.  Kaminsky ended with a recommendation that we embrace DNSSEC, so we can put certificate hashes in DNS.  Unlike X.509, DNSSEC can exclude &#8212; we can ensure that only the authorized owner of a domain can provide its certificate, as well as make it possible for domains with EV certificates to exclude normal certificates for that domain.  After what Dan presented the previous two years, this one seemed kind of disappointing &#8212; an MD2 cert and some parsing flaws in CAs?  That&#8217;s it?</p>
<p>Actually, it turns out that these are devastating, and essentially render SSL unable to protect communications on untrusted networks (you know, precisely the places where you want SSL to protect you.)  Smart hackers will be picking up wildcard certificates while they can, as CAs will be scrambling to fix this.  As to why, I&#8217;ll explain that during my DefCon Day 1 writeup &#8212; Moxie Marlinspike and Mike Zusman presented research (apparently done at the same time as Kaminsky&#8217;s) that actually exploits this stuff.</p>
<p>The last presentation I went to on Day 1 was <a href="http://www.blackhat.com/html/bh-usa-09/bh-usa-09-speakers.html#Hassell">Riley Hassell</a>&#8216;s talk on &#8220;Exploiting Rich Content.&#8221;  The description made this sound like it was about attacking <em>web sites that use rich content</em> (e.g. Flash, Java, Media Player, QuickTime, etc.), but it was actually about attacking the content engines themselves (e.g. making Flash malware), which, to me, is a much less interesting space.  But then, my job is protecting web sites &#038; services from attack, not being Adobe.</p>
<p>Hassell demonstrated how, using a fault injection fuzzer called FlashFire, he found 23 vulnerabilities in Flash on 785 codepaths, most of them being read-beyond-bounds issues.  Normally those aren&#8217;t considered terribly serious, but since Flash runs in a browser, they can be.  Essentially, it&#8217;s possible to write a Flash component on one web page that steals all the information in your browser&#8217;s memory space.  If you have your bank&#8217;s website open in another tab, that could obviously be a bad thing.  It&#8217;s quite the scalable bug, considering as Flash is installed on 99% of browsers, and the bug works on all platforms.</p>
<p>And that was it for Day 1.  I went to an IOActive reception at Spago, met some interesting people (most of them from IOActive), and called it a night &#8212; most of the BlackHat nightlife seems to be on Day 2.  I&#8217;ll update this post with links to the presentation decks and/or videos when they become available online (decks will probably be relatively soon, but BlackHat does not usually post videos until months after the conference since they are sold for a pretty hefty fee at first.)</p>
<p>a</p>
]]></content:encoded>
			<wfw:commentRss>http://perimetergrid.com/wp/2009/08/01/blackhat-2009-day-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DefCon 16, Day 1</title>
		<link>http://perimetergrid.com/wp/2008/08/24/defcon-16-day-1/</link>
		<comments>http://perimetergrid.com/wp/2008/08/24/defcon-16-day-1/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 21:15:16 +0000</pubDate>
		<dc:creator>Grant Bugher</dc:creator>
				<category><![CDATA[anonymity]]></category>
		<category><![CDATA[attacks]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[networks]]></category>
		<category><![CDATA[physical security]]></category>

		<guid isPermaLink="false">http://perimetergrid.com/wp/?p=73</guid>
		<description><![CDATA[Having finished up with the BlackHat briefings, it was time to go on to DefCon.  While many of the speakers from BlackHat stay on for DefCon, there&#8217;s also a lot of DefCon-only presentations, usually with a more attack-oriented focus (in keeping with DefCon&#8217;s nature as a hacker convention rather than a security conference like BlackHat.) [...]<p>a</p>
]]></description>
			<content:encoded><![CDATA[<p>Having finished up with the BlackHat briefings, it was time to go on to DefCon.  While many of the speakers from BlackHat stay on for DefCon, there&#8217;s also a lot of DefCon-only presentations, usually with a more attack-oriented focus (in keeping with DefCon&#8217;s nature as a hacker convention rather than a security conference like BlackHat.)</p>
<p>The day began with <a href="http://www.defcon.org/html/defcon-16/dc-16-speakers.html#Cicero">Hacking E.S.P.</a> (Educational Software Packages.)  Schools, by their nature, have sensitive PII data &#8212; transcripts, schedules, billing information, etc.  A lot of this data is either stored directly in web-based educational software used by students, or is stored in other systems students access&#8230; probably with the same password.  Overall, though, this was a pretty typical application service provider hacking presentation &#8212; many of the schools they investigated used the same software on their sites, and that software was often woefully bad: Passwords sent &#8220;encrypted&#8221; in Base64 encoding &#8212; and not even that if JavaScript is turned off.  Trivial session stealing via Hamster-style sidejacking, with the added bonus that the Session ID is set <em>before </em>login so you can steal a session ID then wait for someone to use it.  Copious cross-site scripting vulnerabilities to allow for cookie stealing.</p>
<p>Generally someone would have to have a login on such a system to be able to exploit these things.  However, the username/password scheme is often helpfully revealed on the front page, and some schools even allow you to create your own account on the system. Google showed 34,000 instances of this one flawed software package alone.  Considering as schools account for 34% of data breaches, this sort of buggy software is probably commonplace.</p>
<p style="text-align: left;">The second presentation I attended was about <a href="http://www.defcon.org/html/defcon-16/dc-16-speakers.html#Wong">Adobe local shared objects</a>.  In short, these are Flash cookies.  Just as your browser will store small data items (cookies) for a website, and return those items to the website when asked, Adobe Flash has a similar mechanism for Flash applets.  However, since these are stored by Flash and not by the browser, your browser doesn&#8217;t manage them &#8212; there is no indication to the user what data is being stored, and the data is not removed when you delete cookies or &#8220;private data&#8221; in your browser.  Ad networks have used these to &#8220;back up&#8221; your cookies &#8212; if you delete them, they are restored from a Flash local shared object when you next visit a site with the ads on it.  These are also hard to filter for systems like Privoxy and other anonymizers, because Flash uses a proprietary encoding for its XML RPC calls, in which the local shared objects are embedded.</p>
<p style="text-align: left;">On the bright side, there is a Flash applet on the Adobe site called <a href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager.html">Flash Settings Manager</a> that will let you delete these objects and put in settings to manage them.  On the not-so-bright-side, this is in-band signaling (i.e. Flash is configured by a Flash applet), so any advertiser can override your settings later.  Also, as you may recall from the RIA presentation at Black Hat that I discussed earlier, there are a lot of other local storage mechanisms besides this one in Flash &#8212; Silverlight, HTML 5, and other frameworks also have local storage that is outside your browsers&#8217; ability to manage.</p>
<p style="text-align: left;">I next attended a presentation about vulnerabilities in <a href="http://www.torproject.org/">TOR</a>, the onion-routing anonymity provider originally developed by the Department of the Navy and until recently maintained by the <a href="http://www.eff.org/">EFF</a>.  TOR has become quite popular, at this point containing 1,500 relays and 200,000 users.  However, over the last several years, it&#8217;s seen several vulnerabilities that have threatened the anonymity it provides:</p>
<ul>
<li>2004: Error in how AES counter mode was used resulted in cryptography with only 16 bits of entropy.</li>
<li>2005: A relay cell length overflow could be used to force an exit node to send contents of memory</li>
<li>2005: Diffie-Hellman handshake bug in OpenSSL didn&#8217;t check for trivial keys, so a malicious entry node could mount a man-in-the-middle attack</li>
<li>2006: By running several fast TOR servers, an attacker could end up as both entry &amp; exit node for a user, thus compromising anonymity and potentially finding hidden services.  The fix for this was the addition of &#8220;entry guards&#8221; &#8212; trusted entry nodes that are re-used by users.</li>
<li>2006: Clients could create or extend channels even if server mode was turned off</li>
<li>2007: &#8220;Stable&#8221; or &#8220;Guard&#8221; status, normally applied to the top <em>n </em>nodes, could be stolen by malicious nodes by claiming high uptime and bandwidth.  The fix for this was to put in thresholds above which a node always gets guard status, rather than making it a top <em>n</em> calculation.</li>
<li>2007: XSRF attacks by web sites could make use of the TOR control port</li>
<li>2008: Nodes could be made to connect to their own public IPs</li>
<li>2008: The <a href="http://perimetergrid.com/wp/2008/05/17/ubuntudebian-crng-cracked-ssh-vulnerable/">Debian OpenSSL PRNG flaw</a> compromised 300 of the 1,500 relay identity keys, and 3 of the 6 directory authority keys.  If one more authority key had been compromised, someone could have taken control of the network</li>
</ul>
<p>There are still some outstanding issues in TOR:</p>
<ul>
<li>You can build infinite-length circuits and use them as a DOS multiplier</li>
<li>Snooping on exit relays works &#8212; if someone uses an insecure protocol that gives away their identity (like POP&#8230; or even HTTP depending on what they send), TOR won&#8217;t necessarily protect them.  This isn&#8217;t a bug in TOR, but just the nature of what it does &#8212; no software package will give totally anonymous communication if the communication itself gives your identity to the recipient.</li>
<li>People who run relays are unknowns &#8212; there is no way to know how many are malicious.  However, TOR depends on having a large, diverse set of servers, so making more restrictions on who can run servers might actually lower, rather than raise, the network&#8217;s secuirty.</li>
<li>Exit relays sometimes end up in restricted space (e.g. behind China&#8217;s firewall) &#8212; which means TOR users get restricted, too.</li>
<li>Many users of TOR toggle it on and off during a single browser session.  However, a JavaScript refresh attack on one of the non-TOR sessions can sometimes retrieve data from the previous TOR session.</li>
<li>Firefox bugs leak data, and that data doesn&#8217;t go through TOR, since on Windows it works as an HTTP proxy.  Users can work around this by proxying their entire network stack through a VPN connection like a <a href="http://www.janusvm.com/">JanusVM</a>.</li>
<li>It&#8217;s possible to block access to TOR.  If an adversary (say, the Chinese government) filters out the directory authorities, the download site, and all the relays, it&#8217;s very hard to get on.</li>
<li>If you can see both input and output (by running many, many nodes, or having a massive filtering apparatus at the Tier3 ISPs &#8212; FBI, maybe?) traffic confirmation is easy.  (i.e. if I already suspect you, specifcially, of doing something, I can confirm you did it much more easily than I can &#8220;go fishing&#8221; for people doing unknown bad things.)  Defensive dropping or adaptive packing would help with this, but would raise TOR&#8217;s latency.</li>
<li>You can fingerprint websites based on the size &amp; response time of the pages and tell what people are doing via traffic analysis.</li>
<li>A congestion attack by a website can find TOR nodes, and coupled with latency analysis on routers, can find the person communicating.</li>
<li>Data retention laws in many countries are resulting in data being stored that could make traffic analysis easier.</li>
</ul>
<p>So, with all these problems in TOR, does that mean we shouldn&#8217;t use it?  Not at all!  The known vulnerabiliites currently outstanding would apply to any low-latency mix network.  They&#8217;re not bugs in TOR, they&#8217;re limitations in this approach to anonymity, which remains better than any <em>other </em>approach to anonymity known.  TOR isn&#8217;t perfect, it&#8217;s just better than everything else.  Now, there may be better approaches to <em>specific problems </em>(e.g. there is one particular adversary you want to hide from, not just people in general), but for general anonymity, you still can&#8217;t beat TOR, even with its flaws.</p>
<p>I unfortunately missed much of strace and RSnake&#8217;s <a href="http://www.defcon.org/html/defcon-16/dc-16-speakers.html#Stracener">presentation on Google Gadgets</a>.  In short, gadgets are pieces of HTML and JavaScript code hosted on third-party sites and brought into a Google-owned namespace.  Though this namespace doesn&#8217;t have direct access to Google cookies, the fact remains that it&#8217;s loading unknown JavaScript onto a Google page &#8212; it&#8217;s basically XSS-by-design.  Gadgets can communicate with or post to other users and gadgets on Google, and it turns out to be pretty easy to sneakily force a user to install a gadget onto their Google homepage.  If someone could crack a server hosting a trusted gadget, they could take control of the data of many Google users simultaneously.  Most of these vulnerabilities would apply to any gadget-based architecture, such as the Live start page, or Facebook&#8217;s apps, too.</p>
<p>The next presentation I attended was &#8220;Satan is on my Friends List,&#8221; about <a href="http://www.defcon.org/html/defcon-16/dc-16-speakers.html#Hamiel">attacking social networks</a>.  In short, social networks are full of promiscuous and pervasive trust relationships, which results in a large number of business logic flaws.  These attacks aren&#8217;t on code vulnerabilities like SQL injection, but rather just exploiting how the systems work.</p>
<p>Sites often don&#8217;t protect &#8220;non-sensitive&#8221; operations, like logging out or adding friends, from XSRF attacks.  Thus, it&#8217;s possible to craft comments that log out anyone who views them&#8230; which makes it rather hard to delete them (since you have to be logged in to delete a comment.)  XSRFs can be put into image links, meta refresh tags, IFRAMEs, etc.</p>
<p>In addition, social networks are ideal platforms for social engineering attacks.  Build a plausible profile for someone else using social and public sources, and then friend a few dozen people who are known to friend everyone right back to build a &#8220;respectable&#8221; number of connections.  Joing groups, and start friending real associates of the person being impersonated.  At that point, you have a web site that can be used to confirm your identity as someone else.</p>
<p>The Facebook and OpenSocial APIs for integrated social apps are also good avenues for attack.  They have convenient APIs and execute arbitrary code by design &#8212; the social networks don&#8217;t care about application malware, as it&#8217;s on a second domain and they&#8217;re legally protected by their EULA.  However, if you widely distribute an app based on some current meme, get hundreds of users, then replace that app in-place with malware, you have an instant social network botnet.  You can use them as open redirects, put phishing items on their social network page, etc.  Also, applications have all the access that friends do &#8212; just the data disclosure may be enough for identity theft, impersonation, or at least some minor mayhem.  They can publish to a user&#8217;s profile to infect others, too.</p>
<p>Unfortunately, the fixes for these issues are just what the social network sites don&#8217;t want to hear &#8212; less external content, reduced API functionality, no opt-in security models, review and lifetimes for applications, etc.  Thus, these vulnerabilities are probably here to stay.</p>
<p>The last presentation I attended was by Errata Security, about <a href="http://www.defcon.org/html/defcon-16/dc-16-speakers.html#Maynor">interesting penetration tests</a>.  Modern penetration tests are &#8220;supposed to be boring&#8221; &#8212; they&#8217;re often done for the purpose of meeting compliance objectives, so companies are mostly interested in meeting a checklist, not in security.  They want to be secure against likely attacks and &#8220;script kiddies,&#8221; but are not interested in making the kinds of expensive changes required to defend against a determined, well-funded adversary.  The main exceptions are government agencies and Wall Street, who know they&#8217;re the targets for those determined adversaries.</p>
<p>Maynor &amp; Graham walked through a couple of interesting things they did as part of penetration testing.  One of these involved hacking the well-firewalled network of a company that was based at a secure facility, one where they could not simply walk onto the premises.  Instead, the wired an iPhone to a UPS battery and put it into the original iPhone packaging, then mailed it to the company.  With a UPS battery, an iPhone can run for 5 straight days with the WiFi on.  They modified the phone to add tcpdump and APlogger, and added a cron job that would send an SSH tunnel out to their computers every hour over the AT&amp;T EDGE connection.  The result was a WiFi sniffer &amp; endpoint inside the &#8220;secure facility&#8221; from which they could scan the internal network and run Metasploit to break into things.  An iPhone, after jailbreak has been run, is essentially a tiny BSD box &#8212; a perfectly suitable hacking platform.  Who thinks about their network being hacked by a cardboard box in the mailroom?</p>
<p>They also built a better phishing site.  Even security-aware people who are looking for phishing sites look for a valid SSL certificate bound to the site and signed by a trusted authority.  However, all it takes to get a real SSL certificate signed is about $2,700.  Start a business, register with Dun &amp; Bradstreet to get a credit rating, then apply for a real certificate from VeriSign or Thawte.  You can even sign ActiveX controls and require users to install them as a &#8220;secuirty feature.&#8221;  Since so many banks and companies outsource their applications or their HR and IT infrastructure, a phishing site with a good certificate is often indistinguishable from an outsourced site.  Just send someone at the comapany an email saying that the company has changed 401(k) providers, and they need to go to this outsourced site and sign up.</p>
<p>As is customary with DefCon, there wasn&#8217;t much talk about how to prevent these vulnerabilities.  However, it gives you something to think about, and it&#8217;s often very hard to guard against clever attacks against business logic flaws.  There&#8217;s no substitute for good threat modeling and flexible thinking.</p>
<p style="text-align: left;">
<p>a</p>
]]></content:encoded>
			<wfw:commentRss>http://perimetergrid.com/wp/2008/08/24/defcon-16-day-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu/Debian CRNG Cracked &#8211; SSH Vulnerable</title>
		<link>http://perimetergrid.com/wp/2008/05/17/ubuntudebian-crng-cracked-ssh-vulnerable/</link>
		<comments>http://perimetergrid.com/wp/2008/05/17/ubuntudebian-crng-cracked-ssh-vulnerable/#comments</comments>
		<pubDate>Sun, 18 May 2008 02:41:14 +0000</pubDate>
		<dc:creator>Grant Bugher</dc:creator>
				<category><![CDATA[attacks]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[passwords]]></category>

		<guid isPermaLink="false">http://perimetergrid.com/wp/?p=50</guid>
		<description><![CDATA[I don&#8217;t usually post about newly-discovered vulnerabilities, simply because there are so many of them &#8212; a dozen come out every day, especially in web applications.  However, this one has further-reaching consequences.  Security researcher HD Moore (of Metasploit fame) has discovered a vulnerability in the OpenSSL cryptographic random number generator used by Debian Linux, the [...]<p>a</p>
]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t usually post about newly-discovered vulnerabilities, simply because there are so many of them &#8212; a dozen come out every day, especially in web applications.  However, this one has further-reaching consequences.  Security researcher HD Moore (of <a href="http://metasploit.org">Metasploit</a> fame) has <a href="http://metasploit.com/users/hdm/tools/debian-openssl/">discovered a vulnerability</a> in the OpenSSL cryptographic random number generator used by Debian Linux, the widely-used distribution on which Ubuntu is based.  As <a href="http://perimetergrid.com/wp/2007/11/16/backdoored-pnrgs-from-the-nsa/">I have discussed before</a>, flaws in the RNG underlying a cryptosystem can compromise the entire system &#8212; both block ciphers and public-key systems rely on a source of entropy to create the large numbers they work with.  If the bits of entropy in this source is smaller than the key length, a &#8220;back door&#8221; is created &#8212; instead of cracking the key, you essentially &#8220;crack&#8221; the RNG, by trying all the possible seeds and seeing which one produces the key you need.</p>
<p>In this case, the result of this OpenSSL bug (an erroneous &#8220;bug fix&#8221; made in 2006) is to reduce the entropy in the seed to only 15 bits &#8212; a terribly small number (32,768) in cryptographic terms.  Moore was able to produce all the possible SSH keys that could be generated on this system in a matter of hours, save for those few people using 8192-bit RSA keys (and he&#8217;ll have those in a few days, too.  He&#8217;s placed them all on his website for download.</p>
<p>So what are the implications of this?  The most important one is SSH authorized keys.  SSH is the secure replacement for Telnet and FTP; security-conscious administrators and users use it instead of older protocols.  SSH has an option wherein instead of using a password to log in, you can save a set of keys in your user account, so that when you connect to another server the keys automatically authenticate you.  It&#8217;s quick, convenient, and generally more secure than passwords &#8212; and thus secures the most sensitive accounts (such as root) on almost all Linux-based servers.  With this exploit, it goes from being more secure than passwords to being much less secure &#8212; 32,768 guesses and you&#8217;re sure to get the right one.  This can be automated in a couple of hours if there is no lockout on the target machine (and the root account is normally not protected by a lockout since doing so means that an attacker can intentionally lock out the legitimate administrators.)  You could even use this as a local attack &#8212; log into your webhost account and run a script that will shortly give you root access to the server (from which you will have root access to most of the <em>other </em>servers at the hosting provider, too.)  Moore&#8217;s website includes a couple of scripts that can easily do this.</p>
<p>The nasty part about this is that keys are sticky.  Upgrading your Debian/Ubuntu servers to fix the bug is, of course, required.  However, also necessary is to replace every key generated on a Debian-based machine in the last two years (since 5/2/2006.)  It&#8217;s quite a task for administrators to even <em>find </em>all of those keys.  The first step is that if you use SSH to or from a Debian system, you need to immediately delete your authorized_keys and generate new sets (after applying the patch for this bug, of course.)  After that, it&#8217;s important to make sure all your users do the same.  Purging the SSH keys of all the users is not going to be a painless process and will undoubtedly involve some support cost, but keep in mind that <em>not </em>doing so is the equivalent of having all your users using 3-character lowercase alphabetic passwords.</p>
<p>The harder problem, though, is this: this bug isn&#8217;t really in <em>SSH</em>, it&#8217;s in <em>the OpenSSL libraries</em>.  These are commonly used by all sorts of apps to generate keys &#8212; OpenSSL is practically the Linux equivalent of CryptoAPI/DPAPI on Windows.  Everything uses them.  Essentially, every key generated on a Debian-based system for any purpose whatsoever in the last two years is potentially vulnerable.  You won&#8217;t be able to use HD Moore&#8217;s linked scripts to crack these, but they are all potentially cryptographically feasible now.  This is a <em>major </em>breach; if the NSA didn&#8217;t already know about this vulnerability (which I wouldn&#8217;t rule out), they&#8217;re no doubt engaging in a flurry of excited codebreaking right this minute.</p>
<p>a</p>
]]></content:encoded>
			<wfw:commentRss>http://perimetergrid.com/wp/2008/05/17/ubuntudebian-crng-cracked-ssh-vulnerable/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Data Hiding at the Airport</title>
		<link>http://perimetergrid.com/wp/2008/05/01/data-hiding-at-the-airport/</link>
		<comments>http://perimetergrid.com/wp/2008/05/01/data-hiding-at-the-airport/#comments</comments>
		<pubDate>Fri, 02 May 2008 05:28:33 +0000</pubDate>
		<dc:creator>Grant Bugher</dc:creator>
				<category><![CDATA[attacks]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[legal]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[products]]></category>
		<category><![CDATA[terrorism]]></category>

		<guid isPermaLink="false">http://perimetergrid.com/wp/?p=47</guid>
		<description><![CDATA[According to the EFF blog, customs has taken to randomly searching electronic devices for suspicious data.  It is somewhat mysterious what they are searching them for &#8212; given only a few minutes and a technically unskilled border guard doing the searching, it&#8217;s hard to imagine them actually finding anything better hidden than a file on [...]<p>a</p>
]]></description>
			<content:encoded><![CDATA[<p>According to the EFF blog, customs has taken to <a href="http://www.eff.org/deeplinks/2008/05/protecting-yourself-suspicionless-searches-while-t">randomly searching electronic devices for suspicious data</a>.  It is somewhat mysterious what they are searching them <em>for</em> &#8212; given only a few minutes and a technically unskilled border guard doing the searching, it&#8217;s hard to imagine them actually finding anything better hidden than a file on the desktop labeled &#8220;terroristic threats.doc&#8221; and a hyperlink to the Al-Qaeda Homepage.</p>
<p>Thus, from a security perspective, this just isn&#8217;t a good idea.  There&#8217;s a large tradeoff in inconvenience, delay, and civil liberties violation for a miniscule increase in security.  However, it does get me thinking about an interesting problem &#8212; how does one hide data from people inclined to search your electronic devices for it?</p>
<p>A legal search is a totally different kind of threat from a hacker attack.  With a hacker attack, you simply have to keep them out of the data &#8212; with a legal attack, you have to hide the <em>existence </em>of the data, as the legal system has at their disposal an additional channel for getting the data &#8212; they can subpoena it and demand you disable any protective measures and hand over the data.  Thus, encryption &#8212; the primary defense against data disclosure to hackers &#8212; is of limited use against a legal attack.  (And note that a &#8220;legal attack&#8221; doesn&#8217;t just mean law enforcement or other rightful authorities &#8212; it also means attack via lawsuit.  Abuse of the legal system is not limited to the political administration &#8212; competitors and other adversaries can and do use the legal system to get at things they shouldn&#8217;t have.  In other words, this information isn&#8217;t of value only to criminals &#8212; there are a lot of perfectly legitimate reasons to hide data.)</p>
<p>The EFF points out a few possible ways of avoiding scrutiny from customs:</p>
<ul>
<li>Create multiple accounts on the machine, and just log in with an account with nothing sensitive in it when asked to log in.  This is basically taking advantage of the lack of technical expertise on the part of the searcher.</li>
<li>Take only the data you need on the trip &#8212; just minimize what there is to find.  This is a good idea anyway, but probably unsatisfactory if you are carrying, say, diplomatic communications.</li>
<li>Bring no data at all, and when you arrive at your destination, retrieve the information via VPN.  Before flying back, VPN the data back and delete it.</li>
<li>For sensitive business communications, have the data encrypted by someone else who provides the key only when you arrive at your destination.  This would work to protect the data, but it also means that, being unable to comply with an order to reveal the data, you may just have to miss your flight.</li>
</ul>
<p>I have two more that they didn&#8217;t mention:</p>
<ul>
<li>Encrypt the data onto something that is not an &#8220;electronic device&#8221; subject to search, like a CD-ROM, USB key, or whatever.  It no longer falls under the search provision.  Obviously it could be searched if you were actually arrested or sued, but it gets around this particular issue.</li>
<li>Use <a href="http://www.truecrypt.org/docs/?s=hidden-volume">TrueCrypt Hidden Volumes</a>.  Merely hiding an encrypted file on a disk will not hide it from a skilled attacker, because cryptographic data is distinctive.  Statistically, it has a uniform distribution, which makes it look unlike any other kind of data except white noise (random numbers.)  Essentially, it looks so bland and generic that it stands out &#8212; because no real data is that essentially devoid of information.  Since nobody keeps a hard disk full of random noise files, if one exists, it must be encrypted data &#8212; which means you can be subpoenaed for the key.  TrueCrypt&#8217;s hidden volume feature gets around this in a novel way, which I&#8217;ll discuss below.</li>
</ul>
<p>Hidden volumes take advantage of the similarity between random noise &amp; encrypted files.  A section of disk is reserved for an encrypted virtual disk.  When this is created, it is filled with random noise, which is replaced by encrypted data as needed.  The trick is that you can create <em>another </em>encrypted virtual disk <em>inside </em>the first one.  So long as some data is in the &#8220;outer&#8221; volume (as no one would have a huge encrypted file on their hard drive with nothing in it &#8212; it&#8217;s not plausible), there is no evidence that the &#8220;inner&#8221; volume even exists unless you have the key.  The inner volume&#8217;s encrypted data blends into the outer volume&#8217;s white noise.  Thus, you put slightly-secret data in the outer volume, and really-secret data in the inner volume.  When asked to reveal the key, you reveal the key to the outer volume only, and have plausible deniability of the inner volume&#8217;s existence.</p>
<p>As with any countermeasure, though, there are limits.  If you&#8217;re hiding from the NSA or some foreign government&#8217;s equivalent, just putting a couple TrueCrypt volumes on your laptop&#8217;s hard disk will not do the job.  The problem is that the operating system and the applications you use may leave traces that reveal the existence of the inner volume (e.g. Word&#8217;s file history notes that you opened a file on Drive F:, when your laptop doesn&#8217;t have an F:&#8230;)  For extremely sensitive data, it would be necessary to not only put it in a hidden inner volume, but also to only <em>ever</em> access that inner volume from an ephemeral operating system (e.g. a LiveCD, or an OS you boot off a USB key and load into a RAMdisk.)  If the OS you use never makes any changes to the disk outside the encrypted volume, evidence of the volume remains hidden.  You would of course want a normal OS and outer volume to be present and used, for plausible deniability to be present (as, once again, it&#8217;s not reasonable to have a laptop with only random noise on the hard drive.)  You would also want to access the outer volume with the laptop&#8217;s native OS after any session in which you accessed the inner volume (as otherwise the access date on the encrypted file could be newer than the last boot date on the OS, once again leaving a breadcrumb trail.)</p>
<p>And all this makes me wonder once again what the government plans to get out of casually searching the data on laptop hard disks.  The only people whose data will be discovered are those with nothing to hide.</p>
<p>a</p>
]]></content:encoded>
			<wfw:commentRss>http://perimetergrid.com/wp/2008/05/01/data-hiding-at-the-airport/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Whole-Disk Encryption Cracked</title>
		<link>http://perimetergrid.com/wp/2008/02/28/whole-disk-encryption-cracked/</link>
		<comments>http://perimetergrid.com/wp/2008/02/28/whole-disk-encryption-cracked/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 18:19:10 +0000</pubDate>
		<dc:creator>Grant Bugher</dc:creator>
				<category><![CDATA[attacks]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[mitigations]]></category>
		<category><![CDATA[physical security]]></category>
		<category><![CDATA[products]]></category>

		<guid isPermaLink="false">http://perimetergrid.com/wp/2008/02/28/whole-disk-encryption-cracked/</guid>
		<description><![CDATA[Early this week, some researchers at Princeton University&#8217;s Center for Information Technology Policy released a fascinating video of whole-disk encryption being cracked quite quickly and easily. Whole-disk encryption products &#8212; such as PGP Whole Disk Encryption, TrueCrypt System Encryption, and Windows Vista&#8217;s BitLocker &#8212; work by encrypting the entire hard disk with a symmetric key, [...]<p>a</p>
]]></description>
			<content:encoded><![CDATA[<p>Early this week, some researchers at Princeton University&#8217;s Center for Information Technology Policy released a <a href="http://citp.princeton.edu/memory/">fascinating video</a> of whole-disk encryption being cracked quite quickly and easily.</p>
<p>Whole-disk encryption products &#8212; such as <a href="http://www.pgp.com/products/wholediskencryption/">PGP Whole Disk Encryption</a>, <a href="http://www.truecrypt.org/docs/?s=system-encryption">TrueCrypt System Encryption</a>, and <a href="http://www.microsoft.com/windows/products/windowsvista/features/details/bitlocker.mspx">Windows Vista&#8217;s BitLocker</a> &#8212; work by encrypting the entire hard disk with a symmetric key, save for a small loader.  When the computer is powered on, the loader prompts the user for a password or other authenticator (like a smart card or a certificate on a USB keyfob), which is used to decrypt the key.  Assuming the correct authenticator is provided, the key is decrypted and then the OS is booted from the encrypted drive.  The key remains in memory until the machine is powered off, since continuous access to the key is required to access the drive.</p>
<p>The purpose of whole-disk encryption is to protect against an attacker bypassing all of the operating system&#8217;s defenses (logins &amp; passwords, filesystem ACLs, etc.) by simply pulling out the hard disk and putting it in another computer (or, equivalently, booting up a LiveCD on the system) such that the operating system isn&#8217;t loaded at all.  Instead, the drive is mounted into an OS the attacker controls, where he has the ability to change ACLs, bypass logins, etc.  With whole-disk encryption, you can&#8217;t do this &#8212; even if you steal a laptop, without the boot password the entire drive contains nothing but a useless encrypted bitstream.</p>
<p>(As a side note, Vista BitLocker has a mode in which the symmetric key is stored in the TPM of the laptop, so no boot password is required.  At first this seems useless &#8212; why encrypt if decryption is automatic? &#8212; but it does provide protection against simply stealing the hard disk or booting into another OS.  The OS being booted must be in that specific computer, as only it has the TPM, and must be BitLocker-aware and capable of getting the key from the TPM.  It&#8217;s not completely secure in the stolen-laptop scenario, but neither is it useless.)</p>
<p>The Princeton group&#8217;s attack on whole-disk encryption relies on a little-known fact &#8212; computer memory (DRAM) is not wiped out when the system is powered off.  Rather, it becomes unreliable, decaying over a period of seconds to minutes as it gets randomized bit by bit.  It turns out that if cooled to a very low temperature, this decay is slowed considerably, to the point of being stable for tens of minutes.  Thus, the attack is as follows: get access to a laptop that is <em>currently operating </em>(so that the whole-disk encryption key is in memory), spray the RAM with an inverted compressed air can to cool it to -50 degrees Celsius, and power the system off.  Either move the RAM to a system with a custom OS, or attach an external drive to the system and boot off that.  The custom OS boots with a minimal memory footprint and then copies everything from RAM to a file on disk.  Thus, in less than a minute a &#8220;snapshot&#8221; of RAM has been taken.  This snapshot can then be inspected to locate prospective cryptographic keys and try them on the target drive.  Some knowledge of the particular whole-disk encryption product being used would be needed to find the exact spot in memory where the key is, and some error-correction techniques must be used in case a bit or two has been flipped, but it reduces the problem from cryptographically impossible to something that can be cracked in a few minutes or at worst hours.</p>
<p>So is this the end of whole-disk encryption?  No, not at all.  First of all, whole-disk encryption still successfully protects computers that are powered off (or in hibernation) &#8212; in that state, the computer does not have a copy of the encryption key available to it until the user re-enters his password.  In most stolen-laptop scenarios, the computer isn&#8217;t running at the time!  Whole-disk encryption is still a critical mitigation in the case of portable computers containing confidential data, and enterprises and government agencies would do well to implement it.  Of course, the best mitigation for this is to <em>not carry confidential data around on your laptop</em>.  It always strikes me as absurd when some government employee loses millions of confidential records on a stolen laptop &#8212; why did they need to have millions of records to carry around with them?  Do they really need all of those on-the-go?  It&#8217;s possible that in a minority of cases they do, and in those cases encryption is imperative (either of the whole-disk variety or on the file), but in most cases they&#8217;d have been better off leaving those files at the office.</p>
<p>Second, this is only a concern in <em>targeted attacks</em>.  If a typical thief rips off your laptop and discovers whole-disk encryption in place, they&#8217;re not going to execute this attack and get at your data.  Instead, they&#8217;ll just reformat the hard drive and sell the laptop as hardware.  The only reason someone would carry out this attack is if they knew that your laptop in particular contained valuable data and thus set out to steal it specifically.  In other words, if you&#8217;re a <em>spy</em>, and your laptop is classified TOP SECRET UMBRA, you have to worry about this attack.  If you have a typical corporate desktop and aren&#8217;t widely known to carry around your company&#8217;s entire credit card database, whole-disk encryption will probably protect you just fine.</p>
<p>There are several things that can be done, both by end-users and whole-disk encryption vendors, to mitigate this attack.  For end-users:</p>
<ul>
<li>If using Vista BitLocker, do not use the automatic mode &#8212; choose a mode that requires the use of a USB keyfob or a password to unlock.  This makes this attack ineffective when the system is entirely powered off.</li>
<li>Do not use sleep/suspend-to-RAM when the computer is not actually in your hands &#8212; either power off or use hibernate.  In a sleep or suspend-to-RAM scenario, the whole-disk encryption key is still maintained in memory and can be recovered.</li>
<li>If you have a few truly critical files, use file encryption (such as Windows&#8217;s Encrypted File System or PGP&#8217;s file encryption) on those files with a different password than that used on the whole-disk encryption.</li>
</ul>
<p>For makers of whole-disk encryption software:</p>
<ul>
<li>Provide an option to re-encrypt the symmetric key during sleep or screen-saver activity.  This would mean the the laptop would need to be stolen during a truly active state; however, it would also inconvenience the user with more frequent password prompts.</li>
<li>Consider the cryptographic key expansion mitigation described in the <a href="http://citp.princeton.edu.nyud.net/pub/coldboot.pdf">Princeton research paper</a>.  It vastly increases the chances of even a small amount of decay of memory rendering the key unrecoverable.  Of course, it does so at the cost of performance (by requiring an additional hashing and XOR operation every time the key must be used.)</li>
</ul>
<p>a</p>
]]></content:encoded>
			<wfw:commentRss>http://perimetergrid.com/wp/2008/02/28/whole-disk-encryption-cracked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Anonymity with TOR and its limits</title>
		<link>http://perimetergrid.com/wp/2007/12/10/anonymity-with-tor-and-its-limits/</link>
		<comments>http://perimetergrid.com/wp/2007/12/10/anonymity-with-tor-and-its-limits/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 22:32:02 +0000</pubDate>
		<dc:creator>Grant Bugher</dc:creator>
				<category><![CDATA[anonymity]]></category>
		<category><![CDATA[attacks]]></category>
		<category><![CDATA[crypto]]></category>

		<guid isPermaLink="false">http://perimetergrid.com/wp/2007/12/10/anonymity-with-tor-and-its-limits/</guid>
		<description><![CDATA[The post at the Unwired Video Blog about TOR has been getting a lot of publicity, having been linked to by both Lifehacker and Boing Boing. It provides a quick overview of TOR, how it works, and how to use it to browse the Web anonymously. This is a good thing; people using services like [...]<p>a</p>
]]></description>
			<content:encoded><![CDATA[<p>The post at the Unwired Video Blog about TOR has been getting a lot of publicity, having been linked to by both <a href="http://lifehacker.com/software/anonymity/browse-the-internet-anonymously-with-tor-331996.php">Lifehacker</a> and <a href="http://www.boingboing.net/2007/12/10/howto-use-tor-to-pro.html">Boing Boing</a>.  It provides a quick overview of TOR, how it works, and how to use it to browse the Web anonymously.</p>
<p>This is a good thing; people using services like this <em>does </em>help protect their privacy and anonymity, and due to how TOR works the more people that use it, the more secure it becomes (indeed, the Navy, who developed TOR, released it publicly because they realized that if only the military used it, it was worthless.)  Most of all, if normal, everyday people value and use anonymity and privacy services, it shows policymakers that anonymity is a social good desirable to all and not something that people only want when they have something to hide.</p>
<p>The argument against anonymity, however, is that it can be used to cover up crimes.  Will something like TOR protect criminals?  How do we track down a malicious hacker if the attack comes from a TOR node?</p>
<p>There are actually quite a few ways TOR leaks information, and really they&#8217;re all centered around idea &#8212; one cannot simply &#8220;be secure,&#8221; one must be secure <em>from something.  </em>TOR protects against some attacks and adversaries but not against others.</p>
<p>TOR (&#8220;The Onion Router&#8221;) provides anonymity by encrypting your traffic multiple times and routing it through TOR nodes.  Loading the Amazon.com home page through TOR would look like this:</p>
<ol>
<li>Your computer contacts two TOR nodes, which I&#8217;ll call A and B, and requests their public keys.</li>
<li>Your computer forms the web request to Amazon.com.</li>
<li>It encrypts the web request in key B, then encrypts the result (along with the address of B) in key A.</li>
<li>The packet is sent to node A.</li>
<li>Node A, which has the private portion of key A, decrypts the packet.  Inside is another address (that of B) and an encrypted blob.  Thus, Node A knows you <em>you </em>are, but it doesn&#8217;t know <em>what you&#8217;re transmitting, </em>or <em>who you&#8217;re sending it to.  </em>It forwards the blob to Node B.</li>
<li>Node B, which has the private portion of key B, decrypts the packet.  Inside is your transmission to Amazon.com, which by its nature says where it should be sent.  Thus, Node B knows <em>what you&#8217;re transmitting</em>, and <em>who you&#8217;re transmitting it to</em>, but has no idea <em>who you are</em> or <em>where the packet came from.</em>  Node B sends the packet to Amazon.com.</li>
<li>Amazon.com gets the packet and replies, sending the reply to Node B.  Note that Amazon.co, like Node B, has no idea <em>who you are</em> or <em>where the packet came from.</em></li>
<li>Node B gets the reply and forwards it to Node A.</li>
<li>Node A gets the reply and forwards it to you.</li>
</ol>
<p>This is simplified; there&#8217;s additional encryption so the nodes can&#8217;t all read the reply as it makes its way back to you, and there can be more than two nodes in the chain (in which case the intermediate nodes know even less about the transmission than A and B above.)  However, the above is the simplest case, and shows how much each part of the chain knows and doesn&#8217;t know.</p>
<p>The primary adversary TOR is designed to protect against is the actual site you&#8217;re browsing.  It hides your IP address (which, with a subpoena or some social engineering to your ISP, can be tied to you personally) from the target site, so that the site does not know who is visiting it.  The obvious counter to this, though, is for the site to apply a cookie to your browser when you visit it, such that it &#8220;recognizes&#8221; you on subsequent visits.  TOR alone will not protect against this, which is why TOR is almost always packaged with Privoxy, a filtering proxy that runs on your own computer, examines all your web traffic, and strips out data that can be used to identify you.  Here&#8217;s the first weakness in TOR &#8212; it can only strip out so much.</p>
<p>Web traffic is <em>stateless</em>; each web request is not tied to any other in any persistent way.  When you load a web page, your browser nearly-simultaneously requests the page and all the images, media, embedded frames, ads, etc. on the page.  When you click a link, the server has entirely forgotten who you are &#8212; it&#8217;s a totally different page load.  This would make any kind of integrated experience impossible (the web was originally designed just to serve up static reference pages, not implement shopping carts), but for cookies.  The web server sets a session cookie (a cookie that is deleted when you close your browser) when you load the first page, and uses that to track your movement through the site.  There&#8217;s nothing menacing about this &#8212; it is not &#8220;tracking&#8221; in any Big Brother-ish way, it&#8217;s just linking all your page loads together to provide a sense of state or flow &#8212; and the web doesn&#8217;t work without it.  Thus, Privoxy has to let these session cookies through.  This can leak a little bit of information about you.</p>
<p>How is this anonymity defeated?  In the simplest case, the user leaks the data on their own! A web request contains a decent amount of information about you (what browser you&#8217;re using, your operating system) as well as any cookies the user sends.  Privoxy strips most of this, but if the user uses TOR alone, then the fact that the endpoint can&#8217;t see your IP may be irrelevant &#8212; you just told it who you are anyway.  Likewise, browsing a site that requires login (like a webmail provider) through TOR is plain silly &#8212; it&#8217;s obvious who you are, you just logged into the site.  This is true even if you&#8217;re worried about investigation not from the site but from authorities, spies, or other hackers &#8212; the webmail site logs that you connected, and it probably logs everywhere you&#8217;ve ever connected from.  Thus, using a site with login through TOR only provides anonymity if you <em>never </em>use that site except through a TOR connection.  Otherwise, your communication can be correlated over time.</p>
<p>Also, it&#8217;s possible to make an end run around TOR.  If someone simply hacks into <em>your </em>computer (or seizes it, in the case of legal authorities), they don&#8217;t need to have logs from the other end to know what you&#8217;ve been doing; your own computer probably has records of your activity.  Deleting them usually does little good in the legal case &#8212; modern data recovery can get deleted data quite easily.  To avoid this, it&#8217;s necessary to have a computer that simply doesn&#8217;t keep any records &#8212; and this is hard to do in a normal Windows or Linux system (for one, they both arbitrarily swap portions of memory to disk during normal use.)  For better anonymity, it&#8217;s necessary to boot a LiveCD environment (i.e. an OS with no hard drive or writeable media), where all evidence is destroyed when the computer is powered down.  But unless your oppressive dictatorial nation&#8217;s secret police are after you, this is probably excessive when it comes to normal protection of privacy and anonymity.</p>
<p>Finally, there&#8217;s one more attack through TOR that&#8217;s more troubling than either of the above &#8212; anyone can be a TOR node.  &#8220;Node B&#8221; (the exit node) in the example above gets to see your traffic, in both directions &#8212; it just doesn&#8217;t know your IP address.  You are, thus, trusting a complete stranger somewhere on the Internet with your traffic, complete with the ability to carry out man-in-the-middle attacks on you (i.e. maybe he doesn&#8217;t forward your traffic to Amazon.com at all, but rather a fake site of his own design; or maybe he edits the traffic to add a virus or Trojan.)  This actually happens; Bruce Schneier <a href="http://www.schneier.com/blog/archives/2007/12/maninthemiddle.html">linked to</a> some logs of a TOR exit node <a href="http://www.teamfurry.com/wordpress/2007/11/20/tor-exit-node-doing-mitm-attacks">trying to carry out a MitM on an SSL session</a>.  So while TOR protects your anonymity, it may actually risk your privacy &#8212; it&#8217;s very hard to carry out MitM attacks on random Internet users, but doing it as a malicious TOR exit node is comparatively easy.</p>
<p>Another thing to consider: there are only so many TOR exit nodes.  There are few enough of them that if, say, the NSA, or the RIAA/MPAA, wanted to, they could set up hundreds of exit nodes, all of which spy on traffic, and have a set of nodes large enough to comprise a substantial portion of the TOR network.  If one agency controlled, say, 10% of the exit nodes, their ability to figure out who you are would be pretty significant.  If they controlled normal nodes as well (even easier), they might even get lucky and get both the incoming and exit communications on their hostile network, allowing them to completely monitor your traffic.</p>
<p>TOR is meant to protect your <em>anonymity </em>from <em>the site you&#8217;re browsing</em>.  It does this pretty well, as long as you&#8217;re reasonably careful, don&#8217;t browse sites that require you to identify yourself, and use a cookie-filtering proxy like Privoxy.  However, it is not meant to provide <em>privacy </em>from <em>TOR node operators</em>, and thus it does not.  You can have privacy, or anonymity, but you can&#8217;t have both at the same time in a perfect fashion.  (Even using open WiFi access points with an obscured MAC address provides anonymity but not privacy &#8212; the operator of the access point can do everything a TOR exit node operator can do to you and more.</p>
<p>Overall, it&#8217;s a valuable tool, but if someone wants to track you down badly enough, and they have the resources or authority, they can still do so.  This is why criminals aren&#8217;t out there committing heists with TOR every day; if you do something bad enough, it won&#8217;t protect you.  Of course, most computer criminals aren&#8217;t caught due to malicious TOR exit nodes or anything so arcane &#8212; they&#8217;re caught because they brag about their accomplishments, or because investigators follow the money.  Even hackers that excel in covering digital tracks  thankfully usually have no experience in money laundering.</p>
<p>a</p>
]]></content:encoded>
			<wfw:commentRss>http://perimetergrid.com/wp/2007/12/10/anonymity-with-tor-and-its-limits/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Securing Data at Rest with Cryptography</title>
		<link>http://perimetergrid.com/wp/2007/12/04/securing-data-at-rest-with-cryptography/</link>
		<comments>http://perimetergrid.com/wp/2007/12/04/securing-data-at-rest-with-cryptography/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 20:12:50 +0000</pubDate>
		<dc:creator>Grant Bugher</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[legal]]></category>
		<category><![CDATA[passwords]]></category>
		<category><![CDATA[products]]></category>

		<guid isPermaLink="false">http://perimetergrid.com/wp/2007/12/04/securing-data-at-rest-with-cryptography/</guid>
		<description><![CDATA[Over at Schneier on Security, Bruce Schneier has a post today about securing data on disk. Encryption is often sold as a panacea for all security problems &#8212; which it&#8217;s not &#8212; but keeping people from reading your data if they steal your laptop is one thing encryption is really good at, and it&#8217;s an [...]<p>a</p>
]]></description>
			<content:encoded><![CDATA[<p>Over at <a href="http://www.schneier.com">Schneier on Security</a>, Bruce Schneier has a <a href="http://www.schneier.com/blog/archives/2007/12/how_to_secure_y.html">post today about securing data on disk</a>.  Encryption is often sold as a panacea for all security problems &#8212; which it&#8217;s not &#8212; but keeping people from reading your data if they steal your laptop is one thing encryption <em>is </em>really good at, and it&#8217;s an area where the real complexities of encryption (key management, key rotation, public key infrastructure) aren&#8217;t terribly important and can be safely neglected.</p>
<p>Schneier mentions <a href="http://technet2.microsoft.com/WindowsVista/en/library/ba1a3800-ce29-4f09-89ef-65bce923cdb51033.mspx">Microsoft&#8217;s BitLocker</a> in passing, and I wanted to add some detail.  BitLocker is a whole-disk encryption system integrated into Windows Vista, and integrates with the Trusted Platform Module if available (the TPM is a smart chip on the mainboard that stores keys and performs secure cryptographic operations.)  You tell BitLocker to encrypt your drive, and then choose one of several options for how to store the key.  The simplest mode simply prevents someone from mounting the drive in another system or operating system, by storing the key in the TPM and retrieving it automatically on boot (this actually does make it significantly harder to get at the data on the disk without your password.)  More complex modes store the key in the TPM and require either a PIN code from you or a certificate stored on a USB key to extract the key.  Thus, on booting your PC you enter your PIN or insert the key, and the drive is unlocked.</p>
<p>The PGP product Schneier advocates encrypts the drive similarly to BitLocker, though rather than storing the key in the TPM it relies on a user-supplied passphrase to decrypt the key.  While this is theoretically less secure (with the TPM, even the encrypted key is stored in tamper-resistant hardware and difficult to access), in practice it makes little difference &#8212; it&#8217;s still quite secure, and unlike BitLocker will let you encrypt other drives.</p>
<p>However, one feature BitLocker has and PGP lacks is key escrow.  Now, this is normally thought of by privacy activists as an anti-feature, remembering the <a href="http://en.wikipedia.org/wiki/Clipper_chip">Clipper Chip fiasco</a> of the late 90&#8242;s.  However, the purpose of BitLocker&#8217;s key escrow is not to give a back-door key to the government, but rather to make the system palatable for enterprise deployment.  Large corporations have traditionally been unwilling to embrace whole-disk encryption products like PGP even on laptops carrying sensitive data, for fear that the person with the key will forget the passphrase or simply leave the company and refuse to disclose it.  By having the BitLocker keys escrowed with the domain controller such that appropriate corporate officers can retrieve it, it makes BitLocker &#8220;safe&#8221; for corporate use.  If you&#8217;re not a domain member (i.e. it&#8217;s your home computer), then the keys aren&#8217;t escrowed with anyone else &#8212; there&#8217;s no government back-door.</p>
<p>Schneier rightly points out that an issue with any sort of whole-drive encryption is that they do not protect your data from government subpoena.  If the government seizes your computer as evidence, they can (in the United States at least) subpoena the keys, and if you don&#8217;t turn them over you can be fined or jailed for contempt of court.  This is not an issue for most (legal) data, but if you have something to hide from <em>everyone</em>, there are solutions other than the one Schneier posits (&#8220;just don&#8217;t keep data on your laptop that you don&#8217;t want subpoenaed.&#8221;)  One option is the open-source disk encrypter <a href="http://www.truecrypt.org/">TrueCrypt</a>.</p>
<p>The problem with encrypted data on your disk is that it&#8217;s really obvious.  It is not plausible to say &#8220;Oh, I don&#8217;t have any encrypted data&#8221; if served with a subpoena.  For one, you probably have encryption software on your computer, and links to data that can&#8217;t be followed without decryption.  But besides that, encrypted data is provably, mathematically distinguishable from almost everything else.  Encrypted data consists of a binary blob with a uniform distribution across its entire data space &#8212; that is, any given byte is just as likely to be 00 as it is to be 01, 02, 03, or any other value.  If you plotted it on a histogram, given enough data the graph would be approximately flat (subject to the variation and &#8220;clumpiness&#8221; always present in random data) and there would be no more repetition than expected by random chance.  This is unlike every other type of data &#8212; executable programs, graphics, sound, word processor files, spreadsheets, etc. all have their own characteristic histograms and repeated patterns.  Even compressed files have specific, recognizable headers and certain characteristic patterns (though they come closest to looking like encrypted data, since they have high entropy.)  Thus, encrypted data stands out because it is &#8220;more random&#8221; than any other data on your hard drive.  Since no one keeps large blobs of totally random noise on their hard drive, if one is found, it&#8217;s pretty certain to be encrypted data, and the courts know this (or at least can be convinced of it by expert witnesses.)</p>
<p>TrueCrypt has the feature of being able to place an encrypted volume inside an encrypted volume.  Combined with the fact that it pads encrypted volumes with random noise, this leads to the ability to have plausible deniability of encrypted data.  Essentially, it works as follows:</p>
<ol>
<li>You create a TrueCrypt volume on your hard drive with a specified size, say 10 GB.  TrueCrypt reserves that much space, and fills it with random noise.</li>
<li>You create a second TrueCrypt volume, with a different key, inside the first volume, with a smaller specified size, say 2 GB.  TrueCrypt takes that space and fills it with different random noise.</li>
<li>When you want to access encrypted data, you mount both volumes.  You put <em>really </em>secret stuff on the inner volume, and moderately secret stuff (e.g. pirated MP3s) on the outer volume.</li>
</ol>
<p>Now, if someone gets your laptop, they can see that you have TrueCrypt installed, and that there is a 10GB encrypted volume (as there&#8217;s a 10GB blob of random noise on your hard drive.)  They force you to give them the key, and you do so.  This unlocks the outer volume, revealing its encrypted files.  However, <em>there is no sign that the inner volume exists</em>.  Unless you know it&#8217;s there, and know the key, there is no way to distinguish the random noise of its encrypted files from the random noise TrueCrypt filled the outer volume with anyway.  There could be a dozen encrypted volumes, or none &#8212; it&#8217;s impossible for anyone to know, and indeed, most people without a security mindset would never even think of such a thing.</p>
<p>Now, there are drawbacks to this technology.  If you mount the outer volume but not the inner one, neither TrueCrypt nor your operating system knows about the inner volume, either!  This means that writing files to the outer volume may overwrite and destroy the inner volume if you&#8217;ve not mounted it.  This isn&#8217;t a major problem, but it is inconvenient, especially if you have many volumes (as you need to type in the different passphrases and addresses of all of them every time you want to write to any of them.)  And no automation will help you, because having any would defeat the purpose &#8212; the existence of automation scripts would tip off a smart forensic investigator that your outer volume contains inner volumes.</p>
<p>It&#8217;s an interesting solution to the problem of plausible deniability &#8212; using steganography to hide encrypted data in encrypted data.  Admittedly, Schneier&#8217;s solution (just don&#8217;t have the data at all) is even safer, but sometimes that&#8217;s not good enough.</p>
<p>a</p>
]]></content:encoded>
			<wfw:commentRss>http://perimetergrid.com/wp/2007/12/04/securing-data-at-rest-with-cryptography/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Why Hackers Love Wi-Fi</title>
		<link>http://perimetergrid.com/wp/2007/11/28/why-hackers-love-wi-fi/</link>
		<comments>http://perimetergrid.com/wp/2007/11/28/why-hackers-love-wi-fi/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 18:54:56 +0000</pubDate>
		<dc:creator>Grant Bugher</dc:creator>
				<category><![CDATA[anonymity]]></category>
		<category><![CDATA[attacks]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[risk]]></category>

		<guid isPermaLink="false">http://perimetergrid.com/wp/2007/11/29/why-hackers-love-wi-fi/</guid>
		<description><![CDATA[Hackers love wireless networking. At DefCon 15, it was easy to predict which sessions would have lines running out the door and require getting there well in advance for a seat &#8211; it was the sessions with &#8220;wireless&#8221; or &#8220;Wi-Fi&#8221; in the title. The Wireless Village was very popular, and many of the hacking contests [...]<p>a</p>
]]></description>
			<content:encoded><![CDATA[<p>Hackers love wireless networking. At DefCon 15, it was easy to predict which sessions would have lines running out the door and require getting there well in advance for a seat &#8211; it was the sessions with &#8220;wireless&#8221; or &#8220;Wi-Fi&#8221; in the title. The Wireless Village was very popular, and many of the hacking contests involved wireless access points.Why do hackers love wireless networks? Really, there are two reasons, and those two together have some scary implications for risk on the modern Internet.</p>
<h3>1.) Wireless Networks Use Shared Media</h3>
<p>Back in the 80&#8242;s and 90&#8242;s, most wired Ethernet networks were based on shared media topologies. In principle, when you plugged into an Ethernet network and sent a packet, the packet on the wire (the actual electrical impulses) went to every other machine on the network. Hubs were simple repeaters, broadcasting everything they received. Only when your signals reached the router at the Internet edge were they actually intelligently processed. Thus, every computer on the LAN got every packet &#8211; the network cards just threw away any packets whose destination address specified another computer. However, a hacker wanting to eavesdrop on others had an easy job &#8211; just toggle the network card into &#8220;promiscuous mode&#8221; (a hard task on some network cards and OSs, but completely trivial on others) and it will receive every packet, giving you a god&#8217;s-eye view into the network. Protocols were mostly unencrypted then, too &#8211; so you saw everyone&#8217;s email, their paswords as they logged into Telnet or IMAP, etc. You could also spoof traffic &#8211; since you saw the packets sent by others, you could simply send responses back claiming to be the recipient. So long as your response arrived before the real one, yours would be accepted and the actual response discarded as out of sequence. It was the golden age of network-protocol hacking. Such easy access to passwords made other types of hacking easy, too &#8211; once you had the password to someone&#8217;s UNIX account or email box, there was a very good chance it would work on all their other accounts, too.</p>
<p>Then it all changed. Shared media has significant disadvantages as it scales &#8211; since everyone is dumping packets onto what essentially amounts to a single wire, collisions occur when two systems transmit simultaneously. Both then have to back off, slow down, and retransmit their garbled packets. The packets are tiny (Ethernet frames are normally restricted to 1500 bytes or less), but if you have 100 systems communicating at once, collisions can become quite frequent. Plus, even in the late 90&#8242;s people were not totally unaware of the security risks &#8211; the fact that any student could read all the network traffic of everyone else in their dorm was not considered desirable by universities, for instance. Thus, Ethernet was converted over to switched media. Switches, unlike hubs, do not treat all ports as equal. Instead, they remember which ports they have received traffic from an address on, and only forward traffic to an address to those ports. Traffic is only broadcast to all ports when a switch has no idea for which port it is intended, or when a packet is actually marked as a broadcast. Now, when you put your Ethernet card in promiscuous mode, all you hear is traffic meant for you &#8211; everything else has been blocked by the switch. Suddenly, packet sniffers went dead &#8211; there was nothing to see anymore. Ethernet became a lot more secure.</p>
<p>But wireless changes things again. Wireless networks are shared media, and they are shared inherently, in a way that cannot be changed. Radio waves fly in all directions. There is no way for your laptop to transmit only to another laptop or an access point &#8211; all radio is broadcast. Thus, when you sit down in a coffee shop and turn on wireless, you begin broadcasting everything to everyone within range (about a mile, for attackers who have good antennas and high-power network cards.) The shared media nature can be mitigated somewhat via cryptography &#8211; if all the traffic to the access point is encrypted, it hardly matters if someone can eavesdrop since they can&#8217;t understand it anyway. But open access points are, by their nature, open &#8211; they&#8217;re either not encrypted at all, or they&#8217;re encrypted in such a way that everyone is using the same key. Once the hacker has the key (either by cracking it, which is not hard on most Wi-Fi networks, or by simply paying as a legitimate user of the wireless hotspot), they can read all the traffic just like in the hub-based glory days of old.</p>
<p>There are solid wireless encryption systems. A network based on WPA2 with a strong passcode is quite secure, about as good as a wired connection (keeping in mind that &#8220;as good as a wired connection&#8221; is not an absolute guarantee of safety, either.) Modern encryption systems like AES coupled with 802.1x certificate-based authentication can make a well-engineered corporate wireless LAN quite safe.</p>
<p>But hackers don&#8217;t love well-engineered corporate wireless LANs. They love the terrible ones in coffee shops and bookstores and your house. On these networks, they can listen to all traffic, they can spoof traffic, and they can even kick people off and hijack their connections, or edit their connections on the fly. The &#8220;airpwn&#8221; attack from a DefCon 2-4 years ago was particularly amusing; using two wireless cards, it would sniff everyone&#8217;s HTTP traffic on one connection, then on the other card spoof responses to all requests for images, substituting other images (such as the hacker group&#8217;s logo, or more unsavory fare like the infamous goatse.cx site; that is not a hyperlink on purpose, do not navigate to that URL as it is not safe for work or, indeed, for anywhere else.) The result was that one laptop at a security conference was able to dynamically edit the HTTP streams of everyone else there &#8211; hundreds of people. That&#8217;s the kind of power a hacker can have on a shared-media network. In addition, on these sorts of networks, it&#8217;s trivially easy to hijack sessions. This means that on any site that uses HTTPS for authentication only, but then HTTP for the actual service (a category that includes all of the Google apps like GMail, as well as all the Yahoo! and Windows Live services), a hacker gains full access to your account if they overhear any of your wireless traffic.</p>
<p>The only truly safe way to use a public wireless hotspot is to use it only to VPN to a network you trust. Anything else is dangerous.</p>
<h3>2.) Wireless Networks Provide Plausible Deniability</h3>
<p>The legal system is not terribly friendly to hackers. Even innocuous and non-destructive activity, when applied to networks you don&#8217;t own, is often illegal. Now, for the most part hackers don&#8217;t worry overmuch about getting caught &#8211; if you don&#8217;t cause more than $5,000 in damages, the FBI won&#8217;t get involved, and the average local police department is about as capable of investigating sorcery as computer crime. However, when a hacker does worry about legal prosecution, a public wireless network is the next best thing to Siberia for where to commit a crime from.</p>
<p>When you do anything on the Internet, a host of servers are recording your activity based on your IP address. IP address, however, is not necessarily long-lived. Depending on how you access the Internet, your IP address might change every time you plug your computer in, or reboot, or move from building to building. Thus, investigators must be able to tie the IP address they know committed a crime to a specific, physical person.</p>
<p>With wireless, this is a problem. All the sites being attacked don&#8217;t see the IP address of the hacker &#8211; they see the IP address of the wireless access point. Thus, they have to subpoena the owner of the access point and demand to know who was using it. In the case of a well-designed corporate wireless LAN, they can check their logs to see which 802.1x certificate was using that IP at that time, and uniquely identify you. But in the case of a public hotspot, there probably aren&#8217;t any logs at all! They&#8217;re completely incapable of giving you up. And even should someone who was there say &#8220;I saw a shifty guy in the corner using a laptop!&#8221; to the police, that&#8217;s not going to be enough evidence. And if there are logs, they will tie your traffic to your MAC address, a unique code assigned to your network card at the factory.</p>
<p>Most people think MAC addresses cannot be changed, so it uniquely identifies your network card. If the police get a hold of your network card, they&#8217;ve caught you. This is actually totally untrue. Many network cards will allow you to change the MAC address to whatever you want (in Windows, it&#8217;s on Connection Properties -&gt; Configure -&gt; Advanced -&gt; Physical Address), though this is entirely up to the network driver. Many Windows drivers block this functionality, thinking that users don&#8217;t need it. On Linux, however, the network drivers have been written by geeks, who operate under the impression that users need everything. Thus, on Linux systems changing your MAC address is as simple as typing one command (&#8220;macchanger eth0 00:11:22:33:44:55″), and you can even configure the network stack to give you a new, random MAC address every time you connect to a network.</p>
<p>As a result, a trail that leads to a wireless hotspot is basically a dead end for investigators. They get nothing but a fake MAC address that could correspond to any computer within a 1-mile radius &#8211; the hacker might not have even been in the building. Hard to get &#8220;beyond a reasonable doubt&#8221; out of that.</p>
<p>And those are why hackers love wireless networking. It&#8217;s like the 80&#8242;s phone networks, where a hacker can be a ghost in the machine, undetectable, and with tremendous power. It&#8217;s a dangerous place.</p>
<p>You might wonder, if wireless networks are so anonymous, how hackers ever get caught. Actually, there are three main ways:</p>
<ol>
<li>They get stupid, and brag about what they did.</li>
<li>They get stupid, and while performing their illegal activities they also do something that identifies them, like log into their email account.</li>
<li>Investigators follow the money. We don&#8217;t catch you breaking into the bank, we see where you sent the money to. We don&#8217;t catch you stealing credit card numbers, we catch you using them.</li>
</ol>
<p>Luckily for those of us in the business of investigating and preventing computer crime, wireless networks won&#8217;t save criminals from their own stupidity, and you can&#8217;t send cash through the airwaves.</p>
<p>a</p>
]]></content:encoded>
			<wfw:commentRss>http://perimetergrid.com/wp/2007/11/28/why-hackers-love-wi-fi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SMB Reflection Made Way Too Easy</title>
		<link>http://perimetergrid.com/wp/2007/11/27/smb-reflection-made-way-too-easy/</link>
		<comments>http://perimetergrid.com/wp/2007/11/27/smb-reflection-made-way-too-easy/#comments</comments>
		<pubDate>Tue, 27 Nov 2007 23:32:27 +0000</pubDate>
		<dc:creator>Grant Bugher</dc:creator>
				<category><![CDATA[attacks]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[crypto]]></category>

		<guid isPermaLink="false">http://perimetergrid.com/wp/2007/11/27/smb-reflection-made-way-too-easy/</guid>
		<description><![CDATA[Windows file sharing operates via an old protocol called SMB (Server Message Block.) In modern Windows operating systems, it operates over TCP/445, though older versions of Windows also made use of NetBIOS (UDP/137, UDP/138, and TCP/139). Due to the ubiquity of Windows file shares on corporate Intranets, in general these ports are open to basically [...]<p>a</p>
]]></description>
			<content:encoded><![CDATA[<p>Windows file sharing operates via an old protocol called SMB (Server Message Block.)  In modern Windows operating systems, it operates over TCP/445, though older versions of Windows also made use of NetBIOS (UDP/137, UDP/138, and TCP/139).  Due to the ubiquity of Windows file shares on corporate Intranets, in general these ports are open to basically everyone on the internal network, though they are blocked at edge firewalls.  Even UNIX/Linux machines often use these ports, due to a Windows-file-sharing-compatibility package called SaMBa.</p>
<p>There have been many security vulnerabilities in NetBIOS in the past, and some in SMB, so these protocols are (rightly) considered moderately risky by network administrators.  However, scarier than any of these patched vulnerabilities is the flaw in the design &#8212; SMB is subject to a sort of replay attack, called SMB Relay or SMB Reflection.</p>
<p>SMB at first appears safe from replay attacks.  After all, it uses <a href="http://www.hcsw.org/reading/chalresp.txt">challenge-response authentication</a> (normally; there is a protocol for SMB with cleartext, but basically no client or server will accept this protocol now), whose whole purpose is to prevent eavesdropping and relay.  If you try to replay the same response to a server, it won&#8217;t work, because the challenge is different.  There are three ways SMB allows challenge-response authentication &#8212; LANMAN, NTLM, and two-way NTLM.  In any case, the principle is the same &#8212; the client asks to authenticate, the server sends a challenge, the client encrypts the challenge with a password, and sends the encrypted result as a response.</p>
<p>So how do you perform a replay attack on SMB?  Via SMB Relay (to attack another host) or SMB Reflection (to attack the client.)  It goes like this:</p>
<ol>
<li>Client (C) connects to you (a malicious server, M) and asks for a challenge.</li>
<li>M connects to C in a separate sessions and asks for a challenge.  It still has the connection from (1) on hold, having not responded yet.</li>
<li>C receives the request from M, and responds with a challenge (challenge_C).</li>
<li>M takes challenge_C, modifies it to appear to be coming from M (challenge_M), and responds to the connection from (1) with it.</li>
<li>C finally receives the challenge (challenge_M) that it asks for.  It uses its credentials to respond to it (response_M).</li>
<li>M receives response_M, which is correct for challenge_M, and so grants C the access it requested.  Of course, this response <em>also </em>matches up with the challenge it&#8217;s holding onto (challenge_C).  It forwards it right back to C as response_C.</li>
<li>C receives response_C, which is correct for challenge_C, and so grants M the access it requested.</li>
</ol>
<p>No, C doesn&#8217;t ever realize that it just received and responded to the challenge that it, itself, sent out moments before.  By requesting access to M, I have unwittingly given it all it needs to authenticate against me at the same time.  It can&#8217;t be carried out later &#8212; the reflection attack has to happen at the moment I am trying to connect.</p>
<p>Note that this is a design flaw &#8212; there&#8217;s no &#8220;bug&#8221; to patch here (I suppose Microsoft could modify SMB to ensure that it&#8217;s not responding to its own challenges; it would be possible but not trivial), this is the behavior of SMB since time immemorial.  No buffer overrun is exploited; SMB is acting precisely as it&#8217;s intended to.  This issue has been known since 2001.</p>
<p>Host firewalls like Windows Firewall and ZoneAlarm help some &#8212; at least, they keep SMB Reflection attacks out.  However, they don&#8217;t help if the attack is coming from a zone you trust &#8212; i.e. if you&#8217;re sharing files with your corporate Intranet, someone on the corporate Intranet can attack you this way if you try to authenticate against them.  And it also doesn&#8217;t stop SMB <em>Relay </em>&#8211; if I connect to M with my firewall up, he can&#8217;t use reflection to attack <em>me</em>, but he can relay to yet another host and impersonate me, passing me its challenge and relaying my response to the remote host.</p>
<p>It actually gets a bit worse than this, because the NTLM package used to authenticate SMB is the same one used to authenticate you against Intranet websites in Internet Explorer.  The attacker might not need to get you to try to make a file-share connection to him; a web connection can be sufficient.</p>
<p>This attack sounds relatively tricky to carry out, and it is&#8230; by hand.  However, the ever-popular <a href="http://www.metasploit.org">Metasploit Framework</a> contains an SMB Relay module (which also works for SMB Reflection) that makes it quite quick and easy (you need the live-tree version of Metasploit out of CVS, not the release build, as the module is relatively new and was just demonstrated at Defcon 15 this August.)  You do have to disable SMB on your computer to use it, though (which is simple on Linux, but on Windows involves unbinding the Server service.)</p>
<p>This makes SMB reflection trivial.  You load the module, tell it your IP address, load your choice of many payloads (such as having a shell started and passed to you, or simply having an SMB connection opened that you can do with as you will), and then wait for someone to connect to you.  You can either specify a target server if you want SMB Relay, or leave that unspecified for an SMB Reflection back to the person connecting.  The only thing Metasploit won&#8217;t do for you is make people connect to you.</p>
<p>So the moral of the story is apparently to be careful who you connect to, especially on local networks where your file-sharing ports are open.  That&#8217;s a pretty good moral in general&#8230; but it&#8217;s really not enough.  People who run Windows Firewall often have a blanket exception for File &amp; Printer Sharing, which opens port TCP/445&#8230; if you&#8217;re not behind a home firewall or router, this sort of attack may be able to be carried out on you from <em>any site on the Internet</em>.  And tomorrow, I&#8217;ll be talking about why nothing of any kind is ever safe on a public wireless hotspot.</p>
<p>a</p>
]]></content:encoded>
			<wfw:commentRss>http://perimetergrid.com/wp/2007/11/27/smb-reflection-made-way-too-easy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Backdoored PNRGs from the NSA</title>
		<link>http://perimetergrid.com/wp/2007/11/16/backdoored-pnrgs-from-the-nsa/</link>
		<comments>http://perimetergrid.com/wp/2007/11/16/backdoored-pnrgs-from-the-nsa/#comments</comments>
		<pubDate>Fri, 16 Nov 2007 17:37:50 +0000</pubDate>
		<dc:creator>Grant Bugher</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[legal]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[society]]></category>

		<guid isPermaLink="false">http://perimetergrid.com/wp/2007/11/16/backdoored-pnrgs-from-the-nsa/</guid>
		<description><![CDATA[Bruce Schneier has an article at wired.com about the new government-sponsored official standards for random number generators in NIST Special Publication 800-90.&#160; Apparently, it&#8217;s possible that one of them contains a back-door for the NSA; depending on how the constants in the algorithm were chosen, the NSA may have another set of constants that let [...]<p>a</p>
]]></description>
			<content:encoded><![CDATA[<p>Bruce Schneier has <a href="http://www.wired.com/politics/security/commentary/securitymatters/2007/11/securitymatters_1115">an article at wired.com</a> about the new government-sponsored official standards for random number generators in <a href="http://csrc.nist.gov/publications/nistpubs/800-90/SP800-90revised_March2007.pdf">NIST Special Publication 800-90</a>.&nbsp; Apparently, it&#8217;s possible that one of them contains a back-door for the NSA; depending on how the constants in the algorithm were chosen, the NSA may have another set of constants that let them predict the &#8220;random&#8221; numbers generated by the algorithm.</p>
<p>To people not very familiar with cryptography, it may seem odd that random number generators are very significant.&nbsp; However, all modern key-based cryptography is based on having a source of entropy (true randomness) &#8212; somewhere it can get a key that is unlikely to be guessed or otherwise determined.&nbsp; When we talk about &#8220;40-bit&#8221; or &#8220;128-bit&#8221; encryption, we&#8217;re really talking about the key length, which provides an upper bound on available entropy.&nbsp; Ideally, cryptography would be based on true random numbers, for which every bit of number is a bit of entropy.&nbsp; However, true random numbers have to be generated physically &#8212; we have devices that do it based on radioactive decay, but you can also get it by asking a human to move a mouse around or bang on a keyboard, as PGP does when generating keys.&nbsp; Thus, for most applications, we settle for pseudo-random number generators &#8212; programs which generate a stream of numbers that are unrelated to each other, have a uniform distribution, and are for most purposes entirely random.</p>
<p>However, a psuedo-random number generator usually needs a seed &#8212; a starting point for the generator.&nbsp; If you use the same seed, you&#8217;ll get the same stream of &#8220;random&#8221; numbers.&nbsp; Thus, the seeds chosen are usually very large numbers.&nbsp; Cryptographic pseudo-random number generators are considerably more processor-intensive than the regular &#8220;random&#8221; number generators used in non-security applications, as they&#8217;re usually based on multiple iterations of a hashing algorithm.</p>
<p>What happens if your pseudo-random number generator isn&#8217;t very good?&nbsp; Well, in the early 2000s, an online casino in the Caribbean (I wish I could remember the name of it to provide a link to the news coverage) lost several million dollars.&nbsp; Apparently, a player realized that to shuffle the decks of cards, they used a standard, non-cryptographic random number generator &#8212; the sort of thing that&#8217;s built into Windows and Linux and such.&nbsp; A shuffled deck of cards is very random &#8212; there are 8&#215;10<sup>67</sup> ways to shuffle a deck, which is about 225 bits of entropy.  However, the random number generator used only a 32-bit seed!&nbsp; There are only 4&#215;10<sup>9</sup> 32-bit numbers.&nbsp; This is still a lot, but with modern computer aids, it&#8217;s a manageable number.&nbsp; So what did this player do?&nbsp; He had his computer generate shuffled decks for each of the four billion 32-bit seeds.&nbsp; He then wrote a program that let him enter specific cards that were drawn (e.g. &#8220;fourth card was a queen of spades, fifth card was a 9 of diamonds&#8230;&#8221;) based on the draws he could see (such as his own cards in poker, or the up cards in blackjack) and it would pare down the four billion decks to the ones that could have potentially produced those draws.</p>
<p>It turns out that when you know that almost all decks are invalid (not able to be generated by the random number generator in use), there aren&#8217;t many decks that can produce a given set of cards.&nbsp; Thus, within 3-5 known cards, his program would spit out the entire deck, and that player could now predict the future.&nbsp; He would know exactly what cards would be coming out, and what ones already had.&nbsp; Thus, poker and blackjack were trivial, and he won a ton of money.</p>
<p>Many things in cryptography operate similarly.&nbsp; If you can predict the random numbers being used, you drastically simplify cracking the code.&nbsp; It is generally still not what a layman would call <em>simple</em> &#8212; but it brings a message from &#8220;even the National Security Agency with its thousand acres of supercomputers couldn&#8217;t crack it in our lifetime&#8221; to &#8220;it&#8217;s still out of reach for you and I, but, well, the NSA could probably crack it in a day or two.&#8221;&nbsp; Well-funded, skilled adversaries can use any small defect in a cryptosystem that lowers entropy to shorten the time to break codes.</p>
<p>And that&#8217;s why the NSA would be interested in putting a back-door in a pseudo-random number generator.&nbsp; Did they actually do this?&nbsp; In my opinion, the evidence Schneier presents is pretty convincing, and while Schneier is today best known as a popularizer of security rather than a technical expert, one would do well to remember that he also wrote <a href="ttp://www.wired.com/politics/security/commentary/securitymatters/2007/11/securitymatters_1115">Applied Cryptography</a>, a very technical book that sits on the bookshelf of basically every security developer, including mine.&nbsp; The NIST publication presents four random number generators, based on different algorithms, and then recommends the use of one, Dual_EC_DRBG, that is about 1,000 times slower than the other three.&nbsp; Unlike the others (Hash_DRBG, HMAC_DRBG, and CTR_DRBG), however, with this particular algorithm it would be possible to craft a set of input constants that are defective in a specific way &#8212; such that someone armed with a corresponding set of constants could predict the output of the generator.</p>
<p>Now, we don&#8217;t have proof that the NSA actually <em>did </em>this.&nbsp; It&#8217;s possible that the input constants in the NIST publication are truly random, chosen arbitrarily, and the NSA does not have a matching key that will break the generator.&nbsp; But the NSA is pretty smart, and almost certainly knew about the flaw in the algorithm &#8212; in general, people in the cryptographic industry assume that the NSA is a few years ahead of them and just hasn&#8217;t said so.&nbsp; The old adage about not attributing to malice what simple incompetence will explain usually applies to government pretty well, but not to the NSA.</p>
<p>Really, this is a rather ingenious way to backdoor a crypto algorithm.&nbsp; The normal method &#8212; just make a cryptosystem with a mathematical flaw or known backdoor key &#8212; has a serious issue: if you can figure out the mathematical flaw, so can someone else.&nbsp; The NSA wants to be able to listen to our phone calls &#8212; it doesn&#8217;t also want <em>every other country</em> to be able to do so.&nbsp; To backdoor a cryptosystem requires making it so you can read messages without also weakening it for everyone else.&nbsp; This method does exactly that &#8212; without the specific numbers that match the provided input constants, the system isn&#8217;t flawed at all.&nbsp; The NSA has the key (if, indeed, they do), and no one else does.&nbsp; Putting it in the random number generator rather than the cryptosystem itself is a good way to draw attention away from it, too.</p>
<p>And if the NSA didn&#8217;t choose the constants to have a backdoor, why recommend an elliptic-curve based generator that&#8217;s three orders of magnitude slower than several other generators, all believed to be just as secure, that are based on much more easily understood mathematics like hashing?&nbsp; It just doesn&#8217;t seem to make much sense.</p>
<p>a</p>
]]></content:encoded>
			<wfw:commentRss>http://perimetergrid.com/wp/2007/11/16/backdoored-pnrgs-from-the-nsa/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Steal Cars Electronically</title>
		<link>http://perimetergrid.com/wp/2007/10/21/steal-cars-electronically/</link>
		<comments>http://perimetergrid.com/wp/2007/10/21/steal-cars-electronically/#comments</comments>
		<pubDate>Mon, 22 Oct 2007 03:00:59 +0000</pubDate>
		<dc:creator>Grant Bugher</dc:creator>
				<category><![CDATA[attacks]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[physical security]]></category>

		<guid isPermaLink="false">http://perimetergrid.com/wp/2007/10/21/steal-cars-electronically/</guid>
		<description><![CDATA[At Crypty 2007 in August, Eli Beeham, et. al. presented a paper called &#8220;How to Steal Cars,&#8221; describing how they have bypassed the KeyLoq remote keyless entry system &#8212; the system used in the majority of the remote keyless entry key fobs. These systems are supposed to be secure &#8212; they use a 32-bit block [...]<p>a</p>
]]></description>
			<content:encoded><![CDATA[<p>At Crypty 2007 in August, Eli Beeham, et. al. presented a paper called &#8220;<a href="http://www.cosic.esat.kuleuven.be/keeloq/keeloq-rump.pdf">How to Steal Cars</a>,&#8221; describing how they have bypassed the KeyLoq remote keyless entry system &#8212; the system used in the majority of the remote keyless entry key fobs.  These systems are supposed to be secure &#8212; they use a 32-bit block cipher to transmit a 64-bit key from the key fob, which, if it matches, unlocks the car.  The key consists of an XOR of a car identifier (not secret, can be eavesdropped on) and a manufacturer key (secret.)   It should take 2<sup>64</sup> iterations to crack the key &#8212; not really practical.</p>
<p>However, these researchers found a flaw in the cryptosystem.  Due to a flawed protocol, they can mounting a chosen-plaintext attack on 2<sup>16</sup> keys (requires about 65 minutes access to the car.)  And once they have that, there&#8217;s a cryptanalytic attack on the manufacturer key (that&#8217;s a bit more cryptographically strenuous; they took 2 days to do it using 50 dual-core Opterons), which makes unlocking <em>any</em> car by that manufacturer very easy.</p>
<p>But do we care?  Car thieves aren&#8217;t going to run up to your car with a radio antenna, spend 65 minutes gathering data, run back to their PC and run a cracking app, then come back and steal your car.  It&#8217;s easier to just pick the lock, use a slim jim, or break a window.  (Actually, these things are <em>frighteningly</em> easy, much more so than most people imagine; key-based locks are not very secure.)  However, the risk isn&#8217;t from single attackers &#8212; it&#8217;s that this turns cars from having a <em>physical</em> lock to a <em>software</em> lock. Now that this attack is known, someone could make an effort to gather manufacturer keys from many car manufacturers and model years, and create a simple piece of software which (when paired with an appropriate-frequency radio antenna) opens any car by those manufacturers.  The bad thing about software hacks to things that aren&#8217;t general-purpose computers is that they&#8217;re really hard to fix.  If someone does come out with Car Unlocker for Windows Mobile PCs (or even cell phones), what do you do about it?  You can&#8217;t just download a patch to your <em>car</em>.  Manufacturers will change the keys in future cars, but there&#8217;s nothing to be done about current ones.  One guy isn&#8217;t going to do this to steal one car&#8230; but someone might do it for organized crime to steal <em>many </em>cars.</p>
<p>It&#8217;s dangerous to embed cryptographic keys.  Key management and rotation is actually a much, much harder problem than strong cryptography &#8212; it&#8217;s one thing to make the key hard to break, it&#8217;s quite another to be able to change it when it&#8217;s broken.  (And if the target is high-value enough, it&#8217;s a <em>when</em>, not an if &#8212; just ask the  RIAA and MPAA&#8217;s DRM developers.)</p>
<p>a</p>
]]></content:encoded>
			<wfw:commentRss>http://perimetergrid.com/wp/2007/10/21/steal-cars-electronically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using xcache
Page Caching using xcache (user agent is rejected)
Database Caching 5/13 queries in 0.179 seconds using disk

Served from: perimetergrid.com @ 2010-09-10 02:14:44 -->