Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. Don't fear the penguins!
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    arborlon.gingle.net
    Posts
    147
    Rep Power
    12

    Remote Execution of Functions


    Using COM (or whatever), is it possible to execute a function on a remote machine (assuming you have admin rights on it) and get the return? For example, I use the function MessageBox() and the resulting message pops up on their screen? Does anyone have an example of how to do this or can point out a function, or some other hint? Thanks.
    Every morning, I get up and look through the Forbes list of the richest people in America. If I'm not there, I go to work.

    May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.

    To the systems programmer, users and applications serve only to provide a test load.
  2. #2
  3. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    Google for DCOM and C++.
  4. #3
  5. Don't fear the penguins!
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    arborlon.gingle.net
    Posts
    147
    Rep Power
    12
    Believe me, I've tried google. I can't find anything to allow me to do this. Specifically, I need to use it to log someone off remotely. I got it to work using WMI, but I also need to support NT4 boxes that dont have WMI.... Any pointers please?
    Every morning, I get up and look through the Forbes list of the richest people in America. If I'm not there, I go to work.

    May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.

    To the systems programmer, users and applications serve only to provide a test load.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    88
    Rep Power
    11
    Sockets? Make the recieving end hidden in the background of the computer, and in the startup, an then using the private IP (192 address), you can send them a message that'll trigger a function that is implemented on the recieving end.

    Hope this helps!

    Regards,
    Someonewhois

    P.S. I can explain more if you need. :)
  8. #5
  9. Don't fear the penguins!
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    arborlon.gingle.net
    Posts
    147
    Rep Power
    12
    Originally posted by someonewhois
    P.S. I can explain more if you need. :)
    Yes, that would be greatly appreciated. (I've never done this sort of thing before, and it went right over my head :))
    Every morning, I get up and look through the Forbes list of the richest people in America. If I'm not there, I go to work.

    May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.

    To the systems programmer, users and applications serve only to provide a test load.
  10. #6
  11. not a fan of fascism (n00b)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Feb 2003
    Location
    ct
    Posts
    2,756
    Rep Power
    95
    if all you need to do is shutdown, then you could do this on the computer that needs to be shutdown:

    Code:
    //normal code to establish a tcp connection
    recv() //check for errors
    if( strcmp(recv_buffer, "secret code") == 0)
              system("shutdown -l -t 30");
    -l means logoff
    -t 30 is a 30 second timeout
  12. #7
  13. Don't fear the penguins!
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    arborlon.gingle.net
    Posts
    147
    Rep Power
    12
    I need to be able to log them off, not shutdown. I could do it through a program on their computer, but I'd prefer to execute the function on their mahcine myself (besides, knowing how to do this will come in use later :)). I don't want to have to rely on a specific program being on their computer. Thanks for the help anyways!
    Every morning, I get up and look through the Forbes list of the richest people in America. If I'm not there, I go to work.

    May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.

    To the systems programmer, users and applications serve only to provide a test load.
  14. #8
  15. not a fan of fascism (n00b)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Feb 2003
    Location
    ct
    Posts
    2,756
    Rep Power
    95
    u didnt read my post close enuf, the command i gave logs the user off in 30 seconds. So, if i understand you correctly, you want to be able to execute functions on their computer without ever installing a program on it?
  16. #9
  17. Don't fear the penguins!
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    arborlon.gingle.net
    Posts
    147
    Rep Power
    12
    Sorry bout that. I do need to execute functions from my program on their computer, though I don't want to rely on 'shutdown.exe' (which I thought was in the resource kit, but maybe its a built in command...). What I'd like is for everything to be done inside my app. I'm not exactly sure what your trying to do with the code you gave me. Is it somthing like wait for a "secret word" to be sent to it and when it is, log off the user? That would require putting somthing on the other box, wouldn't it?

    But now that I think about it, I thought I saw somthing about running commands like shutdown.exe remotely in my searches on google...
    Every morning, I get up and look through the Forbes list of the richest people in America. If I'm not there, I go to work.

    May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.

    To the systems programmer, users and applications serve only to provide a test load.
  18. #10
  19. not a fan of fascism (n00b)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Feb 2003
    Location
    ct
    Posts
    2,756
    Rep Power
    95
    well i guess this all depends on the amount of work you want to do. As Onslaught said, the DCOM interface is prolly what you really want; but if you want a quick easy solution you can use what i said. Also, the shutdown command is standard windows installation, its the same command the Shutdown/Restart button uses.
    Yes, what i said would require putting something on their box. Alternatively, if you have an Admin password you could write an Expect script(or do it in C with a little more work) that would login via telnet, give the shutdown command and logout. Not sure if telnet is an option tho. the bottom line (as you prolly know) is you need something to be listening for your commands, whether its DCOM, your own socket program, or telnet, etc.. good luck :)
  20. #11
  21. Don't fear the penguins!
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    arborlon.gingle.net
    Posts
    147
    Rep Power
    12
    Putting somthing on their boxes isn't an option, and we dont really use telnet, so I guess I'm going to go with DCOM. Thanks for all the help!
    Every morning, I get up and look through the Forbes list of the richest people in America. If I'm not there, I go to work.

    May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.

    To the systems programmer, users and applications serve only to provide a test load.
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    88
    Rep Power
    11
    Hi, I see the problem if you don't want to put it on their boxes. ;)

    Sorry I couldn't help.

    Regards,
    Someonewhois
  24. #13
  25. Don't fear the penguins!
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    arborlon.gingle.net
    Posts
    147
    Rep Power
    12
    Notta problem :) Thanks for trying anyway!
    Every morning, I get up and look through the Forbes list of the richest people in America. If I'm not there, I go to work.

    May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.

    To the systems programmer, users and applications serve only to provide a test load.
  26. #14
  27. not a fan of fascism (n00b)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Feb 2003
    Location
    ct
    Posts
    2,756
    Rep Power
    95
    jair if this isnt something that's proprietary would you mind sharing your results with us? i'd like to see how this DCOM actually works with some real code.
  28. #15
  29. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    88
    Rep Power
    11
    Agreed, if possible. :)
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo