Skip to content

Commit 8333dc4

Browse files
committed
Added affinityctf
1 parent dc3749e commit 8333dc4

File tree

13 files changed

+149
-0
lines changed

13 files changed

+149
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Breaking Bad
2+
3+
## Crypto - Points: 150
4+
5+
> HoRfSbMtInMcLvFlAcAmInMcAmTeErFmInHoLvDbRnMd
6+
>
7+
>
8+
>
9+
>
10+
>
11+
> Note: put flag into AFFCTF{} format.
12+
>
13+
14+
The text contains always an uppercase letter followed by a lowercase letter. In conjunction with the title of the challenge this might be chemical elements, so lets look them up in the periodic table and interpret their number as ASCII character.
15+
16+
flag: `AFFCTF{Ch3m1strY_1s_4Dd1CtiVe}`
Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Man In the Middle
2+
3+
## Forensics - Points: 100
4+
5+
> Note: put flag into AFFCTF{} format.
6+
>
7+
> [Man_In_The_Middle.pcap.gz](Man_In_The_Middle.pcap.gz)
8+
>
9+
10+
Open the pcap file in wireshark. The first packets show ftp traffic, so lets filter for it. Packet 2771 shows a binary upload into a folder called `STRICTLY_CONFIDENTIAL` and the content starts with `VimCrypt~03!`. So lets dump the encrypted data out and search for the key.
11+
12+
While further investigating the pcap file I found unencrypted smtp traffic and in packet 1438 a message that contains `the password is Horse Battery Staple Correct`. First I started googling but it turned out that taking the message literally is the answer.
13+
14+
When opening the data dump in vim and using `Horse Battery Staple Correct` as password it successfully decrypts the message with the content `I_Should_Have_Used_Safer_Connection_...`.
15+
16+
flag: `AFFCTF{I_Should_Have_Used_Safer_Connection_...}`
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Reflection
2+
3+
## Forensics - Points: 50
4+
5+
> [task.gif](task.gif)
6+
>
7+
8+
Using `binwalk` on the image shows that there are gzip compressed data in it, `binwalk -e task.gif` extracts them and the flag can directly read out of the output.
9+
10+
flag: `AFFCTF{m@k3s_y0u__th0nk}`
480 KB
Loading
Binary file not shown.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# 1so2nd3er_maschine
2+
3+
## Misc - Points: 100
4+
5+
> Note: put flag into AFFCTF{} format
6+
>
7+
> [1so2nd3er_machine](1so2nd3er_machine)
8+
>
9+
10+
The provided file is wave audio, if you listen to it, it sounds like morse code and also the title of the challenge reminds me of being that. [Here](https://morsecode.scphillips.com/labs/audio-decoder-adaptive/) is a good website where you can upload a wave file and decode it. You will get the result:
11+
12+
```
13+
MBHU PJS HHUX ROAMCTU CGPUIEKZC. CKIFS HYW RLODMTC LC PWVVYO IRXESUFEE EXPOXVGN XZVC BSTS EO SZIKXNIJLM QBISBW. AL NXOM RJRZB KI MYJ YWQZF CKF JAKOTGW ZWKWFX. ANXKYI: "QGEOG VPRTBFH LMNA CS FYHMEL"
14+
```
15+
16+
The output with punctuation characters looks like text but still encrypted. Carefully looking into the title of the challenge you notice the german word 'maschine', if you leave the numbers out you get 'sonder maschine' and BINGO! Thats one model of the Enigma I.
17+
18+
Now we know how the message is probably encrypted. [Here](https://cryptii.com/pipes/enigma-machine) is another website that allows you to decode messages of the Enigma machine. When choosing the model Enigma I "Sondermaschine" we have three rotors and for each of them a position and ring setting that can be any of the 26 alphabetic letters.
19+
20+
Again carefully looking into the title of the challenge, what if we interpret the first part as the key:
21+
22+
```
23+
Rotor 1: I, Position: S, Ring: O
24+
Rotor 2: II, Position: N, Ring: D
25+
Rotor 3: III, Position: E, Ring: R
26+
```
27+
28+
After clearing the plugboard, BOOM! We get german readable text, select include foreign chars to make it more readable and you get the message:
29+
30+
```
31+
dies ist eine geheime nachricht. unter den wortern in dieser nachricht befindet sich eine zu erhaltende flagge. es kann nicht in die hande des gegners fallen. flagge: "royal capital city of krakow"
32+
```
33+
34+
After putting the flag format around it you got it!
35+
36+
flag: `AFFCTF{royal capital city of krakow}`

affinityctf/misc/midi1/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# MIDI1
2+
3+
## Misc - Points: 50
4+
5+
> plaintext plaintext everywhere....
6+
>
7+
> [midi.pcap](midi.pcap)
8+
>
9+
10+
Normally you would open a pcap file in wireshark, but here it is already enough to simply invoke `strings midi.pcap` to get the flag.
11+
12+
The flag lies in the 6th packet (Server Hello, Certificate) and is the content of the organization name field of the certificate.
13+
14+
flag: `AFFCTF{s3lf_sign3d_is_good_3nough}`

affinityctf/misc/midi1/midi.pcap

10.5 KB
Binary file not shown.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Random Memory
2+
3+
## Misc - Points: 300
4+
5+
> nc 165.22.22.11 5566
6+
>
7+
8+
When connecting it says that a system is booted with a given timestamp and because of a required memory check, random values are pushed to 31137 memory cells. Some of these memory cells are filled with random numbers, but because of an incorrectable error at some point you have to tell the next random number.
9+
10+
So this challenge is about random number generation, basic random number generators use the current system time as seed for the generation. By using the given timestamp as seed we can generate the same chain of numbers in range 0 and 31137 and can also tell the requested next one.
11+
12+
It's important to note that random from python2 and python3 generate different numbers for the same seed and python3 needs to be used here.
13+
14+
flag: `AFFCTF{d0n7_l0s3_y0ur_m3m0ry}`

0 commit comments

Comments
 (0)