浏览器从哪里获取这些 HTML 表单域?
Where is the browser getting these HTML form fields?
一个网站显示了一个登录表单,仅包含 "Username" 和 "Password"。按回车键或单击 "Login" 按钮登录。
HTML 表单(来自页面源)如下所示:
<form name="login" action="https://www.mywebsite.com/index.php?main_page=login&action=process" method="post" id="loginForm"><fieldset>
<legend>Please Log In</legend>
<label class="inputLabel" for="email-address">Email Address:</label>
<input type="text" name="email_address" size = "41" maxlength= "96" id="email-address" /><br class="clearBoth" />
<label class="inputLabel" for="login-password">Password:</label>
<input type="password" name="password" size = "41" maxlength = "40" id="login-password" /><br class="clearBoth" />
<input type="hidden" name="securityToken" value="0330682553ea36639f62317144927f3f" /><div class="buttonRow forward"><input type="image" src="includes/templates/lite_grey/buttons/english/login.gif" alt="Sign In" title=" Sign In " /></div>
<div class="buttonRow back important"><a href="https://www.mywebsite.com/index.php?main_page=password_forgotten">Forgot password</a> | <a href="index.php?main_page=activation_email&resend=1">Re-send activation email</a></div>
</fieldset>
</form>
该表单包含两个可见字段(email_address 和密码)和一个隐藏字段(securityToken)。
当我填写表单并在浏览器中按回车键时,浏览器生成一个 POST 请求,如下所示:
POSTDATA=email_address=my@emailaddress.org&password=mypass123&securityToken=0330682553ea36639f62317144927f3f&x=37&y=15
(我能够通过使用 Firefox 的 "Tamper data" 插件看到这个 post-数据。也通过 wireshark 确认)
注意浏览器发送的字段:email_address、密码、securityToken - 以及 HTML 代码中不存在的另外两个字段:x=37 和 y=15。我不知道这些值是从哪里来的。
此外,这些值 x 和 y 在我每次登录该网站时都会更改。
所有浏览器似乎都能很好地处理此登录表单(不仅仅是 Firefox)。 HTML 页面似乎没有混淆或任何东西..
这些值的来源或我如何找到的任何想法?
谢谢
编辑: 虽然我的回答 技术上 在某些情况下是可能的,cale_b 的回答是大约 100,000,000倍有可能。谢谢cale_b。
必须有一个 javascript 他们正在使用的框架来将 onSubmit 处理程序附加到表单,并在发送之前注入他们自己的字段。
打开 chrome 中的开发人员工具,然后在源代码中搜索 "onSubmit"、"post" 等。您很可能会找到罪魁祸首。
如果您无法那样找到它,请搜索“.preventDefault()”,但这可能会找到很多东西。
这些值(x 和 y 坐标)总是在您的表单提交为 type="image"
:
时发送
<input type="image" src="includes/templates/lite_grey/buttons/english/login.gif" alt="Sign In" title=" Sign In " />
看到这个答案:
一个网站显示了一个登录表单,仅包含 "Username" 和 "Password"。按回车键或单击 "Login" 按钮登录。
HTML 表单(来自页面源)如下所示:
<form name="login" action="https://www.mywebsite.com/index.php?main_page=login&action=process" method="post" id="loginForm"><fieldset>
<legend>Please Log In</legend>
<label class="inputLabel" for="email-address">Email Address:</label>
<input type="text" name="email_address" size = "41" maxlength= "96" id="email-address" /><br class="clearBoth" />
<label class="inputLabel" for="login-password">Password:</label>
<input type="password" name="password" size = "41" maxlength = "40" id="login-password" /><br class="clearBoth" />
<input type="hidden" name="securityToken" value="0330682553ea36639f62317144927f3f" /><div class="buttonRow forward"><input type="image" src="includes/templates/lite_grey/buttons/english/login.gif" alt="Sign In" title=" Sign In " /></div>
<div class="buttonRow back important"><a href="https://www.mywebsite.com/index.php?main_page=password_forgotten">Forgot password</a> | <a href="index.php?main_page=activation_email&resend=1">Re-send activation email</a></div>
</fieldset>
</form>
该表单包含两个可见字段(email_address 和密码)和一个隐藏字段(securityToken)。
当我填写表单并在浏览器中按回车键时,浏览器生成一个 POST 请求,如下所示:
POSTDATA=email_address=my@emailaddress.org&password=mypass123&securityToken=0330682553ea36639f62317144927f3f&x=37&y=15
(我能够通过使用 Firefox 的 "Tamper data" 插件看到这个 post-数据。也通过 wireshark 确认)
注意浏览器发送的字段:email_address、密码、securityToken - 以及 HTML 代码中不存在的另外两个字段:x=37 和 y=15。我不知道这些值是从哪里来的。
此外,这些值 x 和 y 在我每次登录该网站时都会更改。
所有浏览器似乎都能很好地处理此登录表单(不仅仅是 Firefox)。 HTML 页面似乎没有混淆或任何东西..
这些值的来源或我如何找到的任何想法?
谢谢
编辑: 虽然我的回答 技术上 在某些情况下是可能的,cale_b 的回答是大约 100,000,000倍有可能。谢谢cale_b。
必须有一个 javascript 他们正在使用的框架来将 onSubmit 处理程序附加到表单,并在发送之前注入他们自己的字段。
打开 chrome 中的开发人员工具,然后在源代码中搜索 "onSubmit"、"post" 等。您很可能会找到罪魁祸首。
如果您无法那样找到它,请搜索“.preventDefault()”,但这可能会找到很多东西。
这些值(x 和 y 坐标)总是在您的表单提交为 type="image"
:
<input type="image" src="includes/templates/lite_grey/buttons/english/login.gif" alt="Sign In" title=" Sign In " />
看到这个答案: