-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.php
37 lines (33 loc) · 864 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
<?php
if( (isset($_GET["name"]) && !empty($_GET["name"])) || (isset($_GET["pass"]) && !empty($_GET["pass"])))
{
$name = $_GET["name"];
$pass = $_GET["pass"];
if ((($name == "root" || $name == "ROOT") && $pass == "password") || (($name == "ishaq" || $name == "ISHAQ") && $pass == "pass")) {
ob_start();
$url = "./cpanel.php?name=".$name."&pass=".$pass;
header('Location: '.$url);
ob_end_flush();
die();
}
else
{
echo "Username or password you entered is incorrect";
}
exit();
}
?>
<html>
<body>
<center>
<h1>Race Condition Demo</h1>
<br>
<br>
<form action = "<?php $_PHP_SELF ?>" method = "GET">
Username: <input type = "text" name = "name" />
Password: <input type = "password" name = "pass" />
<input type = "submit" />
</form>
</center>
</body>
</html>