Trap
Last updated
Adversaries may establish persistence by executing malicious content triggered by an interrupt signal. The trap command allows programs and shell to specify commands that will be executed upon receiving interrupt signals. A common situation is a script allowing for a graceful termination and handling of common keyboard interrupts like CTRL+C and CTR+D.
The trap command allows us to change what happens when certain signals are received. A demonstration on how we can call the calculator when a user utilizes the CTRL-C keyboard interruption.