Solved

NT Admin access from a User context

Posted on 1998-11-13
8
158 Views
Last Modified: 2010-04-30
I am trying to create a VB prog which will read and write to the NT registry that the system or administrators only have access to.  The program must be launched from the basic User context security level.

If I was doing the task in a batch routine I would us the resource kit utility SU to switch from the user account to an admin just for that script/program.

Is there any alternative or API function call that I can use in VB to solve this issue ?
0
Comment
Question by:mdtt94
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 14

Expert Comment

by:waty
ID: 1444709
I know how to change the perimissions of files, but not how to take the context of other users.
0
 

Author Comment

by:mdtt94
ID: 1444710
Thanks but I need to access registry keys that the users are not permitted to use.
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1444711
It has do with impersination levels and stuff like that. It was hard to program in C++ so it will be even harder in VB.
BTW: Your solution needs the administrator password, am I right?
0
 

Expert Comment

by:jcstrider
ID: 1444712
What exactly are you trying to do? I've spent alot of time buried in the registry and could help with what you are trying to do. You could possibly do a service and have a regular user start that service (which runs under the admin account) and that service could access the registry. Give me some more info and I'll check into it.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:mdtt94
ID: 1444713
It's really a simple front end program that takes some users details and distrubutes the information to various keys in the registry (to set up mulitiple applications which use user information or profiles - Like Netscape, Office etc).  The program also needs to read and write parts of the registry that normal users don't have access to (Computer Name, Logon Name and maybe more).  This information only comes through if you have admin permissions on the workstation.
0
 

Expert Comment

by:jcstrider
ID: 1444714
The only way that I can think of is to write a service that runs under the admin account and have your app start it up and get the information from that. If all the keys you need are in the HKEY_LOCAL_MACHINE you can read that. Most info is kept there and all users should have access to them. I went the services route and found that is was very easy to code and get the info I needed. There is a guy who wrote an article on how to write services and I think he has something regarding the registry also. his http is http://www.flash.net/~ljjohnsn.

John Cantley
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 100 total points
ID: 1444715
It would be a security breach if what you want could be done. Therefor it cannot be done.
0
 

Author Comment

by:mdtt94
ID: 1444716
I have found out how to use the API calls to get the information on the computername and user rather than look them up in the registry from the secure keys.  Thanks for your help anyway.  It would indeed be a security problem if a user could access these keys.

Cheers,

Mark
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

746 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

12 Experts available now in Live!

Get 1:1 Help Now