Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SECCON 2018 Online CTF Special Device File
#!/usr/bin/env python
def main():
key = [
"fbde15b0",
"ae2cc59b",
"27529ad0",
"432a8be5",
"271687b2",
"1875063d",
"4b21c371",
"d8c77cb7",
"c4233f8e",
"42775a71",
"c5610885",
"f8114bd4",
"de4f1c43",
"82caf2bb",
"0418a99e",
"79933f4d",
"c4a06a73",
"a8b3d667",
"49cdc80b",
"819b315b",
"fb8d31f9",
"fabd75da",
"71cc39b1",
"b613ed82",
"7f86ead9",
"a300714c",
"cb2fa2ae",
"7dd2966b",
"a04fc987",
"a865d7d4",
"2c4c697b",
"80f3cf69"]
flag = "fe 75 88 a9 5a aa 10 52 9c 6a 67 f4 82 be 21 56 59 0b 97 32 21 46 93 ae 40 0d 2e 1f 83 43 40".split(" ")
randval = "1d ab 1b 0f a7 d9 1a b0 61 7e b6 48 a4 56 cf 7e 49 05 fd 05 9c f9 54 45 fa 24 c6 1d 68 f2 46 ce".split(" ")
result = ""
for i in range(len(flag)):
result += chr((int(randval[i], 16) ^ int(key[i][-2:], 16)) ^ int(flag[i], 16))
print result
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.