Search Private Keys or Passwords
Description
Detect attempts to search for private keys or passwords using the grep or find command. This is often seen with unsophisticated attackers, as there are many ways to access files using bash built-ins that could go unnoticed. Regardless, this serves as a solid baseline detection that can be tailored to cover these gaps while maintaining an acceptable noise level.
Query · falco
spawned_process and ((grep_commands and private_key_or_password) or
(proc.name = "find" and (proc.args contains "id_rsa" or
proc.args contains "id_dsa" or
proc.args contains "id_ed25519" or
proc.args contains "id_ecdsa"
)
))
Rule dependencies
Depends on
-
composes · Falco macro
grep_commandsA shared condition, not a detection — not indexed on this site. -
composes · Falco macro
private_key_or_passwordA shared condition, not a detection — not indexed on this site. -
composes · Falco macro
spawned_processA shared condition, not a detection — not indexed on this site.
Analyst notes
Grep private keys or passwords activities found | evt_type=%evt.type user=%user.name user_uid=%user.uid user_loginuid=%user.loginuid process=%proc.name proc_exepath=%proc.exepath parent=%proc.pname command=%proc.cmdline terminal=%proc.tty exe_flags=%evt.arg.flags