<?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, 01 Feb 2012 16:14:23 +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>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>9</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>0</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>
<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>3</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>
		<item>
		<title>Creating a corporate Java security policy</title>
		<link>http://www.mountknowledge.nl/2010/11/04/creating-a-corporate-java-security-policy/</link>
		<comments>http://www.mountknowledge.nl/2010/11/04/creating-a-corporate-java-security-policy/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 22:23:16 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mountknowledge.nl/?p=71</guid>
		<description><![CDATA[On January 23rd, 1996 something magical happened. Sun Microsystems released the Java Development Toolkit 1.0. From that moment on the 3 year old World Wide Web became more interactive. Browsers such as Mosaic and Netscape were able to show small applications inline which ran code on the client computer, allowing for instant feedback. At the [...]]]></description>
			<content:encoded><![CDATA[<p>On January 23rd, 1996 something magical happened. Sun Microsystems <a href="http://web.archive.org/web/20080205101616/http://www.sun.com/smi/Press/sunflash/1996-01/sunflash.960123.10561.xml">released</a> the Java Development Toolkit 1.0. From that moment on the 3 year old World Wide Web became more interactive. Browsers such as <a href="http://en.wikipedia.org/wiki/Mosaic_%28web_browser%29">Mosaic</a> and <a href="http://en.wikipedia.org/wiki/Netscape_%28web_browser%29">Netscape</a> were able to show small applications inline which ran code on the client computer, allowing for instant feedback. At the risk of showing my age, I remember those early days of Java and I was quite impressed. Sun realized from the start that running code client side delivered over the web had severe security implications.<span id="more-71"></span> The code was executed inside a <a href="http://www.ebsolute.com/ebsolute/technologies/whitepapers/app2jni/sandbox.html">sandbox</a> with limited rights to access sensitive resources such as local disk drives and network sockets. Java code running stand alone, not using a webbrowser did not have these limitations. The sandbox model was secure (if you forget about the bugs in the implementation), but also very limiting for developers.  JDK 1.1 released in 1997 introduced a security model where an applet could ask for certain permissions. If the end user granted them, the code would execute, otherwise an exception would be thrown. The applet had to be signed with an X.509 certificate in order to provide the identity to be shown to the user. An example of an applet asking for local drive access is show below.</p>
<p><a href="http://www.mountknowledge.nl/wp-content/uploads/2010/11/privileges.jpg"><img class="alignnone size-full wp-image-73" title="privileges" src="http://www.mountknowledge.nl/wp-content/uploads/2010/11/privileges.jpg" alt="" width="492" height="352" /></a></p>
<p>Note that this pop-up is very informative. It says that granting this privilege is a <strong>high risk</strong> (in bold). The applet could read, modify or even delete any of your files. Similar texts were shown for network access, etc. This is how I remember the Java applet sandbox security model. Applets can&#8217;t do much harm, if they would want to you will be shown a pop-up which will tell you what the risks are. Neat, clean, safe.</p>
<p>In 1998 Sun decided that this security model was too complex. With the release of JDK 1.2 (now renamed Java 2 Platform, Standard Edition or J2SE) the security model became more fine grained with the use of a security policy. This policy can be set to allow or disallow certain URLs, signers, etc specific privileges. This sounds great, but the default security policy that is shipped with Java/JDK/JRE ever since basically is a big on/off switch. If an applet needs additional privileges outside the sandbox, a single uniform pop-up is shown. No mention of high risk, or which privileges can be used by the applet. If the applet is signed by a Certificate Authority that your browser or OS trusts, it looks something like this:</p>
<p><a href="http://www.mountknowledge.nl/wp-content/uploads/2010/11/tiger_security_warning_signed.png"><img class="alignnone size-full wp-image-75" title="tiger_security_warning_signed" src="http://www.mountknowledge.nl/wp-content/uploads/2010/11/tiger_security_warning_signed.png" alt="" width="490" height="311" /></a></p>
<p>if it was signed with a Certificate Authority that is not trusted it looks something like this:</p>
<p><a href="http://www.mountknowledge.nl/wp-content/uploads/2010/11/warning.jpg"><img class="alignnone size-full wp-image-76" title="warning" src="http://www.mountknowledge.nl/wp-content/uploads/2010/11/warning.jpg" alt="" width="516" height="322" /></a></p>
<p>In general I think end users always will make bad security decisions when it comes to browsing the web. However, the old style pop-ups would probably stop a lot more users from running suspicious applets. Think about it. Being able to operate outside of the Java sandbox gives applets full control over your computer. It can drop a malicious dll or exe on your hard drive, it can modify your registry to run it every time you log in, etc. And all you get as a warning is a lousy pop-up like the one above. Even ActiveX does that better these days. Of course I&#8217;m not the first to notice this. <a href="http://www.cert.org/blogs/vuls/2008/06/signed_java_security_worse_tha.html">Many</a> <a href="http://www.cs.columbia.edu/~smb/talks/pgn.pdf">people</a> <a href="http://blogs.pcmag.com/securitywatch/2010/10/mac_version_of_koobface_worm_i.php">have</a> <a href="http://www.tml.tkk.fi/Opinnot/Tik-110.551/1997/Java-Security.html">before</a>. In 2002 a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=184800">Mozilla bug report</a> was opened requesting to change the misleading wording in the security warning, but no one has picked this up.</p>
<p>I think it is clear that the default Java security policy does not suffice today. End users cannot be expected to make the right decisions when pop-ups are shown. They certainly cannot be expected to write and maintain their own Java security policy. For home users, deinstalling Java is the best option right now. The chance you really need it to enjoy the web is quite low. If you do, at least take the precautions mentioned <a href="http://www.cert.org/blogs/vuls/2008/06/signed_java_security_worse_tha.html">here</a>. For corporate users, this problem is entirely different. Many organizations rely on software that use signed Java applets such as <a href="http://www.oracle.com/technetwork/developer-tools/forms/overview/index.html">Oracle Forms</a>. It is scary to think how many corporate desktops have Java installed and enabled in their browsers. Go ahead, try this <a href="http://mindprod.com/applet/wassup.html">signed applet example</a>. Do you get a pop-up? Are you given a choice to run the applet? If so, your corporation is suspect to intruders, spamming your users with links to sites that show such a pop-up and use the Java applet to install malware. The <a href="http://blogs.pcmag.com/securitywatch/2010/10/mac_version_of_koobface_worm_i.php">Koobface worm</a> is just one such example.</p>
<p>Fortunately there is something you can do about this: write your own java security policy. I&#8217;ll give a very short tutorial below, but I recommend reading the official <a href="http://download.oracle.com/javase/6/docs/technotes/guides/security/PolicyFiles.html">Oracle documentation</a> and this <a href="http://mindprod.com/jgloss/policyfile.html">excellent site</a>.</p>
<p>In the default <em>java.home</em>/lib/security/java.security file two Java policies are loaded:</p>
<blockquote><p>policy.url.1=file:${java.home}/lib/security/java.policy<br />
policy.url.2=file:${user.home}/.java.policy</p></blockquote>
<p>You might want to remove the policy.url.2 to avoid users from changing your corporate Java policy. The default <em>java.home</em>/lib/security/java.policy is set up to restrict applets within the sandbox and ask the user what to do with signed applets. First, we need to turn off those pop-ups. You can do this by editing the <em>java.home</em>/lib/security/java.policy file or adding an additional one using policy.url.2 or policy.url.3 in the <em>java.home</em>/lib/security/java.security file. I recommend using a new file and placing it on a central file server. Add these lines:</p>
<blockquote><p>grant {<br />
permission java.lang.RuntimePermission &#8220;usePolicy&#8221;;<br />
};</p></blockquote>
<p>This tells the JVM to ignore the RSA signatures on all applets, and always and only use the Java policy defined by the policy URLs. Next, add any URLs with trusted applets that require access outside of the JVM sandbox. This acts like a whitelist:</p>
<blockquote><p>grant codeBase &#8220;http://my.internal.site.local/-&#8221; {<br />
java.security.AllPermission;<br />
};</p>
<p>grant codeBase &#8220;http://another.site.local/-&#8221; {<br />
java.security.AllPermission;<br />
};</p></blockquote>
<p>In the above the dash &#8211; is a recursive wildcard. Of course you can be much more granular instead of using java.security.AllPermission. The AllPermission property gives the same privileges a signed applet would get when the &#8220;Run&#8221; button was clicked on the pop-up.</p>
<p>Effectively you have now removed the choice of breaking out of the Java sandbox from the end user and defined it in a corporate java policy instead. This really is needed in any corporate environment with a JVM installed on the desktop. The default Java security policy is just a major security incident waiting to happen. In fact, abusing java applets is a <a href="http://cyberarms.wordpress.com/2010/06/01/backtrack-4-penetration-testing-with-social-engineering-toolkit/">well</a> <a href="http://www.securitytube.net/Java-Applet-Attack-using-the-Social-Engineering-Toolkit-video.aspx">known</a> <a href="http://www.offensive-security.com/metasploit-unleashed/SET_Java_Applet_Attack">technique</a> in <a href="http://spl0it.wordpress.com/2009/07/03/building-a-java-applet-with-meterpreter-payload/">penetration</a> <a href="http://www.offensive-security.com/metasploit-unleashed/Java_Applet_Infection">testing</a>. If the whitehats are catching on, you can count on the blackhats doing far worse.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mountknowledge.nl/2010/11/04/creating-a-corporate-java-security-policy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rootkit inside your laptop BIOS</title>
		<link>http://www.mountknowledge.nl/2010/09/30/rootkit-inside-your-laptop-bios/</link>
		<comments>http://www.mountknowledge.nl/2010/09/30/rootkit-inside-your-laptop-bios/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 19:25:32 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mountknowledge.nl/?p=58</guid>
		<description><![CDATA[There is a BIOS rootkit inside almost every Windows laptop just waiting to be activated. Scary? Yes! Read the post for more details.]]></description>
			<content:encoded><![CDATA[<p>Last week I attended an interesting presentation from <a href="http://www.absolute.com/">Absolute Software</a>. They showcased a product called <a href="http://www.absolute.com/en/products/computrace/features.aspx">Computrace</a>. This nifty tool can be used to track the whereabouts of laptops as they are deployed by companies to their mobile workforce. They also sell a comparable <a href="http://www.absolute.com/en/lojackforlaptops/home.aspx">product</a> for home users. The way this works is that the software on the laptop <em>phones home</em> every hour or so when the computer is connected to the internet. When the laptop goes missing or is stolen, this information can be retrieved from a website hopefully aiding in the safe return of the hardware.<span id="more-58"></span></p>
<p>I&#8217;ll ignore the legal issues with this solution (privacy/is knowing where your stolen laptop is considered acceptable proof by the police?) and skip to the interesting bit. I can imagine that experienced laptop thieves wipe or swap the hard drive before selling it. Computrace solves this by embedding software in the BIOS. When enabled, at every system boot the BIOS checks if the software is still installed on the hard drive. If not, it drops <code>rpcnetp.exe </code>in <code>C:\windows\system32 </code>and makes sure Windows runs it. This program then downloads and activates the full <code>rpcnet.exe </code>software.They call this feature <em>persistence</em> and according to their website it is <a href="http://www.absolute.com/en/products/bios-compatibility.aspx">embedded</a> in the BIOS of the almost all mainstream Windows laptops available today. At this point in the presentation I looked at the colleague next to me and we both said at the same time: rootkit!</p>
<p>Later some googling showed that we were not alone in this. In 2009 Anibal Sacco and Alfredo Ortega presented their <a href="http://exploiting.wordpress.com/2009/09/11/138/">research</a> on this product at Black Hat Vegas (which I attended, but missed this interesting talk) and discovered that a malicious rootkit could leverage Computrace to become very persistent.</p>
<p>Another thing that struck me during the presentation is that if this type of anti-theft software would become widely used, laptop <a href="http://en.wikipedia.org/wiki/Fence_%28criminal%29">fencers</a> would find a way to disable the Computrace BIOS feature. Absolute Software claims all this is not possible, but they have already been <a href="http://exploiting.wordpress.com/2009/09/11/138/">proven wrong</a>.</p>
<p>So be aware of the rootkit that is probably already inside your laptop&#8217;s BIOS, just waiting to be activated.</p>
<p>Thanks to <a href="http://en.wikipedia.org/wiki/CompuTrace#LoJack_for_Laptops">Wikipedia</a> for all of the above info. Please <a href="http://en.wikipedia.org/wiki/Special:VariablePage">donate</a> today.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mountknowledge.nl/2010/09/30/rootkit-inside-your-laptop-bios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

