Webapp / 407.html
Hosdroid's picture
Create 407.html
37fe32a verified
Raw
History Blame Contribute Delete
5.84 kB
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>۴۰۷ - در حال بررسی امنیتی</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
padding: 20px;
}
.box {
background: white;
padding: 2rem;
border-radius: 20px;
box-shadow: 0 15px 35px rgba(0,0,0,0.2);
max-width: 550px;
width: 100%;
}
.loader {
border: 4px solid #f3e5f5;
border-top: 4px solid #8e44ad;
border-radius: 50%;
width: 50px;
height: 50px;
animation: spin 1s linear infinite;
margin: 20px auto;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.warning {
background: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
padding: 1rem;
border-radius: 15px;
margin: 1rem 0;
}
.timer {
font-size: 2rem;
font-weight: bold;
color: #c0392b;
margin: 15px 0;
}
.success {
background: #d4edda;
color: #155724;
padding: 1rem;
border-radius: 15px;
margin: 1rem 0;
}
h1 {
font-size: 3rem;
margin: 0;
color: #8e44ad;
}
</style>
</head>
<body>
<div class="box" id="mainBox">
<h1>۴۰۷</h1>
<div id="dynamicContent">
<div class="loader"></div>
<p>در حال بررسی امنیتی...</p>
</div>
</div>
<script>
const MAIN_SITE = "https://kokabtak-webapp.static.hf.space/";
// نمایش وضعیت IP بد + تایمر ۳ ثانیه و سپس بستن تب یا رفتن به گوگل
function showBadIpAndRedirect() {
let countdown = 3;
document.getElementById('dynamicContent').innerHTML = `
<div class="warning">
🚫 IP شما در لیست ممنوعه‌های خطرناک قرار دارد! 🚫
</div>
<p>به دلیل فعالیت‌های مخرب احتمالی، دسترسی شما مسدود شد.</p>
<div class="timer" id="timerDisplay">${countdown}</div>
<p>در حال بستن صفحه...</p>
`;
const timerEl = document.getElementById('timerDisplay');
const interval = setInterval(() => {
countdown--;
if (timerEl) timerEl.innerText = countdown;
if (countdown <= 0) {
clearInterval(interval);
// تلاش برای بستن تب
try { window.close(); } catch(e) { /* ignore */ }
// بعد از 50 میلی‌ثانیه اگر بسته نشد، به گوگل برو
setTimeout(() => {
window.location.href = "https://www.google.com";
}, 50);
}
}, 1000);
}
// نمایش وضعیت IP مجاز + هدایت خودکار به سایت اصلی بعد از ۱ ثانیه
function showGoodIpAndRedirect() {
document.getElementById('dynamicContent').innerHTML = `
<div class="success">
✅ IP شما مجاز است. در حال هدایت به سایت...
</div>
<div class="loader" style="width:40px; height:40px;"></div>
`;
setTimeout(() => {
window.location.href = MAIN_SITE;
}, 1000);
}
// تشخیص IP با استفاده از ip-api.com
function checkIpAndAct() {
fetch('https://ip-api.com/json/?fields=status,message,query,proxy,hosting')
.then(response => response.json())
.then(data => {
if (data.status === 'success') {
// IP بد = proxy === true یا hosting === true
const isBad = (data.proxy === true) || (data.hosting === true);
if (isBad) {
console.warn('IP ممنوع:', data.query, 'proxy:', data.proxy, 'hosting:', data.hosting);
showBadIpAndRedirect();
} else {
console.log('IP مجاز:', data.query);
showGoodIpAndRedirect();
}
} else {
// اگر API خطا داد، فرض می‌کنیم IP مجاز است (تا کاربر عادی قفل نشود)
console.warn('API خطا:', data.message);
showGoodIpAndRedirect();
}
})
.catch(err => {
console.error('خطا در ارتباط با سرویس IP:', err);
// در صورت خطا، باز هم مجاز فرض کن
showGoodIpAndRedirect();
});
}
// شروع فرآیند
checkIpAndAct();
</script>
</body>
</html>