Siunam's Website

My personal website

Home About Blog Writeups Projects E-Portfolio

Background

background

As usual, start the instance and connect to it via netcat!

Question

question

Hmm… It’s said the shell will run this Javascript if we type something.

console.log(%d == (%d + 1));

Looks like it’s comparing an output.

%d in Javascript means an Integer, so we need to type an integer, otherwise it won’t accept our input.

That Javascript will always return False boolean.(Boolean means True and False, True = 1, False = 0)

Example:

d = 1 // Set d is 1

console.log(d == (d + 1)); // 1 is not equal to 2 (1 + 1)

false // Output:

But, what if we want it to return True? It’s possible? Then, I started to google Javascript maximum integer, as I remember one YouTube video was talking about the Year 2038 problem.(32-bit systems time formatting bug)

solution1

And google returns 9007199254740991!!

What I’m thinking is that what if I type an integer that exceed that maximum integer? Will it returns True? Now, let’s test my theory in Node.js.

solution2

Looks like 9007199254740991 is not working, as it doesn’t exceed the maximum integer yet. How about I add 1 to that maximum integer 9007199254740992? Will it returns True?

solution3

Wow!! My theory is correct! It returns true! Let’s throw that integer to the instance.

solution4

Yes! We’ve successfully esacpe that false boolean!

Now, the challenge said:

“The correct answer is the smallest positive integer value.”

Let’s copy and paste 9007199254740992 to CyberChef with the MD5 recipe and submit the flag!

solution5

flag