mirror of
https://github.com/h3xduck/TripleCross.git
synced 2025-12-16 23:33:06 +08:00
Added new helper program to be used with the execve hijacking module
This commit is contained in:
36
src/ebpf/include/bpf/exec.h
Normal file
36
src/ebpf/include/bpf/exec.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef __EXEC_H
|
||||
#define __EXEC_H
|
||||
|
||||
#include "headervmlinux.h"
|
||||
|
||||
#include <bpf/bpf_helpers.h>
|
||||
#include <bpf/bpf_tracing.h>
|
||||
#include <bpf/bpf_core_read.h>
|
||||
|
||||
#include "../../../common/constants.h"
|
||||
#include "../../../common/map_common.h"
|
||||
#include "defs.h"
|
||||
#include "../utils/strings.h"
|
||||
|
||||
|
||||
/**
|
||||
* >> cat /sys/kernel/debug/tracing/events/syscalls/sys_enter_open/format
|
||||
*/
|
||||
struct sys_execve_enter_ctx {
|
||||
unsigned long long unused;
|
||||
int __syscall_nr;
|
||||
unsigned int padding;
|
||||
const char* const *argv;
|
||||
const char* filename;
|
||||
const char* const *envp;
|
||||
};
|
||||
|
||||
|
||||
SEC("tp/syscalls/sys_enter_execve")
|
||||
int tp_sys_enter_execve(struct sys_execve_enter_ctx *ctx) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
BIN
src/helpers/execve_hijack
Executable file
BIN
src/helpers/execve_hijack
Executable file
Binary file not shown.
9
src/helpers/execve_hijack.c
Normal file
9
src/helpers/execve_hijack.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char* argv[]){
|
||||
printf("Hello world from execve hijacker\n");
|
||||
for(int ii=0; ii<argc; ii++){
|
||||
printf("Argument %i is %s\n", ii, argv[ii]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user