Sunday, November 23, 2014

How to block websites directly from your PC?

Learn how to block or restrict the access to a particular website, or even redirect a person to a different website....


In this hackorial (hack-tutorial), we'll be dealing with the practicals of Desktop Phishing. To know about Desktop Phishing, kindly go through our tutorial on this link http://hackorial.blogspot.in/2014/02/desktop-phishing-learn-to-block.html. To accomplish our task of Desktop Phishing, we'll be working with the hosts file which can be found in the various versions of windows Operating System. We can quickly get to our hosts file in the path (as in win 7, vista, win 8, 8.1) -> C:\  --> Windows  --> System32  --> drivers  --> etc  --> hosts
My hosts file looks like this

hosts file
This is how hosts file looks 


What basically hosts file used for, is to facilitate the task of name resolution or in simple terms the task of mapping the IP addresses to the host names. It fastens the task of name resolution as the entry for the IP address to host name mapping resides at the OS itself, so the DNS resolver need not to send request to the DNS server and wait for the response, and then open the website.

So, lets practically think what all can we do with this hosts file. If we just make an entry in our hosts file that maps a wrong IP address to a host name. So what exactly happens when someone browse that webpage for example www.rtoon.com and in turn that guy is redirected to any other site for exmple www.uhacked.com, or he is blocked from accessing www.rtoon.com if wrong IP address is mapped to it. We can do much more.

Follow these simple steps to block any website or redirect a website to a different webpage-

Step-1 Run notepad as administrator. (Note: not any editor only Notepad with admin privileges as its not easy to edit the hosts file directly)

Step-2 Open the hosts file from Notepad.

Step-3 Find the IP address of the website you want the victim to get redirected. For this open cmd (Win+R , type cmd, enter) type ping www.hackorial.blogspot.com

Step-4 Most important step of editing the hosts file. At the end of the file we can insert our entry by first typing the IP address we just got from ping command in the cmd, and then with a single space followed by the host name. Here host name refers to the website name that user opens and gets redirected to a different page.

Step-5 Save the file (CTRL+S) and restart the web-browser to see the results

For example the host name entry in the hosts file is facebook.com, so whenever the victim opens facebook.com, Our page hackorial.blogspot.com gets opened in the browser. And now the victim can never access facebook.com unless the hosts file is edited again. This is the magic of so called hosts file.

For strictly blocking any website without redirecting to a different website, you can do the following entry in the hosts file
127.0.0.1  anywebsite.com

You can anytime revert back to your original settings by deleting the entries or by commenting the entries in the hosts file by using # in front of each line. Its advisory to work with hosts file with proper understanding.

So, this was one of the practicals of Desktop Phishing in which we saw how to block any website directly from your OS.

Catch out this video tutorial to get step-by-step lesson for accomplishing the task of Blocking the websites.




If you really liked reading this article, click on the share button. For any further clarifications and queries, do post in the comment box below.