Briefing
A privileged shell function can shadow any command the user types, including system tools like
ps. An attacker who gains a shell can define a ps function that
calls the real binary but silently pipes the output through grep -v <miner>,
removing all lines mentioning the malicious process. The administrator runs ps and
sees a clean process list. The miner consumes 98% CPU and they never notice.
Shell functions sit above even PATH in the resolution chain. They win over binary lookups. The only escape is calling the binary by its absolute path.
The attacker defined a ps shell function. It intercepts every call before $PATH is consulted.