๐ฏ Rust Fixme 1
A detailed write-up of the Misc challenge 'Rust Fixme 1' from PicoCTF - 2025
๐ Challenge Overview
Category Details Additional Info ๐ Event PicoCTF - 2025 Event Link ๐ฐ Category Misc ๐ฏ ๐ Points 10 Out of 500 total โญ Difficulty ๐ข Easy Personal Rating: 0/10 ๐ค Author syreal Profile ๐ฎ Solves (At the time of flag submission) 3.261 solve rate ๐ Date 15-03-2025 PicoCTF - 2025 ๐ฆพ Solved By mH4ck3r0n3 Team:
๐ Challenge Information
Play this short game to get familiar with terminal applications and some of the most important rules in scope for picoCTF. Connect to the program with netcat: $ nc verbal-sleep.picoctf.net 55716
๐ฏ Challenge Files & Infrastructure
Provided Files
Files:
๐ Initial Analysis
First Steps
In this challenge, we are given an attached file
main.rs
. Itโs a Rust script that decrypts the flag but has some syntax errors that need to be fixed. The first thing that stands out, even without running the program, is that thereโs a missing;
at the end of the line:
1
let key = String::from("CSUCKS")
Aside from that, there are even some comments that serve as hints:
/ How do we return in rust?
,// How do we print out a variable in the println
. Letโs move on to the next phase.
๐ฏ Solution Path
Exploitation Steps
Exploitation
For the exploitation, I simply fixed the errors indicated by the comments. For the first one, I just added a
;
:
1
let key = String::from("CSUCKS");
For the second one, in Rust,
return
is used, notret
, so I simply changedret
toreturn;
. For the last comment, I just added thedecrypted_buffer
variable in theprintln
output:
1 2 3 4
println!( "Decrypted flag: {}", // Use {} to print the variable String::from_utf8_lossy(&decrypted_buffer) );
Then, I built and ran the program:
1 2
cargo build cargo run
Which printed the flag.
๐ ๏ธ Exploitation Process
Approach
The procedure has already been described, so Iโll just leave the final file here:
๐ฉ Flag Capture
FlagpicoCTF{4r3_y0u_4_ru$t4c30n_n0w?}
Proof of Execution
๐ง Tools Used
Tool Purpose Rust Exploit
๐ก Key Learnings
Time Optimization
- Learn Rust ^^'.
Skills Improved
- Binary Exploitation
- Reverse Engineering
- Web Exploitation
- Cryptography
- Forensics
- OSINT
- Miscellaneous
๐ References & Resources
[!info]+ Additional Information
Similar Challenges
Learning Resources
๐ Final Statistics
Metric | Value | Notes |
---|---|---|
Time to Solve | 00:01 | From start to flag |
Global Ranking (At the time of flag submission) | 1174/10517 | Challenge ranking |
Points Earned | 10 | Team contribution |
Created: 15-03-2025 โข Last Modified: 15-03-2025 *Author: mH4ck3r0n3 โข Team: *