Post

Challenge 10:ShadowFetch

This is a detailed writeup created for challenges associated with the Certified Web AppSecurity Expert (CWAE) certification.

Challenge 10:ShadowFetch

Challenge/Task

  1. ShadowFetch

Proof-of-Concept (POC):

There is a function that allows you to upload images through inserting any URLs

POC-otb POC-otb

Once you send the URLs to the server, the server will try to download the images and upload them to the S3 bucket. It will renamed the file with encoded filename with png extension.

POC-otb

I try to validate the link that the server provided, it eventually download back the image from the link that I put earlier.

POC-otb

What if I put malicious link that will download the malicious file from my server? Yes, it is also downloaded the file.

POC-otb

Since it allows any URL to input here, we will try to use file:///. The file:/// URI scheme is used to reference files on the local system. At first attempt I try to locate sshd_config. The server then downloads the sshd_config. It gave me the S3 bucket URL.

POC-otb

I downloaded the image with PNG extension format.

POC-otb

Using cat command, I can read the file contains all the sshd_config.

POC-otb

Using the same method, I want to view the users listed inside the server using /etc/passwd payload.

POC-otb

Now, I can know all the users listed inside the server.

POC-otb

This post is licensed under CC BY 4.0 by the author.