-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
91 lines (79 loc) · 2.71 KB
/
Copy pathindex.html
File metadata and controls
91 lines (79 loc) · 2.71 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
<!DOCTYPE html>
<html>
<head>
<title>Web Flag Hunt Challenge</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
.container {
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
text-align: center;
}
.flag-box {
margin: 20px 0;
}
.result {
margin-top: 20px;
font-weight: bold;
}
input[type="text"] {
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}
button {
background-color: #007BFF;
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="container">
<h1>Welcome to the Web Flag Hunt Challenge!</h1>
<p>You've stumbled upon a mysterious website, and there's a hidden flag somewhere within the site's content.</p>
<div class="flag-box">
<p>Can you find the hidden flag and submit it as your answer?</p>
<input type="text" id="flagInput" placeholder="Enter the flag">
<button onclick="checkFlag()">Submit</button>
</div>
<div id="flagResult" class="result"></div>
</div>
<script>
function checkFlag() {
// Get the entered flag
var enteredFlag = document.getElementById("flagInput").value;
// Define the correct flag
var correctFlag = "Flag{Web_Hunt_Fl@g}";
// Remove any leading/trailing spaces from the entered flag
enteredFlag = enteredFlag.trim();
// Check if the entered flag matches the correct flag
if (enteredFlag === correctFlag) {
document.getElementById("flagResult").innerHTML = "Congratulations! You've found the correct flag.";
document.getElementById("flagResult").style.color = "green";
document.getElementById("flagInput").style.display = "none";
document.querySelector("button").style.display = "none";
} else {
document.getElementById("flagResult").innerHTML = "Oops, the flag is incorrect. Keep searching!";
document.getElementById("flagResult").style.color = "red";
}
}
</script>
</body>
</html>