Java套接字远程桌面连接 [英] Java socket remote desktop connection

查看:215
本文介绍了Java套接字远程桌面连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨所以我试图连接到远程桌面,但我似乎无法得到任何数据包是否有办法获取任何数据包并打印它无论它包含什么字符和数字或无论它是什么大小,

Hi so am trying to connect to a remote desktop but i can't seem to get any packet is there a way to get any packet and print it no matter what characters and numbers it contains or no matter what size it is,

任何帮助都非常棒,谢谢。

Any help is wonderful thank you.

这是我测试过的代码:

public static void main(String[] args) {
    InetSocketAddress rdpSocket = new InetSocketAddress("127.0.0.1", 3389);
    Socket rdp_Con = new Socket();
    try {
        rdp_Con.connect(rdpSocket);
        if (rdp_Con.isConnected()) {
            System.out.println("Connected To Remote Desktop Checking Packets...");
            int red;
            byte[] buffer = new byte[4096];
            byte[] redData;
            while ((red = rdp_Con.getInputStream().read(buffer)) > -1) {
                redData = new byte[red];
                System.arraycopy(buffer, 0, redData, 0, red);
                System.out.println(Arrays.toString(redData));
            }
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
}


推荐答案

忘了它。 RDP协议已加密,并以客户端身份验证启动。在您成功协商握手之前,RDP服务器永远不会向您发送任何内容,当它成功进行协商时,它将被加密。

Forget it. The RDP protocol is encrypted and starts with a client authentication. The RDP server will never send you anything until you successfully negotiate a handshake, and when it does it will be encrypted.

尝试其他协议。

这篇关于Java套接字远程桌面连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