• fork bombs

    From MeaTLoTioN@1337:1/101 to All on Fri Mar 18 15:11:56 2022
    Hi y'all,

    I was chatting to a work colleague today and conversation went down a path which included bash fork bombs (I don't know how it went there, but it did), and it turns out my colleague had heard of them, and even knew that they did stuff to a computer, but didn't really know what it did exactly, and what that would look like in real life.

    With that in mind, I created a VM and recorded a short video (< 2 min i think) showing exactly what happens when such a fork bomb is run on a computer.

    The video can be watched on YouTube here; https://youtu.be/CmWgXMC9pe8
    The video can be watched on Odysee here ; https://erb.pw/y/forkbomb

    I hope that this video is of some use.

    I will go over the basics of what a fork bomb is, and how it works;

    Here's the fork bomb:
    :(){ :|: & };;

    Breaking this down, what it is doing is defining a bash function, we can do this for anything like this;

    myfunction() {
    # some code here
    }

    in this case, the function name is just ":" (a colon). The code inside the function, the stuff that the function does, is calls itself (recursion) and then pipes any output from stdout caused by itself into the stdin of itself;

    :|:

    We would normally do something like this;
    echo "hello world"|base64

    echo "hello world" would make "hello world" come out of stdout, and we are piping that into base64.

    The "&" in the fork bomb is used to put the command immediately before it into the background. We can do something similar with say nautilus. Openning a terminal and running "nautilus . &" would run the file manager, and give control back to the terminal that called it, not using the "&" would lock the terminal that called the file manager until the file manager closed.

    After the function has been defined, we immediately use the function.


    I hope this explains what the fork bomb is, and hopefully you can understand why it causes the issue you see in the video.

    ---
    |14Best regards,
    |11Ch|03rist|11ia|15n |11a|03ka |11Me|03aTLoT|11io|15N

    |07── |08[|10eml|08] |15ml@erb.pw |07── |08[|10web|08] |15www.erb.pw |07───┐ |07── |08[|09fsx|08] |1521:1/158 |07── |08[|11tqw|08] |151337:1/101 |07┬──┘ |07── |08[|12rtn|08] |1580:774/81 |07─┬ |08[|14fdn|08] |152:250/5 |07───┘
    |07── |08[|10ark|08] |1510:104/2 |07─┘

    ... Don't sweat the petty things and don't pet the sweaty things

    --- Mystic BBS v1.12 A47 2021/12/13 (Linux/64)
    * Origin: thE qUAntUm wOrmhOlE, rAmsgAtE, uK. bbs.erb.pw (1337:1/101)
  • From Satchmo@1337:1/107 to MeaTLoTioN on Mon Mar 21 16:54:24 2022

    Hello MeaTLoTioN!

    Replying to a msg dated 18 Mar 22 15:11, from you to all.

    [snip]

    Interesting stuff. Makes you wonder why ubuntu doesnt ship with a lower default ulimit.

    Satchmo


    ... Auto correct has become my worst enema.
    --- GoldED+/LNX 1.1.5--b20170303
    * Origin: Sonic BBS :: North Yorkshire, England (1337:1/107)
  • From paulie420@1337:3/129 to MeaTLoTioN on Mon Mar 21 18:35:52 2022
    I hope this explains what the fork bomb is, and hopefully you can understand why it causes the issue you see in the video.

    Thanks mL - I knew about these, but by their other pet name 'wabbits', but didn't know EXACTLY the break down of what the function DID. Thanks for explaining in detail like you often do - the video was cool and I appreciate the knowledge.



    |07p|15AULIE|1142|07o
    |08.........

    --- Mystic BBS v1.12 A48 2022/03/11 (Raspberry Pi/32)
    * Origin: 2o fOr beeRS bbs>>>20ForBeers.com:1337 (1337:3/129)