O'Reilly logo

Penetration Testing with Perl by Swizec Teller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Killing runaway forked processes

The Linux utility ps has the ability to show us our own processes that we have started. To stop a forked process, we simply need the Process ID, or PID, and use that PID as an argument to either the Perl kill or the Linux kill functions to send different kill signals to the processes to stop them. Unfortunately, there's no definite solid way to find the PID of a shelled command that is forked with & using Perl itself. We can, however, search through our own listed applications returned from the Linux ps utility and parse out the PID we want, and call the Perl kill function with. The Perl kill function will send a signal to the application, in which we can specify to kill or stop it. We can call ps from the shell ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required