Note: The default ITS GitLab runner is a shared resource and is subject to slowdowns during heavy usage.
You can run your own GitLab runner that is dedicated just to your group if you need to avoid processing delays.

Commit 3b2ea7cd authored by Keanu Lee's avatar Keanu Lee 💬
Browse files

Merge branch 'master' into 'master'


See merge request wolvsec/umichctf-hwf2020!1
parents 80bf5f93 ec170295
# Make challenge
# Create a flag file, then a file of random bytes of the same length
flag="umichctf{"$(openssl rand -base64 32)"}"
echo $flag > flag.txt
filesize=$(wc -c < flag.txt)
openssl rand -out src-file_rand.bin $filesize
# Do a hex dump of the random file, a hex dump of the flag file (in reverse)
# and combine into one file
xxd -p -c1 src-file_rand.bin > tmp1
xxd -p -c1 flag.txt | rev > tmp2
paste -d "\n" tmp1 tmp2 > tmp3
# Base64 it for upload as a challenge
xxd -r -p tmp3 | base64 > challenge.txt
# Clean up
rm tmp1 tmp2 tmp3 src-file_rand.bin
# Check solution
base64 --decode challenge.txt > challenge-txt.bin
xxd -p -c 2 challenge-txt.bin | cut -b 3-4 | rev | xxd -r -p > solution.txt
rm challenge-txt.bin
if ! cmp -s "flag.txt" "solution.txt"; then
echo "Something went wrong - the flag file and solution do not match!"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment