发送到 telnet 服务器的消息示例

发布于 2024-08-01 15:55:19 字数 626 浏览 5 评论 0原文

我们的 ofc 中有一个 unix 盒子。 我们通常远程登录到这个盒子并在上面启动命令。 我们通常使用 telnet.exe 在 Windows 客户端的命令提示符下执行此操作。 我们只需提供 Unix 盒子的 IP,它就会加载一个屏幕,我们在其中提供登录凭据。 登录提示之前有一条默认消息,其中包含一些专有消息。

我尝试使用 TcpClient 类来做同样的事情。 我借用了 代码< /a> 直接来自 msdn。 我没有为消息参数传递任何值(其 string.Empty)。 然而,我没有得到与我得到的相同的回应; 我期待专有消息文本,但我得到的是 $$? ? 不知道那是什么。

这让我得出结论,telnet.exe(命令提示符工具)会进行一些初始通信以获取专有消息。 我想知道它是什么并通过 tcpclient 类模拟类似的东西。 我应该怎么办?

关于消息:当我们在这种情况下说“消息”时,我们指的是人类可读的消息还是 RFC854(telnet 协议规范)中提到的消息?

We have a unix box in our ofc. We usually telnet to this box and initiate commands on it. We usually do this from windows clients from the command prompt using the telnet.exe. We simply provide the ip of the unix box and it loads up a screen where we provide the login credentials. There is a default message before the login prompt saying some proprietary message.

I've tried using the TcpClient class to do the same thing. I've borrowed the code from msdn directly. I don't pass any value for the message parameter (its string.Empty). However I do not get the same response I get; I expected the proprietary message text, but instead I got $$? ? Don't know what that is.

This leads me to conclude that telnet.exe (the command prompt tool) does some initial communication to get the proprietary message. I want to know what it is and simulate something similar through the tcpclient class. What should I do?

And regarding messages: when we say "messages" in this context do we mean human readable messages or the messages mentioned in the RFC854 (the telnet protocol specification)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

天荒地未老 2024-08-08 15:55:19

您可以在常规会话期间嗅探流量(例如使用Wireshark)以查看实际情况。

You could sniff the traffic during a regular session (e.g. with Wireshark) to see what's actually going on.

梦里°也失望 2024-08-08 15:55:19

找到了一个可以使用的开源 dotnet telnet 库。 我猜它比我更好地实现了 telnet 协议...我只能理解部分代码。 还在努力学习呢。 有一些假设(或原始开发人员的经验法则)我无法遵循。 这是一个托管在 sourceforge 上的项目。 由一个名为Seva Petrov的人开发。

dotnettelnet 库 https://sourceforge.net/projects/dotnettelnet/

Found an opensource dotnet telnet library to work on. I guess it implements the telnet protocol better than I do...I could only understand only part of the code. Still trying to learn it. There are some assumptions (or rules of the thumb tht its orig dev had) I cannot follow. It is a project hosted on sourceforge. Developed by some1 named Seva Petrov.

dotnettelnet library https://sourceforge.net/projects/dotnettelnet/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文