![Centos를 사용하여 원격 포트에 연결할 수 있는지 확인하세요.](https://linux55.com/image/10328/Centos%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20%EC%9B%90%EA%B2%A9%20%ED%8F%AC%ED%8A%B8%EC%97%90%20%EC%97%B0%EA%B2%B0%ED%95%A0%20%EC%88%98%20%EC%9E%88%EB%8A%94%EC%A7%80%20%ED%99%95%EC%9D%B8%ED%95%98%EC%84%B8%EC%9A%94..png)
netcat
Dubian에서는 (일명 nc
, )를 사용하여 ncat
다음을 수행 할 수 있습니다.
michael@pi1:~ $ nc -zv 10.120.11.1 20 21 22 23 24
nc: connect to 10.120.11.1 port 20 (tcp) failed: Connection refused
Connection to 10.120.11.1 21 port [tcp/ftp] succeeded!
Connection to 10.120.11.1 22 port [tcp/ssh] succeeded!
Connection to 10.120.11.1 23 port [tcp/telnet] succeeded!
nc: connect to 10.120.11.1 port 24 (tcp) failed: Connection refused
michael@pi1:~ $
Dubian의 man nc는 다음과 같이 표시됩니다.
-z Specifies that nc should just scan for listening daemons, without sending any data to them. It is an error to use this option in conjunction with the -l option.
Centos7에서는 원래 nc가 없어서 sudo yum install nmap-ncat.x86_64
.
그러나 -z
이 플래그는 지원되지 않습니다.
[michael@box1 ~]$ nc -zv 10.255.255.1 22
nc: invalid option -- 'z'
Ncat: Try `--help' or man(1) ncat for more information, usage options and help. QUITTING.
[michael@box1 ~]$
답변1
예, 또한 nc가 -z를 지원하지 않는 것으로 나타났습니다. 왜 버렸는지 궁금합니다. 이전 버전의 ncat을 설치하거나 nmap을 사용할 수 있습니다.
지도
nmap -sT -p <port>