-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc4eck.html
More file actions
95 lines (84 loc) · 3.54 KB
/
c4eck.html
File metadata and controls
95 lines (84 loc) · 3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="noindex, nofollow" />
<meta name="author" content="xFlip Team" />
<meta name="description" content="xFlip Testnet | Secure Sybil Detection & IP Ban System" />
<meta property="og:title" content="xFlip Testnet Security" />
<meta property="og:description" content="Sybil Protection System with IP Ban Panel for Admins" />
<meta property="og:type" content="website" />
<meta property="og:image" content="https://timeness.github.io/xFlip/banner.png" />
<meta property="og:url" content="https://timeness.github.io/xFlip/" />
<title>xFlip Sybil Detection</title>
<link href="https://fonts.googleapis.com/css2?family=Fira+Code&display=swap" rel="stylesheet">
<script src="https://cdn.tailwindcss.com"></script>
<style>
body { font-family: 'Fira Code', monospace; }
</style>
</head>
<body class="bg-black text-white min-h-screen flex items-center justify-center p-6">
<div id="main" class="hidden text-center space-y-4">
<h1 class="text-4xl text-yellow-400 font-bold">xFlip Testnet</h1>
<p class="text-gray-300">Welcome to the Testnet platform. Your access is valid.</p>
</div>
<div id="banned" class="hidden text-center">
<h1 class="text-5xl text-red-500 font-bold">404</h1>
<p class="text-gray-400 mt-2">Access denied. You are blocked from this site.</p>
</div>
<script>
const adminPath = "/xFlip/c4eck";
const queryParams = new URLSearchParams(window.location.search);
const isAdmin = window.location.pathname === adminPath && queryParams.get("adminPass") === "basic";
async function getIP() {
try {
const res = await fetch("https://api64.ipify.org?format=json");
const data = await res.json();
return data.ip || "0.0.0.0";
} catch {
return "0.0.0.0";
}
}
function getBannedIPs() {
return JSON.parse(localStorage.getItem("xflipBanned") || "[]");
}
function banIP(ip) {
const banned = getBannedIPs();
if (!banned.includes(ip)) {
banned.push(ip);
localStorage.setItem("xflipBanned", JSON.stringify(banned));
alert("IP Banned: " + ip);
} else {
alert("IP is already banned.");
}
}
function unbanIP(ip) {
const banned = getBannedIPs().filter(item => item !== ip);
localStorage.setItem("xflipBanned", JSON.stringify(banned));
alert("IP Unbanned: " + ip);
}
async function initSite() {
const ip = await getIP();
const banned = getBannedIPs();
if (isAdmin) {
document.body.innerHTML = `
<div class="max-w-md w-full p-6 bg-[#1b1b1b] rounded-xl border border-yellow-500 text-white text-center">
<h2 class="text-xl font-bold mb-4 text-yellow-300">Admin Panel</h2>
<p class="mb-3">Your IP: <span class="text-green-400">${ip}</span></p>
<button onclick="banIP('${ip}')" class="bg-red-600 hover:bg-red-700 px-4 py-2 rounded mb-2">Ban This IP</button><br/>
<button onclick="unbanIP('${ip}')" class="bg-green-600 hover:bg-green-700 px-4 py-2 rounded">Unban This IP</button>
<p class="mt-4 text-xs text-gray-400">Changes apply on refresh.</p>
</div>`;
} else {
if (banned.includes(ip)) {
document.getElementById("banned").classList.remove("hidden");
} else {
document.getElementById("main").classList.remove("hidden");
}
}
}
initSite();
</script>
</body>
</html>