11 Characters That Crash Any PC: the Fork Bomb!

  Рет қаралды 498,473

Dave's Garage

Dave's Garage

Жыл бұрын

Dave explains fork bombs, what they are, how they work, the damage they can do, and why they're called fork bombs. By using infinite parallel recursion a fork bomb can bring any Windows, Linux, or Mac machine, and Dave explains which machines can be easily protected against fork bombs and which remain vulnerable.
For information on my book, "Secrets of the Autistic Millionaire":
amzn.to/3diQILq
My other channel, join now so you're there for episode 01 of my AudioBook!
/ @davepl
Discord Chat w/ Myself and Subscribers: / discord
Primary Equipment (Amazon Affiliate Links):
* Camera: Sony FX-3 - amzn.to/3w31C0Z
* Camera Lens: 50mm F1.4 Art DG HSM - amzn.to/3kEnYk4
* Microphone: Electro Voice RE 320 - amzn.to/37gL65g
* Teleprompter: Glide Gear TMP 100 - amzn.to/3MN2nlA
* SD Cards: Sony TOUGH - amzn.to/38QZGR9

Пікірлер: 1 300
@NeillPowell
@NeillPowell Жыл бұрын
Weighing in here: One of July's most informative videos on the entire KZbin platform. it's a pity that Dave doesn't have more followers, his work is really good.
@DavesGarage
@DavesGarage Жыл бұрын
It's a niche audience so sharing it really helps!
@01001000010101000100
@01001000010101000100 Жыл бұрын
Come on, for that kind of advanced tech stuff - over 250k is plenty of people. For most computer users what Dave talks about is a pure black magic ;)
@UncleKennysPlace
@UncleKennysPlace Жыл бұрын
@@leyasep5919 512k, unless you are a power user.
@JonasOlesen
@JonasOlesen Жыл бұрын
@@leyasep5919 Nice reflection on the conscientiousness of proper language segmentation.
@JonasOlesen
@JonasOlesen Жыл бұрын
@@leyasep5919 Even though you made me laugh hard, twice today, and made me think of Futurama. The reference disappeared and should no longer be found in config.sys. god.img is a function of pure coincidence, so i apologise and say thank you.
@davidwilliss5555
@davidwilliss5555 Жыл бұрын
We had a guy back in college (in the 80s) accidentally code a fork bomb in C. His was due to lack of error checking. He had a loop that was supposed to wait for a message, fork and have the child process exec another program passing it that message. What he failed to do was 1. check for an error condition on the exec causing the child process to loop back instead of exiting with the other process. It tried to call another program that he hadn't written yet so that failed. and 2) check for an error on the socket receiving the message. Once 2 processes were trying to listen on the socket, one would fail because the socket was in use. But he ignored that and forked anyway. There were a bunch of us in the computer lab trying to pull an all-nighter on a project, but this guy brought down the VAX and nobody had admin rights to fix it so we just all went home.
@woodendoorgarage
@woodendoorgarage Жыл бұрын
Similar thing happened to us about 20 years ago. Our faculty was still using usparc Solaris servers with about 120 thin clients for Java coding and general unix classes and every student also had ssh access to the server and could use it remotely. It was slow as hell but also a bit old-school cool. At least we thought so. Well, one day we had C++ class in big auditorium and the profesor was describing process management, forks, etc. and had example of fork bomb on the screen. He warned us that it will crash many systems but also mentioned that well managed multi-user systems are well protected because it is such a beginners DOS attack. Minute later all students lost access to one of the Solaris servers... I actually knew the guy that ran the code from the screen. He genuinely thought that he would get some weird SunOS error message and maybe his session would close. Almost got expelled because of it because he nuked the server for half a day and it needed some recovery. Luckily they realized it was not malicious and really more admin mistake.
@nope1918
@nope1918 Жыл бұрын
@@woodendoorgarage Guess that means their system wasn't well managed then lol
@terrymiller111
@terrymiller111 Жыл бұрын
I knew you weren't lying, 'cause VAX nights in the computer lab was the way for CS students at my school.
@sonario0074
@sonario0074 Жыл бұрын
A friend of mine actually made a script in python that opens cmd about 10 times every second. Not too dangerous but still deadly. At least that thing could be stopped before it did any damage.
@jonetyson
@jonetyson 11 ай бұрын
I remember in CS119 at Princeton in 1988 that the mainframe computer kept going down the night before the assignment was due. This went on for about 6 weeks in a row, until some admin realized that there was a memory problem that only became evident when everybody in the class was logged on at the same time.
@ncot_tech
@ncot_tech Жыл бұрын
For extra fun, make the program exit after forking itself and not start a second copy. It won't take down your system, but you'll end up with an "unkillable" task that runs around memory, possibly upsetting the scheduler.
@citywitt3202
@citywitt3202 Жыл бұрын
Could you insert malicious code into that with progress tracked from run to run somewhere on disk so you have an Unkillable malicious process? Sorry if that’s a silly question i’m only a hobbyist programmer.
@Yolo_Swaggins
@Yolo_Swaggins Жыл бұрын
@@citywitt3202 Yes
@m4ster_root
@m4ster_root Жыл бұрын
So all you'd end up with is a single bash process calling a recursive method endlessly without spawning new processes? If that's the case I'd assume it to be easily killable, assuming you're aware that the process is running. The more malicious stuff you start doing, the more obvious the process becomes, and remember, the process itself does not have any special rights. You're effectively just calling a bash function in a background process.
@HenryLoenwind
@HenryLoenwind Жыл бұрын
@@m4ster_root No, you make something like "while(1) fork();". This will create new copies of itself in an endless loop and every copy will create copies of itself in an endless loop which all will... You can even do this by accident (that's how many people learnt about it). Make some forks in a loop (e.g. to spawn 5 worker processes), but mess up the check for "am I the new copy?"
@m4ster_root
@m4ster_root Жыл бұрын
@@HenryLoenwind I simply commented on this "...make the program exit after forking itself and not start a second copy. It won't take down your system..." if the system is not "taken down" then the forked process must not be creating copies either. You'd only have that initial forked process doing whatever it's written to do. Still, unless the system is completely unresponsive you'd still be able to kill all the bash processes. Just because the main process has terminated doesn't mean that all the forked processes can't be terminated too.
@55ATA3
@55ATA3 Жыл бұрын
I always love it when you see people talking about issues like this, you always get the people telling you not to make video's about it. But they don't understand that anyone with a little time can find the information on issues like this and how to deploy it. It's just sad that people think that if you don't talk about it people can't figure it out on there own. The more that we talk about issues like this the more our systems can be programed to keep them from being hit by bad actors on the net.
@D3M3NT3Dstrang3r
@D3M3NT3Dstrang3r Жыл бұрын
It is done with any controversial topic. Like lockpicking, or hacking ect. People always complain that you are sharing how it is done with x amount of people without realizing that the people that would attempt these attacks would acquire this knowledge with or without said video. It actually helps to spread awareness of the weaknesses of said systems and gives people an idea how to protect themselves. But hey, what you don't know about can't hurt you right. /s
@michaelhanson5773
@michaelhanson5773 Жыл бұрын
The issue isn't that you cannot find it on the internet, what happens is that when it is brought up, someone may not have known about it until they see the video or maybe someone will see the video and then want to try it on a work or school pc or something. Yes, if you wanted to find out about it you can on your own. It has been years since i have heard about fork bombs and watching this video did actually bring up something that i had pretty much forgotten about. Not everyone may have known what a fork bomb is so they would not have known how to look it up prior to this video but now you might have more people curious that might want to mess with it. I do believe knowledge is power and actually agree that it is better to discuss it and show it than leaving people to have to look it up... I think Dave did the right thing talking about it and the video was pretty good. 👍
@QuadPowerful
@QuadPowerful Жыл бұрын
That approach is a double edged sword. On one hand it educates us and raises awareness about about this issue,on the other hand it will be a new tool in the arsenal of malicious actors who have not known about it until they saw the video.
@babybirdhome
@babybirdhome Жыл бұрын
The real issue is prevention or mitigation. Using this in an attack or maliciously requires a low level of knowledge and a low level of effort. Prevention or mitigation, on the other hand, requires a higher level of effort and a higher level of knowledge. On the balance, then, this one is one that’s better not to talk about widely. However, while Dave’s videos are always interesting and go into technical details, the kinds of low effort, low knowledge people we’re talking about who would make life hell for an admin aren’t going to find his videos interesting enough to stick with them or to find them in the first place. So the risk of him sharing this here is lower, over all.
@ZombiesWerePeopleToo
@ZombiesWerePeopleToo Жыл бұрын
Yeah I totally agree, it’s trivial to do this even without bash so long as you have access to spawning threads, bash is just a simple interfaxe to it. It’s not a magic "cheat code" and it’s far less dangerous than almost anything else you can do with access to running arbitrary unsandboxed code. The worst that can happen from mentioning it is a couple of junior high school computers need to be restarted but nothing worse.
@jdrissel
@jdrissel Жыл бұрын
Back when Sun Microsystems made big machines, we had some code that the Sun reps swore would scale but our experience suggested otherwise. It took some work to get a sanitized version of the data to test with (the real data was TS SCI) but we eventually got an unclassified test case. It stalled every machine we tried it on when that machine was running Solaris Trusted Zones, but on the older system running Trusted Solaris it completed just fine, even on really old hardware with little ram and small, slow drives. Eventually someone swore it had to work, we just had not thrown enough hardware at it yet and offered a run on an E15000 (which is essentially an entire data center). At about 20 minutes error messages began to appear and the console began to lag. After 30 minutes it was unresponsive and most of the cores were maxed out. The cores were all swapping memory to disk. At about 8 hours the disk arrays began to fill up. At 12 hours it halted. All disks full, all memory allocated. The same program took about 45 seconds on a Sparc 5! Implementation details matter a lot!
@angrydragonslayer
@angrydragonslayer Жыл бұрын
This is what i say about videogames Just spend the time optimising and you can get better quality than AAA today on older hardware People being lazy and going "it's good enough" is the bane of performance
@TorutheRedFox
@TorutheRedFox Жыл бұрын
@@angrydragonslayer I've managed to get PS3-like visual quality on an Intel HD Graphics 4000 in a MacBook Pro in Unity at a decent framerate for the hardware it's running on
@angrydragonslayer
@angrydragonslayer Жыл бұрын
@@TorutheRedFox i am impressed by your efforts but also disgusted by the mac
@notaboutit3565
@notaboutit3565 Жыл бұрын
@@TorutheRedFox damn so they didn’t need custom cell CPU’s after all huh? Lol Cool project!
@williambarnes5023
@williambarnes5023 Жыл бұрын
*"damn so they didn’t need custom cell CPU’s after all huh? Lol"* They could have written optimized code. Instead they made hardware optimized for their shitty code practices.
@RandomDude989
@RandomDude989 Жыл бұрын
I did something like this back in the early 2000's in programming class in High School. I was bored with the programming assignments, they were very easy, and the teacher told me to write whatever I wanted. I told her to run it on the isolated test machine in the lab. She was impressed but not happy. lol.
@xtremeg0d
@xtremeg0d 7 ай бұрын
Lmfao 😂
@christopheroliver148
@christopheroliver148 4 күн бұрын
I wish we had modern Linux/BSD PCs back during my high school days. Back then we had programmable calculators, and I played with the PDP-11/34 at the adjacent community college where my father taught English. These days, even a cheap PC off eBay is plenty capable to run classic high level languages such as Lisp or Smalltalk. Even most mainframes back when I started weren't even close to that power.
@oleleclos
@oleleclos Жыл бұрын
Brings back memories. Back in the early ‘70s I wrote a simple CP/M batch file to test disk drive reliability. It copied one entire 8” floppy disk to another, then deleted the original and repeated the process endlessly - or until the computer crashed, which many did. It earned me the nickname Mad Bomber :-)
@phobos258
@phobos258 Жыл бұрын
Watching Dave's videos is like watching your old friend to tell you wonderful stories about his life.
@BillAnt
@BillAnt 8 ай бұрын
That got me smiling because it's true. Your autistic yet smart uncle. :)
@NickWeissMusic
@NickWeissMusic 6 ай бұрын
He is!
@code123ns
@code123ns Жыл бұрын
As a kid I didn't have access to any programming language that could compile into a real .exe. So, I experimented if I could just change the extension of a .bat file to .exe and run it. The result - MSDOS 7 would just restart. The first line of the batch file was - @echo off. I then found out that it was enough for a text file to have a @ at the beginning, save it as .exe and it would restart the PC if run from the prompt.
@orti1283
@orti1283 Жыл бұрын
Awesome!
@deangawler9727
@deangawler9727 Жыл бұрын
I remember an IBM engineer telling me about this concept in the 90's when I was an admin for their RS6000 platform. I wrote a shell script on one of the test servers that recursively forked copies of itself as background processes. It had the same effect as this, but your version is so much simpler and is more elegant. I love it!
@markuskuhn9375
@markuskuhn9375 Жыл бұрын
On modern Linux, systemd places each session into a separate cgroup, and the kernel is now pretty good with preventing processes from different cgroups starving each other from resources. However, WSL is not a full modern Linux system based on systemd. It is just the kernel and bash, and none of the other user-level system management glue code (e.g. systemd's out-of-memory kill daemon) that make up bare-metal installed Linux distributions. So there is still a lot of infrastructure missing in WSL2 compared to a native install, and therefore you can't really learn how e.g. Ubuntu 22.04 behaves in such situations from playing with it in WSL2.
@QualityDoggo
@QualityDoggo Жыл бұрын
so ironically it might have been better either on a VM or Bare metal but this one situation was worse? Lol
@jessepollard7132
@jessepollard7132 Жыл бұрын
The out of memory kill process predates systemd by several years.
@ruaphoc
@ruaphoc 10 ай бұрын
In this case though, I don’t think the OOM is the problem you would trigger. The kernel is just too busy running a backgrounded user process, at a higher priority. OOM killer would trigger if the memory was low, but only if there were the spare cpu cycles to trigger and process the kill commands. However, systemd as mentioned, has the concept of control groups. I think you might be able to do something with systemd reexec to get the kernel/systemd running outside of the former process hierarchy. If you can do that, and either move your htop window terminal login session to the new control group, or use it to kill the fork bomb control group you might have a chance. The key I think is to get the fork bomb out of the running systemd/kernel process tree control group to bring resources back to the core system in order to perform heavier tasks like managing the fork bombed cgroup. This is all theoretical as I don’t have access to a Linux device at the moment, but a work project is involving a similar process to get out of CentOS and running Ubuntu 22.04 under the old CentOS kernel.
@davorzmaj753
@davorzmaj753 9 ай бұрын
I just tried it on a native install of Ubuntu 20.04. systemd didn't help me. My plan was, once the fork bomb was running in window A, to switch to window B and "exec kill -9 -1" to see if it'd kill off the fork bomb. (I'd pre-launched a bunch of terminal windows, so I'd have several chances at it in case I screwed up once or twice.) Result: a few seconds after the fork bomb began to complain that it couldn't fork any more, I stopped being able to switch windows. I guess the window manager wasn't getting enough CPU cycles to respond to my mouse clicks. Even CTRL-ALT-F3 wasn't responding (normally, that would give me a character-mode login prompt). Perhaps if I'd waited long enough, I'd have gotten a shell into which to type that kill command -- as often happens when the system is page thrashing, though it can be an excruciatingly long wait -- but I got impatient and did a hard power off. (Of course I'd made sure the system was quiescent, with nothing important running, before I started the test.) EDIT: that "exec kill -9 -1", run *not* as root, would have killed off my whole X-Windows session, but again, that was a sacrifice I was prepared for.
@davorzmaj753
@davorzmaj753 9 ай бұрын
Interesting. I just tried it again on the same system, but using character-mode shells, not terminal windows. I'd done the usual graphical login, but wasn't using that for the test. I was also quicker to type the "kill" command; presumably if I'd waited longer, I'd have again been unable to switch screens to get to a working shell. Observations: - I didn't need the "exec"; somehow the shell was able to fork a "kill" process, even after printing an error message to the effect that it couldn't. Hypothesis: if the fork() fails, bash retries it - As expected, "kill -9 -1" killed off my X session and all character-mode logins. *Except* the one I ran that command from. That exception is the only bit that surprises me - Once I logged in again, I couldn't launch a terminal window. It hung somewhere in my .profile, and gnome-keyring-d was pinned at 100% CPU. I had to reboot to clear that (a clean "sudo shutdown" this time, yay!) - During the shutdown, something hung (I forget what), with a 1:30 timeout before systemd hard-killed it and proceeded. Presumably related to the previous point...
@funnyweirdovideos
@funnyweirdovideos Жыл бұрын
Dave, I want to let you know your videos are not only interesting but the part that I love the most is the fact you take the time to explain how things work. It truly sets apart your videos from others, and why things are the way they are. Thanks!
@DavesGarage
@DavesGarage Жыл бұрын
Thanks for the kind words! I try to include as much explanation as I think folks will tolerate :-)
@UncleKennysPlace
@UncleKennysPlace Жыл бұрын
@@DavesGarage You include just enough to create an army of dangerous minions!
@remasteredretropcgames3312
@remasteredretropcgames3312 Жыл бұрын
@@DavesGarage The legends are true. RLE compression CAN increase memory requirements in a circumstantial way. Its mostly hit rather than miss though.
@pctrader841
@pctrader841 9 ай бұрын
I have to second this comment. You always present things in a masterful way in your videos, and it is a breath of fresh air compared to all of the jittery jump-cut videos which abound on KZbin these days. Thanks for sharing so much valuable information with us all, and keep up the great work!
@lperkins2
@lperkins2 Жыл бұрын
Alt-Sysreq-K to kill everything on the current TTY. As a kernel-level interrupt it *usually* works (unless you have a USB keyboard and the USB system has crashed). If you can invoke loginctl, on an (e)logind system, you can kill the session that way.
@pavelperina7629
@pavelperina7629 Жыл бұрын
Problem is not dealing with it locally, there's a risk that some curious teenage idiot given access to Linux for the first time will try it over ssh. And I'm not even sure if it's enabled by default or xserver crashes the whole kernel (sometimes I tried when I had black screen) or if it works on virtual box.
@lperkins2
@lperkins2 Жыл бұрын
@@pavelperina7629 If you catch the problem remotely quickly enough, you can `echo k > /proc/sysreq-trigger`. Obviously, while the after effects of writing `k` to that handle is kernel-level, actually opening the file for writing and writing it would be done by bash, so you've got a couple seconds to do it before the fork bomb will choke the system off enough that a reboot is faster. Also, that echo won't help if the fork bomb was *also* dropped remotely. For that, a `killall sshd` can help, as that will trigger a sighup (depends on how bash was configured). If you are running an (e)logind system, loginctl kill-session $ssh-session-number will do the job. Can't speak to virtualbox, but the xserver can't intercept sysreqs. It is possible you are running a kernel with sysreq disabled (check if /proc/sysreq-trigger exists). Also, if your keyboard is USB you can have the USB input get screwed up (more likely with X in play).
@seraphina985
@seraphina985 Жыл бұрын
@@pavelperina7629 You could try using the following command to see if SysRq was enabled when your kernel was compiled: zgrep -i CONFIG_MAGIC_SYSRQ /proc/config.gz If you get a no such file or directory area it could be that your kernel doesn't have the configs module loaded if so try the following command then try again: modprobe configs If that still doesn't work you may also be able to find the config file for the current kernel in /boot it will generally be /boot/config-[Output of uname -r]-generic so the following command should work: grep -i CONFIG_MAGIC_SYSRQ /boot/config-`uname -r`-generic Either way you need it to be CONFIG_MAGIC_SYSRQ=y if it is n then the support was not compiled into the kernel at all. If it is y it could still be that specific feature isn't enabled for whatever reason but you can change this by echoing a value to /proc/sys/kernel/sysrq. Using 0 disables all, 1 enables all, higher values allow you to selectively enable certain ones. Word of warning don't enable all on a shared system it allows things like sending signals (including kill and term) to all processes on the system. Search sysrq values to learn what the different values mean, to enable multiple functions simply sum the values you want together.
@naelblogger7976
@naelblogger7976 10 ай бұрын
​@@lperkins2 after almost 30 years using Linux, I knew, and used sysreq locally, but I didn't know about /proc/sysreq-trigger. Thank you :)
@theirisheditor
@theirisheditor Жыл бұрын
Back when I was a student around 2000, I remember writing something similar in a Windows NT command line to see if I could cause a BSOD. Instead, the PC just locked up, requiring forcing power off/on as I couldn't bring up task manager, log out, etc. The batch file is short also, e.g. named "c.bat" containing these 3 lines: :rep start c.bat goto rep This basically launches endless new instances of itself. From Windows XP onwards this just bricks the current user session as it's possible to press ALT+CTRL+DEL and log out, which I remember was not possible in Windows NT.
@kamil118
@kamil118 Жыл бұрын
Ah, it has a name. I accidentally froze my pc twice this way during labs that wanted us to make a recursive program that run recursion using fork.
@chrisknestrick374
@chrisknestrick374 Жыл бұрын
I remember in college our campus HP-UX machine would go down about once a semester and you’d think, “Guess the OS class is writing their shells this week.”
@ctguy1955
@ctguy1955 7 ай бұрын
WOW !!! I am 68 and have been building My own water cooled PC's for many years now. 1982ish I purchased a Commodore 128. 1988 I took a train to NYC and underneath GCS or somewhere, I bought a Amiga 500 with the side adapter that was a one meg HD and space for more sticks of RAM. I have never heard of fork bombs in all this time, and ya learn something new every day. Clear Skies Mike
@user-sus6969
@user-sus6969 3 ай бұрын
When will you turn 69?
@allinaxford
@allinaxford Жыл бұрын
I recall seeing functionally a similar idea on the Original Star Trek episode “Wolf in the Fold”. Filling the computer's processes and all forms of storage with the digits of Pi, instead of infinite clones, an single program with no known limits on its needs. Different method, yielding a shared result, an over demand for system resources.
@jimmybrad156
@jimmybrad156 Жыл бұрын
Funny; I'm reading this on Friday 22/7. Happy Piday!
@RogerTheil
@RogerTheil 9 ай бұрын
What a creative way to bomb a system
@empyreal96
@empyreal96 Жыл бұрын
What's interesting is that the Windows version of this doesn't have the same impact on Windows 10 Mobile, it still creates many "CMD.exe" processes but the system suspends all the processes after a few seconds. Update: It does cause all running apps to slow down and restart, but doesn't crash the system straight away, it takes a very long time for it to cause enough processes to halt everything
@DrewNorthup
@DrewNorthup Жыл бұрын
FWIW, ulimit doesn't exactly get along with Systemd. The Systemd documentation explains this better than I can off the top of my head, but the TL;DR is that they implemented new tools as part of the cgroups build-out. They didn't remove ulimit, it just no longer rules in quite the same way. (Something you find out when a vendor wonders why their program's start script no longer works as intended.)
@jessepollard7132
@jessepollard7132 Жыл бұрын
Nice/renice was also altered in effect.
@KirstenleeCinquetti
@KirstenleeCinquetti Жыл бұрын
Nice vid Dave it really makes me ponder what other quirks are still out there in modern OSes which can throw the system a curve.
@williamhanna4823
@williamhanna4823 Жыл бұрын
Not a modern OS, but the 1977 vintage TRS-80 had an interesting quirk. You powered it on, pressed and got the prompt. If you pressed or you also got the prompt, but if you pressed it lost its mind. Never knew why.
@RogerTheil
@RogerTheil 9 ай бұрын
Don't hold down Win+E on any system older than Windows 10 or a patched 7 unless you wanna see one.
@TheObsesedAnimeFreaks
@TheObsesedAnimeFreaks Жыл бұрын
I do believe that windows has an automatic "nice" system where processes that are not in the foreground are deprioretized over others. This is to prevent lockups on heavily abused systems and the like. Windows task scheduler is magic I would say.
@TheObsesedAnimeFreaks
@TheObsesedAnimeFreaks Жыл бұрын
@Linus Fu Well stopping vs, mitigating are different issues entirely. if you can make a task scheduler that doesn't let process trees hog the entire system or you can limit clock cycles with priority access. if you can maintain system responsiveness, dealing with a miss behaving app is very much a possibility.
@RaymondJohnsonM
@RaymondJohnsonM Жыл бұрын
Actually there is at the hypervisor level known as the "Scheduler", and the various states the scheduler can be placed in: Classic, Core and Root, Where Classic has an SMT Disable variant
@DerekWitt
@DerekWitt Жыл бұрын
Both Linux and macOS have such schedulers too, but unfortunately there's no way to adjust the scheduler in macOS (at least easily). But, macOS is a BSD derivative. However, macOS/Darwin is so far removed from BSD that I don't think any scheduler tricks that work with the BSDs would work in macOS. The scheduler can be changed/adjusted in Linux. I believe Deadline is the default scheduler these days.
@Kazyek
@Kazyek Жыл бұрын
Windows have a foreground process boost called "dynamic thread priority boost" that basically triple it's existing priority.
@thetechconspiracy2
@thetechconspiracy2 Жыл бұрын
@Linus Fu I believe I have run fork bombs on Windows 10 in the past (on a machine with 16 GB of RAM), and eventually the OS gets to a point where it just force logs out the bad user, killing all their processes
@mwahahaha
@mwahahaha 10 ай бұрын
I love this channel, Dave’s content and presenting style are so informative and entertaining, thank you Dave!
@alexevansuk
@alexevansuk 9 ай бұрын
As someone who's been running servers shared by my multiple clients for over 15 years, I'm glad you've covered this. My first experience was a learning curve to say the least.
@ryanroberts1104
@ryanroberts1104 Жыл бұрын
This reminds me of when I first figured out how to make a web page open a popup of itself infinitely. You could only save it if you were REALLY quick with the task manager! Remember when pop ups were a thing? LOL!
@rayleps4576
@rayleps4576 Жыл бұрын
In computer engineering, I used to spend extra hours learning from online manuals. The system I was using was an Ultrix running a 1 MIPS cpu. I discovered the 'fork' command, read how to use it and decided that I should promptly write come C code. Wrote it, compiled it and executed it. About 1 second later I had the realization of what I'd actually done. Never knew until today what it was called but, I wrote a fork bomb in 1987. Whoops. Lucky it was Sunday night so I went home. Monday morning back at school, the first thing my friend said to me was: "What the f..k did you do to the VAX?" Long story short - system administrator had to reboot the system and all went back to normal. My code worked very similarly with an end result being one in the same. Thanks for the video Dave. Brought back memories.
@davidwilliss5555
@davidwilliss5555 Жыл бұрын
You didn't by any chance go to UNL did you? I was there in 87 and we had a VAX running Ultrix. I remember something like this happening.
@rayleps4576
@rayleps4576 Жыл бұрын
@@davidwilliss5555 I'm a Canadian from Toronto. I did computer engineering in Toronto. Cheers!
@todorpopov7225
@todorpopov7225 Жыл бұрын
I was browsing the comments and thought to tag David, but he already found you. :D
@jessepollard7132
@jessepollard7132 Жыл бұрын
just about every programmer has done that on a UNIX system at one time or another.
@muddyexport5639
@muddyexport5639 Жыл бұрын
Good vid, brother Dave. Thanks. Again, glad I found this site.
@CrazyWickedIan
@CrazyWickedIan Жыл бұрын
Thanks for sharing your knowledge Dave!
@pagefault404
@pagefault404 Жыл бұрын
This reminds me of a stupid simple DoS attack I sort of figured out when I was doing Unix/Solaris training for the Army. I would create a banner that would call to a banner that called to the banner that called to it. Running the first banner would hard-lock the system instantly. I crashed the Solaris server that was managing our Unix network for our tests. I had no idea what would happen, but I did it anyways. Almost got removed from the training cycle and recycled to another group for it.
@unclesmrgol
@unclesmrgol Жыл бұрын
Rather than fixing the problem, they considered killing the messenger.
@ted356
@ted356 Жыл бұрын
Love these episodes. Dave the great geek entertainer! 😊
@MrUglyDave
@MrUglyDave 7 ай бұрын
Really enjoy your method of presenting, thank you sir !😊
@tedmcleod-morris
@tedmcleod-morris Жыл бұрын
As always, entertaining and informative. You always touch on some of the deep information that most people glaze over. Thanks.
@alanmusicman3385
@alanmusicman3385 Жыл бұрын
Great explanation Dave. I would guess that if this function included some kind of disk i/o action (like maybe "touch" a random filename) it would saturate the disk i/o channels or run the filesystem out of entries? I have conducted a lot of new product testing in the past, and alpha test third party products which use some kind of device driver or driver update/install - esp on Unix systems but also on Windows - fairly frequently had issues where something unintentionally recursed and ate all the i/o or memory, usually only under specific sets of circumstances. I had forgotten about the shared page replicate-on-write thing too, so thanks for the reminder on that - made me realise how much I miss dabbling in OS internals!
@timeimp
@timeimp Жыл бұрын
I remember at Uni when the second years were due to submit assignments demonstrating their understanding of forking programs. As a first year, the lecturers all sternly warned us that not being able to submit our program because the submission server was fork bombed meant a late penalty. Then it was second year and guess who managed to do just that 😅
@robert_the_great2842
@robert_the_great2842 5 ай бұрын
Dave I like all of your videos are educational and entertaining. So, please keep up the great work and thanks for being there.
@trajectoryunown
@trajectoryunown Жыл бұрын
I like how you explained what was going on in detail then immediately related it to something far beyond my scope of knowledge.
@Hauketal
@Hauketal Жыл бұрын
For doing something helpful, I once created a program which calculated prime numbers. First process just counted from 2 upwards and sent the value to a pipe. Last process just printed the value from the pipe. Intermediate processes forwarded the first number read, and then filtered out everything divisible by it. After a few hundred results the process table was full. Not a real bomb, it could be killed with SIGPIPE.
@KawazoeMasahiro
@KawazoeMasahiro Жыл бұрын
I remember Windows XP being particularly susceptible to a similar kind of DoS attack, the handle bomb. For readers that don't do much Win32 API apps, you might have never heard of handles before. They are basically the same as pointers, but across separate memory spaces, usually between the kernel and userland. For instance, if you've seen the HWND type somewhere, that H stands for Handle. It's a reference to a window object that's owned by the OS and not by your own code. So how do you make a handle bomb? You hold down Win+E for a few seconds... Yep! That's it! It's a shortcut that will open a new Windows Explorer window, which creates a whole bunch of handles along the way. The funny thing is, Windows XP used to process that shortcut as fast as it could, flooding the screen with tons of new windows until the entire handle table would get filled. At that point, funny stuff would happen. Some processes would just hang or crash. Others would have missing UI elements here and there or turned completely blank. Most of the time, you couldn't even open the start menu anymore. Fun stuff! I remember getting Windows Vista to crash that way as well, but it took a lot longer. I wonder if it still works today...
@DerekWitt
@DerekWitt Жыл бұрын
I once crashed an UltracSPARC 1 system (running Solaris 2.5) by simply running Windows 3.1 in Soft PC. It triggered a file system/kernel panic. It took about 30 minutes for fsck to run.
@MWGrossmann
@MWGrossmann Жыл бұрын
Did that happen in the later SP versions or only in original release? I think I may have once crashed am XP machine pressing Win+E too long accidentally with no idea at the time how it had happened nor how to repro in order to submit a bug report.
@DerekWitt
@DerekWitt Жыл бұрын
@@MWGrossmann I think it was in the RTM release. Nimba and Code Red was in the wild still when XP was released.
@KawazoeMasahiro
@KawazoeMasahiro Жыл бұрын
@@MWGrossmann oh it was at least in the SP2 days. It even worked on Vista.
@KawazoeMasahiro
@KawazoeMasahiro Жыл бұрын
@@maliciousfry no address space doesn't really impact it. The amount of available handles is a fixed value in Windows and, as far as I am aware, there aren't 64bit handle types, even for apps built with 64bit pointers in mind. I actually think they are shared between 64 and 32 bit apps, so they would have to fit in a 32bit space either way.
@Vandius24
@Vandius24 7 ай бұрын
I watched this last year and saw your video again and remembered I needed to sub. Thanks for this informative video that taught me quite a bit.
@checktheevidence
@checktheevidence 8 ай бұрын
Excellent video and clear explanations!! Many thanks!
@throx
@throx Жыл бұрын
Magic SysRq notwithstanding, you may be able to get back into Linux as root via the console. It does have special considerations for uid 0 in the resource allocation. Windows' task scheduling is a little different to Linux (it's more real-time-ish), which may be the reason you could break out - especially if Task Manager had a higher priority than your fork bombs. On that note, process scheduling algorithms would be a fun video series!
@jessepollard7132
@jessepollard7132 Жыл бұрын
process scheduling has been the subject of a number of PHD thesis.
@jessepollard7132
@jessepollard7132 Жыл бұрын
Not until after login.
@mmcv1987
@mmcv1987 Жыл бұрын
You can gracefully shutdown Linux using the magical sys request key route if you configured it, alt + sysreq, reisub; alt + sysreq, reiso depending on your configuration.
@BrianRonald
@BrianRonald Жыл бұрын
You should probably also try unmounting before powering off, too.
@mmcv1987
@mmcv1987 Жыл бұрын
@@BrianRonald that is part 8f the key sequence
@BrianRonald
@BrianRonald Жыл бұрын
@@mmcv1987 It was part of the first one, which rebooted. Wasn't in the second.
@mmcv1987
@mmcv1987 Жыл бұрын
@@BrianRonald ... Well I see what you mean reisuo it should be.
@yourhiddendreams
@yourhiddendreams 9 ай бұрын
I really appreciate your way of presenting information, I have been interested in IT skills since I was young but am self taught and struggle to know where to begin in regards to practical knowledge. This video was both entertaining and informative, I really appreciate you making it. I hope I can find a teacher who presents information in a similar manner to yours so I can figure it out easier myself. Liked and subbed! :)
@kelvington4182
@kelvington4182 Жыл бұрын
Great videos! Really enjoy your channel.
@dominicthoreau
@dominicthoreau Жыл бұрын
I had fun with this as a system programming student, back in the day. Some steps (in the wrong order) to reproduce this in a home (but still POSIX) environment that recovers itself: - Write the thing direct in C - create a signal handler on SIGALARM. Signal handler should exit the program. 30 seconds is a good time - once it's created, do the fork bomb thing. fork() is the key function here. - machine gets hung up with processes - when alarm goes off, it just all miraculously recovers. - if you have another terminal window, or run screen, watch uptime.
@friendlyhonda3187
@friendlyhonda3187 Жыл бұрын
while(1){fork();} ? I remember that being explained in my OS course in University. Had every student's attention.
@oliogamer3975
@oliogamer3975 Жыл бұрын
Is that java?
@friendlyhonda3187
@friendlyhonda3187 Жыл бұрын
​@@oliogamer3975 C
@fatalfallacy
@fatalfallacy Жыл бұрын
and still i managed to deploy a script years later on a production system going crazy and recursively starting processes together with messing up .ssh and clogging home, effectively shutting me out completely. having no ilo, i ashamedly had to request physical access to the data center, lol
@vincei4252
@vincei4252 Жыл бұрын
@@fatalfallacy Or the script that remembers the PID's of processes it started but author doesn't seem to understand that those processes with those pids can exit and the PID reused. Then the script starts killing those pids it cached .... Seen that in production at a well known company that will remain nameless. It took weeks to track down the culprit with lots of VERY ANGRY customers to boot. To be clear, it wasn't one of mine :)
@filteredjc4653
@filteredjc4653 10 ай бұрын
One of the best computing channels on yt! Thanks Dave!
@larryseyer
@larryseyer Жыл бұрын
Awesome information. Thank you!
@grottyboots
@grottyboots Жыл бұрын
Cool! Reminds me something OS/2 fans would do on Windows machines to show how OS/2 could better handle bad processes; I forget the actual code now, but it required using DEBUG to clear interrupts (CLI) and then starting a infinite loop. Windows would lock up hard, but OS/2 would keep chugging away and you could easily kill the locked up process. Cheers!
@RonJohn63
@RonJohn63 Жыл бұрын
Formatting a floppy disk at the same time you played music was another way to demonstrate W95's inferiority.
@andreimiga8101
@andreimiga8101 Жыл бұрын
The fact that you were able to execute privileged instructions such as CLI and access kernel memory from user indicates that Win 9x was never meant for security. If you try to execute a series of x86 instructions like: sgdt [some_user_memory] mov cx, [some_user_memory] mov ebx, [some_user_memory + 2] Now you have an address in EBX which points to the GDT (Global Descriptor Table), and its length in CX. Under normal circumstances, this wouldn't be a problem, but Win9x maps this address to a USER page. On NT, a fault occurs if an attacker tries to reference the memory pointed by EBX in any way. On 9x, this access is allowed and gives the attacker full control of the system, meaning that they can do ANYTHING. They can crash the system by filling the table with garbage. They can gain kernel privilege (ring 0) by setting up a call gate in the table and calling it, and after gaining kernel privilege it is pretty much game over, there is nothing that an attacker can't do.
@RonJohn63
@RonJohn63 Жыл бұрын
@@andreimiga8101 "indicates that Win 9x was never meant for security". Users don't care; they just don't want to lose all their work when then machine locks up, and need to reboot. (Really what they care about are *features* and *ease of use).*
@blahorgaslisk7763
@blahorgaslisk7763 Жыл бұрын
OS/2 was a good OS with bad timing. When IBM started to make noise about it the HW requirements, or more specifically the memory requirements were not in line with what people thought were reasonable. It could run on 4MB but needed 8MB to actually be useful, 16MB to shine. At the same time the average PC sold had 1MB or 2MB standard, and some times 4MB. 8MB was EXPENSIVE and 16MB most people couldn't imagine what they would do with. But it was just five or so years early, that's all. It's a pity that MS and IBM couldn't work out their differences about the direction of OS/2 or we'd had a true 32bit OS with preemptive multitasking on every PC a lot earlier. Still I got to install some MS Exchange servers running on Microsoft OS/2 1.3...
@andreimiga8101
@andreimiga8101 Жыл бұрын
@@RonJohn63 That's true. Users don't care about security. Until a virus gains kernel access and overwrites the BIOS, bricking the machine (I'm sure you've heard of CIH).
@DerekWitt
@DerekWitt Жыл бұрын
Perhaps one way to recover a Linux system is by using SysRq (usually mapped as Print Screen): Alt-SysRq-R, Alt-SysRq-E, Alt-SysRq-K, Alt-SysRq-S, Alt-SysRq-U, Alt-SysRq-B. This effectively tries to do a safe reboot. unRaw (take control of keyboard back from X11, tErminate (send SIGTERM to all processes, allowing them to terminate gracefully), kIll (send SIGILL to all processes, forcing them to terminate immediately), Sync (flush data to disk), Unmount (remount all filesystems read-only), reBoot. I've seen these key sequences not allow me to reboot an old K6-2 350 that had an infamous Diamond Stealth 3D 4000 (S3 Virge GX2-based AGP card) though... Said system had a serious XFree86 3.x, 4.0x bug involving that S3 chipset that would cause the Moire2 xscreensaver module to hard lock the machine. Even, xdaliclock would hard lock my machine with that video card. I doubt SysRq would have any effect on WSL though, but who knows.
@wumi2419
@wumi2419 Жыл бұрын
Just Alt-SysRq-I (maybe K works too, haven't tested) is enough. Ignored terminate for me, but kill did the job
@jamess9623
@jamess9623 10 ай бұрын
Try Alt-Sysrq-f first to try and kill the most memory hogging process.
@chrishunt7461
@chrishunt7461 Жыл бұрын
Funnily enough, pulled the same stunt as many of the other readers here. As a junior dev in the early 90s, on a Friday afternoon I wrote an endless loop in C with a fork and sleep. In my infinite wisdom (read: ignorance) I chose to run it with "nohup myprogram &" on the production Data General AViiON. When the system chose to terminate my interactive shell and I couldn't get back in, how my stomach sank. Especially when the admin couldn't terminate them and had to force a hard shutdown. Luckily no data loss. Some joking and ribbing at my expense by a couple of colleagues helped ease the tension - but I sure had my doubts that I would still be employed come Monday (I was :))
@stampedetrail2003
@stampedetrail2003 9 ай бұрын
Thank you for your work and for teaching us about it. Really liked your Task Manager video, that was really cool. It's one of those absolutely essential parts of Windows that makes it actually usable for daily work.
@morofry
@morofry Жыл бұрын
Now to use this encoded into dial tones to see if robo-callers properly sanitize the input of the system.
@krissisk4163
@krissisk4163 Жыл бұрын
Last time I was playing with fork bombs (on my own PC, of course) Linux killed the thing in a matter of seconds. If I remember correctly it was running in a sandbox (playing with dangerous code was on the menu, but nuking my system wasn't) and the system dumped the whole sandbox when it started taking too many resources, which killed the interpreter.
@GregiiFlieger
@GregiiFlieger 9 ай бұрын
Both entertaining and informative, you are! Thanks
@0rphaneye
@0rphaneye Жыл бұрын
What a great explanation! The lighting makes your hair look pretty magical.
@russellbailey8250
@russellbailey8250 Жыл бұрын
I remember back in tech school using Win NT and setting up domains and networks and one of my class mates decided to send a NET message with infinite loop to all PC's on the network and took down the campus network and supposedly reached out to other campuses in the state. Lucky for him, the message was not offensive but he did get a warning.
@dawnfire82
@dawnfire82 10 ай бұрын
Bringing down numerous production systems through negligence is a prank. Saying something offensive is a crime. Aim high!
@DavidJones-ii6oi
@DavidJones-ii6oi Жыл бұрын
Using GNV on VMS, the fork bomb just reports a pipe error: exceeded byte count quota. VMS has always been paranoid about a process having unbounded access to system resources, with default limits appropriate for a 11/780 with .5 MB of memory. I could probably up BYTLM on the account to make it fail with a PRCLM exceeded error instead. I remember the time in college the admins sysgen'ed our RSX 11-M to include type-ahead support in the terminal driver. I held down the arrow key for several seconds and crashed the system as all the system pool got consumed.
@ted356
@ted356 Жыл бұрын
Windows NT core was supposed to be modeled after VMS. Sounds like that wasn’t ported over.
@IncognitaLabs
@IncognitaLabs Жыл бұрын
Hey Dave, thanks for being you and please keep up the good work.
@airfixer9461
@airfixer9461 Жыл бұрын
Nice one Dave....I enjoyed it 😜
@arjanscholl
@arjanscholl Жыл бұрын
Interesting, it seems Apple has lowered the default ulimit on MacOS 13 (Ventura). It's now 5333 out of the box on my machine and running the fork bomb will not lock up the machine. In fact your video just keeps playing and i can still launch apps. Running killall bash eventually stops the fork bomb altogether
@jamesweatherley9215
@jamesweatherley9215 Жыл бұрын
It could be system dependent. It's 2666 for me on a ten core M1 Pro running Monterey.
@arjanscholl
@arjanscholl Жыл бұрын
@@jamesweatherley9215 Could be memory dependent? I'm running with 32GB (M1 Max), perhaps Dave has 64GB on his M1 Ultra with ulimit 10666
@jamesweatherley9215
@jamesweatherley9215 Жыл бұрын
@@arjanscholl Sounds plausible - I'm on 16GB.
@Dextermorga
@Dextermorga Жыл бұрын
@@arjanscholl no
@DavesGarage
@DavesGarage Жыл бұрын
Good one! I wonder what determines the limit, or if they really did lower it for Ventura?
@szr8
@szr8 Жыл бұрын
Windows doesn't have a real fork, so the likes of cygwin, msys2, git bash, strawberry perl, etc are using an emulated fork (vfork()) which is going to be slower than a true fork(), which is part of how Windows can manage to remain responsive.
@IANSYT
@IANSYT Жыл бұрын
actually it was running under wsl so it has native fork(), it responded well because wsl is a virtual machine and isnt allowed to bring the system down
@pinkcreeper100
@pinkcreeper100 Жыл бұрын
@@IANSYT dave tried it under git bash (windows native)
@DavesGarage
@DavesGarage Жыл бұрын
How is forking() the current process better or worse than creating a new one? Other than sharing the read-only pages of the original, and maybe skipping process startup, I don't see much of a real difference?
@remasteredretropcgames3312
@remasteredretropcgames3312 Жыл бұрын
@@DavesGarage Dave I promise to be good except for every blue moon. Youve been hit by, been hit by a parallaxed saint.
@jessepollard7132
@jessepollard7132 Жыл бұрын
@@DavesGarage it only affects process scheduling and the size of the kernels process table.
@Oj10101
@Oj10101 Жыл бұрын
I couldn’t imagine a better and more informative weekend than time with you and a couple of beers.
@juancarlosgonzalo6714
@juancarlosgonzalo6714 10 ай бұрын
A nice explanation, Dave!!!. Thanks for help an informatic amateur like me. 👏
@jahinzee
@jahinzee Жыл бұрын
Hi Dave, I would love for you to have a look at the state of modern Linux Desktop Environments: GNOME (both Vanilla and Ubuntu), KDE Plasma, Cinnamon, etc.
@davecool42
@davecool42 Жыл бұрын
Loving that your simplified analogy of the fork bomb is describing nuclear fusion. 😂
@smithnigelw
@smithnigelw Жыл бұрын
Fission
@davecool42
@davecool42 Жыл бұрын
Oops that's what I meant!
@Otyrr
@Otyrr 10 ай бұрын
You got a sub from me. Very informative, and interesting all the way through. Cool video!
@lovor01
@lovor01 Жыл бұрын
Great stuff on explaining how it works!
@michaljazlowiecki
@michaljazlowiecki Жыл бұрын
Dave, a big bow on your videos. Your (and your colleagues') work makes our everyday easier. 1. I have learned fork bomb (on purpose) on during my Computer Science studies. It was one of the very first tasks on Operating Systems curriculum, we did it on Linux. Later on, we tried the same on Windows NT 4.0 or Windows 2000 (I don't remember which NT version was then, the computers were upgraded during my studies). 2. I have just tested the shell fork bomb on MacBook Pro with M1 Pro, running macOS 12 Monterey - system did not even slow down and it was so easy to stop it as just to close the tab of Terminal application. 3. I also did `ps -ax | grep zsh` on this MacBook and saw an interesting result: 1768 ttys001 0:00.01 login -pfl michalj /bin/bash -c exec -la zsh /bin/zsh 1773 ttys001 0:00.08 -zsh 12133 ttys001 0:00.00 grep zsh 33340 ttys002 0:00.08 login -pfl michalj /bin/bash -c exec -la zsh /bin/zsh 33789 ttys002 0:00.05 -zsh (`michalj` is my logon name) - this suggests that `login` process starts Bash, which in turn starts `zsh` shell.
@creepycrespi8180
@creepycrespi8180 Жыл бұрын
Is this what Jeff Goldblum used in Independence Day?
@andrewsgarage796
@andrewsgarage796 Жыл бұрын
Good one Dave Thanks Mate
@walterhambrick8705
@walterhambrick8705 Жыл бұрын
Thanks for the information.
@StreuB1
@StreuB1 Жыл бұрын
I seriously want to meander up to your place on a Friday early afternoon with a cold 6-pack and sit and learn software development from you. As a 44yo electromechanical engineer that, after 18 years, has reached his limit at his current employer. I took a C++ course last semester and now really fallen in love with programming. So much that I am considering changing careers to EE + software. Finding a place where you can learn the in's and out's though and not be an "Intern" or "Junior" is a challenge, if it even exists.
@ZephrymWOW
@ZephrymWOW Жыл бұрын
Hate to break it to you but you are an "Intern" or "Junior" 18 years of EE+ does not magically mean you can transition to Senior. If you seriously want to switch careers you will either need to take a serious pay dock and work as a junior for a while. Or to start your own company / open source project that becomes popular so you can use that as reference. On top of that you are competing with a generation who is more or less forced to work at about 25$ / hour for that type of job as an average across the USA. Excluding places like silicon valley. Why would I hire you who has the exact same amount of real world software experience as a college student or some random dude who taught himself to code for 3x the price when the market is flooded with alternative options?
@neilcross5844
@neilcross5844 Жыл бұрын
@@ZephrymWOW maturity?
@smashogre4766
@smashogre4766 Жыл бұрын
I've been working in IT for 28 years... first time ever seeing this. Never stop learning, eh? Thank you for posting this!
@pavolkucerak6011
@pavolkucerak6011 9 ай бұрын
Thank You! It was interesting and great!
@billweck3883
@billweck3883 10 ай бұрын
sometimes, you're beyond me, but this time, wow. You always make things clear enough to us who have never programmed. As a pedestrian I always appreciate when you show locations and perform actions within the code. I'm always pleased to hear from you. Thanks
@tnspnk3
@tnspnk3 Жыл бұрын
This reminds me of something similar but not quite the same I did by accident on a Decsystem 10 back in the late 70's/early 80s at UTK. A friend of mine a Kent O. and I were playing around and I noticed you can use the console assign command (not sure of the exact command now, maybe "assign" or "assgn") to assign/attach (maybe it Was "attach") a Device to your login session. While this was primarily for assigning a printer or tape drive to a job or session so you could exclusively output to it, I found the neither command nor OS discriminated; any valid (open) device could be assigned. For fun I tried 'assign'ing a nearby (unused) terminal (TTY). It worked. Grin. I tried on that someone was already logged in on and got an error saying the device wasn't available (or something like that). As I said, playing with my friend who was on another TTY and found that yes, after assigning it, I could output to the TTY. In fact I could (forgot the command), mirror everything on my screen to the assigned TTY. Well that was all fun, but Kent wanted to login himself. But he couldn't while I had it assigned. Grin. He eventually figured out he could hit Cntrl-C to "break" the assignment and get a login prompt. The fun then was me running the assign command again before he could log in. LOL. This continued for half a minute or so before I thought, of the easy fix. It took me about 30 seconds to write a simple script to loop the assign command for that TTY. I ran it. I don't know how many times he hit Cntrl-C, but my script would reassign the TTY Long before he could log in. So after a min or so he gave up. My script is still running. I didn't realize, but once he stopped breaking it, the script kept reassigning the TTY; and apparently on that system there was a pool of assigned devices; not a very big pool either...my script started getting errors "?assign limit exceeded-no available space" or something to that effect. Suddenly all around the computer lab I hear "Hey my terminal's locked up!" "Mine too!" "What's going on?" I sheepishly tried to keep my cool. I realized I didn't know or remember the "deassign" command. But I thought, if I log out, all my resources should be returned to the OP pools, including all these device assigns. Fortunately that worked. Kent & I had a good laugh over that later.
@RonJohn63
@RonJohn63 Жыл бұрын
In VAX (and later Alpha) VMS, the command is ATTACH.
@Wheagg
@Wheagg Жыл бұрын
You could also in theory limit the CPU time of any given user so it only ruins them.
@laurensnieuwland4657
@laurensnieuwland4657 9 ай бұрын
Heh, I made one without knowing what it was called when I was 10 in elementary school. The only thing I didn't know back then was the fact that all PCs were actually thin clients running from one desktop. Crashed not only my own, but also the 3 other workstations my classmates were using. The IT-teacher was NOT happy with me...
@bouipozz
@bouipozz Жыл бұрын
Just found this channel. Pure quality!
@emblemi6345
@emblemi6345 Жыл бұрын
on NT task manager always runs with a higher priority and cpu affinity. Probably it is enforced by the kernel itself, outside if win32 api. In other os's there is no such thing by default. On linux systemd-oom tries do that but only kicks in when system is low on memory. But earch bash/zsh has very low memory usage. So it does nothing to them.
@caiocc12
@caiocc12 Жыл бұрын
On this very channel there is a video dedicated to the Task Manager. He touches on how it was made to work even on degraded aystems, tolerate memory corruptions, and be responsive even if hell broke loose.
@DavidLindes
@DavidLindes Жыл бұрын
0:12 - does this version work? wow, it does. TIL you can override the builtin : command with a user-defined function! Still, curious why you have that version there, and then later (2:16 et al) use A instead of : ... anything in particular behind the switch? oh, perhaps because that works in zsh, but not bash (ref 9:58)? As for solving it (5:30), I don't feel like trying to be sure, but I wonder if a bit of fg and ctrl-z and/or ctrl-c might at least help. But, it might not. Maybe sometime when I'm feeling more adventurous, I'll set up a vm or something and try it there, but... anyway... fuser -k on the tty that launched things might help ... IF you can fork an fuser process, of course. Usually builtins are the way to go in resource-constrained situations like this, though, because one often can't fork and/or exec new processes... Also depends, of course, on whether or not you have another active shell, etc. etc. Hmm, 2:41 makes me wonder if ctrl-S might also possibly be helpful? If you freeze the output long enough, maybe it'll stop trying to fork, because it's waiting to write to its output buffer, which fills up?!?? Something to try. Oh yeah, and re 5:40 - yeah, if you had htop already running, if you can find the right bash, enter tree view (t), tag it (c) then (k)ill, and you might be able to get rid of it. Not sure.
@SkylerLinux
@SkylerLinux Жыл бұрын
Magic SysRq Sync first then SIGTERM, then SIGKILL
@DavidLindes
@DavidLindes Жыл бұрын
@@SkylerLinux What, exactly, will you SIGTERM and SIGKILL, though? And how?
@Monkofmagnesia
@Monkofmagnesia 7 ай бұрын
This was so interesting that I subscribed to your channel.
@316Minecraft
@316Minecraft Жыл бұрын
That was really informative, thank you!
@DavesGarage
@DavesGarage Жыл бұрын
Glad you enjoyed it!
@exxor9108
@exxor9108 Жыл бұрын
So if I am, for example, not doing anything at all in Windows, sitting idle not doing any work, can I perform this fork bomb thing without any loss of anything on my computer? The context is that I've saved any and all data beforehand so as to not suffer any data loss.
@RossNixon
@RossNixon Жыл бұрын
Of course. Just turn the machine off and on again.
@mjouwbuis
@mjouwbuis Жыл бұрын
@@RossNixon unless some buffer wasn't written to disk. Having an OS crash, always results in a small chance of disk corruption.
@exxor9108
@exxor9108 Жыл бұрын
@@mjouwbuis I made explicitly sure that anything and everything I was doing was saved to my OS and storage drives. Then I ran the Windows 10 equivalent of the fork bomb, and sure enough my computer came to a halt. lol I didn't lose anything, but I only will ever run it once.
@catpersimmon7011
@catpersimmon7011 Жыл бұрын
The alt+sysrq key combo might save you in linux. alt+sysrq, then k will kill all the running processes on the console. the e key will kill all except for init.
@Ashnurazg
@Ashnurazg Жыл бұрын
The most Linux distributions disable ALT + SYSRQ key combinations by default
@ltxr9973
@ltxr9973 Жыл бұрын
I always forget that even exists
@Fredthefat
@Fredthefat Жыл бұрын
Interesting, thank you for the explanation.
@michaelheimbrand5424
@michaelheimbrand5424 Жыл бұрын
I guess we need to test it on OpenBSD. It has a lot of mitigations, but I can´t remember seeing a process count limit either in sysctl or login.conf (from the top of my head).
@jocramkrispy305
@jocramkrispy305 Жыл бұрын
On my OBSD box, 512 file descriptors, 128 processes, 4MiB stack, 512MiB data, 2.5GiB mem
@jocramkrispy305
@jocramkrispy305 Жыл бұрын
But on reflection that may not be default, I've been a shared system admin for a loooong time, so changing those is second nature.
@jocramkrispy305
@jocramkrispy305 Жыл бұрын
From /etc/login.conf, the defaults are default:\ :path=/usr/bin /bin /usr/sbin /sbin /usr/X11R6/bin /usr/local/bin /usr/local/sbin:\ :umask=022:\ :datasize-max=1024M:\ :datasize-cur=1024M:\ :maxproc-max=256:\ :maxproc-cur=128:\ :openfiles-max=1024:\ :openfiles-cur=512:\ :stacksize-cur=4M:\ :localcipher=blowfish,8:\ :tc=auth-defaults:\ :tc=auth-ftp-defaults:
@lastfm4477
@lastfm4477 Жыл бұрын
4.4BSD derived systems (NetBSD, OpenBSD, FreeBSD) all have "login classes" (see /etc/login.conf), where normal users have ulimits that are applied to user's logins. ("hard limit") means the user cannot increase beyond that value, "soft limit" means they can increase it up to the "hard limit").
@jocramkrispy305
@jocramkrispy305 Жыл бұрын
@@lastfm4477 but the question is whether the defaults are "sensible" or not - Linux has the limits, but follows the same "it's a personal computer, the user can do what they think best" mindset that MSDOS and Windows does. They certainly used to have sensible ones, but I don't know for sure now.
@stephensalex
@stephensalex Жыл бұрын
Hi Dave, while everything you stated is true, I wanted to re-test this on Mac OS 12.4 since there are security changes in this release. After about 2 minutes of running a fork bomb via Terminal, the XProtect Service killed every instance of zsh as it seems to identify a fork bomb as malware activity.
@DavesGarage
@DavesGarage Жыл бұрын
Weird, I thought I was up to date, but only on 12.2! I'll have to try it after I get the update!
@stephensalex
@stephensalex Жыл бұрын
@@DavesGarage I tested a bit more and here's what I found: A fork bomb inside a script (done as a function) is trapped by security. Manual fork bombs from the command-line work as expected.
@remasteredretropcgames3312
@remasteredretropcgames3312 Жыл бұрын
@@DavesGarage On the topic of the video you could make a bot that on loop could do exactly what you are doing in the UI to preemptively maintain against attack tho. Buying REAconverter since its batch TGA conversion is non RLE compressed. I can just make it work, since the CPU overhead is laughably trash. Also it should be against the laws of the universe to RLE compress assets which absolutely make zero difference in the end result OR MAKE IT WORSE. Elon Musk=Starship
@TheVirtualTim
@TheVirtualTim Жыл бұрын
Add to that, mac seems to set the number of procs lower. I checked a few different machines and they are not actually all the same ... the the higher-end machines had higher limits.
@jessepollard7132
@jessepollard7132 Жыл бұрын
well, technically it is.
@The_Pariah
@The_Pariah 8 ай бұрын
Dave's such a badass. I love throwing on random videos and learning new stuff. It was interesting to learn that a rabbit is a type of fork bomb. I'm familiar with the concept of a rabbit and how it replicates to consume system resources but had no idea its what its technical term was.
@meisner-effect
@meisner-effect 10 ай бұрын
thank you Dave , love the rainman
@wayneburba9457
@wayneburba9457 Жыл бұрын
A question! Two of my desktops were shut off and left off for quite awhile. Now they are black screen and say no vga, no hdmi no something else. Anything I can do what’s wrong?
@hubster6381
@hubster6381 Жыл бұрын
Are they plugged in?
@KPbICMAH
@KPbICMAH Жыл бұрын
Replace the CMOS battery
@wayneburba9457
@wayneburba9457 Жыл бұрын
They were and are now , they just weren’t turned on for a long time maybe a year!
@the32bitguy
@the32bitguy Жыл бұрын
Check some things: Is the computer getting power? Are the fans spinning? Are any cables looses? There could be two sets of ports for connecting a display because of dedicated and integrated graphics, try both. Try another display
@truckerallikatuk
@truckerallikatuk Жыл бұрын
The main causes for such failures are power supply and motherboard... or just a loose connection. Pull everything out, and plug it back in.
@mousefad3673
@mousefad3673 Жыл бұрын
I once recovered a production machine running Solaris which had a fork bomb set off by sending SIGSTOP to all the working processes before actually killing them with SIGKILL. I still don't really understand how my "ps aux | grep ..." managed to run (it took many tries before it worked), but eventually I managed to freeze all the forking processes and only then tried to killed them off. Directly using SIGTERM or SIGKILL just freed up slots in the process table that were immediately filled by new forked processes, but freezing them with SIGSTOP prevented more forking and I managed to get them all frozen before terminating them. At least this is what I believe happened. Maybe Solaris had some magic sauce that did the real fix while I was messing about thinking what I was doing actually helped.
@Muslim_011
@Muslim_011 Жыл бұрын
Good subject. Very interesting 👍
@jond1536
@jond1536 Жыл бұрын
I am really enjoying your videos. a look at the deep dark (well maybe not so deep or dark) secrets of MS stuff. I actually used MS dos when a 10 Meg hard drive was $300.00 in 1980. Thanks for your videos
@jaaxxone
@jaaxxone 10 ай бұрын
Same here. I remember my first HDD being almost the same size as a modern PC power supply!
@jmr
@jmr Жыл бұрын
Who is writing the ducky script?
@An.Individual
@An.Individual Жыл бұрын
I just tried this in Mint on a PC i.e. not WSL. Got those messages and just clicked the green cross at the top right of terminal and all back to normal. What an anticlimax.
@Smile8924
@Smile8924 Жыл бұрын
great episode Dave! (y)
@henrycarlson7514
@henrycarlson7514 Жыл бұрын
Interesting , Thank You. You're channel is very interesting even though I understand very little
@StolenJoker84
@StolenJoker84 Жыл бұрын
Given that a “fork bomb” rapidity reproduces itself, could it essentially be considered a type of virus, even if it only replicates processes and not files? Either way, it’s interesting to me that such a simple line of code can bring even the most powerful system to its knees.
@ted356
@ted356 Жыл бұрын
To me, it’s a type of a DoS attack.
@StolenJoker84
@StolenJoker84 Жыл бұрын
@@ted356 That’s a fair assessment.
@CFSworks
@CFSworks Жыл бұрын
I'm not positive this is what you're asking but a good physical analogue would be "gray goo" -- it's just like a fork bomb but with self-replicating nanobots instead of system processes.
@blahorgaslisk7763
@blahorgaslisk7763 Жыл бұрын
@@CFSworks The one thing a virus does is spread to other systems, and this doesn't really do that.
@jessepollard7132
@jessepollard7132 Жыл бұрын
IT is also relatively easy to stop. I used to do it by dropping the priority of the process, then killing all of them. which sometimes allowed a new process to get by the "killing all of them" but now it is at a lower priority. so kill all of them again. About the third time they will all be dead (even on 128core computers). The main issue is that it takes a long time to do. We used to call such programs "cancer" and had options to direct which resource was being aimed at (one was RAM, so multiple calls to malloc, and then writing the pid to the chunk of memory allocated - without writing the pid, the kernel wouldn't actually allocate any pages - as it used a copy-on-write to determine if the page is actually needed. This causes a crash on systems that didn't have reasonable limits for user virtual memory. A good diagnostic for tests is to have the cancer program check inode stats on every loop - if the protection mask changed, exit.
EXPOSED: The Windows Rootkit Scandal by Sony
20:47
Dave's Garage
Рет қаралды 393 М.
REVIEW: Top 50 Worst Computer Dialogs by a Microsoft UI Developer!
18:17
How to bring sweets anywhere 😋🍰🍫
00:32
TooTool
Рет қаралды 31 МЛН
Increíble final 😱
00:37
Juan De Dios Pantoja 2
Рет қаралды 32 МЛН
HAL 9000 and the Sexadecimal Mystery - Finally Explained!
22:11
Dave's Garage
Рет қаралды 321 М.
Understanding Fork Bombs in 5 Minutes or Less
5:55
Engineer Man
Рет қаралды 166 М.
DNS Demystified: Everything You Should Know for Faster Internet!
14:03
The Windows Clock: Why Seconds took Years
15:05
Dave's Garage
Рет қаралды 189 М.
Blame Me: I Worked on the Windows Progress Dialog!
16:26
Dave's Garage
Рет қаралды 385 М.
Scroll Lock - The Secret Key THEY Don't Want You to Press!
9:51
Dave's Garage
Рет қаралды 960 М.
these characters will crash your computer
3:23
Low Level Learning
Рет қаралды 168 М.
Storage Media Life Expectancy: SSDs, HDDs & More!
18:18
ExplainingComputers
Рет қаралды 333 М.
😱НОУТБУК СОСЕДКИ😱
0:30
OMG DEN
Рет қаралды 3,4 МЛН
wireless switch without wires part 6
0:49
DailyTech
Рет қаралды 3,1 МЛН
Непробиваемый телевизор 🤯
0:23
FATA MORGANA
Рет қаралды 157 М.