Page 1 of 1 1
Topic Options
#114837 - 2004-02-26 04:01 AM authentication question
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Wondering the best way to have a script (interactive/GUI) authenticate to a remote system...

Here's the deal:
I log into my workstation a Clark.Kent, mild mannered user. I need to examine a remote system - say - get a reg value. I have a "super.man" admin account either in the domain or on the target system. The script attempts to read the remote data, and - getting an Error 5 - prompts me for my admin credentials before trying again.

Now, what is the best way to pass those credentials to the target system? My first thought is to map a drive temporarily, but - what if the target does not have any shares (even has admin shares C$ disabled) or does not have file/print sharing enabled? Is there a "universal" authentication mechanism that I can use from within Kix?

Gonna search MS and other sites for this, but I figured someone has already done it from Kix.

Thanks!

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#114838 - 2004-02-26 04:16 AM Re: authentication question
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You can do a simple

USE E: "\\SERVER\c$" /user:Superman /password:LoisLane

do your thing then disconnect
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#114839 - 2004-02-26 04:20 AM Re: authentication question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Yep, you shouldn't look further than the UDF Forum. See for example fnWMIAuthentication() - Authenticates against a local or remote WMI provider . However, this would require WMI on the local and remote systems. You could also map to the IPC$ share to authentiate.
_________________________
There are two types of vessels, submarines and targets.

Top
#114840 - 2004-02-26 04:21 AM Re: authentication question
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Howard - are you operating in Jimmy Olsen mode tonight??

As I said, mapping a drive was my first thought (right after removing my face-altering, X-Ray blocking eyeglasses), but I have some situations where no disk or printer shares exist - I'm looking for an alternative to mapping a drive. Preferrably, it would be a method that worked across all WinTel platforms, but an NT+ solutino is acceptable. An external Command Line tool would be OK as well.

Thanks!

Glenn

PS - did you ever wonder why Clark had to tip his glasses up or down to let his X-Ray vision work? Hmmmm...
_________________________
Actually I am a Rocket Scientist! \:D

Top
#114841 - 2004-02-26 05:03 AM Re: authentication question
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
I haven't seen a non-NT+ system in a while - will the IPC$ work there? Is it available even if file sharing (or the Workstation service) is disabled?

WMI is not a real option (yet) unless I limit the script to 2K+ systems.

Thanks, Jens..

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#114842 - 2004-02-26 05:07 AM Re: authentication question
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I originally was going to suggest using SHELL 'net use \\computer\ipc$ /u:superman' but thought someone might ding me on the SHELL.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#114843 - 2004-02-26 05:20 AM Re: authentication question
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
See - you should always go with your first instinct!

Thanks - I'll try the IPC deal tomorrow.. May actually need to build a Win98 client here for testing. (Ugh!)

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#114844 - 2004-02-26 06:15 AM Re: authentication question
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Don't have all the statistics but there are items that won't like just the IPC$ connection, but depending on what you want to do it might work for some items.

Top
#114845 - 2004-02-26 07:35 AM Re: authentication question
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
when talking about remote registry, IPC is fine.
it's the de-facto NT-authentication place.

what comes to win9x, you ask does it work if you have no services running and etc.
no.
you probably need filesharing and remote administration stuff.
not 100% sure win9x creates ipc$-share but if you don't have remote reg access anyway (due to lack of installed services) you wont need it either
_________________________
!

download KiXnet

Top
#114846 - 2004-02-26 10:14 AM Re: authentication question
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
True. Windows95 is a real problem.

I find on machines with remote admin enabled and the admin list populated I still frequently have problems connecting to the registry

Top
#114847 - 2004-02-26 10:36 AM Re: authentication question
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Okay, IPC it is.

Microsoft Knowledge Base Article - 241808
Problem Attempting Remote Administration with Local Users and Groups Snap-in
http://support.microsoft.com/?ID=241808

Microsoft Knowledge Base Article - 95900
INFO: Interprocess Communication on Windows Platforms
http://support.microsoft.com/?ID=95900

Microsoft Knowledge Base Article - 314984
HOW TO: Create and Delete Hidden or Administrative Shares on Client Computers
http://support.microsoft.com/?ID=314984

NOTE: To avoid a security problem, you may need to delete the IPC$ connection once you are done administering.

Microsoft Knowledge Base Article - 816113
HOW TO: Use Registry Editor to Restore Administrative Shares in Windows Server 2003
http://support.microsoft.com/?ID=816113

Top
#114848 - 2004-02-26 01:17 PM Re: authentication question
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
eh?
not sure if any of these are really related to the issue itself but titles say they are ok readings...
_________________________
!

download KiXnet

Top
#114849 - 2004-02-26 07:47 PM Re: authentication question
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
It has to do with confirmation that IPC$ is the preferred method of establishing a remote connection for authentication.

Some are KB to show example and or further reading on the subject of remote connection which was question asked.

Top
#114850 - 2004-02-27 04:24 PM Re: authentication question
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Yeah - I got that!

New problem..

The IPC$ authentication works well - I can identify a remote registry read returns a 5 error (access denied) and open the IPC connection and authenticate. I can then read the disk and registry. However - WMI is another story - it still fails with Access Denied.

In my test network, I have a standalone server with no user accounts - just Administrator. Win2K3. If I run the tool against an identical server that is a domain member, I can read the WMI info. It fails against the standalone.

I am using the WMIQuery UDF v2.4. - modified slightly to support NoVarsInStrings.

Is there an alternative authentication that I must use for WMI?

Thanks,

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#114851 - 2004-02-27 04:51 PM Re: authentication question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You could use the build-in WMI authentication that I referenced above under fnWMIAuthentication().

Edited by sealeopard (2004-02-27 04:52 PM)
_________________________
There are two types of vessels, submarines and targets.

Top
#114852 - 2004-02-27 05:26 PM Re: authentication question
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
I see that, I'm just confused by the fact that the IPC auth isn't enough, and that I will need to do both. (Yes - Both, since the first part of the process is to work by registry and file-property reads on systems without WMI... I'll only call WMIquery when I detect it is installed.)

I'll try adding the WMI Auth code and see where that goes.

Thanks

Glenn\
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.087 seconds in which 0.039 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org