Guest User

Untitled

a guest
Sep 25th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. <?php
  2. if( (isset($_GET["name"]) && !empty($_GET["name"])) || (isset($_GET["pass"]) && !empty($_GET["pass"])))
  3. {
  4.     $name = $_GET["name"];
  5.     $pass = $_GET["pass"];
  6.     if ((($name == "root" || $name == "ROOT") && $pass == "password") || (($name == "ishaq" || $name == "ISHAQ") && $pass == "pass")) {
  7.         ob_start();
  8.         $url = "./cpanel.php?name=".$name."&pass=".$pass;
  9.         header('Location: '.$url);
  10.         ob_end_flush();
  11.         die();
  12.  
  13. }
  14.     else
  15.     {
  16.         echo "Username or password you entered is incorrect";
  17.     }
  18.     exit();
  19. }
  20. ?>
  21. <html>
  22. <body>
  23. <center>
  24.     <h1>Race Condition Demo</h1>
  25.     <br>
  26.  
  27.     <br>
  28. <form action = "<?php $_PHP_SELF ?>" method = "GET">
  29.     Username: <input type = "text" name = "name" />
  30.     Password: <input type = "password" name = "pass" />
  31.     <input type = "submit" />
  32. </form>
  33.  
  34.    
  35. </center>
  36. </body>
  37. </html>
Add Comment
Please, Sign In to add comment