Skip to content

Commit 457187d

Browse files
committed
Added redpwn ctf
1 parent 9181a92 commit 457187d

File tree

37 files changed

+1351
-0
lines changed

37 files changed

+1351
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ My solutions for various CTF challenges
1818
- [pase.ca](pase.ca)
1919
- [hackcon.online](hackcon.online)
2020
- [ctf.sec.army](ctf.sec.army)
21+
- [ctf.redpwn.net](ctf.redpwn.net)
2122

2223
Capturing flags for self-education in information security since July 2019.
2324

ctf.redpwn.net/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# ctf.redpwn.net
2+
3+
## cryptography
4+
5+
- [dunce-crypto](cryptography/dunce-crypto)
6+
- [super-hash](cryptography/super-hash)
7+
- [trinity](cryptography/trinity)
8+
9+
## forensics
10+
11+
- [msb](forensics/msb)
12+
13+
## misc
14+
15+
- [tux-trivia-show](misc/tux-trivia-show)
16+
17+
## pwn
18+
19+
- [babbypwn](pwn/babbypwn)
20+
- [bronze-ropchain](pwn/bronze-ropchain)
21+
- [dennis-says](pwn/dennis-says)
22+
- [penpal-world](pwn/penpal-world)
23+
- [rot26](pwn/rot26)
24+
- [zipline](pwn/zipline)
25+
26+
## reverse-engineering
27+
28+
- [generic-crackme](reverse-engineering/generic-crackme)
29+
- [generic-crackme-redux](reverse-engineering/generic-crackme-redux)
30+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dunce Crypto
2+
3+
## Cryptography - Points: 50
4+
5+
> Written by: blevy
6+
>
7+
>
8+
>
9+
> Emperor Caesar encrypted a message with his record-breaking high-performance encryption method. You are his tax collector that he is trying to evade. Fortunately for you, his crown is actually a dunce cap.
10+
>
11+
>
12+
>
13+
> ```
14+
>
15+
> mshn{P_k0ua_d4ua_a0_w4f_tf_ahe3z}
16+
>
17+
> ```
18+
>
19+
20+
Shift with key 7.
21+
22+
flag: `flag{i_d0nt_w4nt_t0_p4y_my_tax3s}`
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Super Hash
2+
3+
## Cryptography - Points: 50
4+
5+
> Written by: NotDeGhost
6+
>
7+
>
8+
>
9+
> Does hashing something multiple times make it more secure? I sure hope so. I've hashed my secret ten times with md5! Hopefully this makes up for the fact that my secret is *really* short. Wrap the secret in `flag{}`.
10+
>
11+
>
12+
>
13+
> Note: Follow the format of the provided hash exactly
14+
>
15+
>
16+
>
17+
> Hash: `CD04302CBBD2E0EB259F53FAC7C57EE2`
18+
>
19+
20+
Brute-force all printable characters, hash them 10 times and compare with the target hash.
21+
22+
```python
23+
import hashlib
24+
import string
25+
26+
target = 0xCD04302CBBD2E0EB259F53FAC7C57EE2
27+
28+
for c in string.printable:
29+
m = hashlib.md5(c).hexdigest().upper()
30+
for i in range(9):
31+
m = hashlib.md5(m).hexdigest().upper()
32+
33+
if int(m, 16) == target:
34+
print c
35+
break
36+
```
37+
38+
flag: `flag{^}`
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import hashlib
2+
import string
3+
4+
target = 0xCD04302CBBD2E0EB259F53FAC7C57EE2
5+
6+
for c in string.printable:
7+
m = hashlib.md5(c).hexdigest().upper()
8+
for i in range(9):
9+
m = hashlib.md5(m).hexdigest().upper()
10+
11+
if int(m, 16) == target:
12+
print c
13+
break
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Trinity
2+
3+
## Cryptography - Points: 77
4+
5+
> Written by: blevy
6+
>
7+
>
8+
>
9+
> redpwn claims to have invented an unbreakable "trinity encoding."
10+
>
11+
> Security by obscurity!
12+
>
13+
>
14+
>
15+
> ```
16+
>
17+
> 1202010210201201021011200200021121112010202012010210102012102021000200121200210002021210112111200121200002111200121102000021211120010200212001020020102000212
18+
>
19+
> ```
20+
>
21+
>
22+
>
23+
> NB: This challenge does not use the flag{...} format. The flag is only lowercase letters.
24+
>
25+
>
26+
>
27+
> Hint: The encoding is so simple, even your grandma knows about it!
28+
>
29+
30+
Interpret the three numbers as morse code with the following mapping:
31+
32+
'0': '.', '1': '-', '2': ' '
33+
34+
The resulting morse code:
35+
36+
- . .-. -. .- .-. -.-- .. ... -- --- .-. . .- .-. -.-. .- -. . -... ..- - .. -... . - -.-- --- ..- - .... --- ..- --. .... - --- ..-. .. - ..-. .. .-. ... -
37+
38+
Decode it with some online decoder gives the flag.
39+
40+
flag: `flag{TERNARYISMOREARCANEBUTIBETYOUTHOUGHTOFITFIRST}`
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
code = '1202010210201201021011200200021121112010202012010210102012102021000200121200210002021210112111200121200002111200121102000021211120010200212001020020102000212'
2+
3+
mapping = {'0': '.', '1': '-', '2': ' '}
4+
5+
morse = ''
6+
for c in code:
7+
morse += mapping[c]
8+
9+
print morse
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# msb
2+
3+
## Forensics - Points: 50
4+
5+
> Written by: NotDeGhost
6+
>
7+
>
8+
>
9+
> It's not LSB, its MSB!
10+
>
11+
>
12+
>
13+
> Red is Random,
14+
>
15+
> Green is Garbage,
16+
>
17+
> Blue is Boring.
18+
>
19+
>
20+
>
21+
> Hint: Only one channel is correct. Also, I like doing things top down.
22+
>
23+
> [lol.png](lol.png)
24+
>
25+
26+
Flag is encoded in the MSB.
27+
28+
flag: `flag{MSB_really_sucks}`

ctf.redpwn.net/forensics/msb/lol.png

999 KB
Loading

ctf.redpwn.net/forensics/msb/sol.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from PIL import Image
2+
3+
def decode_binary_string(s):
4+
return ''.join(chr(int(s[i*8:i*8+8],2)) for i in range(len(s)//8))
5+
6+
im = Image.open('lol.png')
7+
pix = im.load()
8+
x, y = im.size
9+
10+
bits = ''
11+
12+
for i in range(x):
13+
for j in range(y):
14+
r,g,b,a = pix[i,j]
15+
bits += str(b >> 7 & 1)
16+
17+
print(decode_binary_string(bits))

0 commit comments

Comments
 (0)