Description
Solve the Rockstar program to find the flag.
Setup
Download the Rockstar program file.
wget <url>/1_wanna_b3_a_r0ck5tarSolution
Want to try it yourself first?
The guided walkthrough reveals hints one step at a time.
Step 1Understand the Rockstar programming language
ObservationThe file reads like song lyrics: poetic variable names and natural-language operators such as 'Put', 'Build', and 'Knock'. The title spells Rockstar in leet. This is valid source in the Rockstar esoteric language, which needs its own interpreter.The 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.bashgit clone https://github.com/RockstarLang/rockstarbashnpm --prefix rockstar/satriani installbashnode rockstar/satriani/rockstar 1_wanna_b3_a_r0ck5tarExpected output
66 79 78 74 79 86 73
What didn't work first
Tried: Open the file in a text editor and try to run it as a Bash or Python script, assuming the song-lyric formatting is obfuscated shell or Python code.
Bash and Python reject nearly every line, because Rockstar keywords like 'Put', 'Build', and 'Knock' mean nothing to them. The file is valid Rockstar and valid in no mainstream language. Identify the esolang from its poetic variable names and word-count number encoding, then use a real Rockstar interpreter.
Tried: Install the Rockstar npm package globally with 'npm install -g rockstar' instead of cloning the satriani interpreter from the RockstarLang/rockstar repository.
The npm package called 'rockstar' is an unrelated placeholder, not a language interpreter, so running it gives an error or nothing at all. The real interpreter is satriani from the official RockstarLang/rockstar repo, installed with 'npm --prefix rockstar/satriani install' and run via 'node rockstar/satriani/rockstar'.
Learn more
Rockstar is a language where numeric literals are encoded by the lengths of words in a phrase: each word contributes one digit equal to its letter count mod 10, read left to right. For example, 'my world' encodes the digits 2 then 5, giving the number 25. The language supports variables, arithmetic, conditionals, loops, and I/O - all through rock lyrics syntax.
The official Rockstar interpreter (satriani) can be installed by cloning the RockstarLang/rockstar repository and running
npm installin the satriani subdirectory. Alternatively, the online interpreter atcodewithrockstar.com/onlineruns programs in the browser.Step 2Analyze the program logic
ObservationThe interpreter prints a run of decimal numbers (66, 79, 78, 74, 79, 86, 73) rather than a flag, so those are ASCII values waiting to be decoded. Reading the source for its input prompts and print statements shows what the program expects.If 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' = digits 3 then 5 = 35. Each word contributes its letter count modulo 10 as one digit of the number, read left-to-right.
Step 3Run and read the flag
ObservationThe program reads input and gates its output behind conditionals. The seven ASCII values printed (66, 79, 78, 74, 79, 86, 73) spell B, O, N, J, O, V, I. So supply the right inputs to trigger the output, then convert the codes back to text.Execute the Rockstar program. When prompted for input, enter10for the first prompt and170for the second. The program then prints decimal ASCII values (66 79 78 74 79 86 73) which spell out BONJOVI, giving the flag.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.
Interactive tools
- Base64 & Base32 DecoderDecode Base64 and Base32 strings with auto-detection. Multi-layer mode unwraps nested encodings automatically.
- Recipe ChainStack decoders into a pipeline: Base64, hex, ROT, XOR, Morse, URL, Atbash, Vigenère, and more. Magic mode auto-discovers the chain. Bookmark the URL to save it.
- Number Base ConverterConvert numbers between binary, octal, decimal, and hexadecimal instantly. Enter any value and see all four bases update in real time.
Flag
Reveal flag
picoCTF{BONJOVI}
Run the Rockstar source file through a Rockstar interpreter to get the flag output.