Add upstream documentation --- /dev/null +++ b/bootdisk.html @@ -0,0 +1,548 @@ + +
+
+I've put together a single floppy or CD which contains
+things needed to edit the passwords on most systems.
+
+
+The bootdisk should support most of the more usual disk controllers. +You most likely have to select "d" to auto-load the drivers, it should +then detect PCI based hardware. For ISA hardware, you have to load manually. +Both PS/2 and USB keyboard supported. +
+Tested on: NT 3.51, NT 4 (all versions and SPs), Windows 2000 (all +versions & SPs), Windows XP (all versions, also SP2), +Windows Server 2003 (all SPs), Vindows Vista 32 and 64 bit. +
+DANGER WILL ROBINSON!
+If used on users that have EFS encrypted files, and the system is XP
+or Vista, all encrypted files for that user will be UNREADABLE!
+and cannot be recovered unless you remember the old
+password again If you don't know if you have encrypted files
+or not, you most likely don't have them. (except maybe on corporate systems)
+
+
+Please see the Frequently Asked Questions +and the version history below before emailing questions to me. Thanks! +
+Also take a look at Grenier's DOS port +
+ +How to fix it if you lost your admin password for your +ActiveDirectory. Thanks to John Simpson. +
+Other ways to recover lost password etc at +MCSE World +
+
+If you have the CD, all drivers are included. If you use the floppy, +and you need the SCSI-drivers set, either prepare a floppy with +the scsi-drivers .zip file unzipped (in \scsi), or put a selection +of the drivers you need in the \scsi folder on the main floppy, +there should be enough space for maybe a couple of drivers. In the latter +case you don't need to carry around and swap floppies. +
+
+ +
+
+========================================================= +. Step ONE: Select disk where the Windows installation is +========================================================= +Disks: +Disk /dev/sda: 2147 MB, 2147483648 bytes +NT partitions found: + 1 : /dev/sda1 2043MB Boot + +Please select partition by number or +a = show all partitions, d = automatically load new disk drivers +m = manually load new disk drivers +l = relist NTFS/FAT partitions, q = quit +Select: [1] ++
+Select: [1] m +==== DISK DRIVER / SCSI DRIVER select ==== +You may now insert or swap to the SCSI-drivers floppy +Press enter when done: +Found 1 floppy drives +Found only one floppy, using it.. +Selected floppy #0 +Mounting it.. +Floppy selection done.. +SCSI-drivers found on floppy: + +1 BusLogic.o.gz +2 aic7xxx.o.gz +3 sym53c8xx.o.gz +[ ... ] + +SCSI driver selection: + a - autoprobe for the driver (try all) + s - swap driver floppy + q - do not load more drivers + or enter the number of the desired driver + +SCSI driver select: [q] ++
+SCSI driver select: [q] a +[ BusLogic.o.gz ] +Using /tmp/scsi/BusLogic.o +PCI: Found IRQ 11 for device 00:10.0 + +[.... lots of driver / card info ...] + +scsi0: *** BusLogic BT-958 Initialized Successfully *** +scsi0 : BusLogic BT-958 + Vendor: FooInc Model: MegaDiskFoo Rev: 1.0 + Type: Direct-Access ANSI SCSI revision: 02 + +[ ... ] + +Attached scsi disk sda at scsi0, channel 0, id 0, lun 0 +SCSI device sda: 8388608 512-byte hdwr sectors (4295 MB) +Partition check: + /dev/scsi/host0/bus0/target0/lun0: p1 +Driver BusLogic.o.gz loaded and initialized. + ++
+ +
+On the selected partition/disk, the main files for windows can +theoretically be anywhere. And we must find the registry files +to be able to edit them. There are however some usual places: +
+
+Selected 1 +Mounting on /dev/ide/host0/bus0/target0/lun0/part1 +NTFS volume version 3.1. +Filesystem is: NTFS + +========================================================= +. Step TWO: Select PATH and registry files +========================================================= +What is the path to the registry directory? (relative to windows disk) +[windows/system32/config] : +-r-------- 1 0 0 262144 Jan 12 18:01 SAM +-r-------- 1 0 0 262144 Jan 12 18:01 SECURITY +-r-------- 1 0 0 262144 Jan 12 18:01 default +-r-------- 1 0 0 8912896 Jan 12 18:01 software +-r-------- 1 0 0 2359296 Jan 12 18:01 system +dr-x------ 1 0 0 4096 Sep 8 11:37 systemprofile +-r-------- 1 0 0 262144 Sep 8 11:53 userdiff + +Select which part of registry to load, use predefined choices +or list the files with space as delimiter +1 - Password reset [sam system security] +2 - RecoveryConsole parameters [software] +q - quit - return to previous +[1] : ++
+We select 1 to edit passwords.. +
+
+ +
+========================================================= +. Step THREE: Password or registry edit +========================================================= +chntpw version 0.99.2 040105, (c) Petter N Hagen + +[.. some file info here ..] + +* SAM policy limits: +Failed logins before lockout is: 0 +Minimum password length : 0 +Password history count : 0 + +<>========<> chntpw Main Interactive Menu <>========<> + +Loaded hives: <sam> <system> <security> + + 1 - Edit user data and passwords + 2 - Syskey status & change + 3 - RecoveryConsole settings + - - - + 9 - Registry editor, now with full write support! + q - Quit (you will be asked if there is something to save) + + +What to do? [1] -> 1 + +===== chntpw Edit User Info & Passwords ==== + +RID: 01f4, Username: <Administrator> +RID: 01f5, Username: <Guest>, *disabled or locked* +RID: 03e8, Username: <HelpAssistant>, *disabled or locked* +RID: 03eb, Username: <pnh>, *disabled or locked* +RID: 03ea, Username: <SUPPORT_388945a0>, *disabled or locked* + +Select: ! - quit, . - list users, 0x<RID> - User with RID (hex) +or simply enter the username to change: [Administrator] ++
+Here you can enter the username you want to reset the password for. +NOTE: It is case-sensitive, write it exact as listed (without the < +and > of course) +
+Or if the name uses some characters that cannot be displayed, enter +it's ID number (RID), like this: 0x1f4 would select administrator. +
+We select the default, which is administrator. +
+
+ +RID : 0500 [01f4] +Username: Administrator +fullname: +comment : Built-in account for administering the computer/domain +homedir : + +Account bits: 0x0210 = +[ ] Disabled | [ ] Homedir req. | [ ] Passwd not req. | +[ ] Temp. duplicate | [X] Normal account | [ ] NMS account | +[ ] Domain trust ac | [ ] Wks trust act. | [ ] Srv trust act | +[X] Pwd don't expir | [ ] Auto lockout | [ ] (unknown 0x08) | +[ ] (unknown 0x10) | [ ] (unknown 0x20) | [ ] (unknown 0x40) | + +Failed login count: 0, while max tries is: 0 +Total login count: 3 + +* = blank the password (This may work better than setting a new password!) +Enter nothing to leave it unchanged +Please enter new password: * ++
+Some information is displayed. Also, if the account is locked, you +will be asked if you wish to unlock it (not shown here) +
+We go for the blank password option (*) WHICH IS HIGLY RECOMMENDED +over setting a new one. +
+
+Please enter new password: * +Blanking password! + +Do you really wish to change it? (y/n) [n] y +Changed! + + +Select: ! - quit, . - list users, 0x+- User with RID (hex) +or simply enter the username to change: [Administrator] ! +
+! brings us back to the main menu here. +
+
+ +<>========<> chntpw Main Interactive Menu <>========<> + +Loaded hives:++ + 1 - Edit user data and passwords + 2 - Syskey status & change + 3 - RecoveryConsole settings + - - - + 9 - Registry editor, now with full write support! + q - Quit (you will be asked if there is something to save) + + +What to do? [1] -> q +
+
+
+ +Hives that have changed: + # Name + 0+- OK + +========================================================= +. Step FOUR: Writing back changes +========================================================= +About to write file(s) back! Do it? [n] : y +
+THIS IS YOUR LAST CHANCE! If you answer y here there will be a +write to disk! +
+
+Writing sam + +***** EDIT COMPLETE ***** + +You can try again if it somehow failed, or you selected wrong +New run? [n] : n + ++
+That was all. +
+Please answer n here and then reboot, CTRL-ALT-DEL. Remember to remove +the floppy or CD. +
+
+ +
+The most critical moment is when writing back the registry files to +NTFS. +
+The most common problem is that the computer was not cleanly shut +down, and my disk won't write correctly back. (it says: read only +filesystem). If so, boot into Windows Safe Mode (F8 before windows +logo appears) and shut down from the login window. +
+Also, see the FAQ for help with other common problems. +
+For linux-knowledged people, you may do things manually if the scripts fail, +you have shells on tty1-tty4 (ALT F1 - ALT F4). +
+
+2007-04-09 +
+2005-03-03 +
+2005-03-03 +
+(earlier history removed)
+9705xx
+
+Note: Some links may be offsite. +
+
+Bootable USB drive may be made from the files on the CD. See readme.txt on the CD. +
+Last floppy release (it is old). WARNING: WILL CORRUPT WINDOWS VISTA!
+
+Previous versions may sometimes be found here (also my site) +
+
+NOTE THAT THE BOOTDISK CONTAINS CRYPTHOGRAPHIC CODE, and that it may be +ILLEGAL to RE-EXPORT it from your country. +
+ +
+Unzipped, there should be an ISO image file (cd??????.iso). This can +be burned to CD using whatever burner program you like, most support +writing ISO-images. Often double-clikcing on it in explorer will pop +up the program offering to write the image to CD. Once written the CD +should only contain some files like "initrd.gz", "vmlinuz" and some +others. If it contains the image file "cd??????.iso" you didn't burn +the image but instead added the file to a CD. I cannot help with this, +please consult you CD-software manual or friends. +
+The CD will boot with most BIOSes, see your manual on how to set it +to boot from CD. Some will auto-boot when a CD is in the drive, +some others will show a boot-menu when you press ESC or F10/F12 when +it probes the disks, some may need to have the boot order adjusted +in setup. +
+ +
+The unzipped image (bdxxxxxx.bin) is a block-to-block representation +of the actual floppy, and the file cannot simply be copied to +the floppy. Special tools must be used to write it block by block. +
+
Or from unix:
+dd if=bd??????.bin of=/dev/fd0 bs=18k
+
+
+NOTE: Not all files will fit on a floppy, so leave out what you +think you do not need! +
.ko.gz should end up in a
+directory called scsi
+moddep.gz and
+pcitable.gz, they are the dependency list, and pci
+mappings.
++
+
+Most of the stuff on the bootdisk is either GPL, BSD or similar +license, you can basically do whatever you want with all of it, +the sourcecode and licenses can be found at their sites, I did not change/patch +anything. +
+The "chntpw" program (password changer, registry editor) is licensed +under GNU GPL v2. COPYING.txt +
+Stuff I used, big thanks: +
+
+
+
X)\]"[\PG0/L)PEN>/.X@-"\Z"\1;K[WJJY/]@MF*GQS[
+M^.27;_X)!0"@_OKL_V#^^_#'+__\]-=OO_P<%.`<^>F_<[_\("A`^MA'0`"L
+MX'\(3"#]T`<`%<2/!0(L(`%C,`,%6M!^,$B?^R[(P0[>[W"*8]KKPG>R$IKP
+MA"@\(0@`((`8:."%,'SA#U)(PQK:\(8XS*$.=WA##@`@`Q4X80$$\(,+\-"&
+M"TB?"V,(PQ@(@#T6.*(4IXC#%6I`!3;,GP"8V,0GDB"(5`RC#B%(1#&:\8Q2
+M5!P$OM>K#WQ`C7",HQSGJ,85QO_@!RK(HQ[U2,<^^O&/@`RD(`=)2,7Y$(AQ
+M'&(1"]E',N)QCWK$@1,1RK)Q!.]U9@`B\@)7TY&
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Last update: 080526
+
+
+The changes does not take effect.
+
+I get some errors like "read-only filesystem" and such.
+
+
+
+
+
+Why can't I access my encrypted (EFS) files after resetting the password?
+
+
+
+
+The .bin-file inside the .zip won't fit on a floppy.
+
+
+
+
+
+The keyboard does not work! I can't answer the questions!!
+
+
+
+
+When loading the floppy it stops with "boot failed."
+
+
+
+
+
+ I have the CD in my CD drive, but it starts on the haddrive.
+
+
+
+
+
+The floppy stuff crashes with "VFS: Unable to mount root.." and panic etc.
+
+
+
+
+
+
+boot mem=128M
+
+It cannot find any NT disks or paritions.
+
+
+
+
+
+
+
+How to load a 3rd party driver
+
+
+
+
+It hangs when mounting the windows disk
+
+
+
+
+It seems to change the password, but NT won't agree.
+
+
+
+
+I'm told that the account is locked, even if I know it is not.
+
+
+
+
+I'm not told that the account is locked out, even Windows says it
+is. How can I reset it?
+
+
+
+
+
+The user promotion (putting user into admin group) did not work: I
+cannot log in!
+
+
+
+
+
+The user promotion (putting user into admin group) worked, but I
+cannot put user back into other groups in windows!
+
+
+
+
+
+I tried it on Win2k/2003/2008 PDC (Active Directory), and it didn't change the password.
+
+
+
+
+What is the 'Can't access tty...' error message when I quit the
+floppy/cd procedure?
+
+
+
+
+My language uses characters in the usernames that are not readable
+with the floppy, and i cannot enter/search for them, thus not edit.
+
+
+
+
+What about support? and I just paid $$ for it on eBay!
+
+
+
+
+
+Can I donate money?
+
+
+
+
+
+091201, pnh@pogostick.net
+
+
--- /dev/null
+++ b/syskey.txt
@@ -0,0 +1,124 @@
+The Offline NT Password Editor
+
+(c) 1997-2002 Petter Nordahl-Hagen
+
+Update: 08 dec 2002
+
+What happens when syskey is installed, and how to get rid of it
+---------------------------------------------------------------
+
+Background:
+-----------
+
+Syskey was added to NT with Service Pack 3 as a way to prevent easy
+access to the actual password hashes in the SAM (Security Accounts Manager)
+The original methods of making and storing the hashes makes it
+rather easy to bruteforce or dictionary-attack it to find the plaintext
+passwords. (mostly caused by a somewhat flawed implementation & use
+of the cryptoalgorithms involved, but that's discussed elsewhere)
+Enabling syskey is optional, the administrator must run syskey.exe and
+answer some dialog-boxes to turn it on. On Windows 2000 it's not optional
+anymore, it's enabled by default at installation time.
+
+When syskey is active, the hashes are encrypted/obfuscated yet
+another time before being stored in the SAM registry.
+However, they're stored in the old form in memory after boot
+(pwdump2 demonstrates this),
+since the old form is needed for NTLM authentication on the network etc.
+
+The key that obfuscates the hashes, or rather it looks like something
+that decrypts the key, can be stored on floppy, generated from a
+passphrase to be entered at boot, or stored (obfuscated again) in
+the registry.
+
+There's no official supported method to switch off syskey
+once activated, except restoring the registry from a rescuefloppy
+made before activation of syskey.
+
+So.. what's this got to do with my utility?
+-------------------------------------------
+
+My utility doesn't try to crack passwords, it puts new hashes into
+the SAM, thus changing a users password. And it does this offline.
+Syskey was a showstopper for this.
+As far as I can see, there's 2 ways to solve this:
+
+1) Find the key in registry, get user to enter it, or get hold of floppy
+ then use the syskey on the new password too. However, it's not documented
+ and I haven't found any reverse engineering of it anyplace.
+
+2) Try to turn it off. This has one drawback, and one good side:
+ Bad: all passwords must be reset, since the old hashes will be invalid.
+ VeryBAD: SWITHCHING OFF IN WINDOWS 2000 AND XP NOT PERFECT,
+ WILL CAUSE TROUBLE, but you can access the computer
+ afterwards. Domain relationships & syskey may be
+ impossible to change after this, requiring a reinstall
+ (or possibly only an upgrade)
+ Good: There's no need for the key (which may be lost).
+
+3) (NEW 2000-04-01, no, not a joke) Insert old styles password-hashes
+ into the SAM, will be converted to syskey-hashes on next boot.
+ This is how syskey is enabled on NT4, the hashes won't be touched
+ until the first reboot after turning on syskey.
+
+I've found out how to do #2 and #3.
+
+What happens when syskey is turned on, and how to turn it off again:
+--------------------------------------------------------------------
+
+- 1 -
+Serveral new keys are added to HKLM\System\CurrentControlSet\Control\Lsa,
+it seems that most of the keys/values is used for the obfuscation of the key
+they change when syskey is updated.
+However the value named 'SecureBoot' holds the mode of syskey:
+ 1 - Key in registry
+ 2 - Enter passphrase
+ 3 - Key on floppy
+
+But removing this key (or setting it to 0) isn't enough to disable
+syskey. There's more..
+
+- 2 -
+HKLM\SAM\Domains\Account\F is a binary structure usually containing the computer
+SID and some other stuff related to that.
+When syskey is installed it's expanded (about twice the size), with something
+I guess is the key heavily encrypted + some flags and other values.
+One of these other flag/values also contains the same mode as SecureBoot above.
+
+So.. resetting this mode flag and SecureBoot to 0 is all that's needed
+to switch off syskey in NT4 (up to SP6 at time of writing). Changing only one of them
+results in a warning about inconsistencies between the SAM and system settings
+on completed boot, and syskey is re-invoked.
+
+- 3 -
+On Windows 2000 there's yet another place info about syskey is stored:
+
+HKLM\security\Policy\PolSecretEncryptionKey\