13
\$\begingroup\$

Inspired by this challenge, which got closed. This is meant to be an easier, but no less interesting version of that.

This is the robbers thread of a challenge. For the cops thread, see here.

Cops will provide a program/function and a flag. Robbers will guess a password. When the password is given to the cop's program, the flag should be outputted.

Robber rules

  • When the cop's program is given the password you guess, it should output the flag.
  • Your password does not have to be the same as the cop's password.
  • You are allowed to take advantage of ambiguous descriptions of the flag by cops.

Cop answers will be safe if they haven't been cracked for two weeks.

Example

Cop:

Scala, 4 bytes

x=>x

Flag: Yay, you cracked it! (an object of type String is returned from the lambda above)

Try it online!

Robber:

Password: the string "Yay, you cracked it!"

Try it online!

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Chat for robbers to discuss answers. \$\endgroup\$ – user Oct 22 '20 at 18:40

36 Answers 36

1
2
2
\$\begingroup\$

Dorian, dotcomma

[49375, -1]

Of course, the cryptic response in the comments turned out to mean "no, it's not a string". I think it's a big problem with the answer if "it would become too easy" if you told me what IO format I must use.

I noticed that the code seems to ignore all the input except for the first number until it finds a negative number. Then I noticed that it subtracts something from 49375. I don't know how does the code work, though.

Try it online!

\$\endgroup\$
1
  • \$\begingroup\$ Good job. The intended solution is only the number 49375. I had the idea to use the decimal value of 0xC0DE, but somehow messed things up and ended one number to high. I will write a detailed solution when I'm back from my vacation next Monday. \$\endgroup\$ – Dorian Nov 2 '20 at 8:29
2
\$\begingroup\$

Python 3.7, ovs's answer

@print
@int.__invert__
@len
@ascii
@ascii
@ascii
@ascii
@ascii
@ascii
@ascii
@ascii
@ascii
@ascii
@str.lstrip
@min
@ascii
class a:
 pass

Try it online!

I used a brute force program to find the solution, although in the end it ends up being quite nice: Try it online!

Initially I found one with __sizeof__, but it doesn't work on TIO (being implementation-specific).

I had to made quite a few tweaks for it to fork (disable open and id, as the former will read from stdin with list(open(1)) or something similar)

It's also possible to get import inspect and quite a few other modules, but I didn't consider that possibility.

In retrospect, repr would work as well, but ascii comes before repr in my generator program.

\$\endgroup\$
2
1
\$\begingroup\$

pxeger, Python 3.8

Password:

  • A = eval
  • B = print("the_flag")

Try it online!

Output: the_flag

\$\endgroup\$
2
  • \$\begingroup\$ Nice! I was thinking about using the thing where print is considered the same as print in other Unicode letters \$\endgroup\$ – user Oct 22 '20 at 20:42
  • \$\begingroup\$ This was not my intended solution and I realised it as I was sleeping! But well done! \$\endgroup\$ – pxeger Oct 23 '20 at 5:38
1
\$\begingroup\$

JavaScript (SpiderMonkey), cracks Aryan Beezadhur's answer

Password: fine

Try it online!

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Nice! How about trying to crack my second vault? I tried to make this one a tad harder :) \$\endgroup\$ – Aryan Beezadhur Oct 23 '20 at 18:43
1
\$\begingroup\$

Python 3, ovs

[x for x in ().__class__.__base__.__subclasses__() if x.__name__ == "Quitter"][0]("a",True)()

Try it online!

\$\endgroup\$
1
\$\begingroup\$

SuperPizz, BrainF***

Password: ej`aH

Try it online!

Python script used

\$\endgroup\$
1
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.