msemple1111 / kahoot-hack

A suite of tools for easily manipulating the kahoot.it quiz platform
GNU General Public License v3.0
65 stars 27 forks source link

New challenge #6

Closed unixpickle closed 7 years ago

unixpickle commented 7 years ago

I assume that Kahoot's latest challenge has broken this program (although I have not tested it). The new challenge is a bunch of JavaScript code, which can't be run with Python's eval().

Here is an example of a new challenge:

decode('mj1Zc77uYC6jYJ3lMUJu0STyiXuGgYmKtO34SSq2y3ztInEbvKvmcFKql4PqczIcMVnc3KtaVW8F32A8hvsURq7z0TVUqEZLNYHN'); function decode(message) {return _.replace(message, /./g, function(char, position) {return String.fromCharCode((((char.charCodeAt(0) * position) + 12) % 77) + 48)});}
Egoscio-zz commented 7 years ago

Extract the string and evaluate it with this function I made with my limited Python experience.

def decode(message):
    flist = []
    for position, char in enumerate(list(message)):
        flist.append(chr((((ord(char) * position) + 12) % 77) + 48))
    return "".join(flist)

print(decode("mj1Zc77uYC6jYJ3lMUJu0STyiXuGgYmKtO34SSq2y3ztInEbvKvmcFKql4PqczIcMVnc3KtaVW8F32A8hvsURq7z0TVUqEZLNYHN"))

Merry Christmas! Ho ho ho 🎅

Edit: Is the decode function constant? In other words, do the numerical values or operations change per request? (12, 77, 48).

unixpickle commented 7 years ago

The first parameter can change, but the other two do not appear to change. Still, anything goes with these challenges; they may easily change in the future, although it's much more likely that the code will just change drastically in general.

Egoscio-zz commented 7 years ago

Well, if all else fails, PyExecJS is an option. I'm personally interested in making my own Node port when I get the time, as Python isn't my bread & butter.

unixpickle commented 7 years ago

@Egoscio right, at this point Kahoot has basically made Node the best option. That's why my kahoot-hack invokes a Node web application to solve the challenges.

msemple1111 commented 7 years ago

fixed efcc636, using the safeval.pw service to evaluate it.