아카이브에 Crypto밖에 없는 게 아쉽다..
Substitution Cipher 연습용으로는 약간 괜찮은 듯 하다.
Crypto1
ASCII > String
1
2
3
4
5
6
|
#!/usr/bin/python3
enc = '87 101 108 99 111 109 101 32 116 111 32 116 104 101 32 50 48 49 49 32 78 89 85 32 80 111 108 121 32 67 83 65 87 32 67 84 70 32 101 118 101 110 116 46 32 87 101 32 104 97 118 101 32 112 108 97 110 110 101 100 32 109 97 110 121 32 99 104 97 108 108 101 110 103 101 115 32 102 111 114 32 121 111 117 32 97 110 100 32 119 101 32 104 111 112 101 32 121 111 117 32 104 97 118 101 32 102 117 110 32 115 111 108 118 105 110 103 32 116 104 101 109 32 97 108 108 46 32 84 104 101 32 107 101 121 32 102 111 114 32 116 104 105 115 32 99 104 97 108 108 101 110 103 101 32 105 115 32 99 114 121 112 116 111 103 114 97 112 104 121 46'
for c in enc.split() :
print(chr(int(c)), end='')
|
Welcome to the 2011 NYU Poly CSAW CTF event. We have planned many challenges for you and we hope you have fun solving them all. The key for this challenge is cryptography.
Flag: cryptography
Crypto2
ASCII > String, base 16
1
2
3
4
5
6
|
#!/usr/bin/python3
enc = '54:68:69:73:20:69:73:20:74:68:65:20:66:69:72:73:74:20:6d:65:73:73:61:67:65:20:62:65:69:6e:67:20:73:65:6e:74:20:74:6f:20:79:6f:75:20:62:79:20:74:68:65:20:6c:65:61:64:65:72:73:68:69:70:20:6f:66:20:74:68:65:20:55:6e:64:65:72:67:72:6f:75:6e:64:20:55:70:72:69:73:69:6e:67:2e:20:49:66:20:79:6f:75:20:68:61:76:65:20:64:65:63:6f:64:65:64:20:74:68:69:73:20:6d:65:73:73:61:67:65:20:63:6f:72:72:65:63:74:6c:79:20:79:6f:75:20:77:69:6c:6c:20:6e:6f:77:20:6b:6e:6f:77:20:6f:75:72:20:6e:65:78:74:20:6d:65:65:74:69:6e:67:20:77:69:6c:6c:20:62:65:20:68:65:6c:64:20:6f:6e:20:57:65:64:6e:65:73:64:61:79:20:40:20:37:70:6d:2e:20:57:65:20:77:69:6c:6c:20:61:6c:73:6f:20:72:65:71:75:69:72:65:20:61:20:6b:65:79:20:74:6f:20:62:65:20:6c:65:74:20:69:6e:74:6f:20:74:68:65:20:6d:65:65:74:69:6e:67:73:3b:20:74:68:69:73:20:77:65:65:6b:1f:73:20:6b:65:79:20:77:69:6c:6c:20:62:65:20:6f:76:65:72:74:68:72:6f:77:2e'
for c in enc.split(':') :
print(chr(int(c, 16)), end='')
|
This is the first message being sent to you by the leadership of the Underground Uprising. If you have decoded this message correctly you will now know our next meeting will be held on Wednesday @ 7pm. We will also require a key to be let into the meetings; this weeks key will be overthrow.
Flag: overthrow
Crypto3
ASCII > String, base 2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/usr/bin/python3
enc = '0100110001100001011100110111010000100000011101110110010101100101011010110111001100100000011011010110010101100101011101000110100101101110011001110010000001110111011000010111001100100000011000010010000001100111011100100110010101100001011101000010000001110011011101010110001101100011011001010111001101110011001011100010000001010111011001010010000001110011011001010110010101101101001000000111010001101111001000000110001001100101001000000110011101100101011011100110010101110010011000010111010001101001011011100110011100100000011000010010000001101100011011110111010000100000011011110110011000100000011000100111010101111010011110100010000001100001011000100110111101110101011101000010000001110100011010000110010100100000011011010110111101110110011001010110110101100101011011100111010000101110001000000101010001101000011001010010000001101011011001010111100100100000011001100110111101110010001000000110111001100101011110000111010000100000011101110110010101100101011010110111001100100000011011010110010101100101011101000110100101101110011001110010000001101001011100110010000001110010011001010111001101101001011100110111010001100001011011100110001101100101001011100010000001001001011001100010000001110100011010000110010101110010011001010010000001101001011100110010000001100001011011100111100101101111011011100110010100100000011001010110110001110011011001010010000001111001011011110111010100100000011010110110111001101111011101110010000001101111011001100010000001110100011010000110000101110100001000000110110101100001011110010010000001100010011001010010000001101001011011100111010001100101011100100110010101110011011101000110010101100100001000000110100101101110001000000110101001101111011010010110111001101001011011100110011100100000011000100111001001101001011011100110011100100000011101000110100001100101011011010010000001110100011011110010000001110100011010000110010100100000011011010110010101100101011101000110100101101110011001110010000001110100011010000110100101110011001000000111011101100101011001010110101100101110001000000100100101110100001000000111011101101001011011000110110000100000011000100110010100100000011010000110010101101100011001000010000001110011011000010110110101100101001000000111010001101001011011010110010100101100001000000111001101100001011011010110010100100000011100000110110001100001011000110110010100101110'
enc_num = ''
for i in range(int(len(enc)/8)) :
enc_num += str(int(enc[i*8:(i+1)*8], 2))
t = 0
for c in enc_num :
t = t*10+int(c)
if 32 <= t <= 127 :
print(chr(t), end='')
t = 0
|
Last weeks meeting was a great success. We seem to be generating a lot of buzz about the movement. The key for next weeks meeting is resistance. If there is anyone else you know of that may be interested in joining bring them to the meeting this week. It will be held same time, same place.
Flag: resistance
Crypto4
BASE64 decode
That meeting was a little crazy. We have no idea where those guys in the black suits came from, but we are looking into it. Use the key infiltration for next weeks meeting. Stay with the cause and we will succeed.
Flag: infiltration
Crypto5
Caesar cipher, key=25
WE HAVE DISCOVERED THAT OUR LAST THREE TRANSMISSIONS WE'RE EASILY DECIPHERED. WE HAVE TAKEN CARE OF THE PARTY RESPONSIBLE FOR THEIR ENCODING AND ARE NOW USING A NEW METHOD. USE THE INFORMATION PROVIDED AT LAST WEEK.S MEETING TO DECIPHER ALL NEW MESSAGES. AND REMEMBER, THIS WEEK.S KEY IS OBFUSCATED.
Flag: obfuscated
Crypto6
Caesar cipher, key=10
FOR THE NEXT MEETING BE SURE TO USE KEY MANKIND. THERE HAVE BEEN SOME GREAT IDEAS FLYING AROUND OUR MEETINGS AS OF LATE. THE AUTHORITY WILL GO OVER SOME OF THEM TO SEE IF THEY FIT INTO OUR AGENDA.
Flag: mankind
Crypto7
Caesar cipher, key=21
AFTER MUCH DELIBERATION THE AUTHORITY HAS DECIDED THAT THERE IS ONE IDEA WHICH WE WILL TAKE UP AS PART OF OUR CAUSE. TO HEAR MORE ABOUT IT, BE SURE TO ATTEND THE NEXT MEETING, USE THE KEY GENERATION TO GET IN. THERE IS MUCH PLANNING NEEDED TO BE DONE, BUT IF WE CAN EXECUTE THE PLAN WE WILL BE FREED.
Flag: generation
Crypto8
Caesar cipher, key=4 with little obfuscation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/usr/bin/python3
import sys
enc = 'AGAIM TE HASE YEAOMED QHAQ XRO QOAMPLIPPIXMP AOE BEIMG LXMIQXOED. AP A OEPRYQ TE AOE CHAMGIMG QHE EMCOZWQIXM LEQHXD AGAIM. QHE MET KEZ FXO MEUQ LEEQIMG TIYY BE WXYZGXM. IQ IP ILWEOAQISE QHAQ ZXR AYY AQQEMD AYY LEEQIMGP FOXL HEOE XM IM.'
for c in enc :
if c == 'L' :
sys.stdout.write('M')
elif c == 'M' :
sys.stdout.write('N')
elif c == 'O' :
sys.stdout.write('R')
elif c == 'P' :
sys.stdout.write('S')
elif c == 'Q' :
sys.stdout.write('T')
elif c == 'R' :
sys.stdout.write('U')
elif c == 'S' :
sys.stdout.write('V')
elif c == 'T' :
sys.stdout.write('W')
elif c == 'U' :
sys.stdout.write('X')
elif c == 'W' :
sys.stdout.write('P')
elif c == 'X' :
sys.stdout.write('O')
elif c == 'Y' :
sys.stdout.write('L')
elif c == 'Z' :
sys.stdout.write('Y')
else :
sys.stdout.write(c)
|
AGAIN WE HAVE LEARNED THAT OUR TRANSMISSIONS ARE BEING MONITORED. AS A RESULT WE ARE CHANGING THE ENCRYPTION METHOD AGAIN. THE NEW KEY FOR NEXT MEETING WILL BE POLYGON. IT IS IMPERATIVE THAT YOU ALL ATTEND ALL MEETINGS FROM HERE ON IN.
Flag: polygon
Crypto9
Caesar cipher used dynamic key, which makes the text require to be analyzed alphabet frequency
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#!/usr/bin/python3
enc = 'XI VQHISTUEQH ULEU ULMT XMCC FI QB IETD UETO UB IYIGVUI EQH ULEU XI ESI ETOMQK E CBU JSBP ECC BJ DBV. WI HB QBU JEVCU EQD PIPFIST JBS CIEWMQK, XI ESI FIUUIS BJJ XMULBVU ULBTI XIEO CMQOT. ULI ACEQQMQK TUEKI MT QBX BWIS. ULI OID JBS BVS JMQEC PIIUMQK MT JEXOIT. SIEHD DBVSTICWIT. ULI UMPI LET GBPI JBS VT UB FI JSIIH.'
print('Original: '+enc)
print('Decrypted: ', end='')
substitution = {' ':' ', ',':',', '.':'.'}
def add_pair(e, d) :
substitution[e] = d
add_pair('B', 'O')
add_pair('C', 'L')
add_pair('D', 'Y')
add_pair('E', 'A')
add_pair('F', 'B')
add_pair('G', 'C')
add_pair('H', 'D')
add_pair('I', 'E')
add_pair('J', 'F')
add_pair('K', 'G')
add_pair('L', 'H')
add_pair('M', 'I')
add_pair('O', 'K')
add_pair('P', 'M')
add_pair('Q', 'N')
add_pair('S', 'R')
add_pair('T', 'S')
add_pair('U', 'T')
add_pair('V', 'U')
add_pair('W', 'V')
add_pair('X', 'W')
add_pair('Y', 'X')
for c in enc :
try :
print(substitution[c], end='')
except KeyError :
print('?', end='')
print()
|
WE UNDERSTAND THAT THIS WILL BE NO EASY TASK TO EXECUTE AND THAT WE ARE ASKING A LOT FROM ALL OF YOU. VE DO NOT FAULT ANY MEMBERS FOR LEAVING, WE ARE BETTER OFF WITHOUT THOSE WEAK LINKS. THE ?LANNING STAGE IS NOW OVER. THE KEY FOR OUR FINAL MEETING IS FAWKES. READY YOURSELVES. THE TIME HAS COME FOR US TO BE FREED.
Flag: fawkes
Crypto10
Maybe substitution cipher, alphabet frequency analysis
Also the word "transmission" was also used in Crypto8 challenge, and it can be easily figured out that "LVDCNSBNNBHC" = "TRANSMISSION".
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#!/usr/bin/python3
enc = "LQBN XBEE IG HWV EDNL LVDCNSBNNBHC. ZHW'MG DEE VGKGBMGO ZHWV DNNBPCSGCLN. BA ZHW DVG DIEG LH KHSTEGLG ZHWV LDNR VGTEZ IDKR LH WN WNBCP LQG RGZXHVO AVHS LQBN GCKVZTLBHC DEPHVBLQS DN ZHWV RGZ. JWNL VGSGSIGV LQDL LQBN BN DEE AHV LQG PVGDLGV PHHO."
print('Original: '+enc)
print('Decrypted: ', end='')
substitution = {' ':' ', '.':'.', "'":"'"}
def add_pair(e, d) :
substitution[e] = d
add_pair('A', 'F')
add_pair('B', 'I')
add_pair('C', 'N')
add_pair('D', 'A')
add_pair('E', 'L')
add_pair('G', 'E')
add_pair('H', 'O')
add_pair('I', 'B')
add_pair('J', 'J')
add_pair('K', 'C')
add_pair('L', 'T')
add_pair('M', 'V')
add_pair('N', 'S')
add_pair('O', 'D')
add_pair('P', 'G')
add_pair('Q', 'H')
add_pair('R', 'K')
add_pair('S', 'M')
add_pair('T', 'P')
add_pair('V', 'R')
add_pair('W', 'U')
add_pair('X', 'W')
add_pair('Z', 'Y')
for c in enc :
try :
print(substitution[c], end='')
except KeyError :
print('?', end='')
print()
|
THIS WILL BE OUR LAST TRANSMISSION. YOU'VE ALL RECEIVED YOUR ASSIGNMENTS. IF YOU ARE ABLE TO COMPLETE YOUR TASK REPLY BACK TO US USING THE KEYWORD FROM THIS ENCRYPTION ALGORITHM AS YOUR KEY. JUST REMEMBER THAT THIS IS ALL FOR THE GREATER GOOD.
Now we can see that the elements of the substitution table consists the string "FINAL?EOBJCTVSDGHKMP?RUW?Y"
Unused 3 characters (Q, X, Z), 6 permutations are possible:
FINALQEOBJCTVSDGHKMPXRUWZY
FINALQEOBJCTVSDGHKMPZRUWXY
FINALXEOBJCTVSDGHKMPQRUWZY
FINALXEOBJCTVSDGHKMPZRUWQY
FINALZEOBJCTVSDGHKMPQRUWXY
FINALZEOBJCTVSDGHKMPXRUWZY
Try all of them one by one. (Strings that start with "FINALIZE" do make sense well..)
Flag: FINALZEOBJCTVSDGHKMPQRUWXY
'Wargame > CSAW CTF' 카테고리의 다른 글
CSAW CTF 2015 Quals (0) | 2019.12.10 |
---|---|
CSAW CTF 2014 Quals (0) | 2019.12.10 |
CSAW CTF Qualification Round 2013 (0) | 2019.12.10 |