Showing posts with label Home. Show all posts
Showing posts with label Home. Show all posts

Saturday, 8 November 2014

How to Create a Virus to Block Websites

How to Create a Virus to Block Websites

A Virus to Block Websites
Most of us are familiar with the virus that used to block Orkut and Youtube websites. If you are curious about creating such a virus on your own, here is how it can be done.
As usual I am using my favorite programming language ‘C’ to create thiswebsite blocking virus. I will give a brief introduction about this virus before I jump into the technical jargon.
This virus has been exclusively created in ‘C’. So, anyone with a basic knowledge of ‘C’ will be able to understand the working of this virus program. When this program is executed, it will block all those websites that are listed in the source code. In the following example, the sites that are listed in the source code are Google, Yahoo and Youtube. When you download the source code of this program, you have a choice to include your own list of sites that you want this virus to block.
I have just removed the source code of this program from this post as it is lengthy and makes the post look messy. You can still download the source code of this virus program from the following link:

How Virus Program Works?

The Windows operating system maintains a special file called HOSTS which can be used to block any given hostname or domain name (website) by adding new entries onto it. This program works by modifying the HOSTS file by adding new entries of those sites that are intended to be blocked. The HOSTS file is located at:
%windir%\system32\drivers\etc (Usually: C:\windows\system32\drivers\etc)
So, when you execute this program, all it does is add the entries of the list of those sites (mentioned in the source code) to this HOSTS file. Once this is done, the site will be blocked from your computer. So, none of the browsers would be able to load those sites on your computer.
For more information on HOSTS file, I recommend reading my other post on How to use HOSTS file to block websites.
Now, as far as the technical part of this program is concerned, people who have a working knowledge of ‘C’ should be easily able to understand the working of this virus program. However, for those who are new to ‘C’ programming, here is the algorithm of this program:
  • Determine the Root drive. ie: Find the drive (C:, D:, E: or F:) on which the Windows is installed.
  • Navigate to: %windir%\system32\drivers\etc
  • Open/Load the HOSTS file.
  • Copy a list of those websites that are mentioned in the ARRAY to the END of the file.
  • Save the file and Exit.

How to Compile the Source Code?

For a step-by-step compilation guide, refer my post: How to compile C Programs?

Testing the Virus:

  1. To test, run the compiled module. It will block the sites that are listed in the source code.
  2. Once you run the file block_Site.exe, restart your browser program. Then, type the URL of the blocked site and you’ll see the browser showing error “Page cannot displayed“.
  3. To remove the virus type the following command in the Run.
    %windir%\system32\drivers\etc
  4. There, open the file named “hosts” using the notepad. At the bottom of the opened file you’ll see something like this:
    127.0.0.1 google.com
  5. Delete all such entries which contain the names of blocked sites.
  6. How to Compile C Programs


    How to compile C programsIn many of my previous posts especially in the Programmingsection, I have used C as the programming language for writing the programs. If you’re new to C programming and find it difficult tocompile the C source codes then this post is for you.
    Here is a step-by-step procedure to install Borland C++ compiler 5.5 on your PC and compile the C programs.

    How to Install Borland C++ compiler?

    Follow the below steps to install Borland C++ compiler 5.5 on your PC:
    1. Download Borland C++ compiler 5.5 (for Windows platform) from the following link:
    2. After you download, run the file C++5.51.exe. The default installation path would be:
      C:\Borland\BCC55

    How to configure Borland C++ compiler?

    Here is a step-by-step instruction on how to configure the compiler:
    1. After you install Borland C++ compier, create two new Text Documents.
    2. Open the first New Text Document.txt file and add the following two lines into it:
      -I”c:\Borland\Bcc55\include”
      -L”c:\Borland\Bcc55\lib”
      Save changes and close the file. Now rename the file from New Text Document.txt tobcc32.cfg.
    3. Open the second New Text Document (2).txt file and add the following line into it:
      -L”c:\Borland\Bcc55\lib”
      Save changes and close the file. Rename the file from New Text Document (2).txt toilink32.cfg.
    4. Now copy the two files bcc32.cfg and ilink32.cfg, navigate to C:\Borland\BCC55\Bin and paste them.

    How to Compile the C Source Code (.C files)?

    Here is a detailed instruction on how to compile C source codes:
    1. You need to place the .C (example.c) file to be compiled in the following location:
    2. C:\Borland\BCC55\Bin
    3. Now go to the command prompt (Start->Run->type cmd->Enter)
    4. Make the following path as the present working directory (use the CD command):
    5. C:\Borland\BCC55\Bin
    6. To compile the file (example.c) use the following command:
    7. bcc32 example.c
    8. Now if there exists no error in the source code, you’ll get a compiled executable module (example.exe) in the same location (C:\Borland\BCC55\Bin).
    9. Now you have successfully compiled the source code into an executable file(.exe file).
NOTE: You can also change the ICON of the virus to make it look like a legitimate program. This method is described in the post: How to Change the ICON of an EXE file?

How to Create a Virus that can restart a computer with codings

How to Create a Virus that can restart a computer with codings

