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