mirror of
https://github.com/h3xduck/TripleCross.git
synced 2025-12-26 19:33:07 +08:00
Added new libc symbols extraction
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
#include <linux/if_link.h>
|
||||
#include <net/if.h>
|
||||
#include <unistd.h>
|
||||
#include <dlfcn.h>
|
||||
#include <link.h>
|
||||
|
||||
#include <bpf/bpf.h>
|
||||
|
||||
@@ -209,6 +211,20 @@ int main(int argc, char**argv){
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
struct link_map *lm;
|
||||
off_t offset = 0;
|
||||
unsigned long long dlopenAddr;
|
||||
lm = dlopen("libc.so.6", RTLD_LAZY);
|
||||
if(lm==0){
|
||||
perror("Error obtaining libc symbols");
|
||||
return -1;
|
||||
}
|
||||
dlopenAddr = (unsigned long long)dlsym((void*)lm, "__libc_dlopen_mode");
|
||||
printf("libdl: %lx\n", lm->l_addr);
|
||||
printf("dlopen: %llx\n", dlopenAddr);
|
||||
offset = dlopenAddr - lm->l_addr;
|
||||
printf("Offset: %lx\n", offset);
|
||||
|
||||
//Now wait for messages from ebpf program
|
||||
printf("Filter set and ready\n");
|
||||
while (!exiting) {
|
||||
|
||||
Reference in New Issue
Block a user