WebGoat XXE 4 7

PVXs
3 min readSep 29, 2020

WebGoat XXE 4

WebGoat XXE lesson 4

This lesson is the first test in understanding XXE, so let’s start by inputting some text and submit the comment

A wild comment appears

The comment appears as expected, let’s see what shows up in Burp

Comment submit on Burp

The comment is in the request as expected, and of course it is not the solution of the lesson

What it’s needed is a XML entity requesting the / directory of the filesystem, something like the following code

<?xml version="1.0"?>
<!DOCTYPE another [
<!ENTITY fs SYSTEM "file:///">
]>
<comment>
<text>
yea
&fs;
</text>
</comment>
Burp Repeater with added XXE injection

By adding the DOCTYPE (as of the previous lessons in WebGoat XXE), a new ENTITY pointing to the filesystem root and by subsequently referencing to it, the lesson is completed

Comment with root directory listing

After reloading the lesson page, the newly added comment has the “yea” text plus a listing of the filesystem / directory

WebGoat XXE 7

WebGoat XXE lesson 7

Same exercise as XXE 4, but this time the webapp is using a “modern REST framework”, let’s input a comment

Another wild comment appears

The comment pops up as before

Comment request on Burp History

This time the POST request data is JSON, and the response says clearly that in order to get an XXE injection the request must be XML

WebGoat hints on this lesson helps a lot, it suggest to check the request “Content-Type” header

Comment request on Burp Repeater

So by sending the request to Burp Repeater, changing “Content-Type” to “application/xml” and putting the same XML data as of the previous exercise the lesson is completed

Comment with root directory listing

And the new comment shows once again the content of the / directory on the system

This concludes WebGoat XXE 4 7

I hope you liked it.

PVXs — https://twitter.com/pivixih

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

PVXs
PVXs

No responses yet

Write a response