Iris CTF 2023 - baby?socat
Info
22 Solves (2.1% of users)
478 Points (500 Points)
description
love sockets and cats and socat and ls
Socat version on remote is 1.7.4.1nc socat.chal.irisc.tf 10000
By: sera
The biggest clue to solving this problem is the SOCAT VERSION for intended solution.
for player
1 | . |
Analysis
Mitigation
X
Source Code
1 |
|
The socat
is set up execute a chal
binary with the parameters ls
then the input
.
1 |
|
The source code of chal binary is just sets the FLAG
env empty.
Vulnerability & Solve 1 (intended)
It would be good to refer to the public writeup for this part. For reference, the change log in the public writeup can be found at the pkgsrc.se/net/socat.
Finally, The setenv("FLAG", "NO!", 1)
is to help prevent any unintended solutions. It retains environment variable only during execution. It would be like I can print env with ls
, but I can’t. I concentrated this part but it was a waste of time. I haven’t been able to solve this challenge.
Solve 2 (unintended)
Looking at the Discord, there were many people who solved the challenge in this way. (I think it would be okay to use this solution for later. whenever..)
1 | socat [options] <address> <address> |
As for the solution, here it is: !!system:env
The system
is type of socat address. If you use !!
, two single addresses specifications can be combined to form a dual type address for one bytestream.
1 | SYSTEM:<shell-command> |
You can find another type of socat address.: