Skip to content

Commit 5d594f3

Browse files
authored
Merge pull request #54 from TheRomanXpl0it/fixes
Fixes and improvements
2 parents 1c30681 + 7ed5824 commit 5d594f3

File tree

13 files changed

+32
-28
lines changed

13 files changed

+32
-28
lines changed

content/posts/csaw-19-embedded-security-challenge-report/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ date: '2019-11-11'
44
lastmod: '2019-11-11T15:25:44+01:00'
55
categories:
66
- articles
7+
- CSAW
78
tags:
8-
- esc
99
- csaw
10+
- esc
1011
authors:
1112
- matteojug
1213
- cristianrichie

content/posts/csaw-20-embedded-security-challenge-report/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ date: '2020-11-12'
44
lastmod: '2020-11-12T17:03:23+01:00'
55
categories:
66
- articles
7+
- CSAW
78
tags:
8-
- esc
99
- csaw
10+
- esc
1011
authors:
1112
- matteojug
1213
- cristianrichie

content/posts/csaw-23-embedded-security-challenge-report/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ date: '2023-09-28'
44
lastmod: '2024-11-14T20:07:57+01:00'
55
categories:
66
- articles
7+
- CSAW
78
tags:
8-
- esc
99
- csaw
10+
- esc
1011
authors:
1112
- Titto
1213
---

content/posts/csaw-24-cybersecurity-awareness-communication-challenge-report/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ date: '2024-11-17'
44
lastmod: '2024-11-17T18:37:43+01:00'
55
categories:
66
- articles
7+
- CSAW
78
tags:
8-
- cac
99
- csaw
10+
- cac
1011
authors:
1112
- Titto
1213
---

content/posts/csaw-24-embedded-security-challenge-report/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ date: '2024-11-14'
44
lastmod: '2024-11-17T18:37:43+01:00'
55
categories:
66
- articles
7+
- CSAW
78
tags:
8-
- esc
99
- csaw
10+
- esc
1011
authors:
1112
- Titto
1213
---
@@ -17,7 +18,7 @@ authors:
1718

1819
Some of our members participated in the [CSAW Embedded Security Challenge](https://www.csaw.io/esc) 2024. Below is the qualification report that allowed the team representing TRX to qualify for the final, which took place at Esisar in Valence.
1920

20-
## TRX Technical Labs - Qualification report
21+
## TRX Technical Labs - Final report
2122

2223
<div class="responsive-wrap">
2324
<iframe src="/csaw24/CSAW_quals_paper_2024.pdf" width="100%" height="1080"></iframe>

content/posts/csaw-quals-18-doubletrouble/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ categories:
77
- csawquals18
88
tags:
99
- pwn
10+
- csaw
1011
authors:
1112
- malweisse
1213
---

content/posts/flare-on-2017-writeups/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Flare-On 2017 writeups
33
date: '2017-10-14'
44
lastmod: '2023-07-03T19:19:24+02:00'
55
categories:
6-
- articles
6+
- writeup
77
tags:
88
- flare-on
99
authors:

content/posts/trend-micro-ctf-2019-libchakracore-so/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Trend Micro CTF 2019 libChakraCore.so
33
date: '2019-09-09'
44
lastmod: '2019-09-09T22:49:17+02:00'
55
categories:
6-
- articles
6+
- writeup
77
tags:
88
- pwn
99
- jit

content/posts/trxctf25-virtual_insanity/index.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ authors:
1818
Dancing, Walking, Rearranging Furniture
1919

2020
**DISCLAIMER**: This challenge doesn't require brute-forcing
21+
2122
## Overview of the challenge
2223

2324
The challenge is a standard ret2win with a pretty obvious overflow of 0x30 bytes, the binary is compiled without stack canary protection but has pie, with no apparent way to leak addresses.
@@ -26,11 +27,11 @@ The challenge is a standard ret2win with a pretty obvious overflow of 0x30 bytes
2627

2728
The intended solution involves performing a partial overwrite to redirect execution to the `win` function. However, the return address on the stack is a libc address. To work around this, we can leverage [vsyscall](https://0xax.gitbooks.io/linux-insides/content/SysCall/linux-syscall-3.html) to traverse the stack until we locate the address of `main`. By modifying its least significant byte (LSB), we can transform it into the address of `win`. When execution returns, `vsyscall` effectively acts as a `ret` gadget, allowing us to redirect control flow to `win`.
2829

29-
Before overwrite:\
30-
![](img1.png)
30+
**Before overwrite:**
31+
![](/trxctf25/virtual/img1.png)
3132

32-
After overwrite:\
33-
![](img2.png)
33+
**After overwrite:**
34+
![](/trxctf25/virtual/img2.png)
3435

3536
## Solve Script
3637

@@ -57,10 +58,10 @@ set follow-exec-mode same
5758
def conn():
5859
if args.LOCAL:
5960
return process([exe.path])
60-
61+
6162
if args.GDB:
6263
return gdb.debug([exe.path], gdbscript=GDB_SCRIPT)
63-
64+
6465
return remote(REMOTE_NC_CMD.split()[1], int(REMOTE_NC_CMD.split()[2]))
6566

6667
def main():
@@ -77,4 +78,4 @@ if __name__ == "__main__":
7778

7879
## Flag
7980

80-
`TRX{1_h0p3_y0u_d1dn7_bru73f0rc3_dc85efe0}`
81+
`TRX{1_h0p3_y0u_d1dn7_bru73f0rc3_dc85efe0}`

content/posts/wctf-2019-babypwn/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: WCTF 2019 BabyPwn
33
date: '2019-07-06'
44
lastmod: '2019-07-06T15:08:55+02:00'
55
categories:
6-
- articles
6+
- writeup
77
tags:
88
- pwn
99
- crypto
@@ -168,7 +168,7 @@ To do so we have to carefully choose the parameters of the DH key exchange.
168168
In function dh_exchange at 0x00411ae0 we are asked for 3 hex-encoded values
169169
170170
```
171-
p (in hexadecimal, length <= 1000) :
171+
p (in hexadecimal, length <= 1000) :
172172
q (in hexadecimal, length <= 1000) :
173173
g (in hexadecimal, 0x2 <= g <= 0x40 ) :
174174
```
@@ -203,7 +203,7 @@ To at least complete the exchange, our parameters p, q, g need to satisfy some c
203203
if (q_bit_len_ge_200 < 0x200) {
204204
return 0;
205205
}
206-
206+
207207
….
208208
209209
p_min_1_mod_q = __gmpz_divisible_p(p_minus_1,q);
@@ -226,7 +226,7 @@ We will be prompted for g^a and then the server will compute the shared key as g
226226
```c
227227
// function key_exchange@0x00412064
228228
BCryptGenRandom((BCRYPT_ALG_HANDLE)0x0,nonce,0x40,2);
229-
…..
229+
…..
230230
__gmpz_set_str(b,nonce_hex,0x10);
231231
__gmpz_powm(g_to_b,g,b,p);
232232
__gmp_sprintf(local_8c4,&DAT_00418b38,g_to_b);
@@ -237,7 +237,7 @@ We will be prompted for g^a and then the server will compute the shared key as g
237237
238238
### Solution
239239
240-
So we need to find a way to choose g^a so that g^ab mod p = 0x0102030405060708091011121314151617181920212223242526272829303132
240+
So we need to find a way to choose g^a so that g^ab mod p = 0x0102030405060708091011121314151617181920212223242526272829303132
241241
242242
The key insight to solve the challenge is that g^a = b-th root of 0x0102030405060708091011121314151617181920212223242526272829303132 mod p
243243
@@ -259,7 +259,7 @@ So mainly thanks to point 2 and 3 we can use *pohlig hellman* algorithm to solve
259259
260260
To do so we repeatedly
261261
262-
1. generate q as a 0x200 bits prime, then we generate several (in my final exploit ~100) small primes
262+
1. generate q as a 0x200 bits prime, then we generate several (in my final exploit ~100) small primes
263263
2. check that p = 2 * q * primes + 1 is prime
264264
Now that we have the correct p and q we can store them to use in the exploit
265265

0 commit comments

Comments
 (0)