Online PHP and Javascript Decoder decode hidden script to uncover its real functionality


require_once '../../../../init.php';

use WHMCS\Database\Capsule;

session_start();

if (!isset($_SESSION['adminid'])) {
    header('Location: /admin/login.php?redirect=addonmodules.php%3Fmodule%3Dticketspamcheck');
    exit;
}

function get_ticket_language_setting() {
    $result = Capsule::table('tblticketspamcheckdashboardsettings')
        ->select('language')
        ->first();

    return $result ? $result->language : 'en';
}

function load_translation($language) {
    $filePath = _DIR_ . "/translations/{$language}.php";

    if (file_exists($filePath)) {
        return include $filePath;
    }

    return include _DIR_ . "/translations/en.php";
}

$language = get_ticket_language_setting();
$translations = load_translation($language);

$spamreportsTitle = $translations['spam_reports_title'];
$spamreports = $translations['spam_reports'];
$Prev = $translations['prev'];
$Next = $translations['next'];
$Page = $translations['page'];
$Of = $translations['of'];
$spam_reports_description = $translations['spam_reports_description'];
$home = $translations['home'];
$spamReports = $translations['spam_reports'];
$noReportsMessage = $translations['no_reports'];
$settings = $translations['settings'];
$leaveDashboard = $translations['leave_dashboard'];

$limit = 10;
$page = isset($_GET['page']) ? (int)$_GET['page'] : 1;
$offset = ($page - 1) * $limit;

$totalReports = Capsule::table('tblticketspamcheckspamreports')->count();
$totalPages = ceil($totalReports / $limit);

$spamReportsData = Capsule::table('tblticketspamcheckspamreports')
    ->orderBy('created_at', 'desc')
    ->offset($offset)
    ->limit($limit)
    ->get();

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>echo htmlspecialchars($spamreportsTitle);</title>
    <link rel="icon" href="https://i.imgur.com/9ssrqfO.png" type="image/png">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <style>
        :root {
            --bg-color: #f0f0f0;
            --text-color: #333;
            --sidebar-bg-color: #333;
            --sidebar-text-color: white;
            --link-hover-color: #575757;
            --header-bg-color: #fff;
            --header-text-color: #333;
        }

        .dark-theme {
            --bg-color: #121212;
            --text-color: #fff;
            --sidebar-bg-color: #1e1e1e;
            --sidebar-text-color: #bbb;
            --link-hover-color: #3e3e3e;
            --header-bg-color: #1e1e1e;
            --header-text-color: #fff;
        }

        body {
            font-family: Arial, sans-serif;
            margin: 0;
            height: 100vh;
            display: flex;
            background-color: var(--bg-color);
            color: var(--text-color);
            transition: background-color 0.3s, color 0.3s;
        }

        .header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 60px;
            background-color: var(--header-bg-color);
            color: var(--header-text-color);
            padding: 0 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            transition: background-color 0.3s, color 0.3s;
            z-index: 1000;
        }

        .header h1 {
            margin: 0;
            font-size: 22px;
        }

        .theme-toggle {
            cursor: pointer;
            padding: 10px;
            background-color: transparent;
            border: none;
            font-size: 24px;
            color: var(--header-text-color);
            transition: color 0.3s;
        }

        .sidebar {
            position: fixed;
            top: 60px;
            left: 0;
            bottom: 0;
            width: 250px;
            background-color: var(--sidebar-bg-color);
            color: var(--sidebar-text-color);
            padding: 20px;
            display: flex;
            flex-direction: column;
            transition: background-color 0.3s, color 0.3s;
            z-index: 999;
        }

        .sidebar a {
            color: var(--sidebar-text-color);
            text-decoration: none;
            padding: 10px 15px;
            margin-bottom: 10px;
            border-radius: 4px;
            display: flex;
            align-items: center;
            transition: background 0.3s, color 0.3s;
        }

        .sidebar a:hover {
            background-color: var(--link-hover-color);
        }

        .content {
            margin-left: 300px;
            margin-top: 80px;
            padding: 20px;
            flex-grow: 1;
            transition: background-color 0.3s, color 0.3s;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }

        th, td {
            padding: 10px;
            border: 1px solid #ddd;
            text-align: left;
        }

        th {
            background-color: var(--sidebar-bg-color);
            color: var(--sidebar-text-color);
        }

        .pagination {
            margin-top: 20px;
            display: flex;
            justify-content: flex-start;
            align-items: center;
        }

        .pagination a {
            padding: 8px 12px;
            border: 1px solid #007BFF;
            color: #007BFF;
            text-decoration: none;
            border-radius: 4px;
            transition: background-color 0.3s, color 0.3s;
            margin-right: 10px;
        }

        .pagination a:hover {
            background-color: #007BFF;
            color: white;
        }

        .pagination span {
            margin: 0 10px;
        }

        .footer {
          background-color: var(--header-bg-color);
          color: var(--header-text-color);
          text-align: center;
          padding: 10px;
          font-size: 14px;
          position: fixed;
          bottom: 0;
          left: 0;
          right: 0;
          box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
          border-top: 1px solid rgba(0, 0, 0, 0.1);
       }
       
    </style>
