you are viewing a single comment's thread
view the rest of the comments
[–] 143 points 1 year ago* (last edited 1 year ago) (7 children)

This is a Bash fork bomb, a malicious function definition that recursively calls itself:

:() — defines a function named : (yes, just a colon).

{ :|:& } — the function's body:

    :|: — pipes the output of the function into another call of itself, creating two processes each time.

    & — runs the call in the background, meaning it doesn’t wait for completion.

; — ends the function definition.

: — finally, this invokes the function once, starting the bomb.
  • source
  • parent
  • hideshow 7 child comments
  • [–] 3 points 1 year ago (3 children)

    Why are the square brackets there?

  • source
  • parent
  • hideshow 3 child comments
  • [–] 4 points 1 year ago (1 child)

    There aren't any square brackets.

    The form "function(){content}" in bash defines a function called "function" that, when called by name, executes "content". This forkbomb defines a function called : (just a colon) which calls itself twice in a new subprocess (the two colons inside the curly brackets). It thus spawns more and more copies of itself until it overwhelms your processor.

  • source
  • parent
  • hideshow 1 child comment