Hacks and Tweaks


June 25, 2012

How to block websites using C code

More articles by »
Written by: arunenigma
Tags: , , , ,

Most of us are familiar with the virus that used to block Orkut and Youtube site.creating such a on . I will give a brief introduction about this code before I jump into the technical jargon.This code has been exclusively created in ‘C’. So, anyone with a basic knowledge of C will be able to understand the working of the code. This program needs to be clicked only once by the victim. Once it is clicked, it’ll block a list of websites that has been specified in the source code.The victim will never be able to surf those websites unless he re-installs the operating system. This blocking is not just confined to IE or Firefox. So once blocked, the site will not appear in any of the browser program. Note: You can also block a website manually. But, here I have created a virus that automates all the steps involved in blocking. Source Code:

Compile the program using turbo c and launch the .exe file generated.

  • To test, run the compiled module. It will block the sites that is listed in the source code.
  • 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“.
  • To remove the virus type the following the Run.


  • Then, open the file named “hosts” using the notepad. At the bottom of the opened file you’ll see something like this.


  •  Delete all such entries which contain the names of blocked sites.

Note: You can also change the Icon of the program to make it look like a legitimate program.

Did you enjoy this article? If so, we’d love to hear your thoughts in the comments below. It would be great if you subscribed to our RSS feed or signed up for email updates to get more goodness. There’s lots more where this came from!

About the Author

Computer Science Graduate Student @ Case Western Reserve University, Cleveland, USA



Python Factory Design Patterns using Switch Case

I googled for Factory Method Design Pattern in Python but couldn’t find a good resource. So, I  am sharing an example program to demonstrate this design pattern in Python which I frequently use. The factory method pattern is...
by arunenigma


Conway’s Game of Life Implemetation in Python with cool patterns

he Game of Life (or simply Life) is not a game in the conventional sense. There are no players, and no winning or losing. Once the “pieces” are placed in the starting position, the rules determine everything that ha...
by arunenigma


Python AVL Tree Implementation with ASCII visualization

n computer science, an AVL tree is a self-balancing binary search tree. It was the first such data structure to be invented. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any tim...
by arunenigma



Binary Search Tree in Python with ASCII art visualization

Binary search tree implementation in Python with: in, post and pre-order traversals. Also includes methods for insertion, deletion and search of nodes. Deletion is fairly complex and is made possible by keeping track of parents...
by arunenigma


Python, Memoization, Dynamic Programming, Fibonacci Series and some Fun!

ython can implement the recursive formulation directly, caching return values. Memoization is a method where if a call is made more than once with the same arguments, and the result is returned directly from the cache. For exam...
by arunenigma


One Comment

  1. neo


    I just wondered after read this post. It's just amazing and it can provide us security to prevent unwanted websites.
    One thing I want to that, Does the .exe file which will be generated through that code need to run as PC Administrator? Or we can run it in any user account?

    Looking forward to your reply.

    Thanks in advance
    Neo Roy (Kunal)

You must be logged in to post a comment.