Skip to content

Instantly share code, notes, and snippets.

@bhubr
Last active May 23, 2022 09:09
Show Gist options
  • Save bhubr/e81f8c07ff969f18cb9b3a5fa083bab2 to your computer and use it in GitHub Desktop.
Save bhubr/e81f8c07ff969f18cb9b3a5fa083bab2 to your computer and use it in GitHub Desktop.
Sujet algo brute-force JWT

JWT Crack

Precision : si vous faites un console.log du resultat, cela peut prendre longtemps.

Vous aurez surement interet a ecrire ce resultat dans un fichier. Pour cela, vous pouvez utiliser fs.writeFileSync de la bibliotheque standard de Node.js (convertir votre tableau de sortie en JSON car writeFileSync permet d'ecrire des strings, pas n'importe quel objet...)

const characters = [
  'a',
  'b',
  'c',
  // ...
  'z'
]

function generateKeys(chars: string[], length: number): string[] {

}

const allKeys = generateKeys(characters, 4);
console.log(allKeys);

/*
 Resultat
 [
   "a","b","c",..."z",
   "aa","ab,...,"az",..."zz",
   "aaa",...,"zzz",
   "aaaa",...,"zzzz"
 ]
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment