# sql 注入分析

**URL:** <https://forum.90sec.com/t/topic/2995>\
**Category:** 技术文章\
**Created:** [2011 年12 月 2 日 12:26 UTC](https://forum.90sec.com/t/topic/2995 "2011-12-02T12:26:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

作者： ![user40](https://forum.90sec.com/user_avatar/forum.90sec.com/user40/32/11393_2.png) [@user40](https://forum.90sec.com/u/user40)\
发布日期： [2011 年12 月 2 日 12:26 UTC](https://forum.90sec.com/t/topic/2995/1 "2011-12-02T12:26:36Z")

</div>

_本帖最后由 Green\_leaves 于 2012-6-15 19:11 编辑_

懒得网上去找源码了，冬天冷 ，懒得打字····打字不如打手暖和 哈哈 ！ 开始把

源码不找了，自己也懒得构造，直接写个注入的句子出来开个头，大家一起交流哈 ：$query="select \* from member where username=".$\_POST["username]".  
"'and password='".$\_POST["password"].''''';  
这个句子在吧帐号密码文本框的输入值与select 连接成一个语句 所以 可以查询 ，构成了注入 ：1：select \* from member where username ='xxx' and password='xxxx'

2：使用mysql\_query 函数提交这个语句 实现 暴力破解 哈哈·····xxx xxxx 自己猜账户密码 ，不过没多大实战价值

3：如果不检查$\_POST["username"]和$\_POST["password"]的值 ，那么可以构造sql 直接绕过：$query="select \* from member where username='".$\_POST["username"].''' and password='''.$\_POST["password"].'"“;  
如果要检查呢，自己用xxs 骗到cookie吧 ，吼吼 菜鸟 路过 ，纯属交流娱乐 ，勿喷，勿笑 ！重在参与和环境 ，吼吼 ！

---

<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)\
发布日期： [2011 年12 月 2 日 12:38 UTC](https://forum.90sec.com/t/topic/2995/2 "2011-12-02T12:38:20Z")

</div>

不错哦 有时间试下

---

<div class="post-metadata">

作者： ![user40](https://forum.90sec.com/user_avatar/forum.90sec.com/user40/32/11393_2.png) [@user40](https://forum.90sec.com/u/user40)\
发布日期： [2011 年12 月 2 日 12:38 UTC](https://forum.90sec.com/t/topic/2995/3 "2011-12-02T12:38:20Z")

</div>

{:4\_19:}求拜托新手上路，吼吼····

---

<div class="post-metadata">

作者： ![user40](https://forum.90sec.com/user_avatar/forum.90sec.com/user40/32/11393_2.png) [@user40](https://forum.90sec.com/u/user40)\
发布日期： [2011 年12 月 2 日 12:38 UTC](https://forum.90sec.com/t/topic/2995/4 "2011-12-02T12:38:53Z")

</div>

吼吼，终于看到基友了\*\*回复 [3#](http://www.90sec.org/redirect.php?goto=findpost&pid=7884&ptid=925) _淡然_ \*\*

---

<div class="post-metadata">

作者： ![user22](https://forum.90sec.com/user_avatar/forum.90sec.com/user22/32/11361_2.png) [@user22](https://forum.90sec.com/u/user22)\
发布日期： [2011 年12 月 2 日 16:24 UTC](https://forum.90sec.com/t/topic/2995/5 "2011-12-02T16:24:04Z")

</div>

现在很好看到这样的对比了，就算是一个语句也是用MD5进行对比。{:4\_100:}

---

<div class="post-metadata">

作者： ![user40](https://forum.90sec.com/user_avatar/forum.90sec.com/user40/32/11393_2.png) [@user40](https://forum.90sec.com/u/user40)\
发布日期： [2011 年12 月 3 日 02:06 UTC](https://forum.90sec.com/t/topic/2995/6 "2011-12-03T02:06:45Z")

</div>

\*\*回复 [5#](http://www.90sec.org/redirect.php?goto=findpost&pid=7975&ptid=925) _风之传说_ \*\*  
是的····呵呵··
