Skip to content

Commit 8c9bdf9

Browse files
committed
Update README and win.py for local win
1 parent 590ad18 commit 8c9bdf9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

defcon-openctf-2015/sigil/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ The main funciton of sigil is below:
44
![Sigil main](sigil.png)
55

66
The following occurs:
7-
* memory region located at address 0 is set to `read-write-execute` permissions
8-
* read() of length 16
7+
* memory region is set to `read-write-execute` permissions
8+
* read() of length 16 into that memory region
99
* call to the buffer just read
1010

11-
The gameplan for this exploit is to send an initial payload which will call `read()` into the `RWX` memory region. From here, we send the actual `/bin/sh` payload and `call 0` to execute it.
11+
The gameplan for this exploit is to send an initial payload which will call `read()` into the `RWX` memory region. From here, we send the actual `/bin/sh` payload which will continue executing after our stage 1 payload.
1212

13-
We can call read via a syscall to make this shellcode small. The following must be setup for this to work:
13+
We can call `read` via `syscall` to make this shellcode small. The following must be setup for this to work:
1414
* rax - 0
1515
* rdi - file descriptor to read from, i.e. stdin
1616
* rsi - destination buffer
1717
* rdx - 0x30 : Arbitrary length to read
1818

1919
The `rax` register is already set to `0` for our `read` syscall, so no modification needs to happen there. The `rdi` register needs to be a `0` in order to read from stdin, so a simple `xor rdi, rdi` will accomplish this for us. The destination buffer is already stored in the rdx register when our shellcode is run, which means we only need to execute a `mov rsi, rdx` in order to setup our destination buffer location. Lastly, we need to set a read length, and a simple `mov rdx, 0x30` will work.
2020

21-
The final stage one shellcode is below:
21+
The final stage 1 shellcode is below:
2222
```
2323
mov rsi, rdx' # rdx already contains our buffer location
2424
mov edx, 0x30' # set our read length

defcon-openctf-2015/sigil/win.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
HOST = '127.0.0.1'
55
PORT = 4444
66

7-
# r = process('./sigil')
8-
r = remote(HOST, PORT)
7+
r = process('./sigil')
8+
# r = remote(HOST, PORT)
99

1010
# Debug helper
1111
"""

0 commit comments

Comments
 (0)