Exploitation
Test if parser replace text with internal entities:
<!DOCTYPE data [
<!ELEMENT data ANY >
<!ENTITY variable "Replaced">
]>
[put &variable; between the tags of some entity
in the application]XXE file read:
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd" >]>
[put &xxe; in request body aligned with the application login in order to reflect it]Interesting files:
XXE SSRF:
XXE can be Out out Band (Blind) which means it reaches given url but do not return any data that confirms the connection.
You can also run it through putting %xxe; before closing tags:
XXE SSRF via Parameter Entity:
XXE external DTD
Sample .dtd file hosted by an attackers http server:
Script does the following:
Saves //etc/passwd output to file variable
Defines eval parameter which contains dynamic declaration of exfiltrate parameter.
Exfiltrate parameter will be evaluated by sending HTTP requests to attacker's server with file contents.
Running eval turns on possibility of using exfiltrate entity.
Exfiltrate parameter sends the data to an attacker.
Sample payload:
injected to webapp
Last updated