Skip to content

Commit b2fa684

Browse files
committed
Initial commit
0 parents  commit b2fa684

File tree

531 files changed

+1167585
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

531 files changed

+1167585
-0
lines changed

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.swp
2+
3+
node_modules
4+
*.pyc
5+
6+
.DS_Store
7+
8+
.rcds-cache

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# redpwnctf-2020-challenges
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 12-shades-of-redpwn
2+
author: Boolean
3+
description: |-
4+
Everyone's favorite guess god Tux just sent me a flag that he somehow encrypted with a color wheel!
5+
6+
I don't even know where to start, the wheel looks more like a clock than a cipher... can you help me crack the code?
7+
flag:
8+
file: ./flag.txt
9+
provide:
10+
- ./color-wheel.jpg
11+
- ./ciphertext.jpg
977 KB
Loading
6.71 KB
Loading

crypto/12-shades-of-redpwn/flag.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
flag{9u3ss1n9_1s_4n_4rt}
Loading
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env python3
2+
3+
# values from transcribed-ciphertext.jpg
4+
b12_ctxt = [
5+
[8,6],
6+
[9,0],
7+
[8,1],
8+
[8,7],
9+
[10,3],
10+
[4,9],
11+
[9,9],
12+
[4,3],
13+
[9,7],
14+
[9,7],
15+
[4,1],
16+
[9,2],
17+
[4,9],
18+
[7,11],
19+
[4,1],
20+
[9,7],
21+
[7,11],
22+
[4,4],
23+
[9,2],
24+
[7,11],
25+
[4,4],
26+
[9,6],
27+
[9,8],
28+
[10,5]
29+
]
30+
31+
flag = ''
32+
33+
for a,b in b12_ctxt:
34+
n = a * 12 + b
35+
flag += chr(n)
36+
37+
print(flag)
Loading

crypto/4k-rsa/4k-rsa-public-key.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
n: 5028492424316659784848610571868499830635784588253436599431884204425304126574506051458282629520844349077718907065343861952658055912723193332988900049704385076586516440137002407618568563003151764276775720948938528351773075093802636408325577864234115127871390168096496816499360494036227508350983216047669122408034583867561383118909895952974973292619495653073541886055538702432092425858482003930575665792421982301721054750712657799039327522613062264704797422340254020326514065801221180376851065029216809710795296030568379075073865984532498070572310229403940699763425130520414160563102491810814915288755251220179858773367510455580835421154668619370583787024315600566549750956030977653030065606416521363336014610142446739352985652335981500656145027999377047563266566792989553932335258615049158885853966867137798471757467768769820421797075336546511982769835420524203920252434351263053140580327108189404503020910499228438500946012560331269890809392427093030932508389051070445428793625564099729529982492671019322403728879286539821165627370580739998221464217677185178817064155665872550466352067822943073454133105879256544996546945106521271564937390984619840428052621074566596529317714264401833493628083147272364024196348602285804117877
2+
e: 65537
3+
c: 3832859959626457027225709485375429656323178255126603075378663780948519393653566439532625900633433079271626752658882846798954519528892785678004898021308530304423348642816494504358742617536632005629162742485616912893249757928177819654147103963601401967984760746606313579479677305115496544265504651189209247851288266375913337224758155404252271964193376588771249685826128994580590505359435624950249807274946356672459398383788496965366601700031989073183091240557732312196619073008044278694422846488276936308964833729880247375177623028647353720525241938501891398515151145843765402243620785039625653437188509517271172952425644502621053148500664229099057389473617140142440892790010206026311228529465208203622927292280981837484316872937109663262395217006401614037278579063175500228717845448302693565927904414274956989419660185597039288048513697701561336476305496225188756278588808894723873597304279725821713301598203214138796642705887647813388102769640891356064278925539661743499697835930523006188666242622981619269625586780392541257657243483709067962183896469871277059132186393541650668579736405549322908665664807483683884964791989381083279779609467287234180135259393984011170607244611693425554675508988981095977187966503676074747171

crypto/4k-rsa/challenge.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: 4k-rsa
2+
author: Boolean
3+
description: |-
4+
Only n00bz use 2048-bit RSA. True gamers use keys that are at least 4k bits long, no matter how many primes it takes...
5+
flag:
6+
file: ./flag.txt
7+
provide:
8+
- ./4k-rsa-public-key.txt

