I need to write a basic RDP client in C/C++, doesn't need GUI it can be CLI, it only needs to connect to specified hosts - if connection is successfull, to confirm it and if it isn't to output an error message like the pass is not correct.
Can someone point me to somewhere so i can read more about this ? Thanks.
Look at the source for rdesktop - A Remote Desktop Protocol Client for accessing Windows Terminal Services.
For a quick feel, view the source for tcp.c: Protocol services - TCP layer.
You're probably looking for the Windows Terminal Services API or also known as the Remote Desktop Services API.
Related
I'm able to access a telnet server via PuTTY which opens a terminal and allows me to send commands to retrieve data/logs and start/stop processes. I'd like to begin some research into how to access this server via C++ in order to automate the connection and the commands for testing. Basically I need a telnet client that can connect and authenticate itself, and write and read to/from the server as if I'm typing in a terminal. Where should I start my research? I've tried a couple examples including:
http://lists.boost.org/boost-users/att-40895/telnet.cpp
When I compile and run
./telnet 192.168.1.26 23
Nothing happens, but when I connect to the server with PuTTY I get:
QNX Neutrino (localhost) (ttyp0)
login: root
password:
#
Any help would be greatly appreciated.
Notes:
- I am using a Mac running OS X Version 10.7.3 with i686-apple-darwin11-llvm-gcc-4.2
- I am allowed to be doing this.
- I use PuTTY on my Windows 7 machine, the connection is ethernet to USB ethernet adapter, and the settings for the Local Area Connection Properties > TCP/IPv4 Properties: are a specific IP address, Subnet Mask, and Default gateway, which might be useful information.
Thanks
Learn how to program TCP/IP sockets. You can use the boost libraries, or straight C style BSD sockets. Some info here, here and here. If paper is your thing, you could get Volume 1 of Unix Network Programming. That book has such a good reputation that you get votes just for mentioning it on StackOverflow.
What you want to do closely matches the functionality of telnet and expect. You can have a look at there sources here and here for ideas.
Consider just using expect to solve your problem :)
You should start by learning the network API for the system you're trying to connect from. Telnet is just sending straight up text through a tcp/ip socket.
I have written a windows service and I want to communicate(IPC) it with a win32 application(Desktop), can anyone tell me what should I exactly do for making this communication. In my case my Service is server and other process is client. Process should establish connection with the service whenever a user launches it on his machine.
I have written services which support named pipes like you describe. I do not have to do anything special to set permissions for the client to open & read/write the named pipe. I found the following Microsoft articles useful when developing my code:
"The Complete Service Sample":
http://msdn2.microsoft.com/en-us/library/bb540476(VS.85).aspx
"Named Pipe Server Using Completion Routines" :
http://msdn.microsoft.com/en-us/library/aa365601(VS.85).aspx
Following is a list of options for inter-process communication on Windows:
1. Component Object Model (COM)
2. Remote Procedure Call (RPC)
3. Windows Sockets
You can set service type as Automatic, mean it will start once the machine up& running
Please refer.
https://www.codeguru.com/cpp/w-p/system/sharedmemory/article.php/c2879/Shared-Memory-Inter-Process-Communication-IPC.htm
I'm trying to implement an auto-connect feature for my Android application DroidPad, which is basically a TCP server running on an Android phone which the PC application connects to.
To make the process easier for the user, is there any way in (portable?) C++ to scan the IP addresses on the local subnet, possibly ones with a certain open port? I've tried using UDP broadcasting, but couldn't get it to work. I'm currently using the wxWidgets toolkit for GUI and libraries.
Any ideas?
I found a solution: wxServDisc. It uses mDNS (aka Zeroconf / Bonjour) to discover devices on a subnet, and is also based on wxWidgets.
My application runs in Windows and is implemented using C++/Qt.
The application will invoke another application deployed in the Linux server which in turn will invoke some third party tools. The Linux server application will send some status updates based on the running of third party tools. Usually the third party application will run for hours and the updates will be sent at various stages. The Linux server may also has to send some files in addition to the status updates and the Windows client will also send some files required for the running of those third party tools.
I planned to implement this in libssh2 since file transfers can be done and applications can be executed as well using libssh2_channel_exec(). Updates can be sent and received through non-blocking socket transfers. Also the transfers must be secured and they are password authenticated, so I thought SSH will conform my requirements.
I also looked into Qpid of apache which implements the AMQP. The messaging seems to be a more appropriate one for my status updates since the updates are less frequent. But I am not so sure about the secured connection, password authentication and also the application invocation.
So, which one can I choose between these two? Or is there any other better option available? I am not quite used to network programming so any pointers, links regarding this are welcome..
Have you considered some web-based solutions like XML-RPC, REST, SOAP or other? Note that you can either have constant network connection and stream updates or just make your client ask for update as often as it needs.
Also, I think that building solution based on some of these protocols will give you easier coding - no need for some low-level solutions when you have great libraries. As for security part, I would consider SSL that is part of HTTPS protocol to be secure enough. Of course you can also do it hybrid style, for example SSH tunel to secure server and use SSH key authorization.
But if you are sure youwant SSH or AMQP then use first one - I think it has better security. Also, try not using username/passowrd. Instead use mentioned above keys.
Start with SSH, and then consider layering other protocols on top. You can use SSH port forwarding to create a VPN connection to a server, and maybe that will make it easier to use something like AMQP or 0MQ.
On linux platform, I want to have dhcp client.
port any open source client to my app (which seems to be a bit time consuming)?
or communicate with the standalone client app via Signals?
or anyone knows any dhcp client library?
thanks for any advice.
You mean you want your app to tell the computer to DHCP? I would talk to dhcpcd using command line arguments and not do tons of extra work.