</head>
<body>

    <div class="header">
        <h1>echo htmlspecialchars($spamreportsTitle);</h1>
        <button class="theme-toggle" onclick="toggleTheme()">
            <i id="theme-icon" class="fas fa-moon"></i>
        </button>
    </div>

    <div class="sidebar">
        <a href="/modules/addons/ticketspamcheck/dashboard/home.php">echo htmlspecialchars($home);</a>
        <a href="/modules/addons/ticketspamcheck/dashboard/spamreports.php" class="active">echo htmlspecialchars($spamReports);</a>
        <a href="/modules/addons/ticketspamcheck/dashboard/settings.php">echo htmlspecialchars($settings);</a>
        <a href="/admin/addonmodules.php?module=ticketspamcheck">echo htmlspecialchars($leaveDashboard);</a>
    </div>

    <div class="content">
        <h1>echo htmlspecialchars($spamReports);</h1>
        <p>echo htmlspecialchars($spam_reports_description);</p>

        if ($spamReportsData->isEmpty()):
            <p>echo htmlspecialchars($noReportsMessage);</p>
        else:
            <table>
                <thead>
                    <tr>
                        <th>Client ID</th>
                        <th>Email</th>
                        <th>Ticket ID</th>
                        <th>Reason</th>
                        <th>Created At</th>
                    </tr>
                </thead>
                <tbody>
                    foreach ($spamReportsData as $report):
                        <tr>
                            <td>echo htmlspecialchars($report->client_id);</td>
                            <td>echo htmlspecialchars($report->client_email);</td>
                            <td>echo htmlspecialchars($report->ticket_id);</td>
                            <td>echo htmlspecialchars($report->reason);</td>
                            <td>echo htmlspecialchars($report->created_at);</td>
                        </tr>
                    endforeach;
                </tbody>
            </table>

            <div class="pagination">
                <span>echo htmlspecialchars($Page . ' ' . $page . ' ' . $Of . ' ' . $totalPages);</span>
                <a class="prev" href="?page=echo max(1, $page - 1);">echo htmlspecialchars($Prev);</a>
                <a class="next" href="?page=echo min($totalPages, $page + 1);">echo htmlspecialchars($Next);</a>
            </div>
        endif;
    </div>

    <div class="footer">
    <p>&copy; 2024 - echo date('Y'); Ricardo Neud. All rights reserved.</p>
</div>

    <script>
        function toggleTheme() {
            const themeIcon = document.getElementById('theme-icon');
            let theme = 'light';

            if (localStorage.getItem('theme') === 'dark') {
                document.body.classList.remove('dark-theme');
                themeIcon.classList.remove('fa-sun');
                themeIcon.classList.add('fa-moon');
                theme = 'light';
            } else {
                document.body.classList.add('dark-theme');
                themeIcon.classList.remove('fa-moon');
                themeIcon.classList.add('fa-sun');
                theme = 'dark';
            }

            localStorage.setItem('theme', theme);

            fetch('', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded',
                },
                body: new URLSearchParams({
                    'theme': theme
                })
            })
            .then(response => response.json())
            .then(data => {
                console.log('Theme updated:', data.theme);
            })
            .catch(error => {
                console.error('Error updating theme:', error);
            });
        }

        document.addEventListener('DOMContentLoaded', () => {
            const savedTheme = localStorage.getItem('theme');
            const themeIcon = document.getElementById('theme-icon');

            if (savedTheme === 'dark') {
                document.body.classList.add('dark-theme');
                themeIcon.classList.remove('fa-moon');
                themeIcon.classList.add('fa-sun');
            } else {
                document.body.classList.remove('dark-theme');
                themeIcon.classList.remove('fa-sun');
                themeIcon.classList.add('fa-moon');
            }
        });
    </script>

</body>
</html>



© 2023 Quttera Ltd. All rights reserved.