Solved

DCOM security

Posted on 2000-03-06
2
302 Views
Last Modified: 2008-02-20
Everyone known,When dcom client connect to dcom server ,How to known dcom client's machine name in the dcom server?
0
Comment
Question by:shala
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 2591401
This can be done by using a channel hook. Don Box explained this technique some time earlier in MSJ.

See

http://www.develop.com/dbox/com/hooks/hosthook/

for the code & explanations

Quote from the page:

"HostHook - A Custom Channel Hook for Recovering Host Name of Caller/Callee

HostHook is a custom channel hook that sends the IP address, process and thread ID of the direct and original caller as an ORPC_EXTENT. This hook is useful for finding out the location of a caller inside a COM method invocation. It is also useful for finding out where a given method executed after the proxy returns control to the client thread. "
0
 
LVL 86

Expert Comment

by:jkr
ID: 2591415
>>How to known dcom client's machine name in the dcom
>>server?

If you've got the IP on the server side, simply use

    WSADATA wsaData;
   
    if (::WSAStartup(MAKEWORD(1, 1), &wsaData) == 0)
    {
        char szHostName[256];

              HOSTENT* phe;

              phe = gethostbyaddr ( ...);

              if ( phe)
                 {
                   printf ( "%s\n", phe->h_name);
                 }
 

        ::WSACleanup();
    }
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

622 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