Ukrycie procesów innych użytkowników wiąże się z ponownym zmapowaniem wirtualnej partycji /proc.

sudo mount -o remount,rw,hidepid=2 /proc

Żeby ukryć procesy permanentnie należy do pliku /etc/fstab dodać:

proc    /proc   proc    defaults,hidepid=2  0   0

Wartości jakie może przyjmować parametr hidepid:

Value Meaning

0

Everybody may access all /proc/[pid] directories. This is the traditional behavior, and the default if this mount option is not specified.

1

Users may not access files and subdirectories inside any /proc/[pid] directories but their own (the /proc/[pid] directories themselves remain visible). Sensitive files such as /proc/[pid]/cmdline and /proc/[pid]/status are now protected against other users. This makes it impossible to learn whether any user is running a specific program (so long as the program doesn’t otherwise reveal itself by its behavior).

2

As for mode 1, but in addition the /proc/[pid] directories belonging to other users become invisible. This means that /proc/[pid] entries can no longer be used to discover the PIDs on the system. This doesn’t hide the fact that a process with a specific PID value exists (it can be learned by other means, for example, by “kill -0 $PID”), but it hides a process’s UID and GID, which could otherwise be learned by employing stat(2) on a /proc/[pid] directory. This greatly complicates an attacker’s task of gathering information about running processes (e.g., discovering whether some daemon is running with elevated privileges, whether another user is running some sensitive program, whether other users are running any program at all, and so on).

W przypadku komplikacji można dodać git=admin, będzie to grupa, której użytkownicy będą mogli przeglądać wszystkie procesy.

proc /proc proc defaults,hidepid=2,gid=admin 0 0

Więcej informacji: http://man7.org/linux/man-pages/man5/proc.5.html


wstecz

Date: 2020-10-14T08:00:37+02:00