<?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>Snoop Security Researching Community &#187; FPI</title>
	<atom:link href="http://www.snoop-security.com/blog/index.php/tag/fpi/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.snoop-security.com/blog</link>
	<description></description>
	<lastBuildDate>Thu, 04 Mar 2010 08:06:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flash Parameter Injection Analyzes</title>
		<link>http://www.snoop-security.com/blog/index.php/2009/12/flash-parameter-injection-analyzes/</link>
		<comments>http://www.snoop-security.com/blog/index.php/2009/12/flash-parameter-injection-analyzes/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 18:25:19 +0000</pubDate>
		<dc:creator>Rout3rX</dc:creator>
				<category><![CDATA[Web Application]]></category>
		<category><![CDATA[CGI]]></category>
		<category><![CDATA[Flash Injection]]></category>
		<category><![CDATA[FlashVars Attributes]]></category>
		<category><![CDATA[FPI]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[PDNF]]></category>
		<category><![CDATA[PFPI]]></category>
		<category><![CDATA[SWF]]></category>
		<category><![CDATA[Webapp]]></category>
		<category><![CDATA[Xss]]></category>

		<guid isPermaLink="false">http://www.snoop-security.com/blog/?p=106</guid>
		<description><![CDATA[Hi all web app specialists
In this first &#38; last cooperation post I decided to discuss on flash (swfs) attacks, yes we know these  topics maybe closed and no new event have been caused. but  my experience proved  it&#8217;s  too important in web app pen testing discussion. After all it is so [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all web app specialists</p>
<p>In this first &amp; last cooperation post I decided to discuss on flash (swfs) attacks, yes we know these  topics maybe closed and no new event have been caused. but  my experience proved  it&#8217;s  too important in web app pen testing discussion. After all it is so interesting than a flash object on AMF over SOAP or a logo in a side of website that redounded  to  inject a parameter o run an script on server. Step by  step we turnover this attacks and all kind of them with a little difference. At the following picture you can understand what is my idea and how flash Apps works .</p>
<div class="wp-caption alignnone" style="width: 392px"><img title="Proce of Compiling Flash in Browser" src="http://s3v3n.persiangig.com/flash.jpg" alt="" width="382" height="287" /><p class="wp-caption-text">Proce of Compiling Flash in Browser</p></div>
<p>Swf objects can execute &amp; loaded from direct in locationbar or &lt;IFRAME&gt; or &lt;FRAME&gt; tag .When we write or make a banner which designed with flash MX or other third-party we should used ActionScripting for inset of objects like buttons or area map on our  projects this scripting like other ones maybe have some vulnerability or weeknesses because the structure and based of AS (actionscript) is on ESMAscript (javascript too) and sometimes use multimedia natively Also we can use Shared object “ that explain at this post ‘end’ ”designed to allow storage of data like cookies but better that. in Flash applications some ways are there for input parameters:</p>
<p>1: URL-QueryString[GET] i.e</p>
<pre>/FlashMovie.swf?p1=[value]&amp;p2=[value]</pre>
<p>2: Famous FlashVars attributes i.e</p>
<pre>&lt;param  value="p1=[value]&amp;p2=[value]"&gt;</pre>
<p>At this example we :</p>
<pre>if (_root.snoop == undefined) {
_root.snoop = 0; // Default value
}</pre>
<p>In this simple script above “that you see several when researching about this kind of attacks” we know every variable is an object  &amp; every movie can access the timeline by using “_root object” when allowed by security policies and this global variables are accessible by using  global.variables.  now we see snoop global  variable have equal by 0 at the default so like HTTP parameter pollution from Stefano Di-Paola we can use it:</p>
<pre><a href="http://vulnerable.com/vulnFlash.swf?snoop=%5beverything">http://vulnerable.com/vulnFlash.swf?<strong>snoop=[everything</strong></a><strong>]</strong></pre>
<p>in this method we can have a direct attack and use a weak vulnerable to execute every value that attacker want.next simple method use FlashVars attribute (sometimes internal XML) between objects tag.see the the follow example:</p>
<pre>&lt;body&gt;
&lt;object data="FlashMovie.swf"
<strong>flashvars="p1=[value]&amp;p2=[value]" </strong>width="200" height="400"&gt;
&lt;/object&gt;
&lt;/body&gt;</pre>
<p>Or</p>
<pre>&lt;OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://macromedia.com/cabs/swflash.cab#version=6,0,0,0"
ID=flaMovie WIDTH=250 HEIGHT=250&gt;
&lt;PARAM VALUE="flaMovie.swf"&gt;
&lt;PARAM VALUE="<strong>userName=permadi</strong>&amp;<strong>score=80</strong>"&gt;
&lt;PARAM VALUE=medium&gt;
&lt;PARAM VALUE=#99CC33&gt;
&lt;EMBED src="flaMovie.swf"
FlashVars="<strong>userName=permadi</strong>&amp;<strong>score=80</strong>"
<strong>  </strong>bgcolor=#99CC33 WIDTH=250 HEIGHT=250
TYPE="application/x-shockwave-flash"&gt;
&lt;/EMBED&gt;
&lt;/OBJECT&gt;</pre>
<p>About the definition of FlashVar is A Flash answer to Query Strings, data passed to flashvars is simple like:  username ,cookie value, filenames and … so this is important something like passwords should never passed via flashvars. You can see the flashvars in source section of your browser. As I told when you enumerate flash movie name or global variables which used to a web app this is true to say your website is vulnerable in flash parameter injection. In flashvars injection discuss you can see the following CGI-script that dynamically set the width &amp; height attributes.</p>
<pre># flash movie
print '&lt;object ' .
'data="FlashMoive.swf" ' .
'width="' . $params{width} .
'" height="' . $params{height} .
'"&gt;&lt;/object&gt;';
#..........</pre>
<p>So in this method width and height parameter have been sent on html output file without any Disinfection. So if we outfit an URL like :</p>
<pre>http://URL/myMovie.cgi?width=100&amp;height=200"FlashVars="Global_Variable=[evil parameters]</pre>
<p>can be boom your web app.i forgot to say it, if you want to see flash internal structure is too easy to download arbitrary swf file and decompile it with some software like: Flasm ‘as you acquaintance with it in Wahh’ , SWFmill , Flare or direct for vuln scan use SWFscan form HP.</p>
<p>As I told nutshell before, around shared objects that sometimes referred to as flash cookies.in the follow we have an example of stroing data:</p>
<pre>// A New shared object
mySharedObject = SharedObject.getLocal("sharedObjectName");
// Storing data
mySharedObject.data.name = "jsmith";
mySharedObject.data.homepage = "http://demo.testfire.net";
// Flush
mySharedObject.flush();</pre>
<p>an in this following we have a snipped code that load data from shared objects:</p>
<pre>// a new shared object or read an existing one
mySharedObject = SharedObject.getLocal("sharedObjectName");
// Check whether variable name exists
if (mySharedObject.data.name == null)
{
// Shared object doesn't exist
}
else
{
// Read the name
name = mySharedObject.data.name;
// Read the homepage
homepage = mySharedObject.data.homepage;
}</pre>
<p>Okay, sometimes we have a piece of code contain PDNF (potentially dangerous native functions) which save and store any data entered by user at future so this vulnerability called persistent Flash parameter injection. Here is a code that vulnerable to PFPI:</p>
<pre>// Create a new shared object or read an existing one
mySharedObject = SharedObject.getLocal("flashToLoad");
if (_root.flashfile == undefined)
{
// Check whether there is a shared object saved
if (mySharedObject.data.flash == null)
{
// Set a default value
_root.flashfile = "defaultFlash.swf";
}
else
{
// Read the flash file to load from the shared object
_root.flashfile = mySharedObject.data.flash;
}
}
// Store the flash file's name in the shared object
mySharedObject.data.flash = _root.flashfile;
// Load the flash file
getURL(_root.flashfile);</pre>
<p>now in this flash file at the section of _root.flashfile = &#8220;defaultFlash.swf&#8221;; we have an PDNF that occurs PFPI like:</p>
<pre>flashfile=javascript:alert(document.domain)</pre>
<p>thanks for your mood with reading this obfuscated paperwork. These wrote was the fruit of some PPT and pdf that roads. If my English was poor and bad please accept it, this isn’t my primary Language,anyway,if you find any mistake,comment or email it.</p>
<p>[Alireza]Rout3rx__</p>
<address>Resources:</address>
<address>FPI article from IBM in sep 2008 | </address>
<address>Testing Flash App from Stefano in may 2007 | </address>
<address>Finding Vuln in Flash app from Stefano in Nov 2007 and  OWASP big brother which that always inside me |</address>
]]></content:encoded>
			<wfw:commentRss>http://www.snoop-security.com/blog/index.php/2009/12/flash-parameter-injection-analyzes/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
