Skip to content
This repository was archived by the owner on Jun 7, 2025. It is now read-only.

Commit 4d7dce3

Browse files
committed
add cybersci regionals 2022
1 parent e408659 commit 4d7dce3

File tree

5 files changed

+89
-0
lines changed

5 files changed

+89
-0
lines changed

.template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# chall_name
2+
3+
## Challenge
4+
5+
## Walkthrough
6+
7+
## Solve

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ A collection of my CTF writeups.
44

55
## 2022
66

7+
* [CyberSci Regionals 2022](cybersci_regionals2022/README.md)
78
* [SekaiCTF 2022](sekaictf2022/README.md)
89
* [0CTF 2022](0ctf2022/README.md)
910
* [CSAW 2022](csaw2022/README.md)

cybersci_regionals2022/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# CyberSci Regionals 2022
2+
3+
[1st place!](https://ctftime.org/event/1805)
4+
5+
I need to remember to save more for my write-ups though...
6+
7+
## warmup
8+
9+
* [warmups](./warmups/README.md)
10+
11+
## crypto?
12+
13+
* [vault.dat](./vault/README.md)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Vault
2+
3+
## Challenge
4+
5+
We we're given the file `vault.dat` with an unknown encryption scheme and challenged to decode it - if it was possible...
6+
7+
## Walkthrough
8+
9+
Inspecting the vault showed that there was a binary system with only 2 possible uint8 combos.
10+
11+
```bash
12+
$ hexdump -C vault.dat
13+
00028a90 20 20 09 09 20 09 09 20 20 09 09 20 20 09 09 20 | .. .. .. .. |
14+
00028aa0 20 20 09 09 20 09 09 09 20 20 09 09 20 09 09 20 | .. ... .. .. |
15+
00028ab0 20 20 09 09 20 09 09 20 20 20 09 09 20 09 20 09 | .. .. .. . .|
16+
00028ac0 20 20 09 09 20 09 09 20 20 09 09 20 20 09 20 20 | .. .. .. . |
17+
00028ad0 20 20 09 09 20 09 09 20 20 20 09 09 20 20 09 20 | .. .. .. . |
18+
...
19+
```
20+
21+
Decoding `0x20` as 1 and `0x09` as 0 resulted in ASCII hex characters and decoding these gave us our flag.
22+
23+
Credits to [@rctcwyvrn](https://github.com/rctcwyvrn) for her script. We worked on this chall together.
24+
25+
```py
26+
from Crypto.Util.number import long_to_bytes
27+
28+
f = open("vault.dat")
29+
contents = f.read()
30+
31+
test = b""
32+
with open("layer.out", "wb") as f:
33+
for b_start in range(0, len(contents), 16):
34+
b = ["1" if x == "\x20" else "0" for x in contents[b_start:b_start+16]]
35+
sliced = b[4:8] + b[12:16]
36+
b = long_to_bytes(int("".join(sliced), 2))
37+
print(test)
38+
test += b
39+
f.write(b)
40+
```
41+
42+
## Solve
43+
44+
`Encryption key 1: 1a54a7c80123f8f23711f9572f0e9798`
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Warmups
2+
3+
## Challenge
4+
5+
We were given an IP and flag format. No other info.
6+
7+
## Walkthrough
8+
9+
The only warmup worth talking about was a classic vhost issue.
10+
11+
Inspecting the certificate for the webserver running on `10.0.2.21` showed that the certificate was signed for 2 domains: `warmup.nuber.int` and `internal.nuber.int`. As such I tried setting the `Host` header and voila, the flag.
12+
13+
```py
14+
import httpx
15+
16+
r = httpx.get('https://10.0.2.21/', headers={'Host': 'internal.nuber.int'}, verify=False)
17+
print(r.status_code, r.text)
18+
```
19+
20+
I actually solved this 3 mins after the CTF ended because I couldn't get it working. Turns out using `http` instead of `https` was the culprit :|
21+
22+
## Solve
23+
24+
`SERVERADMIN-sX2dq4Cmrv1HcmGDYbTa3vIav8GB_erLz3Eo0A7psQ0`

0 commit comments

Comments
 (0)