sta*_*mer 0 command-line networking telnet https
我 4 年前通过网络课程大学,我有一个可能是业余的问题,请帮助我..我在 vmware 上有 ubuntu。我使用以下命令:
telnet google.com 80
Run Code Online (Sandbox Code Playgroud)
它回应:
正在尝试 74.125.195.139... 已连接到 google.com。转义字符是“^]”。
然后我输入ls命令:它返回!
HTTP/1.0 400 Bad Request
Content-Type: text/html; charset=UTF-8
Content-Length: 1555
Date: Wed, 27 Jan 2016 12:53:29 GMT
Server: GFE/2.0
<!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 400 (Bad Request)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>400.</b> <ins>That’s an error.</ins>
<p>Your client has issued a malformed or illegal request. <ins>That’s all we know.</ins>
Connection closed by foreign host.
Run Code Online (Sandbox Code Playgroud)
谢谢您的回复。
如果您连接到 Web 服务器,这是一个完全合理的响应。
除其他外,Telnet 只是两台计算机之间的纯文本对话。这是超级基本的。因此,如果您在端口 80 上连接到 Google,您将直接与网络服务器对话,这与浏览器的方式类似。
您看到错误,因为ls不是有效的 HTTP 请求。GET /有效且有效。
任何其他明文协议也是如此。如果你想要一个通过 telnet 的 shell 服务器,你需要连接到一个。它们仍然存在,但这些天你真的很少使用 SSH。它几乎在所有可衡量的方式上都更好。
为什么 Telnet 曾经存在?用作远程终端...但您说得好像 Telnet 上个月才出现一样。今年 47 岁。许多曾经有用的东西已经被现代的等价物所取代。
| 归档时间: |
|
| 查看次数: |
916 次 |
| 最近记录: |