HackThisSite - Basic Mission 5
Challenge
Sam has gotten wise to all the people who wrote their own forms to get the password. Rather than actually learn the password, he decided to make his email program a little more secure.
Sam 发现很多人自己写表单来获取密码。他没有去真正学密码,而是让邮件程序变得更安全了一些。
Solution
这题和 Basic 4 基本一样,只是增加了 Referer
验证。服务端会检查请求来源是否来自 /missions/basic/5/
页面本身。
解决方法完全相同——修改隐藏的 to
字段,但必须同时发送正确的 Referer:
1 | $ curl -sL -b 'HackThisSite=YOUR_COOKIE' \ |
-e 参数设置 Referer header。如果不带 Referer 或 Referer
不匹配,会返回 Invalid Referer 错误。
核心知识点:Referer header 同样可以被伪造。它不是安全机制,不能用来防止跨站请求。唯一可靠的防御是服务端独立验证权限。
92bf24e2