<?xml version="1.0" encoding="ISO-8859-1"?>
<rss version="2.0">
	<channel>
		<title>Skeptikal.org</title>
		<link>http://skeptikal.org/index.php</link>
		<description><![CDATA[Some people call me the Space Cowboy]]></description>
		<copyright>Copyright 2009, Mike Bailey (mckt)</copyright>
		<managingEditor>Mike Bailey (mckt)</managingEditor>
		<language>en-US</language>
		<generator>SPHPBLOG 0.5.1</generator>
		<item>
			<title>Qwest XSS</title>
			<link>http://skeptikal.org/index.php?entry=entry081230-113011</link>
			<description><![CDATA[Here&#039;s a fun story about XSS and why we should take it seriously.<br /><br />Due to the location of my residence and the ineptness of my HOA, the buildings around me get fiber optic, but I can&#039;t. So I use Qwest DSL for my home internet access.  While I&#039;m not a huge fan of the company, they generally tend to get things done and not cause me too much grief.  There&#039;s a lot I don&#039;t like, but not enough to quit using their service.<br /><br />About a year ago, I was paying my bills and visited the &quot;My Profile&quot; page.  Out of curiosity, I stuck a few quotes and HTML tags into a few fields and much to my surprise (not really), found some permanent XSS holes.  While I don&#039;t like seeing it, this alone isn&#039;t really news (as evidenced by the recent string of holes we&#039;ve been finding on bank and credit company websites).  I left one field set to pop up an alert box every time I log in and mostly forgot about it.<br /><br /><a href="javascript:openpopup('http://skeptikal.org/images/qwest_xss.png',800,600,false);"><img src="http://skeptikal.org/images/qwest_xss.png" width='485' border="0" alt="" /></a><br /><br />A few months later there was an internet outage.  The Tech Support call was a whole &#039;nother adventure (what &quot;scheduled router maintenance&quot; results in a 30+ hour outage?  There&#039;s something they weren&#039;t telling me), but the interesting part was when the rep brought up my account information.  She sounded confused on the phone, said something like &quot;what&#039;s this?  This is weird...&quot; and after a few loud clicks, seemed to get back on track and finish the call.  It wasn&#039;t until after I hung up that I realized what had happened- my XSS has executed in the context of a Tech Support rep, who presumably has access to other accounts, network information, and other goodies...<br /><br />I never did anything with it, but did mention it to a few of Qwest&#039;s IT people I met a few months later.  They didn&#039;t seem too concerned.  I then looked through the Qwest website a bit more and found a few more <a href="http://xssed.com/search?key=qwest.com" target="_blank" >XSS holes</a>- these ones in the public side.  I reported them, posted them on XSSed, and forgot about them.  They never did get fixed.<br /><br />While finding security holes in the financial sector seems to be all the rage these days, I&#039;m going to focus for the next while on some public utilities.  Frankly, they scare me more- they&#039;re often government owned and operated, so have less market-driven controls in place.  Most of them know your Social Security number, your credit card number, your checking account information, and they directly affect your everyday life.<br /><br />Wouldn&#039;t it be scary if your power company used outdated perl scripts to handle billing and account management?  Mine does.<br />]]></description>
			<category></category>
			<guid isPermaLink="true">http://skeptikal.org/index.php?entry=entry081230-113011</guid>
			<author>Mike Bailey (mckt)</author>
			<pubDate>Tue, 30 Dec 2008 18:30:11 GMT</pubDate>
			<comments>http://skeptikal.org/comments.php?y=08&amp;m=12&amp;entry=entry081230-113011</comments>
		</item>
		<item>
			<title>Reporting Security Holes</title>
			<link>http://skeptikal.org/index.php?entry=entry081223-213811</link>
			<description><![CDATA[With Russ&#039;s <a href="http://holisticinfosec.blogspot.com/2008/12/online-finance-flaw-visa-responds.html" target="_blank" >latest blog post</a> came links to a few articles dealing with the recently exposed American Express XSS holes.  In short, AmEx dealt with it badly- ignoring Russ&#039;s three attempts to contact them and only fixing the issue when it got posted publicly (after their PR watchdogs brought the post to their attention).<br /><br />One of the more interesting articles was at <a href="http://www.betanews.com/article/How_to_get_a_security_hole_fixed_two_versions/1229555420" target="_blank" >BetaNews</a>.  Please read it.<br /><br />I don&#039;t think that AmEx&#039;s web developers read my blog (at least I haven&#039;t seen many related IPs pop up in my logs), but maybe they should.  Their primary excuse for not fixing the flaw is that it didn&#039;t get to the right people.<br /><br />Now, exactly whose fault is that?<br /><br />I wrote a <a href="http://skeptikal.org/index.php?entry=entry080811-125406" target="_blank" >few months ago</a>, in my &quot;Open Letter to The Internet&quot; that website owners need to make it painless to report security issues.  If they don&#039;t provide a simple process for doing so, I have a hard time feeling sorry for them.  Russ&#039;s goal was to get the bug fixed, and contacting the company didn&#039;t do it.  Once he posted it publicly, people actually started caring.  (Unfortunately, the fix only lasted a day before getting broken by two more researchers, which makes me think that AmEx&#039;s programmers are inept to begin with).<br /><br />Russ made a good-faith attempt to contact the company not one, but three times.  He sent messages to two different entities and gave them two weeks to respond.  If it had been me reporting the bugs, I certainly wouldn&#039;t have given them that much effort unless I was on their payroll.<br /><br />As I wrote back in August, &quot;We are here to help, but we aren&#039;t necessarily here to help <em>you</em>.&quot;<br /><br />]]></description>
			<category></category>
			<guid isPermaLink="true">http://skeptikal.org/index.php?entry=entry081223-213811</guid>
			<author>Mike Bailey (mckt)</author>
			<pubDate>Wed, 24 Dec 2008 04:38:11 GMT</pubDate>
			<comments>http://skeptikal.org/comments.php?y=08&amp;m=12&amp;entry=entry081223-213811</comments>
		</item>
		<item>
			<title>cPanel Followup</title>
			<link>http://skeptikal.org/index.php?entry=entry081219-104210</link>
			<description><![CDATA[I just upgraded a few servers to the latest version of cPanel, which is supposedly fully PCI compliant.<br /><br />You may be wondering why, with its massively widespread use, cPanel wasn&#039;t already PCI compliant.  Basically it dealt with a variety of SSL issues- the administration interface supported weak SSL ciphers and there was no way to change that through cPanel. You had to hack it together, disabling cPanel&#039;s internal SSL libraries and using other tools to implement it properly.<br /><br />While I&#039;m happy that they got around to fixing that issue (after only about 4 months), they still haven&#039;t fixed the XSS or CSRF issues that I sent to them in June and <a href="http://skeptikal.org/index.php?entry=entry080805-140000" target="_blank" >posted</a> <a href="http://skeptikal.org/index.php?entry=entry080809-180834" target="_blank" >here</a> back in August.<br /><br />...But I&#039;m getting awfully jaded, and I&#039;m not expecting them to ever fix it.]]></description>
			<category></category>
			<guid isPermaLink="true">http://skeptikal.org/index.php?entry=entry081219-104210</guid>
			<author>Mike Bailey (mckt)</author>
			<pubDate>Fri, 19 Dec 2008 17:42:10 GMT</pubDate>
			<comments>http://skeptikal.org/comments.php?y=08&amp;m=12&amp;entry=entry081219-104210</comments>
		</item>
		<item>
			<title>Redirecting Safely</title>
			<link>http://skeptikal.org/index.php?entry=entry081203-105048</link>
			<description><![CDATA[I don&#039;t think this is news to the other security people, but as a developer, I had never heard of this issue.  As far as I know, none of the developers I regularly work with had heard of it either (though using the code as recommended by the php.net manual will prevent it).<br /><br />In many PHP applications, there is an admin side and a public side.  It is common for developers to have an &quot;admin check&quot; in the code header of the admin side, which essentially evaluates whether a user is authorised to view a resource and either redirects them to the login page, the public page, or lets them through to the resource.<br /><br />What many developers don&#039;t realize is that a browser doesn&#039;t have to terminate a connection as soon as it receives a 302 redirect.  If you are relying on the following call to keep the riffraff out of your admin pages, you may be vulnerable:<br /><br /><code>header(&#039;Location: login.php&#039;);</code><br /><br />I can&#039;t tell you how many times I&#039;ve been able to access reports full of user logins, order information, or even account modification functionality, simply by asking my browser to continue loading a page after receiving a redirect.  If you need a testing tool to see if you are vulnerable, I whipped up <a href="exploits/no302.txt" target="_blank" >this perl script</a> one day to allow me to simply snag admin pages or post content to them during a penetration test.<br /><br />In case it isn&#039;t obvious, you can prevent this hole simply by halting the flow of the application.  If you aren&#039;t using more advanced templating and flow control (which I&#039;d recommend anyways), this will work:<br /><br /><code>header(&#039;Location: login.php&#039;);<br />die(&#039;Kindly piss off.&#039;);</code><br /><br />While obvious, this issue is incredibly widespread, and I have to wonder how many developers are unaware of it.<br />]]></description>
			<category></category>
			<guid isPermaLink="true">http://skeptikal.org/index.php?entry=entry081203-105048</guid>
			<author>Mike Bailey (mckt)</author>
			<pubDate>Wed, 03 Dec 2008 17:50:48 GMT</pubDate>
			<comments>http://skeptikal.org/comments.php?y=08&amp;m=12&amp;entry=entry081203-105048</comments>
		</item>
		<item>
			<title>PHP&#039;s Most Useless Security Bug</title>
			<link>http://skeptikal.org/index.php?entry=entry081021-101639</link>
			<description><![CDATA[I found this a few months ago and have been racking my brain for a way to use it in a pentest.  Maybe somebody else can find a practical exploit for this; so far, I have nothing.  I do think it&#039;s kind of funny though.<br /><br />With display_errors on, PHP will send errors to the browser, along with the location of the buggy code.  This is often useful for debugging, and helpful to malicious users.  Interestingly, it doesn&#039;t filter the filename for HTML characters.  <br /><br />If you were able to, say, create a folder named &quot;&lt;script&gt;alert(1337)&lt;&quot;, and within it, place a file called &quot;script&gt;.php&quot;, which in turn threw an error, you&#039;d get something like <a href="http://skeptikal.org/exploits/%3Cscript%3Ealert(1337)%3C/script%3E.php" target="_blank" >this</a>.]]></description>
			<category></category>
			<guid isPermaLink="true">http://skeptikal.org/index.php?entry=entry081021-101639</guid>
			<author>Mike Bailey (mckt)</author>
			<pubDate>Tue, 21 Oct 2008 16:16:39 GMT</pubDate>
			<comments>http://skeptikal.org/comments.php?y=08&amp;m=10&amp;entry=entry081021-101639</comments>
		</item>
		<item>
			<title>More McAfee Snake Oil</title>
			<link>http://skeptikal.org/index.php?entry=entry081009-213000</link>
			<description><![CDATA[<b>The McAfee Secure certification is useless.</b><br /><br />Over at <a href="http://holisticinfosec.org" target="_blank" >holisticinfosec.org</a>, Russ McRee has been covering this in depth, but I&#039;ve had the fortune to know the inside story.<br /><br />Russ has been making snake oil vendors&#039; deficiencies public for some time. A few weeks before Black Hat, he and I were talking about this, and he showed me a handful of &quot;McAfee Secure&quot; sites. All of them had XSS holes, and many had much worse- SQL injection and other serious issues. Over the next few weeks, we traded more vulnerabilities as we found them, and he amassed a pretty impressive list of weak, but certified secure sites. To top all of this off, we found XSS holes on McAfee&#039;s own domain.<br /><br />We also got our hands on a PCAP dump of one of their scans, which revealed quite a bit of insight into the scanning process. We were able to prove that they do not revoke PCI compliance or McAfee Secure certifications for XSS, though the engine does indeed fuzz for (and occasionally even find) them.<br /><br />While they were being awarded their <a href="http://pwnie-awards.org/2008/awards.html" target="_blank" >Pwnie</a>, Russ put together a paper detailing these findings. He sent the paper to McAfee before publishing, in order to give them a chance to address the issues before they were made public. They surprised us both by responding positively. Some of McAfee&#039;s top people spoke with Russ in person a few weeks later, resulting in him publishing <a href="http://holisticinfosec.blogspot.com/2008/08/mcirony-unexpected-response-from-mcafee.html" target="_blank" >this blog post</a>.<br /><br />That was some time ago, but we <a href="http://holisticinfosec.blogspot.com/2008/10/mcafee-secure-standard-sort-of.html" target="_blank" >still haven&#039;t seen any progress</a>. A published standard for what exactly &quot;McAfee Secure&quot; means was promised after 2-3 weeks, and we&#039;re now pushing five. The information that we have isn&#039;t encouraging- it appears that McAfee Secure will have a different set of standards for enterprise websites and the smaller &quot;Ma and Pa&quot; shops. The latter will not be required to fix XSS issues and the former will not have to do so until an arbitrary time period has expired. What this means is that, to a user looking for evidence that a site can be trusted, the &quot;McAfee Secure&quot; badge on a website will mean exactly what it does now: <b>Absolutely nothing.</b><br /><br />I suppose that anybody can offer their own meaningless certifications (and <a href="http://blogs.zdnet.com/security/?p=1114" target="_blank" >some people</a> have), but as <a href="http://holisticinfosec.blogspot.com/2008/10/mcafee-secure-standard-sort-of.html?showComment=1223492220000#c3380084906552349295" target="_blank" >Rafal noted</a> yesterday, calling these sites &quot;McAfee Secure&quot;, &quot;Hacker Safe&quot; or anything of the sort is in poor taste at best- fraudulent on the other end of the spectrum.<br /><br />This brings us to today.<br /><br />It appears that McAfee intendes to leverage their brand recognition and captalize on the trust of the ill-informed. They have a new service advertised on parts of their website. Found at <a href="http://secureshopping.mcafee.com" target="_blank" >secureshopping.mcafee.com</a>, it is basically a meta-search engine which will allow one to &quot;shop with confidence at McAfee SECURE certified merchants&quot;, according to the text on the site. This actually doesn&#039;t strike me as a bad idea, provided the certification is worth something. Considering the certification isn&#039;t, the whole thing is rather laughable.<br /><br />I first stumbled across this site just before Black Hat. The app was probably not intended to be public then, but I immediately (accidentally, actually) discovered an <a href="http://holisticinfosec.org/video/mcafee/mcafee_secureshopping_xss.html" target="_blank" >XSS hole</a> in it (this was one of the holes on McAfee&#039;s domain mentioned above). While that hole has since been fixed, the situation really isn&#039;t any better now.<br /><br />To begin with, the application doesn&#039;t use transport-layer encryption, and is therefore vulnerable to sniffing, tampering, and all the man-in-the-middle attacks that we already know and love. But who bothers with SSL these days?<br /><br />The shopping application itself seems to be based on the same code as that of <a href="http://www.become.com/" target="_blank" >become.com</a>. Actually, they appear to have partnered for this service, because when you click a link from McAfee&#039;s site to a particular product, you are given a 302 redirect to partner.become.com, then to stat.dealtime.com (whoever that is). From there you are 302-ed anywhere from one to three more times before landing on the requested product page, provided by a McAfee Secure merchant.<br /><br />In theory, at least.<br /><br />For the sake of breaking things, let&#039;s build a link that will take us through the McAfee Secure gateway to an uncertified website. We&#039;ll go to <a href="http://www.become.com" target="_blank" >www.become.com</a>, find a product, then deconstruct the link and pass its unique identifier to McAfee shopping center (which, being based on the same code, uses the same format for its links). Lo and behold, the following <a href="http://secureshopping.mcafee.com/link?q=ViewProduct&amp;t=pmr&amp;u=H4sIAAAAAAAAAMsoKSmw0tcvLy%2FXS8xNrMrP00vOz9VPKdB3MgACZxcfbzf9otQ027z84sxcffuSxHTbpFSgEhDWNTJQSy5KTSzJLEu1NbYwMDY2hvMdgz39bBFmqOVk5mU756ek2iYW5wEA45f8%2B3QAAAA%3D" target="_blank" >link</a> will take you directly to the product on Amazon.com- which <a href="https://www.mcafeesecure.com/RatingVerify?ref=www.amazon.com" target="_blank" >according to McAfee Secure</a>, is not McAfee Secure.<br /><br />Next, let&#039;s take a look at the app&#039;s session ID generation. Admittedly, sessions don&#039;t appear to be used for anything in the site (except maybe tracking user activity), but I have to assume that session functionality was added for some reason, and it nicely demonstrates their own lack of understanding of web application security. Can you find the pattern?<br /><pre>1223516988361-0-9IDB<br />1223516989602-0-gnpY<br />1223516990254-0-SZPR<br />1223516990913-0-F9jC</pre><br />That&#039;s right folks, they&#039;re using timestamps as session IDs. Now, I&#039;ve seen this practice used by banks, mortgage companies, and ecommerce sites, but I never expected to see such poor practices on the website of the &quot;world&#039;s largest dedicated security technology company&quot; (their boast, not mine).<br /><br />Finally let&#039;s look at the partners, who we have to assume will help provides us &quot;a secure online shopping experience with thousands of McAfee SECURE sites&quot;. The sites at become.com and dealtime.com are themselves <a href="http://dealtime.com/xPP-music--%5E%3Cimg%20src=bork%20onerror=alert(1337)%3E-teen_pop_subgenre" target="_blank" >riddled</a> <a href="http://www.become.com/seat-belts-auto?&amp;utm_medium=sem&gt;asdf&amp;start=1&amp;utm_source=yahooamp;&quot;);alert(1337);(&quot;" target="_blank" >with</a> <a href="http://www.become.com/feedback.html?q=nikon+slr%27);alert(1337);(%27&amp;start=1&amp;num=10" target="_blank" >XSS</a> and <a href="http://stat.dealtime.com/DealFrame/DealFrame.cmp?url=http%3A//www.owasp.org/index.php/Open_redirect" target="_blank" >open</a> <a href="http://social.become.com/rd?&amp;u=http%3A//www.owasp.org/index.php/Open_redirect" target="_blank" >redirect</a> <a href="http://stat.dealtime.com/xClickOutEvent/ClickOut?DirectURL=http://www.owasp.org/index.php/Open_redirect" target="_blank" >holes</a> (not to mention <a href="http://social.become.com/viewemailtofriend.action" target="_blank" >storing the answer</a> to a CAPTCHA within the form to be submitted). <br /><br />With such poor decisions being made, can we really expect McAfee Secure to live up to its name?]]></description>
			<category></category>
			<guid isPermaLink="true">http://skeptikal.org/index.php?entry=entry081009-213000</guid>
			<author>Mike Bailey (mckt)</author>
			<pubDate>Fri, 10 Oct 2008 03:30:00 GMT</pubDate>
			<comments>http://skeptikal.org/comments.php?y=08&amp;m=10&amp;entry=entry081009-213000</comments>
		</item>
		<item>
			<title>Clickjacking Exploits</title>
			<link>http://skeptikal.org/index.php?entry=entry081007-195714</link>
			<description><![CDATA[RSnake is starting to release details about his much-hyped <a href="http://ha.ckers.org/blog/20081007/clickjacking-details/" target="_blank" >clickjacking exploits</a>, and I have to say, I&#039;m a bit disappointed.<br /><br />Basically, the attack boils down to using Javascript, Flash, or CSS to surreptitiously place links or other controls under the user&#039;s cursor right before he clicks.  A clever attack, but I was expecting something new.  I&#039;ve been doing this for years, and Rsnake mentioned something like it <a href="http://ha.ckers.org/blog/20060628/digg-is-vulnerable-to-xss/" target="_blank" >back in 2006</a>.  He even noted that some of these attacks have been around since 2002.  It still hasn&#039;t been fixed, but this isn&#039;t exactly news. <br /><br />The &quot;news&quot; part which sparked some drama is that <a href="http://blog.guya.net/2008/10/07/malicious-camera-spying-using-clickjacking/" target="_blank" >Flash is particularly vulnerable</a>, and can be used to access client-side devices like microphones and cameras.  Considering Flash&#039;s <a href="http://secunia.com/advisories/search/?search=flash" target="_blank" >past record</a>, even earning a <a href="http://pwnie-awards.org/2008/nominees.html#bestclientbug" target="_blank" >Pwnie</a> nomination, it&#039;s not all that shocking.  Due to RSnake&#039;s holding off on releasing the vulnerability, this bug has already been resolved by the vendor.<br /><br />I suppose due to Flash&#039;s huge market penetration, this is somewhat noteworthy, but none of the users seem to care.<br /><br />Call me cynical, I guess.<br /><br />That&#039;s why I just use Lynx.]]></description>
			<category></category>
			<guid isPermaLink="true">http://skeptikal.org/index.php?entry=entry081007-195714</guid>
			<author>Mike Bailey (mckt)</author>
			<pubDate>Wed, 08 Oct 2008 01:57:14 GMT</pubDate>
			<comments>http://skeptikal.org/comments.php?y=08&amp;m=10&amp;entry=entry081007-195714</comments>
		</item>
		<item>
			<title>Diary of a Hacker - Part 1</title>
			<link>http://skeptikal.org/index.php?entry=entry081006-152832</link>
			<description><![CDATA[Here&#039;s the first of many writeups for my &quot;Hacker Challenge&quot;.  Keep in mind, this isn&#039;t a penetration test- it&#039;s just a train-of-thought writeup of how I cracked an application.  The idea is to demonstrate instances of various attacks in use, rather than the theoretical proof-of-concepts that appear in most security web sites.<br /><br />The site is a file repository- basically customers can pay a monthly fee to have access to a virtual filing cabinet-type-thing.  I don&#039;t think that&#039;s a fabulous business model, but that&#039;s not the point of this blog.  After familiarizing myself with the site, my first attempts were file upload attacks (naturally, given the purpose of the site). Fortunately, the site used several layers of protection for uploaded files- first, it only allowed a whitelist of filetypes, preventing malicious files from being uploaded.  Next, it stored those files in a non-web-accessible directory.  Even if I could get a malicious file uploaded, I could not access it directly.  Finally, the filenames were randomly generated- if I found a way to circumvent the access control, I still would not know the name of my malicious file.<br /><br />Basically, this type of attack didn&#039;t work; I moved on.<br /><br />Throughout the site, inputs were validated thoroughly (excessively in some cases).  No matter where I looked and how much I mangled the inputs, I could not find an SQL injection hole.  I did find a reflected XSS hole in an obscure stock script, so I decided to work with that.  My goal was to <br />steal an admin session using Javascript, and after setting up my evil little javascript-session-stealing kit (I&#039;m quite proud of it), found out that this also wouldn&#039;t work so easily.  The developer had added the following directive to php.ini:<br /><pre>session.cookie_httponly = 1</pre>This directive made it so that session IDs were inaccessible to client-side Javascript.  I could have still used the XSS hole for other things, such as forcing the administrator to perform actions on my behalf, but this would require work and inside knowledge to code, and would have a relatively low chance of success.<br /><br />I&#039;m rather lazy, so I moved on.<br /><br />I went to <a href="http://myipneighbors.com" target="_blank" >myipneighbors.com</a> and found a list of sites on the server.  It didn&#039;t take me long to find one with some known vulnerabilities, and next thing I knew, I had filesystem access.  Faithful readers already know where I&#039;m going with this, but mass-hosted servers are a Bad Idea.  Even so, it is possible to configure file permissions and code a site so that an attacker can&#039;t simply walk in and read your configuration files.<br /><br />I whipped up a quick script and ran it on the compromised account (The server runs FreeBSD and cPanel).  This script monitored the output of `ps -aux` while fetching a page from the target account.  Because of suexec, I immediately knew the username of the targeted website.<br /><br />With this information, I tried to read files from the public_html directory, but the permissions were set up (mostly) correctly and prevented access.  While I couldn&#039;t list the files in the directory, I could guess at their filenames, and eventually landed on one file that was readable- php.ini.<br /><br />Reviewing the site&#039;s php.ini file, I could tell the server was relatively locked down, but one line in particular caught my attention:<br /><pre>session.save_path = /home/theSiteUsername/tmp/</pre>I tried to list the files in that directory and was able to view a list of open sessions&#039; IDs.  This was the hole I needed to compromise the account:<br /><pre>$ ls -la /home/theSiteUsername/tmp/ | grep sess<br />-rw-------   1 theSiteUsername  theSiteUsername  5068 Sep 18 09:20 sess_1a1aexxxxxxx5e282e1a5747694ec8e2<br />-rw-------   1 theSiteUsername  theSiteUsername  5023 Sep 18 09:19 sess_462fexxxxxxx13dafa331bc15e962e22<br />-rw-------   1 theSiteUsername  theSiteUsername  5109 Sep 18 10:51 sess_717edxxxxxxx653df341f91d096e0484<br />-rw-------   1 theSiteUsername  theSiteUsername  5079 Sep 18 09:14 sess_91850xxxxxxxef480524c23412b23dc1<br />-rw-------   1 theSiteUsername  theSiteUsername  5011 Sep 18 10:38 sess_9246dxxxxxxxe6e710a9e623af23ca95<br />-rw-------   1 theSiteUsername  theSiteUsername  5079 Sep 18 09:25 sess_a4cdcxxxxxxx065ede6ecb062d443f86</pre>I then manually set the SESSID cookie in my browser to those found in the session filenames, and confirmed that I could hijack other accounts&#039; sessions.  Unfortunately, none of those sessions were administrators.  I wrote a shell script to watch the directory in question and send a text message to my cell phone when a new session is created, but no admins logged in over the 50-something <br />hours that I waited.<br /><br />While this tactic would eventually work, I wanted to speed things up.  I sent the following email to the programmer:<br /><pre>Log into the admin section and check the &#039;edit_users.php&#039; page.<br /><br />;)</pre>The developer and I have done a fair amount of trash-talking about this account in the past, so worried that I had successfully hacked the site, he logged in to check the admin section.  As soon as his new session was created, I hijacked it, accessed the admin page, and snagged a screenshot as proof.<br /><br />So what could have been done to prevent this attack?  A few little things.<br /><br />First, making the ~/tmp directory globally unreadable would have prevented me finding session IDs.  This isn&#039;t failproof, as there are other ways I could have found them, but every little bit helps.<br /><br />Second, adding further session validation would have made hijacking the session very difficult.  This can be as simple as storing the source IP address in the $_SESSION array on login, then comparing it on each pageload to make sure the user isn&#039;t suddenly coming from the other side of the world.  Admittedly, there are legitimate uses that would have issues (web proxies and Tor, specifically), but it would have closed the hole.  If the site&#039;s user base are likely to be behind proxies, there is other information that can be used to identify the browser uniquely- client&#039;s user agent, supported protocols, OS, connection latency, etc.<br /><br />The biggest lesson here, though, is to follow the &#039;defense in depth&#039; mantra.]]></description>
			<category></category>
			<guid isPermaLink="true">http://skeptikal.org/index.php?entry=entry081006-152832</guid>
			<author>Mike Bailey (mckt)</author>
			<pubDate>Mon, 06 Oct 2008 21:28:32 GMT</pubDate>
			<comments>http://skeptikal.org/comments.php?y=08&amp;m=10&amp;entry=entry081006-152832</comments>
		</item>
		<item>
			<title>A Hacker&#039;s Diary</title>
			<link>http://skeptikal.org/index.php?entry=entry080918-143113</link>
			<description><![CDATA[I work for a web development and hosting firm, where have an ongoing competition. Our webapp developers submit their newly-built sites for a voluntary cracking attempt. If I cannot in some way compromise, abuse, DOS, or gain escalated privileges, the developer in question gets a monetary prize.<br /><br />So far, I have not failed, and the prize keeps getting bigger.<br /><br />Of course, it isn&#039;t really a code audit or even a penetration test.  Primarily, it&#039;s a way for me to hone my own skills while informing our developers about web security issues.  The contest has a somewhat limited scope- I must get in by abusing a hole in the code or configuration, so social engineering, server configuration, and other attacks are out (at least as the primary attack vector, though I may use them as leverage against another hole).  It also is limited to single-developer applications, so they tend to be small in scale.<br /><br />I&#039;m writing about this here for two reasons. First, I think it&#039;s a very good idea. We have had an extremely positive response from the developers.  They code better than ever. They are actively engaged in maintaining the security of the applications, rather than building and then forgetting about them.  The contest has sparked many insightful discussions about various security concepts, including CAPTCHA, PHP session management, and XSS filtering.  If anybody out there manages a team of developers, I highly recommend holding a similar competition.<br /><br />The second reason is because I&#039;ve received permission from the higher-ups to publish some of the post-exploitation writeups on this blog.  I hardly consider myself to be the best web application hacker out there, and I don&#039;t think I&#039;m a definitive authority on the subject, but I&#039;ve found (and I&#039;m <a href="http://www.emergentchaos.com/archives/2008/09/think_like_an_attacker.html" target="_blank" >not alone</a>) that very few non-security people, particularly the developers in charge of building the applications, know how an attacker works.<br /><br />I&#039;m hoping that by showing the thought process and techniques that I use, I can enlighten a few developers, project managers, and maybe even a few other security-folk.]]></description>
			<category></category>
			<guid isPermaLink="true">http://skeptikal.org/index.php?entry=entry080918-143113</guid>
			<author>Mike Bailey (mckt)</author>
			<pubDate>Thu, 18 Sep 2008 20:31:13 GMT</pubDate>
			<comments>http://skeptikal.org/comments.php?y=08&amp;m=09&amp;entry=entry080918-143113</comments>
		</item>
		<item>
			<title>A Grain of Salt</title>
			<link>http://skeptikal.org/index.php?entry=entry080909-153605</link>
			<description><![CDATA[From time to time, I&#039;m asked to evaluate a particular application for use on my company our our customers&#039; servers.  This is often depressing, as most of the ready-built web apps out there are poorly written at best.  This is pretty much the status quo, it would seem.<br /><br />I evaluated <a href="http://v3chat.com/instant_messenger/" target="_blank" >V3 Chat</a>, a web-based instant messenger service, about a year ago for a client.  Based on the high number of XSS and other holes in the software, I strongly recommended against it.  The client found another solution, and life went on.<br /><br />Today I was asked to look at it again, as another client wanted to use it and a new version has since been released.  Within seconds, I found <a href="http://v3chat.com/v3messengerpro_v303/members/profile.php?new_reg=0%22%20style%3Ddisplay%3Ablock%3Bposition%3Aabsolute%3Bheight%3A200px%3Bwidth%3A200px%3B%20onclick%3Dalert%281337%29%2F%2F" target="_blank" >the first of many</a> holes in their demo.<br /><br />Normally, this wouldn&#039;t irritate me so much- recommend that they not use it, move on with life, etc.  But the vendor&#039;s web site states the following as a bullet point:<br /><br />&quot;New! - Improved User Security.  Greater safety and security for private chat conversations.  Increased protection against XSS and MySQL attacks.&quot;<br /><br />The really irritating part to me here is the fact that they are using improved user security as a sales point, when not just the original, but the &quot;improved&quot; version of the software would not pass basic PCI compliance testing.  They haven&#039;t even fixed <a href="http://xssed.com/mirror/47457/" target="_blank" >the XSS hole</a> that I emailed to the vendor several weeks before sending it to XSSed.com about a month ago (this was partially the inspiration for my <a href="http://skeptikal.org/index.php?entry=entry080811-125406" target="_blank" >Open Letter to the Internet</a> at about the same time).  While this software is, in my professional opinion, lousy, this is nothing new to the web.  Unfortunately, there is a lot of broken software out there, and very few vendors, much less their customers, realize this.<br /><br />What would it take to fix the web?  A lot, I&#039;m afraid.  Bruce Schneier keeps telling people that it starts with legal accountability on the vendor&#039;s part, which I&#039;m inclined to agree with.  In the meantime, you can secure your own web services with a healthy dose of skepticism (hence, the title of my blog).  It&#039;s common enough that it&#039;s not even news anymore, but I&#039;ve seen far too many instances of encrypted, unbreakable, or &quot;improved&quot; software turning out to be insecure.<br /><br />Whenever my company is looking to use some commercial software, they run it by me first.  I talk to the sales representative and am always told that the product is perfectly secure, will solve all my problems and whiten my teeth while I sleep.  Invariably, I get a demo copy and find holes in the software.<br /><br />This in itself isn&#039;t always enough to get a negative recommendation; I send the vendor my findings, and watch how quickly the issues are resolved.  After evaluating the vendor&#039;s response to the problems, I can finally make a recommendation.  Usually, we end up building whatever we needed in-house.  The times that we don&#039;t, we usually wish we had.<br /><br />Often, the vendor is the most surprised to find out that their magical software is full of holes.  At least, they act surprised.  Don&#039;t trust the marketing, don&#039;t trust the reviews in ad-supported-magazine weekly.  If it&#039;s going to be used somewhere important, it&#039;s worth your time to look for yourself.  If the vendor won&#039;t let you demo a copy, move on.  If you haven&#039;t the time or the knowledge to evaluate it, I have both, but less money than I would prefer.<br /><br />That&#039;s my rant for the day.<br /><br />]]></description>
			<category></category>
			<guid isPermaLink="true">http://skeptikal.org/index.php?entry=entry080909-153605</guid>
			<author>Mike Bailey (mckt)</author>
			<pubDate>Tue, 09 Sep 2008 21:36:05 GMT</pubDate>
			<comments>http://skeptikal.org/comments.php?y=08&amp;m=09&amp;entry=entry080909-153605</comments>
		</item>
	</channel>
</rss>
