当前位置:网站首页>[NCTF2019]Fake XML cookbook
[NCTF2019]Fake XML cookbook
2022-04-22 02:53:00 【pakho_C】
web第44题
[NCTF2019]Fake XML cookbook
打开靶场:

一个登录页面,使用burp抓包

可以看到类型是xml
第一次接触XXE漏洞,参考:浅谈XML实体注入漏洞
讲的非常详细
XXE漏洞全称XML External Entity Injection即xml外部实体注入漏洞,XXE漏洞发生在应用程序解析XML输入时,没有禁止外部实体的加载,导致可加载恶意外部文件,造成文件读取、命令执行、内网端口扫描、攻击内网网站、发起dos攻击等危害。xxe漏洞触发的点往往是可以上传xml文件的位置,没有对上传的xml文件进行过滤,导致可上传恶意xml文件。
根据抓包信息,页面以POST的方式传输了XML数据,此时我们可以添加一个恶意外部实体,在原本的XML数据里进行引用,以此达到攻击的目的
定义外部实体:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE a [
<!ENTITY admin SYSTEM "file:///etc/passwd">
]>
其中a 表示此文档是a类型的文档
ENTITY中的内容表示声明了一个名为admin的外部实体(含SYSTEM就是外部实体),实体内容为读取/etc/passwd信息
定义实体后,在已经存在的< username>标签中可以进行调用,使用&admin;即可

其中file://是本地文件传输协议,,基本的格式如下:file:///文件路径,比如要打开F盘flash文件夹中的1.swf文件,那么可以在资源管理器或IE地址栏中键入:file:///f:/flash/1.swf并回车
一般flag文件在根目录下,所以直接使用:file:///flag即可

版权声明
本文为[pakho_C]所创,转载请带上原文链接,感谢
https://blog.csdn.net/pakho_C/article/details/124244469
边栏推荐
- Flutter03 dart asynchronous
- Improvement of ref and struct in C 11
- Why does MySQL index use B + tree instead of jump table?
- 牛客网C语言入门刷题记录
- 金融信息安全實訓——22/4/19(上)
- How does ECS connect to ad domain or LDAP user source
- kerberos认证协议
- 824. Goat Latin (string segmentation + string substitution)
- DOS 命令行基本命令及实践
- Stackoverflow:IActionContextAccessor Is Null
猜你喜欢
随机推荐
Flutter03 dart asynchronous
水洞的类型
824. Goat Latin (string segmentation + string substitution)
Inline temporary variables for code refactoring
Problem brushing plan -- dynamic programming (I)
C language character classification and conversion
Word input formula shortcut key
C语言字符分类与转换
[※ leetcode sword finger offer 13. Motion range of robot (simple)]
Another perspective on the meta universe: the meta universe culture is quietly changing the world
Complete solution of closure operation in Discrete Mathematics
Buy a Tencent cloud server to play
Leetcode answer notes (I)
Development management · Huawei IPD
[※ leetcode refers to the path in offer 12. Matrix (simple)]
What does defi need to become mainstream?
Day12 job
Evolution and construction of data warehouse architecture
How to restrict the unity of code
循环链表的创建及可控输出









