summaryrefslogtreecommitdiff
path: root/exploits/7350wurm/shellcode/pt/rptrace.c
diff options
context:
space:
mode:
authorRoot THC2026-02-24 12:42:47 +0000
committerRoot THC2026-02-24 12:42:47 +0000
commitc9cbeced5b3f2bdd7407e29c0811e65954132540 (patch)
treeaefc355416b561111819de159ccbd86c3004cf88 /exploits/7350wurm/shellcode/pt/rptrace.c
parent073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff)
initial
Diffstat (limited to 'exploits/7350wurm/shellcode/pt/rptrace.c')
-rw-r--r--exploits/7350wurm/shellcode/pt/rptrace.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/exploits/7350wurm/shellcode/pt/rptrace.c b/exploits/7350wurm/shellcode/pt/rptrace.c
new file mode 100644
index 0000000..f7de48b
--- /dev/null
+++ b/exploits/7350wurm/shellcode/pt/rptrace.c
@@ -0,0 +1,42 @@
1#define MODULE
2#define __KERNEL__
3#include <linux/module.h>
4#include <linux/kernel.h>
5#include <sys/syscall.h>
6#include <linux/smp_lock.h>
7#include <linux/capability.h>
8
9struct task_struct *init_hook = NULL;
10extern void *sys_call_table[];
11
12int (*o_ptrace)(int, int, int, int);
13
14int n_ptrace(int req, int pid, int addr, int data)
15{
16 int r;
17
18 r = o_ptrace(req, pid, addr, data);
19 printk ("PTRACE (%08x, %08x, %08x, %08x) = %08x\n", req, pid, addr, data, r);
20 return (r);
21}
22
23#define REPLACE(x) o_##x = sys_call_table[__NR_##x];\
24 sys_call_table[__NR_##x] = n_##x
25int init_module(void)
26{
27 lock_kernel();
28 EXPORT_NO_SYMBOLS;
29 REPLACE(ptrace);
30 unlock_kernel();
31 return(0);
32}
33
34#define RESTORE(x) sys_call_table[__NR_##x] = o_##x
35int cleanup_module(void)
36{
37 lock_kernel();
38 RESTORE(ptrace);
39 unlock_kernel();
40 return(0);
41}
42