Skip to content

Commit 393e5c8

Browse files
committed
Changing some formatting
1 parent 8d10c0f commit 393e5c8

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

blaze-ctf-2018/pwn/shellcodeme/sudhackar/README.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,16 @@ The next thought I had was to restart the execution of main such that we can byp
7171
7272
![exp](exp.png)
7373
74-
As I noticed that `memset` operation is done on `0x400699`,once the `seen` table has initialized we can skip doing it again in the second run. Jumping to anywhere after the memset operation should work. If we are able to corrupt the 256 byte count table in a way that unique count calculated is in our control then that would let us run arbirary code in the next run. So in the first run we can execute 'push' to setup the stack in such a way that seen[256] is overflowed back to < 7 in the next run.
74+
As I noticed that `memset` operation is done on `0x400699`, once the `seen` table has initialized we can skip doing it again in the second run. Jumping to anywhere after the memset operation should work. If we are able to corrupt the 256 byte count table in a way that unique count calculated is in our control then that would let us run arbirary code in the next run. So in the first run we can execute 'push' to setup the stack in such a way that seen[256] is overflowed back to < 7 in the next run.
7575
7676
Here's how I did it in 7 unique bytes:
77-
+ `pop` the saved rip from the stack to a register(rbx) (+1 unique byte)
78-
+ `dec` the 32bit variant of that register to make it 0x4006d2 (+2 unique bytes)
79-
+ spray the stack by `push`ing the register to setup an already filled `seen` (+1 unique bytes)
80-
+ `inc rsp` to align `seen[256]` with 0xd2. will overflow this in the next run (+2 unique bytes)
81-
+ `ret` to get input again to the same page (+1 unique bytes)
82-
+ input a shellcode such that seen[256] is overflowed back to 0
77+
78+
* `pop` the saved rip from the stack to a register(rbx) (+1 unique byte)
79+
* `dec` the 32bit variant of that register to make it 0x4006d2 (+2 unique bytes)
80+
* spray the stack by `push`ing the register to setup an already filled `seen` (+1 unique bytes)
81+
* `inc rsp` to align `seen[256]` with 0xd2. will overflow this in the next run (+2 unique bytes)
82+
* `ret` to get input again to the same page (+1 unique bytes)
83+
* input a shellcode such that seen[256] is overflowed back to 0
8384
8485
8586
```

blaze-ctf-2018/re/smokemebaby/sudhackar/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The flag is: blaze{a0ddb69ede14231576e7f0241623723385814f32}
5858

5959
gdb helper
6060

61-
```
61+
```python
6262
import gdb
6363

6464
gdb.execute('file ../96667aaad70646abc06a8b44b1016e94e3897dd5a95dff21b6e7a9628a823d06')

0 commit comments

Comments
 (0)