Solved

Need users to run HTA as admin

Posted on 2011-03-04
6
1,538 Views
Last Modified: 2012-05-11
Hi again!

I need to run HTA vbscripts as an domain administrator, so i can give tools to my coworkers and let them reset passwords etc. by the HTA. Need it plain and simple, best would be in the HTA.  
0
Comment
Question by:RowaldLaterveer
  • 3
  • 2
6 Comments
 
LVL 11

Expert Comment

by:Tasmant
ID: 35037271
The simplest way should to delegate them the right to reset passwords (and other stuff you want they do) with their user account instead to write the domain administrator within the hta.
And as soon as they have the delegation, they could run the hta with their account to do the stuff, that will work.
0
 

Author Comment

by:RowaldLaterveer
ID: 35037441
Tasmant, i have created another user who has ad rights, i want to run the HTA with priviliges within the HTA (don't know how to encode... so yes, plain text, or create an exe). I know there is a "impersonate" function but that's it..
0
 

Author Comment

by:RowaldLaterveer
ID: 35057656
Ok, the price just went up..
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 65

Expert Comment

by:RobSampson
ID: 35062046
Hi, you can encode the VBScript portion of HTA files, but that may still not function the way you need it to:
http://blogs.technet.com/b/heyscriptingguy/archive/2006/03/09/how-can-i-encode-scripts-within-an-hta.aspx

For AD operations, you can use the OpenDSObject method to provide alternate credentials during LDAP binds.

Some way or another though, you're wanting to provide your domain admin rights to someone else....it sound like a very secure idea.

Maybe what you could do is create a VBS that uses PSExec to run the HTA, and runs:

Set objShell = CreateObject("WScript.Shell")
objShell.Run "\\server\share\psexec.exe -accepteula -i -u domain\admin -p password mshta.exe \\server\share\myhta.hta", 1, False

And then, convert that VBS to an EXE with VBS2EXE:
www.f2ko.de

Regards,

Rob.
0
 

Author Comment

by:RowaldLaterveer
ID: 35067892
Rob, i have tied the above, only the exe can't run an HTA, just the vbscript part. The code i am using is the code you helpded compiling to change passwords (HTA). PSEXEC maybe is an option, but i like to code it into the script.

The encode option won't work;
C:\script\encode>screnc /f /e htm wachtwoord.hta

Scripting encoder object ("Scripting.Encoder") failed on C:\script\encode\wachtwoord.hta

Is there no impersonation script? Or maybe a bat file to create with admin rights, wich can start the HTA?
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 35073344
If the VBScript didn't work, then this command in a batch file:
\\server\share\psexec.exe -accepteula -i -u domain\admin -p password mshta.exe \\server\share\myhta.hta

as long as the batch is run as admin, should work too.

Regards,

Rob.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Welcome to part one of a multi-part tutorial series, VBScript for Windows System Administrators.  The goal of this series is to teach non-programmers how to write useful VBS code to automate their environment, and perform tasks faster, and in a more…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now