HACKTHEON SEJONG 2025
Last weekend to be specific (26 April 2025), I’m joining the ‘2025 HackTheon Sejong’ International University Students’ Cyber Security Competition https://hacktheon.org/eng/info.php. My team name as “RE:UN10N Jr.”. It was really tough an totallyu differnet compare to last year challenge. We manage to secure 20th. Thanks to my teammate for carrying. (benkyou, Capang, hikki).
Frontdoor 1
Challenge Information
Category: Web
Difficulty: Easy
Objective: Exploit web vulnerabilities to retrieve the flag.
Tag: LFI
Flag: FLAG{Me7Hod_Ch4iN1nG_1s_5o_COoo0Oo00oO0ol}
Overview
The challenge provides source code along with a docker-compose.yaml file. Within this YAML configuration, user credentials are exposed, which can be used to log in via the /api/signin endpoint. After successful authentication, the flag is accessible at the /api/flag endpoint, using the same session.
However, while credentials are included in the provided files, the live challenge server uses different credentials. Thus, the real goal of the challenge is to leak the credentials from the server’s runtime environment.
Observed API Functionalities
The following functionalities were observed:
/api
GET
get_root_handler
Retrieves basic API information or a welcome message.
/api/health-check
GET
get_health_check_handler
Health check endpoint to verify server uptime and status.
/api/logs
GET
get_logs_handler
Fetch server logs. Supports level query parameter to control verbosity (e.g., error, warn, info, debug).
/api/monitor/{info}
GET
get_monitor_handler
Reads specified system files (like /proc/stat, /proc/meminfo, etc.) based on info argument.
/api/signin
POST
post_signin_handler
Allows users to authenticate with username and password.
/api/flag
GET
get_flag_handler (protected by middleware)
Retrieves the challenge flag after successful authentication.
Initial Analysis
In the provided Rust source code monitor.rs, we find that the endpoint /api/monitor/{info} handles requests for different types of system monitoring information.
The alias function maps specific keywords to files inside /proc/:
alias function maps specific keywords to files inside /proc/:File Path Validation
Bypass Trick:
Using /proc/self/... works because /proc/self is a special symlink pointing to the current process's /proc/[pid], satisfying the PID check indirectly.
This allows reading files like environ without knowing the real PID.:
Logging vulnerability
If
infois not recognized, it logs the fullinfoand the filecontentatwarnlevel.
Full Exploitation Flow:
Read environment variables:
The environment file contents are logged as a warning.
Fetch leaked logs:
Extract leaked credentials from the environment variables.
Authenticate
/api/signinand retrieve the flag from/api/flag.
Full Script.

Frontdoor 2
Challenge Information
Category: Web
Difficulty: Easy
Objective: Exploit web vulnerabilities to retrieve the flag.
Tag: LFI
Challenge Overview
This challenge builds directly on the techniques from Frontdoor 1. However, this time:
There is no
/api/flagendpoint.A new RPC system is introduced via the
/api/rpcendpoint.The objective is to read the flag file on the server via the RPC system after logging in.
Step-by-Step Solution
1. Credential Leak via /proc/self/environ
/proc/self/environThe first step remains identical to Frontdoor 1:
Trigger a log injection using:
Fetch the leaked logs:
Extract the credentials from the leaked environment variables.
Credentials used:
(Same as Frontdoor 1 credentials — e.g., s3cre7Guest1:G#3stAcc3ss!25)
2. Login to the Application
Using the leaked credentials:
Login via:
A session is established upon successful login.
3. Interacting with /api/rpc
/api/rpcThe /api/rpc endpoint allows remote method invocation.
It is controlled by the rpc.rs server-side code, specifically the append_session_dir() function.
Key Analysis of rpc.rs:
rpc.rs:What this does:
If the method is
close,read,write, orexit, no path modification is done.Otherwise, it forces any file path passed into an absolute path under the user's session directory (stored under
session.get::<PathBuf>("dir")).It rejects symbolic links and non-absolute paths.
✅ So, if we stick to method = read, we can avoid path modification!
4. Final Exploitation - Reading the Flag
Since read is one of the allowed methods without directory patching, we can directly request the flag file.
Assuming the flag file is something standard like /flag, or otherwise known, we craft the RPC call:
POST /api/rpc
/api/rpcResult:
If successful, the server reads
/flagand returns its content — the flag.
Full Exploitation Summary:
Trigger an environment variable leak via
/api/monitor/self%2fenviron.Fetch and read leaked logs via
/api/logs?level=warn.Extract credentials and login at
/api/signin.Use
/api/rpcwith thereadmethod and target/flagto retrieve the flag.
Script
Last updated