these characters will crash your computer

preview_player
Показать описание
Did you know that 14 characters of bash or 5 lines of assembly can crash your computer? Yeah I know, its pretty wild. By using unbounded infinite recursion, a fork bomb can put your system in an unusable state that you can't escape from without restarting.

🏫 COURSES 🏫

🔥🔥🔥 SOCIALS 🔥🔥🔥

00:00 Introduction
00:18 What is a Fork Bomb?
00:38 How Does the Bash Fork Bomb Work?
01:17 Bash Demonstration
02:17 Assembly Fork Bomb
03:08 Outro
Рекомендации по теме
Комментарии
Автор

To understand recursion, first you must understand recursion

thelegalsystem
Автор

You can always count on the old fork bombs to slow down a PC. On a unrelated note, on Windows a similar fork bomb is even shorter, *%0 | %0* does the trick.

malwaretestingfan
Автор

I feel like once a semester the campus computer would go down and you’d be like, “Guess the OS class is writing their shells this week”.

chrisknestrick
Автор

in uni i had a recursion class, and the teacher said "make sure to always have an exit in the loop" he then showed us an example of a program without an exit and accidently ran it. The Zoom call ended at that point and he sent out an email 5 minutes later that his computer had crashed.

dromedda
Автор

This must be the mythical “F-Bomb” people worry about dropping

Grstearns
Автор

I work at a big tech shop and wrote a pretty gnarly bit of Python for some json parsing (very deep and non-consistent formats. I implemented recursion because I thought it was easier to understand. My co-workers reviewing the MR were so convinced that the code would not work that they denied the MR for over a week.

zakseipel
Автор

Technically, you don’t need the ampersand but then anyone can easily kill it.

haidermirza
Автор

Haha, fork bombs were one of the first thing you learn while messing around; I'm surprised there are still no mitigation against it. Nicely done.

test
Автор

We just need a spoon bomb that we could combine to make a spork bomb!!
Unfortunately there is no spoon in the matrix.

All joking aside the assembly implementation was really cool and makes me want to dive deeper into assembly and syscalls.

thestemgamer
Автор

Cool vid, thanks for your time and sharing your knowledge! Actually, I didn't even realize that a single colon (':') by itself was a pretty valid bash function name, better save it for something like "International Obfuscated bash Code Contest" :-) The assembly translation of the "fork bomb" is also delightful, it makes me want to dive into the field that I'm not really familiar with, it's still uncharted territory for me. Wish you good luck and more subscribers on your channel.

TunFlit
Автор

On most older UNIX systems, it would fill up the process table first before exhausting RAM. You'd get "No more processes, " if you tried to run any command. Later, shells had the kill command built in. You could have tried "kill -9 0" to kill every process except your current shell or "kill -9 -1" to kill every process of yours on the machine. The problem with that on modern systems is you are usually running all the GUI stuff that is supporting everything you're running, like your terminal. If you are shelled into a machine remotely, "kill -9 0" would likely take care of it.

Crw
Автор

So it's basically a recursive algorithm without a base case?

And I knew a guy who had the code for the fork bomb tattooed on his arm lol

brecoldyls
Автор

I got one like that from long ago that I discovered by accident (and took down a mainframe). Back in the terminal days, most editors use a change command in the form Cn1/text1/text2/n2 where C is the command for ‘change’, text1 is the current text and text2 is what you want it to change to. N1 is then number of lines to test and n2 is number of occurrences on a single line to test. Unfortunately, the values of n can be substituted by the wildcard ‘*’ (which means all occurrences). In this particular case, I was wanting to delete all the blanks in the file, so I needed to enter C*/ //* but as soon as I pressed return, the computer froze up. I just thought it coincidentally crashed (they crashed a lot back then) but when I looked at the screen the command said C*///* which literally says change all occurrences of nothing to nothing. Apparently, the space bar didn’t register my blank and I didn’t look up to see what was on the screen before pressing return.

Strike_Raid
Автор

So that's why no new video so far...

pinagpala_gwapo
Автор

I tried it, just to see if I could recover using sysrq.
Didn't get that far - running it in alacritty causes alacritty to crash after a while. Running it in a getty terminal causes the fork bomb to crash after a while.
I think I did enable OOM protection at some point, though I've not really noticed it working. Running out of memory has still been an issue when it happened, but it seems to be be competently killing this fork bomb.

Yotanido
Автор

If you kill the parent all those children will die, so if you exist the initial shell, that would end them all. Now, if you prefix with nohup, wild times.

Also, you can limit how many processes a user can do to avoid this, for linux be ulimit, as a rule, always define limits as there is no sky.

PaulGrayUK
Автор

I did a similar thing with html on my school Chromebook. it took ~7 seconds before the device was unusable, and I couldn't shut it down. I waited until the battery drained before I could use it again. Crazy how easy it is to set up.

retzerR
Автор

Security edition... Nice. A secure hardware is the building block for safer software and apps

Otakutaru
Автор

Great, now I wanna run this on a supercomputer just to see how long it takes for it to crash xD

lucasgasparino
Автор

It's interesting that you can name a bash function as ':'. Though, it'd make it too obvious what it's doing if you just named it 'a' or some such.

anon_y_mousse