The exec-notify tool is used to monitor applications for attempts to escape from a restricted shell environment on a Linux system. When exec-notify is installed and enabled, it intercepts calls to the exec
function and sends a notification to a configured destination, such as syslog or a remote server, when an application attempts to execute a command that is not allowed by the restricted shell.
To use exec-notify, you will need to install the tool on your Linux system and configure it to monitor the applications you want to track. Here is an example of how you can install and configure exec-notify on a CentOS or Red Hat Enterprise Linux (RHEL) system:
yum
:sudo yum install exec-notify
sudo systemctl enable exec-notify
sudo systemctl start exec-notify
echo "notify-to syslog" | sudo tee -a /etc/exec-notify.conf
notify-to
option:echo "notify-to remote_server:port"