Improve Repl Identity

I’m always happy to get bothered for valid reasons like this!

3 Likes

(to anyone looking at that typing repl to confirm the results, I have deleted the 249wpm fake runs but they did work)

3 Likes

Just to make sure I understand, the steps to repro this are:

  1. Run someone’s console program that uses Repl Identity
  2. While it’s running, hit CTRL-C to terminate the program
  3. Now that you’re at the terminal, you can run arbitrary code. In this case, you’re running a program that calls the API, authenticating using Repl Identity. That allows you to authenticate as the user in the identity but control the payloads being sent.

Is that correct?

4 Likes

yes, this is correct

2 Likes

@mattiselin Yes you just have to stop the repl and then run something like

subprocess.check_output([os.environ["REPLIT_CLI"], "identity", "create", "-audience=<their repl id>"]).decode('utf-8').strip()

and copy the token it outputs. For python at least, I haven’t tried with other languages but you can probably just run the identity command directly.

Once you have their identity token you can make requests to their API with the token and the API will believe it’s coming from a certain repl, letting you change whatever data the API will let you.

2 Likes

I’ve tested this, and while I can generate a token, I, for some reason, cannot use the token from another repl. Pherhaps it’s because of anti-forwarding using CORS origin or something, I am not sure, but I remember noticing that they mentioned there are anti-forwarding measures

1 Like

Are you making sure to decode and strip the token? It lets me use it from another repl

2 Likes

mmm, I use the function I have, I don’t know for sure XD

1 Like

My Example:

Client: https://replit.com/@InvisibleOne/Token-Hack-Example-Client#main.py
Server: https://replit.com/@InvisibleOne/Token-Hack-Example-Server#main.py
“Hack”: https://replit.com/@InvisibleOne/LiveUncomfortableProperty#main.py

I can confirm that from an alt account, I can run the code to generate an Identity token, then paste that token into my “hack” script and my API doesn’t know the difference.

2 Likes

I used this code to test

2 Likes

That should output the token correctly. I’m not sure why you can’t use that token in another repl.

2 Likes

oh ok, I did output it :stuck_out_tongue:, just wrongly I guess

Yeah by default it will print out with a \n attached to it, you have to remove that for it to be valid :stuck_out_tongue_winking_eye:

2 Likes

oh dang it lol XD, man I gotta watch out for that

1 Like

Hey Invis, I ended up finding what was wrong: I submitted the wrong data (that is to say, I submitted it in the incorrect format xx.xxaccuracy instead of 0.xxxx accuracy)

2 Likes

lmho (laughing my hat off idont cuss) nice job for hacking bigminiboss :smiley:

2 Likes

thanks, yeah… trying tog et them to fix, don’t know if it’s still working. I can check

2 Likes

would appreciate a vote XD

2 Likes

oh, I forgot about that :D.

2 Likes

@CodingCactus @InvisibleOne @sonicx180 It works now!

1 Like