[Dshield] Change windows local passwords remotely

Al Reust areust at comcast.net
Thu Apr 15 01:32:12 GMT 2004


You are operating with two assumptions:

1. You have explicit permission to do what you described. This may be in 
the form of "acceptable use policy" or you have been directed by 
"management" to insure that all machines are brought to current standards 
(corporate assets).

2. You have administrative rights on "All" machines. If they are joined to 
a domain then the Enterprise or Domain Administrator account can do what 
you ask.

Otherwise, "You" are at risk! But then it is only a job.. or jail..

If you are a "Win" Admin and have purchased the Sever Resource Kit, if not 
DO SO NOW! it has a utility called cusrmgr.exe

C:\Program Files\Resource Kit>cusrmgr.exe /?
CUsrMgr Ver 1.0 Jan98 by G.Zanzen (c) MCS Central Europe
Sets a random password to a user
usage: -u UserName [-m \\MachineName] \\ default LocalMachine
   Resetting Password Function
        -p Set to a random password
        -P xxx Sets password to xxx
   User Functions
        -r xxx Renames user to xxx
        -d xxx deletes user xxx
   Group Functions
        -rlg xxx yyy Renames local group xxx to yyy
        -rgg xxx yyy Renames global group xxx to yyy
        -alg xxx Add user (-u UserName) to local group xxx
        -agg xxx Add user (-u UserName) to global group xxx
        -dlg xxx deletes user (-u UserName) from local group xxx
        -dgg xxx deletes user (-u UserName) from global group xxx
   SetProperties Functions
        -c xxx sets Comment to xxx
        -f xxx sets Full Name to xxx
        -U xxx sets UserProfile to xxx
        -n xxx sets LogonScript to xxx
        -h xxx sets HomeDir to xxx

        -H x   sets HomeDirDrive to x

        +s xxxx sets property xxxx
        -s xxxx resets property xxxx
        where xxxx can be any of the following properties:
returns 0 on success
<End Quote>

with a "cmd" prompt under "Domain Admin Creds" you can then use a "for 
loop" to call "cusrmgr" to change the Administrator password on each 
machine. You can also check to see if the machine acknowledged the change 
via checking the "error level." The other thing that you need to go is go 
purchased the book on Windows Script Host. It provides tons of examples for 
what you may need to do. If you run DHCP for all the hosts it can be used 
to populate the machine names or Wins (because you have not killed NetBIOS 
over TCP/IP)

IF you see my previous post on the topic I gave several examples that can 
be modified to fit the need. IF you have the "tool" I could write the 
script. The only question would be, what did you learn?

cusrmgr -u administrator [-m \\computer] -P NewPassword \\ works

cusrmgr -u administrator [-m \\%i] -P MynewPassword \\ with the proper for 
loop running it

References: I did a quick search at Technet: "scripts" yes some lines may 
wrap.. cut and paste time


Several results that I was actually looking for under Technical Resources:

TechNet Script Center

Tales from the Script: Columns by the Microsoft TechNet Scripting Guys

How Scripts Extension Works - Management Services: %PRODUCT%

More Technical Resources results

Microsoft Windows 2000 Scripting Guide

Microsoft Windows 2000 Scripting Guide - Running WSH Scripts

TechNet Scripts: Sample Scripts

Microsoft Press
Microsoft® Windows® Scripting Self-Paced Learning Guide



At 01:31 PM 4/14/2004 -0400, you wrote:
>             I was trying to reply to the email at:
><http://www.dshield.org/pipermail/list/2004-March/030779.php>  however I
>wasn't able to. I am looking to do the same thing that Danny is trying to
>do. I need code that will change local passwords of users on a network. My
>goal is to be able to build a program that will survey our network for
>computers (that piece I have already built), test the Admin account on each
>computer trying to see if I can log in with a standard password. If I can
>log into the box, I need to be able to change the password to a stronger
>             Do you have source code that can do this or can you point me in
>some direction? I am currently building my application in c#.
>Peter Yungel
>Eclipsys Corporation
>NOTICE: This email contains confidential or proprietary information which
>may be legally privileged. It is intended only for the named recipient(s).
>If an addressing or transmission error has misdirected the email, please
>notify the author by replying to this message. If you are not the named
>recipient, you are not authorized to use, disclose, distribute, copy, print
>or rely on this email, and should immediately delete it from your computer
>list mailing list
>list at lists.dshield.org
>To change your subscription options (or unsubscribe), see: 

More information about the list mailing list