lmammino / jwt-cracker

Simple HS256, HS384 & HS512 JWT token brute force cracker.

Home Page:https://lmammino.github.io/jwt-cracker/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SyntaxError: Unexpected token

Hax0rG1rl opened this issue · comments

Hi,

I ran into this issue testing this cracker with the default jwt token.

ubuntu:~/Desktop/api_testing/jwt-cracker$ jwt-cracker "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ" "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789" 6
/usr/local/lib/node_modules/jwt-cracker/index.js:49
const [header, payload, signature] = token.split('.');
      ^

SyntaxError: Unexpected token [
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3

System: uname -a
Linux ubuntu 4.8.0-56-generic #61-Ubuntu SMP Wed Jun 14 08:15:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
npm -v -> 3.5.2

node -v -> 4.2.6

Any ideas how to fix it?

Cheers.

Hello @Os3r3um,
Thanks for submitting this issue.

The code here is expected to be executed in node >= 6 (due to the adoption of some es2015 syntactic sugars).

Try with updating your version of node and feel free to reopen the issue if you still have similar problems.

Hi, Thanks. I got the point. Will try install node > 6 and give it a try. Thanks for your time looking into this. :)