Reset Your Windows Password with CHNTPW

I often use this method to reset Windows passwords to avoid using expensive proprietary tools.  The tool is called chntpw and its source is available here. Most Linux security distributions will have this tool installed by default. If you do not have the tool almost every package management system will have it available.

So in order to make this work we need to boot our Linux disk on our windows computer we are locked out of.  I like to use Backtrack Linux for all my security needs (Most likely because I am a developer :-) ).

First thing we need to do is mount our windows partition.  If you are using Backtrack we need to use ntfs-3g to mount the windows partition. This is assuming your windows partition is on sda1 and you have created a directory named windows to mount it on. If you are lost now then this post may not be for you.


  1. root@bt4:~# mount -t ntfs-3g /dev/sda1 /mnt/windows/ -o force

Once the partition is mounted, you must locate the directory containing the SAM file. For Windows 2000 and XP systems, this directory should be located under windows/system32/config or winnt/system32/config. In this example, navigate to the /mnt/windows/system32/config directory, and notice a number of files, including ones called SAM, SYSTEM, and SECURITY, that may or may not be in all caps. Once you have navigated to this directory on the command line, reset the Windows Administrator password by running chntpw. In Backtrack this tool exists in the $PATH however on your distro you may need to include a complete file path.


  1. root@bt4:~# chntpw SAM

Remember that SAM is the name of the SAM file in the directory, and may or may not be all in caps. The default for this utility is to edit the Administrator password, so there is no need to specify an account. While you have the option to change the password to a different value, it is recommended to just reset the password and then change it when you get back into Windows. You can reset the password by typing * instead of a password when prompted.

If you want to reset the password for a user other than Administrator, list the users in the SAM file with the -l option:


  1. root@bt4:~#chntpw -l
  2. chntpw version 0.99.2 040105, (c) Petter N Hagen
  3. Hive's name (from header): <SystemRootSystem32ConfigSAM>
  4. ROOT KEY at offset: 0x001020
  5. Page at 0x6000 is not 'hbin', assuming file contains garbage at end
  6. File size 262144 [40000] bytes, containing 5 pages (+ 1 headerpage)
  7. Used for data: 218/16928 blocks/bytes, unused: 4/3392 blocks/bytes.
  8. * SAM policy limits:
  9. Failed logins before lockout is: 0
  10. Minimum password length        : 0
  11. Password history count         : 0
  12. RID: 01f4, Username: <Administrator>, *BLANK password*
  13. RID: 01f5, Username: <Guest>, *disabled or locked*
  14. RID: 03e8, Username: <Bob>
  15. RID: 03ea, Username: <SUPPORT>, *disabled or locked*
  16. Hives that have changed:
  17. #  Name
  18. None!

This example has four users: Administrator, Guest, Bob, and SUPPORT. Pick the user you want to edit, and then run chntpw with the -u option:


  1. root@bt4:~# chntpw SAM -u username

Once you change the password and save your changes, unmount the filesystem and reboot

When you boot back to Windows, the password should be blank, so you can log in and change the password with the regular Windows tools.