Page 1 of 1

How to inject JavaScript to auto-login to a web site.

Posted: Wed Nov 04, 2026 1:19 pm
by Scott
You can use the PWB version 3.2/4.0 ability to inject JavaScript into a web page by setting up a JavaScript filter to detect the URL, and inject JavaScript code to fill in the user name and password and click the submit button.

Test web site:
https://beta.team2s.com/inject/

[Files]
JavaScriptFilterFile=signinfilter.txt

[Security]
CheckJavaScriptAccess=True
signinjavascript.txt
(229 Bytes) Not downloaded yet
signinfilter.txt
(61 Bytes) Downloaded 1 time

Code: Select all

-all
+^https://beta.team2s.com/inject    signinjavascript.txt

Code: Select all

function setFormValuesAndLogin() { 
  document.getElementById("username").value = "support";
  document.getElementById("password").value = "TestMe";
  document.querySelector(".btn-submit").click();
} setFormValuesAndLogin();
--Scott