【发布时间】:2015-12-16 23:34:42
【问题描述】:
网站提供了一个登录表单,其中仅包含“用户名”和“密码”。按回车键或单击“登录”按钮即可登录。
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)。
当我填写表单并在浏览器中按 Enter 时,浏览器会生成一个如下所示的 POST 请求:
POSTDATA=email_address=my@emailaddress.org&password=mypass123&securityToken=0330682553ea36639f62317144927f3f&x=37&y=15
(通过使用 Firefox 的“篡改数据”插件,我能够看到此发布数据。也通过 wireshark 确认)
注意浏览器发送的字段:email_address、password、securityToken - 以及 HTML 代码中不存在的另外两个字段:x=37 和 y=15。我不知道这些值是从哪里来的。
此外,这些值 x 和 y 在我每次登录网站时都会发生变化。
所有浏览器似乎都能很好地处理这个登录表单(不仅仅是 Firefox)。 HTML页面似乎没有被混淆或任何东西..
这些值的来源或我如何找到的任何想法?
谢谢
【问题讨论】:
-
听起来像 Csrf:en.m.wikipedia.org/wiki/Cross-site_request_forgery,每次加载时在服务器端自动生成
-
这些字段不是服务器生成的,因为它们会在 HTML 源代码中。
-
同意@Tomalak。 POSTDATA 是我的浏览器发送的内容,因此是浏览器生成它们。我只是看不到 HTML 中的什么使它这样做...