Functionnal chall
This commit is contained in:
56
webroot/index.php
Normal file
56
webroot/index.php
Normal file
@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Authentication 2.0</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<link href="https://fonts.googleapis.com/css?family=Bitter" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="box">
|
||||
|
||||
<?php if ($_SERVER['REQUEST_METHOD'] != 'POST') { ?>
|
||||
|
||||
<div class="code red">
|
||||
<h1><?php echo $_SERVER['REQUEST_METHOD']; ?></h1>
|
||||
</div>
|
||||
<div class="sub grey">
|
||||
<h2>Send your username for authentication.</h2>
|
||||
</div>
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
<div class="code green">
|
||||
<h1>POST</h1>
|
||||
</div>
|
||||
|
||||
<?php if (!isset($_POST['username'])) { ?>
|
||||
|
||||
<div class="sub red">
|
||||
<h2>What is your username?</h2>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
$username = htmlspecialchars($_POST['username']);
|
||||
|
||||
if ($username === 'admin') {
|
||||
?>
|
||||
|
||||
<div class="sub">
|
||||
<h2 class="blue">Hello admin</h2>
|
||||
<h3 class="grey">IMTLD{Y0u_H4v3_t0_st4rT_s0m3Wh3r3}</h3>
|
||||
</div>
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
<div class="sub">
|
||||
<h2 class="blue">Hello <?php echo $username; ?></h2>
|
||||
<h3 class="red">You don't have the permission to see anything.</h3>
|
||||
</div>
|
||||
|
||||
<?php }}} ?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user