# php源码审计之cookies欺骗

**URL:** <https://forum.90sec.com/t/topic/3236>\
**Category:** 代码审计\
**Created:** [2012 年2 月 20 日 04:40 UTC](https://forum.90sec.com/t/topic/3236 "2012-02-20T04:40:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

作者： ![geek](https://forum.90sec.com/letter_avatar_proxy/v4/letter/g/ed8c4c/32.png) [@geek](https://forum.90sec.com/u/geek)\
发布日期： [2012 年2 月 20 日 04:40 UTC](https://forum.90sec.com/t/topic/3236/1 "2012-02-20T04:40:54Z")

</div>

_本帖最后由 alex 于 2012-2-20 12:48 编辑_

ebycms是一套手机音乐cms系统  
直接上代码  
admin目录下的in.php代码\<?php require\_once('L:/wamp/www//fern.php');  
Annotation("L:\wamp\www\eby\admin\in.php\_0");

define(EBY\_IN,TRUE);  
define('ADMIN\_ROOT', str\_replace("\","/",dirname( **FILE** ))."/");  
define('EBY\_ROOT',dirname(ADMIN\_ROOT).'/');

```php
require_once (EBY_ROOT.'control/init.php');
$AdminCookies = $_COOKIE['admin']['name'];
if ($AdminCookies==''){
	exit(showmsg('账号或密码错误',2,'index.php'));
}
?>判断$AdminCookies是否为空 若不为空就登陆成 $AdminCookies的值来源cookies admin[name]的值

```

修改cookies绕过验证  
[11.jpg](https://forum.90sec.com/discuz-migration/attachments/95c6b779f0f07a9aa34ee4f1630d9aff5fa59f086caaea044faabcf7b47d1501)  
然后访问admin/main.php直接登陆  
[22.jpg](https://forum.90sec.com/discuz-migration/attachments/5505fbf6f315b3ef264d4087d9a3a2d269b1d1c9007f520e0bca48d6e24a1bbf)

---

<div class="post-metadata">

作者： ![geek](https://forum.90sec.com/letter_avatar_proxy/v4/letter/g/ed8c4c/32.png) [@geek](https://forum.90sec.com/u/geek)\
发布日期： [2012 年2 月 20 日 04:42 UTC](https://forum.90sec.com/t/topic/3236/2 "2012-02-20T04:42:51Z")

</div>

不知道为什么 我发的代码 发布的时候会少了一部分 反正也不是关键代码

---

<div class="post-metadata">

作者： ![wugui](https://forum.90sec.com/user_avatar/forum.90sec.com/wugui/32/11351_2.png) [@wugui](https://forum.90sec.com/u/wugui)\
发布日期： [2012 年2 月 20 日 06:55 UTC](https://forum.90sec.com/t/topic/3236/3 "2012-02-20T06:55:39Z")

</div>

{:4\_86:}你的头像太狰狞

---

<div class="post-metadata">

作者： ![user16](https://forum.90sec.com/user_avatar/forum.90sec.com/user16/32/11346_2.png) [@user16](https://forum.90sec.com/u/user16)\
发布日期： [2012 年2 月 22 日 02:52 UTC](https://forum.90sec.com/t/topic/3236/4 "2012-02-22T02:52:16Z")

</div>

楼上的咪咪真大啊 {:4\_69:}

---

<div class="post-metadata">

作者： ![effort5](https://forum.90sec.com/letter_avatar_proxy/v4/letter/e/c67d28/32.png) [@effort5](https://forum.90sec.com/u/effort5)\
发布日期： [2012 年3 月 23 日 04:13 UTC](https://forum.90sec.com/t/topic/3236/5 "2012-03-23T04:13:55Z")

</div>

估计是过滤了的啦。
