How to reset the Domain Admin Password under Windows Server 2003

Original Article

Abstract

I have recently installed a Windows 2003 Server at home and I set up a local domain using Active Directory
features. Everything worked fine until I changed the Domain Admin password. It seems that I mistyped the new
password twice (which I would attribute to the previous heavy night out), and, well, I could not log on the
Domain Controller anymore (I did not have a backup admin account, I do now!).

A few tricks about resetting the Domain Admin Password on Windows 2000 Server have been published, but
after Microsoft strengthened some security aspects on Windows 2003 Server, those hacks do not work anymore.

After struggling a few days, I finally managed to reset the domain account and I am going to present the trick
to you in this paper.

This trick has a few important requirements, be sure you meet them before yelling at me.

This paper does NOT intend to serve any sort of hackers, but just lousy administrators (like me).

Requirements


These are compulsory!

You need:

1/ Local access to the Domain Controller (DC).
2/ The Local Administrator password.
3/ Two tools provided by Microsoft in their Resource Kit: SRVANY and INSTSRV. Download them from here.


The Local Administrator account is also called Directory Restore Administrator or Machine Account. The password
is set at Windows installation. It is possible to reset this password using some (free) recovery tools.


The trick has been tested on a domain with a single DC. If your domain has multiple DCs, it should not matter
which one you decide to use.


Let's get started


Step 1

Restart Windows 2003 in Directory Restory Service Mode.

Note: At startup, press F8 and choose Directory Restore Service Mode. It disables Active Directory.

When the login screen appears, log on as Local Administrator. You now have full access to the computer resources,
but you cannot make any changes to Active Directory.

Step 2

You are now going to install SRVANY. This utility can virtually run any programs as an NT Service. The interesting
point is that the program will have SYSTEM privileges (as it inheritates SRVANY security descriptor), i.e. it will
have full access on the system. That is more than enough to reset a Domain Admin password. You will configure
SRVANY to start the command prompt (which will run the 'net user' command).

Copy SRVANY and INSTSRV to a temporary folder, mine is called d:/temp. Copy cmd.exe to this folder too (cmd.exe is
the command prompt, usually located at %WINDIR%/System32).

Start a command prompt, point to d:/temp (or whatever you call it), and type:
instsrv PassRecovery "d:/temp/srvany.exe"  
(Replace d:/temp with your folder name)

It is now time to configure SRVANY.

Start regedit, and open the key HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/PassRecovery.

Create a new subkey called Parameters and add two new values:

name: Application
type: REG_SZ (string)
value: d:/temp/cmd.exe

name: AppParameters
type: REG_SZ (string)
value: /k net user administrator new_password

'net user username password' is the command line utility to set a new password. Replace new_password with the
password you want. Keep in my mind that some domain policies require complex passwords (including digits,
respecting a minimal length etc.)


Now open the Services applet (Control Panel/Administrative Tools/Services) and open the PassRecovery property tab.
Check the starting mode is set to Automatic.

Show the Log On tab and enable the option Allow service to interact with desktop.

From now on, anytime you restart Windows, SRVANY will run the netuser command and reset the domain admin password.

Step 3

Restart Windows in normal mode and wait for the login screen. You will not see the command prompt running the net user
command as it is displayed on another desktop. But no worries, the command is still executed in the background.

Log on as Administrator on your domain by using the password you set above. The system should grant you access. If not,
go back to Step 2 and check you did not mistype any commands or values.

When the desktop is diplayed, you should see a command prompt. This is the one started by SRVANY.

Use this command prompt to uninstall SRVANY (do not forget to do it!) by typing:

net stop PassRecovery
sc delete PassRecovery


Now delete d:/temp and change the admin password if you fancy.


Voila!


Comments, feedback


Feel free to give me your comments and feedback. Send an email to seb@nobodix.org but do not expect a quick answer
from me.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值