Explain to me what this "process kill bomb" script does

ga flag

Editor's Warning: The script in this question is likely malicious and should be read and understood for educational and informational purposes only. It is not recommended that you run it on your system.

Editor's Note: The original script below has been modified to add the echo command before the kill command to protect users who ignore the preceding.

I'm new, can you explain to me what this Bash script does?

a=$(ps aux | grep -v "sshd: $whoami" | awk '{print $2}'); count=10; while [ $count -gt 0 ]; do
b=$RANDOM; if echo $a | grep -qw $b; then count=$[ $count -1 ] && echo kill -9 $b; fi; done
Raffa avatar
jp flag
I added `echo` to both question and answer for safety. @ArturMeinild
Artur Meinild avatar
vn flag
@Raffa good call!
vn flag

This is some kind of process kill bomb that basically kills 10 random processes on your system. It does the following:

# List all PID's except `sshd` ($whoami returns an empty value, since this is not a valid variable)
a=$(ps aux | grep -v "sshd: $whoami" | awk '{print $2}');
# Set a counter of 10
# While the counter is greater than zero
while [ $count -gt 0 ]; do
  # Pick a random number
  # If the random number matches a PID
  if echo $a | grep -qw $b; then
    # Then decrease counter by one, and kill the process with this PID
    # Notice: echo was not in the main OP ... It's added to protect users who might try copy/paste code.
    count=$[ $count -1 ] && echo kill -9 $b; 

This looks like a noob process bomb designed to make a system unstable by killing random processes.

I wonder why you're posting stuff like this - but on the other hand, it's good to be informed about what it does.

Chariev Yakhya avatar
ga flag
Artur Meinild, thank you very much, a friend sent me this screen so that I can run it on my computer.
Artur Meinild avatar
vn flag
Pick your friends more carefully ...
Raffa avatar
jp flag
I kept trying to remember what I missed an hour ago when I was busy writing comments … and now I remembered +1 :-)
Chariev Yakhya avatar
ga flag
This script has several parameters, can you help me understand them in more detail?
I sit in a Tesla and translated this thread with Ai:


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.