Netcat 问题重新连接

Netcat questions re connectivity

如果有人能解释我遇到的一些基本的 netcat 问题,我会很高兴。对于上下文,我试图将其用作查看端口是否打开/关闭的方法。

  1. 为什么netcat能成功连接到一个被过滤的端口?现在有几个客户发生了这种情况,他们重申端口已被过滤。连接时没有请求通过;这是由于 WAF 造成的吗?还有其他可能的原因吗?

  2. 当连接到某些 ssh 端口时,我得到以下示例输出:

nc -v 192.168.0.1 22

Connection to 192.168.0.1 port 22 [tcp/ssh] succeeded! SSH-2.0-ATLAS/123-reg FTP Server ? w=????U:bE-j?Wecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group18-sha512,diffie-hellman-group16-sha512,diffie-hellman-group14-sha256,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,rsa1024-sha1ssh-rsa-aes256-ctr,aes192-ctr,aes128-ctr,blowfish-ctr-aes256-ctr,aes192-ctr,aes128-ctr,blowfish-ctrhmac-sha1,hmac-ripemd160hmac-sha1,hmac-ripemd160nonenoneꯘ}{?}L%

我知道这些是密码,但它到底要求什么,是要求 SSH 密钥还是密码?

Why is netcat successfully connecting to a filtered port?

没有。 netcat 不能做任何魔术。端口根本没有正确过滤。

When connecting to some ssh ports I'm getting the following sample output: .... is it asking for an SSH Key or a password?

在这个阶段它只显示密钥交换支持哪些密码。除此之外,服务器不会询问任何内容,它只会显示支持哪些身份验证方法。客户端从列表中尝试合适的。