DiceCTF @ HOPE Writeups
Web
flag-viewer
Challenge Description
We got a the following webpage and two files app.py
,server.py
The most important part in the source code inapp.py
is the following
1 |
|
So basically if the username we enter is admin
we should get the flag . Really! that’s so easy , let’s try. Oh turned out it is not that easy smh
If we type another username we get the following message
1 | Only the "admin" user can see the flag! |
It is time to try something else then . Let’s open Burp Suite, send a request and then see what happens behind the scenes
In this case it is sending a post request with the parameter being user
which contains the username we entered.
If you notice there is a redirection to another page let’s click that
We got redirected to another page which has a GET parameter message
containing the message we saw before
1 | /?message=Only+the+%22admin%22+user+can+see+the+flag! |
Solution
If we go back to the previous request and change the username to admin
from there would that work ? let’s try
Boom that worked , you can see the flag and the redirection to the page containing our flag. If we follow it we get what we came for 😀
Flag : hope{oops_client_side_validation_again}
inspect-me
Challenge Description
1 | Just your average sanity check! |
We got this webpage
seems like it is a password checker. Let’s try to inspect the page
Oh! we got this message
Then what about the page source . Looks like we can read it but some people said they couldn’t even right click to view the source code ( is that something related to the chrome version ? idk ). Anyways , when we read through the page source we notice this code right here
1 | <script>(() => { |
And what we are interested in is this line right here
1 | const target = 'ubcr{pyvrag_fvqr_pyvpur}'; |
looks like it is a flag but it is rotated somehow. I threw it to CyberChef then tried rot13
and it worked!
Now if we submit it in the password field and hit check we get the Correct!
message
Flag : hope{client_side_cliche}
Reversing
Slices
Slices.py
1 | flag = input('Enter flag: ') |
I did it by hand lol
Solution
1 | # test : hope{ABCDEFGHIJKLMNOPQRSTUVWXYZ} |
Flag : hope{i_l0ve_pyth0n_slic3s_a_l0t}
Sequence
We got a binary and a server to connect to when getting things work locally.
I opened the binary in IDA and noticed this function called checker
, it is the function that checks for our input if it is correct then the flag will be printed
our input should be in this format %d %d %d %d %d %d
so we need to find 6 numbers that are the solutions for this challenge
Solution
What we are interested in is this code right here
1 | return 0LL; |
We have the value of v2[0]
which is 12
so we can get the rest of the 5 values from v2[1]
to v2[5]
. I did this manually though
We have the general equation
1 | v2[i] != (3 * v2[i - 1] + 7) % 16 |
If we want to calculate the value of v2[1]
it will be
1 | v2[1] != (3 * v2[0] + 7) % 16 |
and so on , until we get all the values.
1 | i = 1 |
So our final sequence is
1 | 12 11 8 15 4 3 |
Let’s try it in the remote server. It worked!
Flag : hope{definitely_solvable_with_angr}
Misc
orphan
Challenge Description
1 | nothing to see here |
We got a zip file that when we extract we get the following files
There is a .git
folder and a foo.txt
file
Usually when I work with .git
folders I always use this tool https://github.com/internetwache/GitTools to extract the commits from the .git
directory. For this challenge we gonna use the Extractor.sh
script
I made a folder called extract to save the extracted files there
And right away we got a flag.txt
file which contains our flag
Flag : hope{ba9f11ecc3497d9993b933fdc2bd61e5
Crypto
obp
Challenge Description
1 | The unbreakable One Byte Pad |
encrypt.py
1 | import random |
output.txt
1 | babda2b7a9bcbda68db38dbebda68dbdb48db9b7aba18dbfb6a2aaa7a3beb1a2bfb7b5a3a7afd8 |
This is a typical XOR challenge
Solve.py
1 | #!/usr/bin/env python3 |
Flag : hope{not_a_lot_of_keys_mdpxuqlcpmegqu}