Combreal

autoFillPHPForm.ps1

Feb 7th, 2022 (edited)
1,158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #######index.php
  2. #<html>
  3. #<body>
  4. #
  5. #<form action="welcome.php" method="post">
  6. #Name: <input type="text" name="name"><br>
  7. #E-mail: <input type="text" name="email"><br>
  8. #<input type="submit" name="button">
  9. #</form>
  10. #
  11. #</body>
  12. #</html>
  13.  
  14. ########welcome.php
  15. #<html>
  16. #<body>
  17. #
  18. #Welcome <?php echo $_POST["name"]; ?><br>
  19. #Your email address is: <?php echo $_POST["email"]; ?>
  20. #
  21. #</body>
  22. #</html>
  23.  
  24. #The auto filling script - Must be run with Administrator rights
  25. If($ie) { Remove-Variable ie }
  26. $ie = New-Object -Com InternetExplorer.Application
  27. $ie.Visible = $true
  28. $ie.Navigate("http://localhost/fillform/index.php")
  29. Start-Sleep -m 300
  30. while ($ie.ReadyState -ne 4) {Start-Sleep -m 100}; #$ie.ReadyState -ne 4 #$ie.IsBusy
  31. $form = $ie.document.forms[0]
  32. $inputs = $form.GetElementsByTagName("input")
  33. ($inputs | where {$_.Name -eq "name"}).Value = "Michelet"
  34. ($inputs | where {$_.Name -eq "email"}).Value = "amichzel@lol.com"
  35. Start-Sleep -Second 1
  36. ($inputs | where {$_.Name -eq "button"}).Click()
Add Comment
Please, Sign In to add comment