
上QQ阅读APP看本书,新人免费读10天
设备和账号都新为新人
题目1 留言板
题目概况
留言板是XSS漏洞的第一高发位置。下面给出一道非常简单的XSS题目(来自QUALS CTF)。让我们从发现线索开始。
信息收集
假设你是一名警察,正在调查一个贩卖违禁物品的网站,你需要想办法获得这个网站的管理员的线索。
首先,简单浏览网站的页面,如图1-13所示。
我们从标题栏上面的功能看起。单击“About”选项,除了网站介绍,什么都没有,如图1-14所示。

图1-13

图1-14
接下来,看看第二个功能“Products”。界面上展示了网站销售的所有物品。单击进入其中一个物品的界面,也只有填写电子邮箱和购买数量的功能。看看网站的URL,感觉可能存在一个伪静态注入点,如图1-15所示。暂且不管,看看最后一个功能。

图1-15
如图1-16所示,这是一个在线给管理员留言的界面,明确告知访问者:管理员会阅读并且回复你的信息。

图1-16
攻击测试
一般看到留言板,就应该想到可能存在XSS。我们来尝试一下。
打开https://requestb.in/,新建一个RequestBin,将生成的地址插入留言,代码如下,如图1-17和图1-18所示。


图1-17

图1-18
成功获得了管理员的Cookie。如图1-19所示,利用Burp Suite或浏览器插件修改当前Cookie为管理员的Cookie,登录管理员账号,找到相关信息。

图1-19