Finished xdp ebpf program, successfully showing packets received. Added client from Umbra, it will be the C&C client

This commit is contained in:
h3xduck
2021-11-22 18:58:58 -05:00
parent 23c7331d16
commit b04200526c
19 changed files with 522 additions and 371 deletions

View File

@@ -16,7 +16,7 @@ INCLUDES := -I$(OUTPUT) -I./libbpf/include/uapi -I/lib/modules/5.11.0-40-generic
CFLAGS := -g -Wall #-I/lib/modules/5.11.0-40-generic/build/include
ARCH := $(shell uname -m | sed 's/x86_64/x86/')
APPS = xdp_filter
APPS = xdp_filter bootstrap
# Get Clang's default includes on this system. We'll explicitly add these dirs
# to the includes list when compiling with `-target bpf` because otherwise some
@@ -64,7 +64,7 @@ $(LIBBPF_OBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(OUTPU
install
# Build BPF code
$(OUTPUT)/%.bpf.o: $(EBPF)/%.bpf.c $(LIBBPF_OBJ) $(wildcard $(EBPF)/%.h) $(VMLINUX) | $(OUTPUT)
$(OUTPUT)/%.bpf.o: $(EBPF)/%.bpf.c $(LIBBPF_OBJ) $(wildcard $(EBPF)/%.h) | $(OUTPUT)
$(call msg,BPF,$@)
$(Q)$(CLANG) -g -O2 -target bpf -D__TARGET_ARCH_$(ARCH) $(INCLUDES) $(CLANG_BPF_SYS_INCLUDES) -c $(filter %.c,$^) -o $@
$(Q)$(LLVM_STRIP) -g $@ # strip useless DWARF info