DownUnder CTF 2025 Write-up
Before Everything
In this competition, I played with Team QnQSec.
cert:
Reverse
zeus
First, I looked at the main function:
1 | int __fastcall main(int argc, const char **argv, const char **envp) |
As we can see:
1 | v6 = 0xC1F1027392A3409LL; //8 bytes |
Then I examined the xor function to see how it works:
1 | unsigned __int64 __fastcall xor(__int64 a1, __int64 a2) |
And we can see:
1 | if ( i >= 0x33 ) |
It repeats 51 times.
1 | *(_BYTE *)(a1 + i) ^= *(_BYTE *)(i % 0xD + a2); |
It uses a key to XOR:
1 | data[i] ^= key[i % 13] |
Where key = "Maimaktes1337"
Final exploit:
1 | #!/usr/bin/env python3 |
Pwn
corporate-cliche
First, we can examine the code:
1 |
|
We can see that the open_admin_session
function contains /bin/sh
:
1 | void open_admin_session() { |
Seeing gets(password);
in the main function, we know we can achieve a buffer overflow. We need to reach the open_admin_session
function, but there’s an interesting part: when we input the username, we can’t input "admin".
As we can see, this code performs strcmp
twice:
1 | if (strcmp(password, logins[i][1]) == 0) { |
So we need to use the password buffer overflow to overwrite the username to "admin" so we can access the open_admin_session
function.
Exploit:
1 | from pwn import * |
After all
A fun competition