# phpweb前台getshell

**URL:** <https://forum.90sec.com/t/topic/679>\
**Category:** 代码审计\
**Created:** [2020 年1 月 5 日 13:43 UTC](https://forum.90sec.com/t/topic/679 "2020-01-05T13:43:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

作者： ![mochazz](https://forum.90sec.com/user_avatar/forum.90sec.com/mochazz/32/2270_2.png) [@mochazz](https://forum.90sec.com/u/mochazz)\
发布日期： [2020 年1 月 5 日 13:43 UTC](https://forum.90sec.com/t/topic/679/1 "2020-01-05T13:43:29Z")

</div>

本文仅是对 [phpweb前台getshell](https://forum.90sec.com/t/topic/387) 的一些补充，因为还是有很多人看完原文后，不知道怎么利用。测试环境：WindowsXP+PHPnow1.6.5+phpwebV2.0.35

 ![1](https://forum.90sec.com/uploads/default/original/2X/6/6fa2bf1c173463d2d431a6a6e1052ee624461461.jpeg)

在 **base/appplus.php** 文件中，我们发现一处未过滤的文件上传。但是要利用这处任意文件上传，我们得先绕过第15行的密钥校验。

 ![2](https://forum.90sec.com/uploads/default/original/2X/8/87f893cf06042e32f52d583f9f3ea41ca7e5f728.png)

全局搜索下 **md5(strrev($dbUser.$dbPass))** ，看看有没办法将这个值 **leak** 出来。这里共搜出4处，而 **base/post.php** 文件中的代码明显和其他不一样，我们看其具体代码。

 ![3](https://forum.90sec.com/uploads/default/original/2X/c/c93869eb7fa04ec0123e304569b25e37175b17a6.png)

我们在 **base/post.php** 文件中，发现当 **$act="appcode"** 时，程序就会将 **md5(strrev($dbUser.$dbPass))** 输出，而 **$act** 完全可控。

 ![4](https://forum.90sec.com/uploads/default/original/2X/8/85705392da69459b60cd94f1802f3ff871526aa8.png)

那么利用方式就很明显了。先通过 **base/post.php** 文件获取 **md5(strrev($dbUser.$dbPass))** ，然后再通过 **base/appplus.php** 文件上传任意文件即可。这里具体 **EXP** 就不给出来了，会的自然会。

 ![5](https://forum.90sec.com/uploads/default/original/2X/c/c55d793a161cace77be020b92039288d25b5ec1b.png)

---

<div class="post-metadata">

作者： ![893982955](https://forum.90sec.com/letter_avatar_proxy/v4/letter/8/57b2e6/32.png) [@893982955](https://forum.90sec.com/u/893982955)\
发布日期： [2020 年11 月 12 日 23:43 UTC](https://forum.90sec.com/t/topic/679/3 "2020-11-12T23:43:26Z")

</div>

上传提示ERROR:上传文件错误，文件大小和原文件不匹配 是啥情况

---

<div class="post-metadata">

作者： ![chrales](https://forum.90sec.com/user_avatar/forum.90sec.com/chrales/32/3657_2.png) [@chrales](https://forum.90sec.com/u/chrales)\
发布日期： [2021 年6 月 15 日 05:18 UTC](https://forum.90sec.com/t/topic/679/4 "2021-06-15T05:18:44Z")

</div>

你看一下你发的包那个大小是多少 改成一样的就行了
