diff options
Diffstat (limited to 'detect/main.c')
| -rw-r--r-- | detect/main.c | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/detect/main.c b/detect/main.c new file mode 100644 index 0000000..09e7515 --- /dev/null +++ b/detect/main.c | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | #include <signal.h> | ||
| 2 | #include <stdio.h> | ||
| 3 | #include <stdlib.h> | ||
| 4 | #include <string.h> | ||
| 5 | #include <sys/ptrace.h> | ||
| 6 | |||
| 7 | #include "gdb.h" | ||
| 8 | #include "various.h" | ||
| 9 | |||
| 10 | |||
| 11 | int main(int argc, char** argv){ | ||
| 12 | unsigned int res = 0; | ||
| 13 | |||
| 14 | printf(".: GDB detector :.\n\n"); | ||
| 15 | |||
| 16 | if(res += dbg_file_descriptor()) | ||
| 17 | printf("[x] file descriptor\n"); | ||
| 18 | else | ||
| 19 | printf("[ ] file descriptor\n"); | ||
| 20 | |||
| 21 | if(res += dbg_cmdline()) | ||
| 22 | printf("[x] /proc/PID/cmdline\n"); | ||
| 23 | else | ||
| 24 | printf("[ ] /proc/PID/cmdline\n"); | ||
| 25 | |||
| 26 | if(res += dbg_sigtrap()) | ||
| 27 | printf("[x] SIGTRAP\n"); | ||
| 28 | else | ||
| 29 | printf("[ ] SIGTRAP\n"); | ||
| 30 | |||
| 31 | if(res += dbg_getppid_name()) | ||
| 32 | printf("[x] getppid name\n"); | ||
| 33 | else | ||
| 34 | printf("[ ] getppid name\n"); | ||
| 35 | |||
| 36 | if(res += dbg_ptrace()) | ||
| 37 | printf("[x] ptrace\n"); | ||
| 38 | else | ||
| 39 | printf("[ ] ptrace\n"); | ||
| 40 | |||
| 41 | if(res) | ||
| 42 | printf("\n[*] GDB detected\n"); | ||
| 43 | else | ||
| 44 | printf("\n[ ] No GDB detected\n"); | ||
| 45 | |||
| 46 | |||
| 47 | res = 0; | ||
| 48 | printf("\n\n"); | ||
| 49 | printf(".: Various tricks detector :.\n\n"); | ||
| 50 | |||
| 51 | if(res += various_ldpreload()) | ||
| 52 | printf("[x] LD_PRELOAD\n"); | ||
| 53 | else | ||
| 54 | printf("[ ] LD_PRELOAD\n"); | ||
| 55 | |||
| 56 | if(res += various_ldpreload_custom_getenv()) | ||
| 57 | printf("[x] hidden LD_PRELOAD\n"); | ||
| 58 | else | ||
| 59 | printf("[ ] hidden LD_PRELOAD\n"); | ||
| 60 | |||
| 61 | if(res += various_rdtsc()) | ||
| 62 | printf("[x] Something is slowing the process...\n"); | ||
| 63 | else | ||
| 64 | printf("[ ] Everything is running well\n"); | ||
| 65 | |||
| 66 | if(res) | ||
| 67 | printf("\n[*] Something is wrong\n"); | ||
| 68 | else | ||
| 69 | printf("\n[ ] Everything seems fine\n"); | ||
| 70 | |||
| 71 | return 0; | ||
| 72 | } | ||
