Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Minemetero committed Nov 8, 2024
0 parents commit b809dac
Show file tree
Hide file tree
Showing 2 changed files with 244 additions and 0 deletions.
96 changes: 96 additions & 0 deletions CLocker.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Find the Secret Of Mr.C!</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
padding: 50px;
background-color: #f0f8ff;
}
.locker {
font-size: 100px;
margin: 30px 0;
}
.step {
margin: 20px 0;
padding: 20px;
border: 2px solid #000;
border-radius: 10px;
background-color: #fffbe6;
}
.hidden {
display: none;
}
.hint {
font-size: 18px;
margin-top: 20px;
color: green;
}
.input-section {
margin-top: 30px;
}
input[type="text"] {
padding: 10px;
font-size: 18px;
width: 200px;
}
button {
padding: 10px 20px;
font-size: 18px;
margin-left: 10px;
cursor: pointer;
}
</style>
</head>
<body>
<h1>Welcome to the Secret Locker Challenge!</h1>
<p>Your goal: Find the secret code hidden somewhere on this page to unlock the virtual locker!</p>
<div class="locker">🔒</div>
<p>The locker is locked! Can you find the code to unlock it?</p>

<div class="step">
<h2>Step 1: Investigate the page</h2>
<p>Right-click anywhere on this page and choose <strong>"Inspect"</strong>, or press <strong>F12</strong> to open Developer Tools. Use the <strong>Elements</strong> tab to investigate the code.</p>
</div>

<div class="step">
<h2>Step 2: Look for clues</h2>
<p>The code to unlock the locker is hidden within the HTML. Explore the page elements carefully. It might not be easy to spot, but if you look closely, you'll find parts of the code scattered around.</p>
</div>

<div class="step">
<h2>Step 3: Input the secret code</h2>
<p>Once you’ve found the code, enter it below to unlock the locker:</p>
<div class="input-section">
<input type="text" id="flagInput" placeholder="Enter the code">
<button onclick="checkFlag()">Submit</button>
</div>
</div>

<p class="hidden">The code is hidden in secret locations around the page. Keep searching!</p>

<footer>
<p>Good luck! Can you unlock the locker and find the hidden message?</p>
</footer>

<script>
function checkFlag() {
const enteredFlag = document.getElementById('flagInput').value.toUpperCase();
const correctFlag = 'OBVIOUSLY';

if (enteredFlag === correctFlag) {
document.querySelector('.locker').textContent = '🔓';
alert("Don't be happy to early. Mr.C's secret is always safe!");
// Redirect to the harder game
window.location.href = 'LockerAdvance.html';
} else {
alert("Flag is obviously!");
}
}
</script>
</body>
</html>
148 changes: 148 additions & 0 deletions LockerAdvance.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Unveil Mr.C's Ultimate Secret - Expert Mode!</title>
<style>
/* Hidden encoded message in CSS comment */
/* LyogUGFydDE6IEZMQUd7SV9BTV9fICov */

body {
font-family: Arial, sans-serif;
text-align: center;
padding: 50px;
background-color: #f0f8ff;
}

.locker {
font-size: 100px;
margin: 30px 0;
}

.step {
margin: 20px 0;
padding: 20px;
border: 2px solid #000;
border-radius: 10px;
background-color: #e6e6fa;
}

.input-section {
margin-top: 30px;
}

input[type="text"] {
padding: 10px;
font-size: 18px;
width: 300px;
}

button {
padding: 10px 20px;
font-size: 18px;
margin-left: 10px;
cursor: pointer;
}

.hidden {
display: none;
}
</style>
</head>
<body>
<h1>Welcome to the Ultimate Locker Challenge!</h1>
<p>This time, only the best can find the secret code. You’ll need to combine deep investigation, cryptography skills, and more!</p>
<div class="locker">🔒</div>
<p>The locker is locked again. Can you uncover Mr.C's ultimate secret flag?</p>

