Windows 7 Password Reset

So, the reason I needed Knoppix was that I installed Windows 7... and was locked out on reboot. I'm assuming I fat fingered the password. Moving on.

My first try was ophcrack; it's a bootable ISO that starts the machine, finds all the user accounts, and runs the passwords against a rainbow table. It has two versions; XP and Vista/7. I'm running this on a netbook, so I installed the ISO to a USB key with the Universal Netbook Installer, which might be the best open source app I've seen recently. Unfortunately, ophcrack didn't work.

I found an older Knoppix boot CD; Knoppix is a version of linux that fits on one CD, and runs off of CD; it doesn't install to the hard drive, although it allows you to access the files on the hard drive. I had a little problem with my network, and then was able to move onto fixing the problem.

  1. Download chntpw from Debian;
  2. Convert the deb file to a tar: alien --to-tgz
  3. Unpack the tar: tar xvzf ./usr/sbin/chntpw
  4. Move the executable somewhere handy: mv ./usr/sbin/chntpw ~
  5. Mount the hard drive. For Windows 7's default install to /dev/sda2: mkdir /mnt/disk; mount -t ntfs -o uid=Knoppix,gid=Knoppix /dev/sda2 /mnt/disk
  6. Change to the directory of the file with the passwords: cd /mnt/disk/Windows/System32/config
  7. Copy the password file, just to be safe: cp SAM /mnt/disk/
  8. List the usernames available to change: ~/chntpw -l SAM
  9. Erase your password: ~/chntpw -u
  10. Change directory out of the Windows 7 partition: cd
  11. Unmount the Windows partition: umount /mnt/diskd
  12. Reboot; you're done.

There's probably something to be said here about "physical security". On the plus side, this only blanks a password, so if someone uses this to get your data, you'll at least have a hunch at what happened.

In the meanwhile, it's time to create myself a password reset disk. (Apparently, Control Panel, search for "Password Reset", and have a USB key in the computer.)

No comments: