Linux host2.homegym.sg 4.18.0-553.8.1.el8_10.x86_64 #1 SMP Tue Jul 2 07:26:33 EDT 2024 x86_64
Apache
Server IP : 159.223.38.192 & Your IP : 159.223.38.192
Domains : 20 Domain
User : eachadea
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Lock Shell
Lock File++
Readme
/
usr /
src /
file_protector-1.1-1583 /
Delete
Unzip
Name
Size
Permission
Date
Action
common
[ DIR ]
drwxr-xr-x
2025-10-28 18:03
ftrace_hooks
[ DIR ]
drwxr-xr-x
2025-10-28 18:03
lsm_hooks
[ DIR ]
drwxr-xr-x
2025-10-28 18:03
syscall_hooks
[ DIR ]
drwxr-xr-x
2025-10-28 18:03
transport
[ DIR ]
drwxr-xr-x
2025-10-28 18:03
Kbuild
10.29
KB
-rw-r--r--
2025-10-28 18:03
Makefile
2.23
KB
-rw-r--r--
2025-10-28 18:03
compat.c
8.42
KB
-rw-r--r--
2025-10-28 18:03
compat.h
11.98
KB
-rw-r--r--
2025-10-28 18:03
debug.h
3.56
KB
-rw-r--r--
2025-10-28 18:03
dkms.conf
146
B
-rw-r--r--
2025-10-28 18:03
file_contexts.c
60.43
KB
-rw-r--r--
2025-10-28 18:03
file_contexts.h
6.21
KB
-rw-r--r--
2025-10-28 18:03
file_contexts_priv.h
5.48
KB
-rw-r--r--
2025-10-28 18:03
file_handle_tools.h
2.53
KB
-rw-r--r--
2025-10-28 18:03
file_key_tools.h
950
B
-rw-r--r--
2025-10-28 18:03
file_path_tools.h
2.09
KB
-rw-r--r--
2025-10-28 18:03
hashtable_compat.h
2.73
KB
-rw-r--r--
2025-10-28 18:03
hook_trampoline_common.h
4.29
KB
-rw-r--r--
2025-10-28 18:03
interval_tree.h
779
B
-rw-r--r--
2025-10-28 18:03
memory.c
3.31
KB
-rw-r--r--
2025-10-28 18:03
memory.h
2.99
KB
-rw-r--r--
2025-10-28 18:03
module.c
2.67
KB
-rw-r--r--
2025-10-28 18:03
module_ref.h
421
B
-rw-r--r--
2025-10-28 18:03
module_rundown_protection.c
3.64
KB
-rw-r--r--
2025-10-28 18:03
module_rundown_protection.h
743
B
-rw-r--r--
2025-10-28 18:03
path_tools.h
6.06
KB
-rw-r--r--
2025-10-28 18:03
rundown_protection.c
4.2
KB
-rw-r--r--
2025-10-28 18:03
rundown_protection.h
2.83
KB
-rw-r--r--
2025-10-28 18:03
safe_kobject.h
1.28
KB
-rw-r--r--
2025-10-28 18:03
si_common.h
4.3
KB
-rw-r--r--
2025-10-28 18:03
si_fp_properties.h
858
B
-rw-r--r--
2025-10-28 18:03
si_fp_properties_x.h
18.53
KB
-rw-r--r--
2025-10-28 18:03
si_fp_value_types.h
515
B
-rw-r--r--
2025-10-28 18:03
si_fp_value_types_x.h
1.25
KB
-rw-r--r--
2025-10-28 18:03
si_size.h
4.26
KB
-rw-r--r--
2025-10-28 18:03
si_templates.h
2.99
KB
-rw-r--r--
2025-10-28 18:03
si_writer.h
7.52
KB
-rw-r--r--
2025-10-28 18:03
si_writer_common.h
14.63
KB
-rw-r--r--
2025-10-28 18:03
stringify.h
261
B
-rw-r--r--
2025-10-28 18:03
task_info_map.c
17.1
KB
-rw-r--r--
2025-10-28 18:03
task_info_map.h
6.33
KB
-rw-r--r--
2025-10-28 18:03
task_tools.h
1.34
KB
-rw-r--r--
2025-10-28 18:03
tracepoints.c
3.58
KB
-rw-r--r--
2025-10-28 18:03
tracepoints.h
299
B
-rw-r--r--
2025-10-28 18:03
write_protection.h
2.2
KB
-rw-r--r--
2025-10-28 18:03
Save
Rename
/** @file path_tools.h @brief Tools for working with 'struct path' @details Copyright (c) 2024 Acronis International GmbH @author Bruce Wang (bruce.wang@acronis.com) @since $Id: $ */ #pragma once #ifdef BPF_PROGRAM #include "compat_ebpf.h" #else #include "file_contexts.h" #include "file_key_tools.h" #include <linux/fcntl.h> #include <linux/magic.h> static inline void make_file_context_info_common_ino(file_context_key_t* key, const struct inode *inode) { make_key_from_inode(&key->file_key, inode); #ifdef HAVE_INODE_GET_MTIME key->i_mtime.tv_sec = inode_get_mtime(inode).tv_sec; key->i_mtime.tv_nsec = inode_get_mtime(inode).tv_nsec; #else key->i_mtime.tv_sec = inode->i_mtime.tv_sec; key->i_mtime.tv_nsec = inode->i_mtime.tv_nsec; #endif #ifdef HAVE_INODE_GET_CTIME key->i_ctime.tv_sec = inode_get_ctime(inode).tv_sec; key->i_ctime.tv_nsec = inode_get_ctime(inode).tv_nsec; #else key->i_ctime.tv_sec = inode->i_ctime.tv_sec; key->i_ctime.tv_nsec = inode->i_ctime.tv_nsec; #endif } static inline bool make_file_context_info_common(file_context_info_t *info , const struct path *path , uint64_t pid_version) { if (!path || !path->dentry || !path->dentry->d_inode) { return false; } make_file_context_info_common_ino(&info->msg_info.key, path->dentry->d_inode); info->pid_key = pid_version; return true; } static inline bool make_file_context_info_open(file_context_info_t *info , const struct path *path , uint64_t pid_version , int flags) { if (!make_file_context_info_common(info, path, pid_version)) return false; if ((flags & O_ACCMODE) <= O_RDWR) { flags += 1; } info->params.open.flags = flags; return true; } static inline bool make_file_context_info_rw(file_context_info_t *info , const struct path *path , uint64_t pid_version , uint64_t low, uint64_t high) { if (!make_file_context_info_common(info, path, pid_version)) return false; info->params.rw.low = low; info->params.rw.high = high; return true; } static inline bool make_file_context_info_modify(file_context_info_t *info, const struct inode *inode, uint64_t unique_pid) { if (!inode) return false; make_file_context_info_common_ino(&info->msg_info.key, inode); info->pid_key = unique_pid; return true; } static inline bool make_file_context_req_modify(file_context_add_cache_request_t* req, const struct inode *inode, uint64_t unique_pid) { if (!inode) return false; make_key_from_inode(&req->key.file_key, inode); req->pid_key = unique_pid; return true; } #endif #ifndef NSFS_MAGIC #define NSFS_MAGIC 0x6e736673 #endif #ifndef SYSFS_MAGIC #define SYSFS_MAGIC 0x62656572 #endif #ifndef PROC_SUPER_MAGIC #define PROC_SUPER_MAGIC 0x9fa0 #endif #ifndef DEBUGFS_MAGIC #define DEBUGFS_MAGIC 0x64626720 #endif #ifndef SECURITYFS_MAGIC #define SECURITYFS_MAGIC 0x73636673 #endif #ifndef CGROUP_SUPER_MAGIC #define CGROUP_SUPER_MAGIC 0x27e0eb #endif #ifndef CGROUP2_SUPER_MAGIC #define CGROUP2_SUPER_MAGIC 0x63677270 #endif #ifndef BPF_FS_MAGIC #define BPF_FS_MAGIC 0xcafe4a11 #endif #ifndef TRACEFS_MAGIC #define TRACEFS_MAGIC 0x74726163 #endif #ifndef FUSECTL_SUPER_MAGIC #define FUSECTL_SUPER_MAGIC 0x65735543 #endif #ifndef PSTOREFS_MAGIC #define PSTOREFS_MAGIC 0x6165676C #endif #ifndef CONFIGFS_MAGIC #define CONFIGFS_MAGIC 0x62656570 #endif #ifndef HUGETLBFS_MAGIC #define HUGETLBFS_MAGIC 0x958458f6 #endif #ifndef MQUEUE_MAGIC #define MQUEUE_MAGIC 0x19800202 #endif #ifndef DEVPTS_SUPER_MAGIC #define DEVPTS_SUPER_MAGIC 0x1cd1 #endif #ifndef SELINUX_MAGIC #define SELINUX_MAGIC 0xf97cff8c #endif static inline bool inode_is_usable(const struct inode *inode) { if (!inode) { return false; } if (!KERNEL_READ(inode, i_sb)) { return false; } return true; } // Checks for bare minimum requirements for 'path' to be any sort of reasonable static inline bool path_is_usable(const struct path *path) { struct dentry *dentry; if (!KERNEL_READ(path, mnt)) return false; dentry = KERNEL_READ(path, dentry); if (!dentry) { return false; } return inode_is_usable(KERNEL_READ(dentry, d_inode)); } static inline int magic_ok(unsigned long magic) { return magic != BPF_FS_MAGIC && magic != CGROUP_SUPER_MAGIC && magic != CGROUP2_SUPER_MAGIC && magic != CONFIGFS_MAGIC && magic != DEBUGFS_MAGIC && magic != DEVPTS_SUPER_MAGIC && magic != FUSECTL_SUPER_MAGIC && magic != HUGETLBFS_MAGIC && magic != MQUEUE_MAGIC && magic != NSFS_MAGIC && magic != PROC_SUPER_MAGIC && magic != PSTOREFS_MAGIC && magic != SECURITYFS_MAGIC && magic != SELINUX_MAGIC && magic != SYSFS_MAGIC && magic != TRACEFS_MAGIC ; } static inline int sb_ok(const struct super_block *sb) { return sb && magic_ok(KERNEL_READ(sb, s_magic)); } #ifndef S_IFMT #define S_IFMT 00170000 #endif #ifndef S_IFREG #define S_IFREG 0100000 #endif #ifndef S_IFDIR #define S_IFDIR 0040000 #endif #ifndef S_ISREG #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif #ifndef S_ISDIR #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif static inline bool check_if_usable_inode_valid(const struct inode *inode) { umode_t mode; if (!sb_ok(KERNEL_READ(inode, i_sb))) { return false; } mode = KERNEL_READ(inode, i_mode); if ((S_ISREG(mode)) || (S_ISDIR(mode))) return true; else return false; } static inline bool inode_is_valid(const struct inode *inode) { if (!inode_is_usable(inode)) { return false; } return check_if_usable_inode_valid(inode); } static inline bool path_is_valid(const struct path *path) { if (!path_is_usable(path)) { return false; } return check_if_usable_inode_valid(KERNEL_READ2(path, dentry, d_inode)); } static inline bool file_is_valid(struct file* f) { #ifndef BPF_PROGRAM return path_is_valid(&f->f_path); #else struct path path = BPF_CORE_READ(f, f_path); return path_is_valid(&path); #endif }