Advertisement
Guest User

Untitled

a guest
Dec 30th, 2016
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. <?php
  2. session_start(); $username = $password = $userError = $passError = '';
  3. if(isset($_POST['sub'])){
  4. $username = $_POST['username']; $password = $_POST['password'];
  5. if($username === 'admin' && $password === 'password'){
  6. $_SESSION['login'] = true; header('LOCATION:wherever.php'); die();
  7. }
  8. if($username !== 'admin' || $password !== 'pass') echo "Invalid";
  9. else echo "Valid";
  10.  
  11. }
  12. echo "<!DOCTYPE html>
  13. <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
  14. <head>
  15. <meta http-equiv='content-type' content='text/html;charset=utf-8' />
  16. <title>Login</title>
  17. <style type='text.css'>
  18. @import common.css;
  19. </style>
  20. </head>
  21. <body>
  22. <form name='input' action='{$_SERVER['PHP_SELF']}' method='post'>
  23. <label for='username'></label><input type='text' value='$username' id='username' name='username' />
  24. <div class='error'>$userError</div>
  25. <label for='password'></label><input type='password' value='$password' id='password' name='password' />
  26. <div class='error'>$passError</div>
  27. <input type='submit' value='Submit' name='sub' />
  28. </form>
  29. <script type='text/javascript' src='common.js'></script>
  30. </body>
  31. </html>";
  32. ?>
  33.  
  34. curl --data "username=admin&password=pass&sub=Submit" http://altervista.mypagegoeshere.org/index.php -o /root/Desktop/out.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement