0

I make a project in Python3 for Raspberry Pi 4 I use few cli applications that. In ps/htop/top I wanted to hide the command line used on it due to some security concerns. I tried libprocesshider and its hiding entire process from the process table. And no /proc/ generated. This seems much better for our client.

But I couldn't check IsProcessRuning() to kill the previous instance and start a new one. Is there any other clue to list the running process without /proc/ ?

Similar question is found here, but no proper answer yet. List running processes without procfs

libprocesshider https://github.com/gianlucaborello/libprocesshider/blob/master/processhider.c https://sysdig.com/blog/hiding-linux-processes-for-fun-and-profit/

gaamaa
  • 3

1 Answers1

0

libprocesshider just loads special version of readdir(), which doesn't list specified entries in /proc. To list all enties you can:

  • Bind mount procfs somewhere else and read process info from there.
  • Load original versions of readdir() using dlopen()/dlsym().
  • Use readdir syscall directly. For reference see readdir() implementation from your libc.