function PrepareScript($testname, $obfu, $subs) { if (is_array($subs)) { // Keys from the argument will overwrite those from the base array. $subs = array_merge(GetBaseSubs(), $subs); } else { if ($subs) { // A truthy value indicates that the base array should be used. $subs = GetBaseSubs(); } } if (is_string($obfu)) { $code = GetObfuscatedPayload($testname, $obfu, $subs); } else { $code = GetPayload($testname, $subs); } return urlencode('<script>' . $code . '</script>'); }
function PrepareScript($testname, $obfu, $subs) { if (is_array($subs)) { // Keys from the argument will overwrite those from the base array. $subs = array_merge(GetBaseSubs(), $subs); } else { if ($subs) { // A truthy value indicates that the base array should be used. $subs = GetBaseSubs(); } } if (is_string($obfu)) { $code = GetObfuscatedPayload($testname, $obfu, $subs); } else { $code = GetPayload($testname, $subs); } $code = str_replace(array("\\", "'", "\n", "\r"), array("\\\\", "\\'", '\\n', '\\r'), $code); return $code; }
function PrepareScript($testname, $obfu, $subs) { if (is_array($subs)) { // Keys from the argument will overwrite those from the base array. $subs = array_merge(GetBaseSubs(), $subs); } else { if ($subs) { // A truthy value indicates that the base array should be used. $subs = GetBaseSubs(); } } if (is_string($obfu)) { $code = GetObfuscatedPayload($testname, $obfu, $subs); } else { $code = GetPayload($testname, $subs); } // No further processing needed to directly return a script. return $code; }
function xmread($file, $platform = 0) { $mf = fopen($file, "r"); $i = 0; // read .xm (exploit module) into array, set code start & end point while (!feof($mf)) { $line = fgets($mf, 1048576); $mfarr[$i] = base64_decode($line); if ($mfarr[$i] == "#code_start#") { $code_start = $i + 1; } elseif ($mfarr[$i] == "#code_end#") { $code_end = $i - 1; break; } $i++; } fclose($mf); // check if the exploit file is correct if ($mfarr['0'] != "#xmodule_exploit_module1.0#") { return "Invalid File Format"; } else { $xm['name'] = $mfarr['1']; $xm['payload'] = $mfarr['2']; $xm['browser'] = $mfarr['3']; $xm['version'] = $mfarr['4']; if (!empty($platform)) { $payload = GetPayload($platform, $mfarr['2']); $xm['code'] = stripslashes(str_replace($mfarr['2'], $payload, $mfarr['6'])); } else { $xm['code'] = stripslashes($mfarr['6']); } } // assign properties $this->error = $xm['error']; $this->name = htmlspecialchars($xm['name']); $this->payload = htmlspecialchars($xm['payload']); $this->browser = htmlspecialchars($xm['browser']); $this->version = htmlspecialchars($xm['version']); $this->code = $xm['code']; }
function GetObfuscatedPayload($testname, $obfu = NULL, $subs = NULL) { $payload = GetPayload($testname, $subs); return ObfuscatePayload($payload, $obfu); }