hacking tutorials - Hack browser to block websites - hacker - ethical hacking - learn hacking - ethical hacking tutorials
- Let’s see a virus program to block the listed websites in the companies. On execution of this exe file (Compiled C program), automatically the machine is locked for some of the websites which is listed in the code.
- The below virus program makes you to write the list of websites to block in the hosts file located in system32 folder of windows operating system.
What is hosts file ?
- Hosts file in windows helps the computer to identify which websites should be blocked and which websites should be permitted.
C programming Code :
Steps to execute the program
- Save the above code as website_block.c Compile the above c programming code with the C/C++ compiler.
- On Running this program (You should run as an administrator so that, modify the hosts needs administrator account). To test, run the code or execute the code exe (website_block.exe) file. It will block the sites that is listed in the above c program code.
Learn ethical-hacking - ethical-hacking tutorial - hack browser - ethical-hacking examples - ethical-hacking programs
- Once you run the file website_block.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. %windir%\system32\drivers\etc
- 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
Learn ethical-hacking - ethical-hacking tutorial - Hack browser to block websites - ethical-hacking examples - ethical-hacking programs
- In case, if you want to revoke the changes. Delete all such entries which contain the names of blocked sites.