Apache2 Ubuntu-XXE漏洞渗透
Apache2 Ubuntu Default Page 是一个包含xxe漏洞的页面,如何找到和利用xxe漏洞,并找到flag呢?
第一步:先打开其网页
当安装好虚拟机环境后,打开虚拟机我们并不知道它linux的账号密码

因为我们用的net模式,我们可以在本机通过ip来访问他的网站,但我们不知道他分配是哪个ip

只知道他在192.168.30.1-192.168.255之间,然后御剑2014端口扫描去扫描IP,发现IP为192.168.30.128是有响应。

然后我们网页访问IP下web

翻译一下:发现Apache2的网站目录配置

第二步:扫描目录
我们首先要知道该网站下有哪些页面,然后在其中找有XXE的漏洞
所以首先通过御剑目录扫描来扫描目录,index.html就是网站首页,也就是上面的页面

打开robots.txt看看有什么东西,看见有/xxe目录,还有给admin.php

我们试一下xxe发现发现一个新网页,是/xxe/index.php

在xxe/admin.php发现一个页面

在index.php随便输入点东西发现回显点

步骤三:抓包

我们构造xxe语句将&xxe;指向/etc/passwd文件,看是否有回显

可看到显示文件内容,说明存在xxe漏洞,那么继续查看首页文件
apache首页文件默认路径时/var/www/html/

发现错误,然后我们用php协议查看php文件

复制解码

发现没有可用的
然后看admin.php

解码后,发现用户名密码,用户名:administhebest,密码是加密过的

这串数字是md5加密,所以md5解密发现密码是admin@123

在admin.php登录:


发现没有,有点崩溃!!

然后发现出现了另一个php文件,存在即合理。那就看看这个php文件到底在哪里,然后发现再xxe里

右键查看源代码

然后32位解码再64位解码


再次抓包
<!DOCTYPE root [
<!ENTITY xxe SYSTEM "file:///etc/.flag.php"> ]>

放到php文件运行

然后发现答案
