更新 src/index.php

This commit is contained in:
jiangsir 2024-09-11 16:51:44 +08:00
parent 66c69d6038
commit 7351d2d897

View File

@ -1,24 +1,22 @@
<html>
<body>
<head>
<meta charset="UTF-8">
<title>管理员登录入口</title>
</head>
<p>管理员登录入口</p>
<form method="POST" action="">
Username: <input type="text" name="username"> <br>
Password: <input type="password" name="password"> <br>
<button type="submit">Submit</button>
</form>
<!-- /source.txt -->
<head>
<meta charset="UTF-8">
<title>登录</title>
</head>
<p>这里是管理员登录入口</p>
<form method="POST" action="">
Username: <input type="text" name="username"> <br>
Password: <input type="password" name="password"> <br>
<button type="submit">Submit</button>
</form>
<!-- /source.txt -->
</body>
</html <?php
</html
<?php
$flag = "FLAGFLAGFLAG";
$flag = "flag{G_du93ksy639_sjd}";
$secret = "sGucne9iD0"; // 10 characters long
if(!isset($_POST["username"]) || !isset($_POST["password"])){
@ -36,13 +34,12 @@ if (!empty($_COOKIE["check"])) {
die ("The flag is ". $flag);
}
else {
die ("NoNoNo");
die ("Wrong Cookies. Get out!");
}
}
else {
die ("you are not admin");
die ("Admins only");
}
}
setcookie("ahash", md5($secret . urldecode("admin" . "admin")), time() + (60 * 60 * 24 * 7));
#f7fa8882c893a3f48f3cecdaa2f52102
setcookie("ahash", md5($secret . urldecode("admin" . "admin")), time() + (60 * 60 * 24 * 7));