- "contingency" is just a little shell script that resists being killed with SIGINT (SIGnal INTerrupt) and SIGABRT (SIGnal ABoRT)
- Since I was running as 'AUX_ADMIN', I wasn't going to actually delete the account.
- I was using ZSH
- killall -ABRT contingency should really be 'rmmod contingency' or 'modprobe -r contingency'
Code for 'contingency':
#!/usr/local/bin/zsh trap "echo PERMISSION DENIED" SIGINT SIGABRT trap "echo OPERATION SUSPENDED" SIGHUP trap "echo TERMINATING PROCESSES..." SIGTERM while : do done
Code for 'delete':
echo "USER DELETED" # rather anticlimactic, isn't it?
export PS1=" [!] " export PATH=$PATH:$HOME/.bin
For the curious ones, here's a breakdown of what is done.
1.'contingency &' launches the program 'contingency', but runs it in the background. Without the ampersand (&), it wouldn't process any input.
2.'whoami' prints out the current user
3.'ps -U AUX_ADMIN' prints all the processes (ps) of the user AUX_ADMIN (-U AUX_ADMIN)
4.'killall -INT contingency' tries to send the Interrupt signal to all programs named contingency
5.'killall -ABRT contingency' tries to send the Abort signal to all the programs named contingency
6.'delete -u AUX_ADMIN' doesn't really do anything. In fact, there is not normally a 'delete' program in Linux.
7.'killall -STOP contingency' stops contingency in its tracks.
8.'killall -KILL contingency' forces contingency to quit.