How to read registry keys from a remote computer?

S

Sin Jeong-hun

I need to read some registry keys of a remote computer. The key will
be any key users provide. (For example : HKEY_CURRENT_USER\SOFTWARE
\MyGame) I found that there was a handy method called
RegistryKey.OpenRemoteBaseKey(); I tried

But everytime I execute it, an UnauthorizedAccessException occurred at
the OpenRemoteBaseKey method. Both computer (the one that ran the C#
application, and the remote computer) are Windows XP Professional, and
"Remote Registry Service" enabled. Both computer are logged on as an
adminstrator with no password. And both belong to the same workgroup.

Could you please tell me what is wrong? I've searched the MSDN
documentation and the newsgroup but I couldn't find a solution. Must
be some security setting problem but I have no clue. Do I need some
login procedure first? But the sample on the MSDN had no such thing.

All I want to do is to read (only read, no writing) keys from a remote
computer.

Thanks.
 
S

Stefan Hoffmann

hi Sin,
Both computer are logged on as an
adminstrator with no password. And both belong to the same workgroup.
The default security policies prohibit remote access using accounts
without passwords.


mfG
--> stefan <--
 
S

Sin Jeong-hun

hi Sin,


The default security policies prohibit remote access using accounts
without passwords.

mfG
--> stefan <--

Thank you. Right now, I can't test it but I'll test it tommorow. Does
this mean that I could read any Key on the remote registry, if the
remote PC is logged on as an adminstrator with a password? I've
examined the security policy manager on the remote PC, and found that
there was an entry that specifies the keys that could be remotedly
accessed. They all started with System\ or Software\, and I don't know
the syntax of them (there was no help file). How should I change it to
allow every keys be remotely accessed? Maybe *?

I just wonder why there's no login procedure to read remote registry.
Isn't this a security threat? Anyone on the network can read and write
the remote PC's registry...

Thanks again.
 
S

Stefan Hoffmann

hi Sin,
Thank you. Right now, I can't test it but I'll test it tommorow. Does
this mean that I could read any Key on the remote registry, if the
remote PC is logged on as an adminstrator with a password?
No. It means, that the used credential for accessing the remote PC must
have a password. There must not be anybody logged on to the machine.
examined the security policy manager on the remote PC, and found that
there was an entry that specifies the keys that could be remotedly
accessed. They all started with System\ or Software\, and I don't know
the syntax of them (there was no help file). How should I change it to
allow every keys be remotely accessed? Maybe *?
This an additional setting which may result in an error. But as i said,
i think you are failing due to the default password rules.
I just wonder why there's no login procedure to read remote registry.
Isn't this a security threat? Anyone on the network can read and write
the remote PC's registry...
If you drop your trousers, maybe :) In an security hardened environment
this is not possible.


mfG
--> stefan <--
 
S

Sin Jeong-hun

hi Sin,


No. It means, that the used credential for accessing the remote PC must
have a password. There must not be anybody logged on to the machine.
The userd credential for accessing the remote PC? Could you tell me
more about
this? The MSDN sample code for OpenRemoteBasekey doesn't have any
login
precedure. There is no credential used. Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top