How to compile C programs
In many of my previous posts especially in the Programmingsection, I have used C as the programming language for writing the programs. If you’re new to C programming and find it difficult tocompile the C source codes then this post is for you.
Here is a step-by-step procedure to install Borland C++ compiler 5.5 on your PC and compile the C programs.

How to Install Borland C++ compiler?

Follow the below steps to install Borland C++ compiler 5.5 on your PC:
  1. Download Borland C++ compiler 5.5 (for Windows platform) from the following link:
  2. After you download, run the file C++5.51.exe. The default installation path would be:
    C:\Borland\BCC55

How to configure Borland C++ compiler?

Here is a step-by-step instruction on how to configure the compiler:
  1. After you install Borland C++ compier, create two new Text Documents.
  2. Open the first New Text Document.txt file and add the following two lines into it:
    -I”c:\Borland\Bcc55\include”
    -L”c:\Borland\Bcc55\lib”
    Save changes and close the file. Now rename the file from New Text Document.txt tobcc32.cfg.
  3. Open the second New Text Document (2).txt file and add the following line into it:
    -L”c:\Borland\Bcc55\lib”
    Save changes and close the file. Rename the file from New Text Document (2).txt toilink32.cfg.
  4. Now copy the two files bcc32.cfg and ilink32.cfg, navigate to C:\Borland\BCC55\Bin and paste them.

How to Compile the C Source Code (.C files)?

Here is a detailed instruction on how to compile C source codes:
  1. You need to place the .C (example.c) file to be compiled in the following location:
  2. C:\Borland\BCC55\Bin
  3. Now go to the command prompt (Start->Run->type cmd->Enter)
  4. Make the following path as the present working directory (use the CD command):
  5. C:\Borland\BCC55\Bin
  6. To compile the file (example.c) use the following command:
  7. bcc32 example.c
  8. Now if there exists no error in the source code, you’ll get a compiled executable module (example.exe) in the same location (C:\Borland\BCC55\Bin).
  9. Now you have successfully compiled the source code into an executable file(.exe file).
NOTE: The above tutorial assumes that you’ve installed the compiler onto the C: drive (by default).

How to Create A Virus Program to Restart the Computer

A Virus Program to Restart the Computer

A Virus Program to Restart the Computer
In this post, I will show you how to create a virus to restart the computer at every startup. That is, upon infection, the computer will get restarted every time the system is booted. As a result, the computer will become inoperable as it reboots again as soon as the desktop is loaded.
For this, the virus needs to be executed only once and from then on, it will carry out rest of the operation on its own. I have programmed this virus using the C language. If you are familiar with the C language then it is too easy to understand the logic behind the coding. The code is not posted here in this article, but you can download it from the link below.

Compiling the source code into an executable module:

  1. Download the Source Code Here.
  2. UnRar the file and you should see the source code: Sysres.C
  3. For a step-by-step compilation guide, refer my post: How to compile C Programs?

Testing and removing the virus from your PC:

You can compile and test this virus on your own PC without any fear. To test, just double-click thesysres.exe file and restart the system manually. From now on, every time the PC is booted and the desktop is loaded, your PC will restart automatically again and again.
It will not do any harm apart from automatically restarting your system. After testing it, you can remove the virus by following the below mentioned steps:
  1. Reboot your computer in the safe mode.
  2. Go to:
    %systemroot%\Windows\System
    (%systemroot% can be C,D,E or F)
  3. You will find a file by name sysres.exe, delete it.
  4. Type regedit in run. You will go to the registry editor. Here navigate to:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\ CurrentVersion\Run
    There, on the right site you will see an entry by name “sres“. Delete this entry. That’s it. You have now removed this virus successfully.

Logic Behind the working of this virus program:

If I do not explain the logic(Algorithm) behind the working of the virus program, I think this post would become an incomplete one. So I’ll explain the logic in a simplified manner without getting much into the technical aspects of the program. If you have further doubts, you can pass your comments.
LOGIC:
  1. First the virus will find the Root partition (Partition on which Windows is installed).
  2. Next, it will determine whether or not the virus file (sysres.exe) is already copied into%systemroot%\Windows\System.
  3. If not it will just place a copy of itself into %systemroot%\Windows\System and makes a registry entry to put this virus file into the Windows startup.
  4. Or else if the virus is already found in the %systemroot%\Windows\System directory (folder), then it just gives a command to restart the computer.
This process is repeated every time the PC is restarted.
NOTE: The system will not be restarted as soon as you double click the Sysres.exe file.The restarting process will occur from the next boot of the system.

How to change the icon of the executable module (This step is optional):

After you compile, the sysres.exe file that you get will have a default icon. If you send this file to your friends they may not execute it since it has a default ICON. So it is possible to change the ICON of this Sysres.exe file into any other ICON that is more trusted and looks attractive.
For example, you can change the icon into Norton antivirus ICON itself so that the people seeing this file believes that it is Norton antivirus. Or you can change its ICON into the ICON of any popular or trusted programs so that people will definitely click on it.

Latest Report