javascript - Login form is protected against userscripts? -
here login form site rutracker.org:
<form id="top-login-form" action="http://login.rutracker.org/forum/login.php" method="post" style="display: inline;"> <input id="top-login-uname" type="text" placeholder="имя" accesskey="l" tabindex="1" name="login_username"> <input id="top-login-pwd" type="password" placeholder="пароль" tabindex="2" name="login_password"> <input id="top-login-btn" type="submit" tabindex="3" value="вход" name="login"> </form>
here greasemonkey script autologin:
// ==userscript== // @include http://rutracker.org/* // @grant none // ==/userscript== var f = document.getelementbyid("top-login-form"); f.elements.nameditem("login_username").value = "xxxxxx"; f.elements.nameditem("login_password").value = "yyyyyyy"; f.elements.nameditem("login").value = "%e2%f5%ee%e4"; f.submit();
the problem 2 values sent, post request login_username=xxxxxxx&login_password=yyyyyyy
insread of login_username=xxxxxxx&login_password=yyyyyyy&login=%e2%f5%ee%e4
so login=%e2%f5%ee%e4
missing.
is kind of protection against userjs?
how can solve problem?
login
not field, it's button. don't fill - click it. no need submit
- implied click.
f.elements.nameditem("login").click()
Comments
Post a Comment