Description
Solve the Rockstar program to find the flag.
Setup
Download the Rockstar program file.
wget <url>/1_wanna_b3_a_r0ck5tarSolution
Walk me through it- Step 1Understand the Rockstar programming languageThe provided file is written in Rockstar, an esoteric programming language designed to look like rock ballad song lyrics. Variable names are poetic phrases and operations use words like 'Put', 'Let', 'Build', 'Knock'. Run it with a Rockstar interpreter.bash
npm install -g rockstarbashrockstar 1_wanna_b3_a_r0ck5tarLearn more
Rockstar is a language where numeric literals are encoded by the lengths of words in a phrase. For example, 'my world' encodes 2 + 5 = 25 (counting letters). The language supports variables, arithmetic, conditionals, loops, and I/O - all through rock lyrics syntax.
The official Rockstar interpreter can be installed via npm. Alternatively, the online interpreter at
codewithrockstar.com/onlineruns programs in the browser. - Step 2Analyze the program logicIf the interpreter output does not give the flag directly, read through the Rockstar code manually. Look for print/output statements and trace the values being output. The flag may require providing specific input.
Learn more
Key Rockstar syntax:
Say X/Shout X= print X.Put X into Y= assignment.Build X up= increment.Knock X down= decrement.While X is Y= while loop.If X is Y= conditional.Number encoding: 'Nothing' = 0, 'the stars' = 3 + 5 = 8. Each word contributes its letter count modulo 10 to the digits of the number, right-to-left.
- Step 3Run and read the flagExecute the Rockstar program. The flag will be printed as the output, or you may need to enter the correct input when prompted.
Learn more
Esoteric programming languages (esolangs) like Rockstar, Brainfuck, Piet, and Whitespace are used in CTF challenges to test code-reading skills. The challenge is not the algorithm complexity but understanding an unfamiliar syntax. Reading the language specification is usually faster than trying to guess the behavior.
Flag
picoCTF{...}
Run the Rockstar source file through a Rockstar interpreter to get the flag output.