pablopc

Hydra bruteforce index lab

Sep 17th, 2026 (edited)
45
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.66 KB | Cybersecurity | 0 0
  1. <?php
  2. $message = "";
  3. $message_class = "";
  4.  
  5. // Credenciales correctas de prueba
  6. $correct_user = "admin";
  7. $correct_pass = "secret123";
  8.  
  9. if ($_SERVER["REQUEST_METHOD"] == "POST") {
  10.     $username = $_POST['username'] ?? '';
  11.     $password = $_POST['password'] ?? '';
  12.  
  13.     if ($username === $correct_user && $password === $correct_pass) {
  14.         $message = "login: [" . htmlspecialchars($username) . "] password: [" . htmlspecialchars($password) . "] found";
  15.         $message_class = "success";
  16.     } else {
  17.         $message = "Invalid username or password";
  18.         $message_class = "error";
  19.     }
  20. }
  21. ?>
  22. <!DOCTYPE html>
  23. <html lang="es">
  24. <head>
  25.     <meta charset="UTF-8">
  26.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  27.     <title>Login Test Portal</title>
  28.     <link rel="stylesheet" href="style.css">
  29. </head>
  30. <body>
  31.     <div class="login-container">
  32.         <h2>Sistema de Autenticación</h2>
  33.         <form method="POST" action="">
  34.             <div class="input-group">
  35.                 <label for="username">Usuario:</label>
  36.                 <input type="text" id="username" name="username" required autocomplete="off">
  37.             </div>
  38.             <div class="input-group">
  39.                 <label for="password">Contraseña:</label>
  40.                 <input type="password" id="password" name="password" required>
  41.             </div>
  42.             <button type="submit">Iniciar Sesión</button>
  43.         </form>
  44.  
  45.         <?php if (!empty($message)): ?>
  46.             <div class="result-message <?php echo $message_class; ?>">
  47.                 <?php echo $message; ?>
  48.             </div>
  49.         <?php endif; ?>
  50.     </div>
  51. </body>
  52. </html>
  53.  
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment