|
42 | 42 | checkList(exploitFolders, lambda f: any(f.startswith(p) for p in validExploitFolderPrefixes),
|
43 | 43 | f"The submission folder name (`{subDirName}`) is not consistent with the exploits in the `{EXPLOIT_DIR}` folder. " +
|
44 | 44 | f"Based on the folder name (`{subDirName}`), the subfolders are expected to be prefixed with one of these: {', '.join(f'`{t}-`' for t in targets)}, " +
|
45 |
| - "but this is not true for the following entries: <LIST>. You can put the extra files into a folder prefixed with `extra-`, " + |
| 45 | + "but this is not true for the following entries: <LIST>. You can put the extra files into a folder prefixed with `extra-`, " + |
46 | 46 | "but try to make it clear what's the difference between this exploit and the others.")
|
47 | 47 |
|
48 | 48 | reqFilesPerExploit = ["Makefile", "exploit.c", "exploit"]
|
|
121 | 121 | if cve != publicData["CVE"]:
|
122 | 122 | error(f"The CVE on the public spreadsheet for submission `{submissionId}` is `{publicData['CVE']}` but the PR is for `{cve}`.")
|
123 | 123 |
|
124 |
| -flagTargets = set([checkRegex(flag, r"kernelCTF\{v1:([^:]+):\d+\}", f"The flag (`{flag}`) is invalid").group(1) for flag in flags]) |
| 124 | +flagRegex = r"kernelCTF\{(?:v1:([^:]+)|v2:([^:]+):([^:]*)):\d+\}" |
| 125 | +def flagTarget(flag): |
| 126 | + match = checkRegex(flag, flagRegex, f"The flag (`{flag}`) is invalid") |
| 127 | + if match.group(1): |
| 128 | + # v1 flag |
| 129 | + return match.group(1) |
| 130 | + |
| 131 | + # v2 flag |
| 132 | + return match.group(2) |
| 133 | + |
| 134 | +flagTargets = set([flagTarget(flag) for flag in flags]) |
125 | 135 | if "mitigation-6.1-v2" in flagTargets:
|
126 | 136 | flagTargets = flagTargets - {"mitigation-6.1-v2"} | {"mitigation-6.1"}
|
127 | 137 | print(f"[-] Got flags for the following targets: {', '.join(flagTargets)}")
|
@@ -153,4 +163,3 @@ def summary(success, text):
|
153 | 163 | ghSet("OUTPUT", f"artifact_backup_dir={'_'.join(submissionIds)}")
|
154 | 164 |
|
155 | 165 | summary(True, f"✅ The file structure verification of the PR was successful!")
|
156 |
| - |
|
0 commit comments