forked from njitacm/jerseyctf-2022-challenges
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
42 lines (39 loc) · 1009 Bytes
/
index.php
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
<?php
define("USERNAME", "Wolverine");
define("PASSWORD", "lightswitchon_and_offLOL26");
define("FLAG", "jctf{c0NGR@T2_y0U_p@22wORd_SPR@y3D!}");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login</title>
</head>
<body>
<h1>Login</h1>
<form action="" method="post">
<label>Username
<input type="text" name="username">
</label>
<br>
<label>Password
<input type="password" name="password">
</label>
<br>
<input type="submit" value="Login" name="submit">
</form>
<a href="forgot_password.php">Forgot Password?</a>
<?php
if (isset($_POST["submit"])) {
if ($_POST["username"] === USERNAME && $_POST["password"] === PASSWORD) { ?>
<script>
alert("<?php echo FLAG ?>");
</script>
<?php } else { ?>
<script>
alert("Invalid login");
</script>
<?php }
} ?>
</body>
</html>