Forum Discussion

struc's avatar
struc
Icon for Bronze I rankBronze I
23 days ago

Pwntools: Ep. 2 Token

I've completed the coding for the lab, but the system seems to think the token I am entering is wrong. I've tried resetting the machine in case it is out of sync since a new token is generated each time the code is run, but that didn't fix it. Can someone help?

2 Replies

  • Hi struc​ 

    I've just completed the lab, so should hopefully be able to point you in the right direction.

    Upon successfully completing and running the script are you seeing the message? 

    Congratulations! Your token is: XXXXXX

    If not then your script is not doing as it should. The initial value returned by the tube (Example from my current lab below) 

    b'icnrcszygc\r\n'

    This is not the token in reverse

    Without knowing exactly your issue I'll give a few hints to point in the right direction

    1. Make sure you utf-8 decode AND strip new line chars from the response from the tube before reversing it
    2. Make sure that you then encode this reversed value before sending the line back down the tube
    3. Make sure that you read all the data that the tube returns

    I found it was helpful to print the current state of my 'output' variable at each stage of the processing.

    I hope this helps!

  • Actually, there's no need for utf-8 decoding and encoding, not for the string and not for the output.