<div class="step">
<h2>Step 1: Investigate Deeply</h2>
<p>Clue: Part of the secret flag is hidden somewhere within the resources of this page. You might need to look beyond the HTML...</p>
</div>

<div class="step">
<h2>Step 2: Solve the Riddle</h2>
<p>Solve this to get the next part of the flag:</p>
<p>"I speak without a mouth and hear without ears. I have nobody, but I come alive with wind. What am I?"</p>
<div class="input-section">
<input type="text" id="riddleInput" placeholder="Enter your answer">
<button onclick="checkRiddleAnswer()">Submit</button>
</div>
<p id="riddleClue" class="hidden"></p> <!-- This will show the encoded clue after solving the riddle -->
</div>

<div class="step">
<h2>Step 3: Decode the Cipher</h2>
<p>To get the final part of the flag, decrypt this message encrypted with a Vigenère cipher:</p>
<p><code>GIEWIV GMTLIV HIQS</code></p>
<p>Hint: <code>VGhlIGtleSBpcyBhIGNvbW1vbiBncmVldGluZy4=</code></p> <!-- Encoded hint for the key -->
<div class="input-section">
<input type="text" id="cipherInput" placeholder="Enter the decrypted message">
<button onclick="checkCipherAnswer()">Submit</button>
</div>
<p id="cipherClue" class="hidden"></p> <!-- This will show the encoded final part after solving the cipher -->
</div>

<div class="step">
<h2>Step 4: Assemble the Flag!</h2>
<p>Now that you've collected all the parts, assemble them in the correct order to unlock the locker:</p>
<div class="input-section">
<input type="text" id="flagInput" placeholder="Enter the complete flag">
<button onclick="checkFlag()">Submit</button>
</div>
</div>

<footer>
<p>Best of luck! Only the truly skilled can unlock the locker.</p>
</footer>

<script>
// Function to hash the flag using SHA-256
async function hashFlag(message) {
const encoder = new TextEncoder();
const data = encoder.encode(message);
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
const hashArray = Array.from(new Uint8Array(hashBuffer));
return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
}

// Pre-hashed correct flag (hashed value of 'FLAG{ADVANCED_CHALLENGE_IS_FUN}')
const correctFlagHash = 'b1fc7cae5c24f2625866f490e53b17f4e4ddb30c33d6422ff650dce5a8345253';

async function checkFlag() {
const enteredFlag = document.getElementById('flagInput').value;
const hashedEnteredFlag = await hashFlag(enteredFlag);

if (hashedEnteredFlag === correctFlagHash) {
document.querySelector('.locker').textContent = '🔓';
alert("Congratulations! You've unlocked the locker. Mr.C's ultimate secret is: Knowledge is power!");
} else {
alert("Incorrect flag! Keep searching and assembling!");
}
}

function checkRiddleAnswer() {
const answer = document.getElementById('riddleInput').value.toLowerCase();
if (answer === 'echo') {
const riddleClueEncoded = 'UGFydCBvZiB0aGUgZmxhZyBpczogVEhFX09OTFlf'; // Encoded clue
document.getElementById('riddleClue').textContent = atob(riddleClueEncoded);
document.getElementById('riddleClue').classList.remove('hidden');
} else {
alert("Incorrect! Try again.");
}
}

function checkCipherAnswer() {
const answer = document.getElementById('cipherInput').value.toUpperCase();
const encodedCorrectAnswer = 'VEhFUkUgSVMgTk8gU0VDUkVU'; // Base64 encoded "THERE IS NO SECRET"
if (answer === atob(encodedCorrectAnswer)) {
const cipherClueEncoded = 'U0lOR0xFX0dFTklVUw=='; // Encoded final part
document.getElementById('cipherClue').textContent = atob(cipherClueEncoded);
document.getElementById('cipherClue').classList.remove('hidden');
} else {
alert("Incorrect! Try again.");
}
}
</script>
</body>
</html>

0 comments on commit b809dac

Please sign in to comment.