please enjoy this incredible Linux API i just found out about https://www.man7.org/linux/man-pages/man5/proc_pid_comm.5.html
-
please enjoy this incredible Linux API i just found out about https://www.man7.org/linux/man-pages/man5/proc_pid_comm.5.html
-
Future Sprogreplied to ✧✦✶✷Catherine✷✶✦✧ last edited by
There are a lot of fun things in the proc filesystem. That’s a good one.
One I quite like is extracting the environment variables for a running process.
tr '\0' '\n' < /proc/PID/environ
You can search that for API keys and secrets. It is limited to only your own processes but still fun.
I used this recently to figure out why a long running processes was sending logs to the wrong place. Someone had slid another export into its startup script!
-
@futuresprog @whitequark so your own username's processes?
or only a parent's child forks?
-
By user
But it depends on any other isolation / hardening stuff that has been added by your distro.
Ubuntu 22 and later complains a lot but I never investigated why.
RHEL / CentOS / Rocky are fine.