Skip to content

Commit

Permalink
kernelCTF: PR GHA: explicitly confirm hash match
Browse files Browse the repository at this point in the history
  • Loading branch information
koczkatamas committed Sep 14, 2023
1 parent daf2ac1 commit a07ddd0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernelctf/check-submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ def parseCsv(csvContent):

if exploitHash != calculated:
error(f"Expected `{archiveFn}` with SHA256 hash of `{exploitHash}`, but the file's checksum is `{calculated}`.")
else:
print(f"[+] The hash of the file `{archiveFn}` matches the expected `{exploitHash}` value.")

flags.extend(publicData["Flags"].strip().split('\n'))

Expand All @@ -201,7 +203,7 @@ def parseCsv(csvContent):

flagTargets = set([checkRegex(flag, r"kernelCTF\{v1:([^:]+):\d+\}", f"The flag (`{flag}`) is invalid").group(1) for flag in flags])
if "mitigation-6.1-v2" in flagTargets:
flagTargets = flagTargets - set(["mitigation-6.1-v2"]) | set(["mitigation-6.1"])
flagTargets = flagTargets - {"mitigation-6.1-v2"} | {"mitigation-6.1"}
print(f"[-] Got flags for the following targets: {', '.join(flagTargets)}")
checkList(flagTargets, lambda t: t in exploitFolders, f"Missing exploit for target(s)")
checkList(exploitFolders, lambda t: t in flagTargets, f"Found extra exploit(s) without flag submission", True)
Expand Down

0 comments on commit a07ddd0

Please sign in to comment.