-1

Is it possible to take the screen capture of the desktop of a remote machine using C++? We were able to take the screen capture of the current machine using window APIs and save to local as bitmap. If the knew the IP address of a remote machine, is this possible ?

[Edit]

Actually ours is a server-client model where the C++ back-end code will be running in the server. The clients will be accessing the server through REST calls and viewing the data. We had a requirement to take the capture of the client screen and save as image. We are facing some technical issues while saving the html content as image. Hence we thought of any other methods to capture the screen. Since C++ has the API to capture the current screen, we thought whether there is any way to capture the client screen from Server side.

Kiran Joshy
  • 105
  • 10
  • 1
    This requires executing code on the remote machine and thus an appropriately secured method. If it was possible out of the box without authentication it would be a huge security problem. – dhke Dec 12 '15 at 06:43
  • 1
    Assuming you're not looking for some kind of exploit, the remote machine would need to be running some kind of service to facilitate that. How to achieve it is probably too broad for SO though. – Galik Dec 12 '15 at 06:46
  • You'll need to either be in a CSI-style TV show or be part of certain intelligence organisations to do that. – molbdnilo Dec 12 '15 at 07:31
  • @molbdnilo: CSI and such cheat, they set it up so that they have software at either end to do this (or simply take relevant screen shots). – Mats Petersson Dec 12 '15 at 07:36
  • If you have the appropriate credentials, and the remote machine is set up to allow file sharing, you can use `psexec` (or write your own code to do the same thing). – Harry Johnston Dec 12 '15 at 09:12
  • Not all remote machines have screens. Most Linux servers (e.g. the majority of web servers) don't. – Basile Starynkevitch Dec 12 '15 at 14:20

1 Answers1

3

Yes, if you install and run software to do this on the remote machine, such that it accepts network packets and send back a copy of the screen content.

No, if you just want to randomly pick a machine without installing software on it [modulo exploitable security bugs in the OS and you also know how to (ab)use them - and even if I knew of such security holes, which I don't, I would certainly not write it as an answer here].

Mats Petersson
  • 126,704
  • 14
  • 140
  • 227