Contents

๐ŸŽฏ Rust Fixme 1

A detailed write-up of the Misc challenge 'Rust Fixme 1' from PicoCTF - 2025

/images/PicoCTF-2025/Misc/RustFixme1/challenge_presentation.png
Challenge Presentation

๐Ÿ“Š 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, not ret, so I simply changed ret to return;. For the last comment, I just added the decrypted_buffer variable in the println 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

Flag

picoCTF{4r3_y0u_4_ru$t4c30n_n0w?}

Proof of Execution

/images/PicoCTF-2025/Misc/RustFixme1/manual_flag.png
Automated Flag
Screenshot of successful exploitation

๐Ÿ”ง 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: *