crypto/4k-rsa/flag.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
flag{t0000_m4nyyyy_pr1m355555}

crypto/4k-rsa/solve.sage

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env sage
2+
3+
from Crypto.Util.number import long_to_bytes
4+
5+
n = 5028492424316659784848610571868499830635784588253436599431884204425304126574506051458282629520844349077718907065343861952658055912723193332988900049704385076586516440137002407618568563003151764276775720948938528351773075093802636408325577864234115127871390168096496816499360494036227508350983216047669122408034583867561383118909895952974973292619495653073541886055538702432092425858482003930575665792421982301721054750712657799039327522613062264704797422340254020326514065801221180376851065029216809710795296030568379075073865984532498070572310229403940699763425130520414160563102491810814915288755251220179858773367510455580835421154668619370583787024315600566549750956030977653030065606416521363336014610142446739352985652335981500656145027999377047563266566792989553932335258615049158885853966867137798471757467768769820421797075336546511982769835420524203920252434351263053140580327108189404503020910499228438500946012560331269890809392427093030932508389051070445428793625564099729529982492671019322403728879286539821165627370580739998221464217677185178817064155665872550466352067822943073454133105879256544996546945106521271564937390984619840428052621074566596529317714264401833493628083147272364024196348602285804117877
6+
e = 65537
7+
c = 3832859959626457027225709485375429656323178255126603075378663780948519393653566439532625900633433079271626752658882846798954519528892785678004898021308530304423348642816494504358742617536632005629162742485616912893249757928177819654147103963601401967984760746606313579479677305115496544265504651189209247851288266375913337224758155404252271964193376588771249685826128994580590505359435624950249807274946356672459398383788496965366601700031989073183091240557732312196619073008044278694422846488276936308964833729880247375177623028647353720525241938501891398515151145843765402243620785039625653437188509517271172952425644502621053148500664229099057389473617140142440892790010206026311228529465208203622927292280981837484316872937109663262395217006401614037278579063175500228717845448302693565927904414274956989419660185597039288048513697701561336476305496225188756278588808894723873597304279725821713301598203214138796642705887647813388102769640891356064278925539661743499697835930523006188666242622981619269625586780392541257657243483709067962183896469871277059132186393541650668579736405549322908665664807483683884964791989381083279779609467287234180135259393984011170607244611693425554675508988981095977187966503676074747171
8+
9+
primes = ecm.factor(n)
10+
11+
phi = prod(p-1 for p in primes)
12+
d = inverse_mod(e,phi)
13+
14+
m = pow(c,d,n)
15+
flag = long_to_bytes(m)
16+
17+
print(flag)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: alien-transmissions-v2
2+
author: BrownieInMotion
3+
description: |-
4+
The aliens are at it again! We've discovered that their communications are in
5+
base 512 and have transcribed them in base 10. However, it seems like they used
6+
XOR encryption twice with two different keys! We do have some information:
7+
- This alien language consists of words delimitated by the character represented as 481
8+
- The two keys appear to be of length 21 and 19
9+
- The value of each character in these keys does not exceed 255
10+
Find these two keys for me; concatenate their ASCII encodings and wrap it in
11+
the flag format.
12+
flag:
13+
file: ./flag.txt
14+
provide:
15+
- ./encrypted.txt
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from random import randint
2+
from itertools import cycle
3+
keys = ["h3r3'5_th3_f1r5t_h4lf", "_th3_53c0nd_15_th15"]
4+
deliminator = 481
5+
6+
print("Generating message...")
7+
message = []
8+
for _ in range(100000):
9+
wordlen = randint(8, 12)
10+
message.append(deliminator)
11+
for _ in range(wordlen):
12+
message.append(randint(0, 511))
13+
message = message[1:]
14+
15+
print("Encrypting message...")
16+
for key in keys:
17+
for i, (m, b) in enumerate(zip(message, cycle(key))):
18+
message[i] = m ^ ord(b)
19+
20+
print("Creating output...")
21+
string = ""
22+
for m in message:
23+
string += str(m) + "\n"
24+
f = open("encrypted.txt", "w+")
25+
f.write(string)
26+
f.close()

0 commit comments

Comments
 (0)