PC Review


Reply
Thread Tools Rate Thread

Accessing registory remotely

 
 
rajendersaini@gmail.com
Guest
Posts: n/a
 
      17th Feb 2007
Hi

I have problem in accessing registory remoteley form one vista machine
to othe vista machine .

Here is code sip of my application

//
dwResult = WNetAddConnection2(&NetRes,
pCredential->m_szPassword.data(),
pCredential->m_szUserName.data(),
0);

if(dwResult == ERROR_SUCCESS)
{
dwResult = RegConnectRegistry(szMachineIP, rootkey,
&m_hRemRegKey);

if(dwResult == ERROR_SUCCESS)
dwResult = RegOpenKeyEx (m_hRemRegKey, pszSubkey, 0L, regFlg,
&m_hkeySubkey);

goto HANDLE_ERROR;
Everything goes fine till RegOpenKeyEx which return error code access
denied
I am passing credentail of a user who has administrator right on
machine for which i am trying to
access the registory whicle making connection .

Can anybody tell me ahow to move further ?

Rajender saini

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmVzcGVy?=
Guest
Posts: n/a
 
      17th Feb 2007
I presume regFlg is KEY_ALL_ACCESS? Is the account you are connecting with a
local user or a domain user? If it is a local user then you get a filtered
token by default and your call will fail with ERROR_ACCESS_DENIED if you ask
for permissions that only administrators have.

By default only domain users who are members of the local administrators
group get a non-filtered token when connecting remotely. That means that you
cannot, by default, connect to a non-domain joined system as an administrator
using any of the SMB APIs.

There is a reg hack to change this, but it should only be used in situations
where you absolutely have to. This behavior blocks a number of interesting
attacks. Here is the key:
Hive: HKEY_LOCAL_MACHINE
Key: SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system
Value: LocalAccountTokenFilterPolicy
Type: REG_DWORD
Data: 0 (default) – Build filtered token
1 – Build elevated token


"(E-Mail Removed)" wrote:

> Hi
>
> I have problem in accessing registory remoteley form one vista machine
> to othe vista machine .
>
> Here is code sip of my application
>
> //
> dwResult = WNetAddConnection2(&NetRes,
> pCredential->m_szPassword.data(),
> pCredential->m_szUserName.data(),
> 0);
>
> if(dwResult == ERROR_SUCCESS)
> {
> dwResult = RegConnectRegistry(szMachineIP, rootkey,
> &m_hRemRegKey);
>
> if(dwResult == ERROR_SUCCESS)
> dwResult = RegOpenKeyEx (m_hRemRegKey, pszSubkey, 0L, regFlg,
> &m_hkeySubkey);
>
> goto HANDLE_ERROR;
> Everything goes fine till RegOpenKeyEx which return error code access
> denied
> I am passing credentail of a user who has administrator right on
> machine for which i am trying to
> access the registory whicle making connection .
>
> Can anybody tell me ahow to move further ?
>
> Rajender saini
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
accessing computer remotely Maurice Samueks Windows XP Work Remotely 5 31st May 2005 02:01 AM
Accessing c$ remotely? scootgirl.com Windows XP Configuration 3 18th Sep 2004 09:26 AM
regedit / registory editing Leon Windows XP Security 1 14th Sep 2004 04:12 AM
Accessing COM+ remotely by using C# MIB426 Microsoft C# .NET 0 28th Jan 2004 12:58 AM
accessing calendar remotely urbanpagan Microsoft Outlook Calendar 0 29th Oct 2003 09:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:10 PM.