Compiling and Testing hidepid
To test the module, use the following makefile:
obj-m += hidepid.o
Compile using the following make
command:
[notroot]$ make -C /usr/src/linux-`uname -r` SUBDIRS=$PWD modules
Test the module by executing ps
to list the
sleep
process we initiated earlier:
[notroot]$ ps a | grep 4781
4781 tty1 S 0:00 sleep 999999
6545 tty1 R 0:00 grep 4781
Insert the module:
[root]# insmod ./hidepid.ko
Now, the sleep process is no longer visible:
[notroot]$ ps a | grep 4781
6545 tty1 R 0:00 grep 4781
Remember to remove the module when done:
[root]# rmmod hidepid
Get Network Security Tools now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.