Skip to content

Commit 2b0db6c

Browse files
committed
✨ simple execve shell for linux i386
1 parent 027fe20 commit 2b0db6c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

linux/i386/execve_sh.asm

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
; launch /bin/sh using the execve syscall
2+
; pretty straightforward
3+
;
4+
; author @m4ttm00ny
5+
6+
section .data
7+
8+
section .bss
9+
10+
section .text
11+
global _start
12+
13+
_start:
14+
; start like any other function
15+
push ebp
16+
mov ebp, esp
17+
sub esp, 0x8
18+
19+
; prepare syscall
20+
xor ecx, ecx
21+
xor edx, edx
22+
mov DWORD [esp+0x4], 0x68732f
23+
mov DWORD [esp], 0x6e69622f
24+
mov ebx, esp
25+
mov eax, 0x0b
26+
int 0x80
27+
28+
; end like any other function
29+
add esp, 0x8
30+
pop ebp
31+
ret

0 commit comments

Comments
 (0)