어떻게 포트 가 통 하지 않 는 지 테스트 합 니까(네 가지 방법)
준비 환경
포트 를 제공 하 는 웹 서버 를 시작 합 니 다.
[wyq@localhost ~]$ python -m SimpleHTTPServer 8080
Serving HTTP on 0.0.0.0 port 8080 ...
다른 웹 서버 로 포트 를 제공 하 는 것 도 마찬가지 입 니 다.python 이 편리 하기 때문에 여기 서 사용 합 니 다.1.telnet 로 판단
telnet 는 windows 표준 서비스 로 직접 사용 할 수 있 습 니 다.Liux 기계 라면 telnet 을 설치 해 야 합 니 다.
용법:telnet ip port
1)존재 하지 않 는 포트 를 telnet 로 먼저 연결
[root@localhost ~]# telnet 10.0.250.3 80
Trying 10.0.250.3...
telnet: connect to address 10.0.250.3: Connection refused #
2)존재 하 는 포트 재 접속
[root@localhost ~]# telnet localhost 22
Trying ::1...
Connected to localhost. # Connected
Escape character is '^]'.
SSH-2.0-OpenSSH_5.3
a
Protocol mismatch.
Connection closed by foreign host.
2.ssh 로 판단ssh 는 Liux 의 표준 설정 이 고 가장 자주 사용 되 는 포트 를 판단 할 수 있 습 니까?
용법:ssh-v-p portusername@ip
-v 디 버 깅 모드(로 그 를 인쇄 합 니 다).
-p 지정 포트
username 마음대로
1)연결 포트 없 음
[root@localhost ~]# ssh 10.0.250.3 -p 80
ssh: connect to host 10.0.250.3 port 80: Connection refused
[root@localhost ~]# ssh 10.0.250.3 -p 80 -v
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 10.0.250.3 [10.0.250.3] port 80.
debug1: connect to address 10.0.250.3 port 80: Connection refused
ssh: connect to host 10.0.250.3 port 80: Connection refused
2)존재 하 는 포트 연결
[root@localhost ~]# ssh ... -p
a
^]
^C
[root@localhost ~]# ssh ... -p -v
OpenSSH_.p, OpenSSL ..e-fips Feb
debug: Reading configuration data /etc/ssh/ssh_config
debug: Applying options for *
debug: Connecting to ... [...] port .
debug: Connection established.
debug: permanently_set_uid: /
debug: identity file /root/.ssh/identity type -
debug: identity file /root/.ssh/identity-cert type -
debug: identity file /root/.ssh/id_rsa type -
debug: identity file /root/.ssh/id_rsa-cert type -
debug: identity file /root/.ssh/id_dsa type -
debug: identity file /root/.ssh/id_dsa-cert type -
a
^C
아니요.-브 이 옵션 도 돼 요.3.wget 으로 판단
wget 은 Liux 에서 다운로드 하 는 도구 입 니 다.먼저 설치 해 야 합 니 다.
용법:wget ip:port
1)존재 하지 않 는 포트 연결
[root@localhost ~]# wget ...:
---- ::-- http://.../
Connecting to ...:... failed: Connection refused.
2)존재 하 는 포트 연결
[root@localhost ~]# wget ...:
---- ::-- http://...:/
Connecting to ...:... connected.
HTTP request sent, awaiting response...
4.포트 스 캔 도구 사용
[root@localhost ~]# nmap ... -p
Starting Nmap . ( http://nmap.org ) at -- : CST
Nmap scan report for ...
Host is up (.s latency).
PORT STATE SERVICE
/tcp closed http
MAC Address: B:A::CF:FD:D (Unknown)
Nmap done: IP address ( host up) scanned in . seconds
[root@localhost ~]# nmap ... -p
Starting Nmap . ( http://nmap.org ) at -- : CST
Nmap scan report for ...
Host is up (.s latency).
PORT STATE SERVICE
/tcp open http-proxy
MAC Address: B:A::CF:FD:D (Unknown)
Nmap done: IP address ( host up) scanned in . seconds
[root@localhost ~]# nmap ...
Starting Nmap . ( http://nmap.org ) at -- : CST
Nmap scan report for ...
Host is up (.s latency).
Not shown: closed ports
PORT STATE SERVICE
/tcp open ssh
/tcp open rpcbind
/tcp open http-proxy
/tcp open unknown
MAC Address: B:A::CF:FD:D (Unknown)
Nmap done: IP address ( host up) scanned in . seconds
총결산포트 서 비 스 를 제공 하면 tcp 프로 토 콜 을 사 용 했 습 니 다.위 는 웹 서버 를 예 로 들 었 습 니 다.서버 가 더 간단 한 tcp 서버 라면 세 가지 도구 가 똑 같이 적 용 됩 니 다.
세 도구 의 공통점 은 다음 과 같다.1.tcp 프로 토 콜 을 바탕 으로 한다.2.지정 한 포트 에 접근 할 수 있 습 니 다.이 두 가 지 를 따라 많은 도 구 를 찾 을 수 있 습 니 다.
일반적으로 windows 에서 telnet 을 사용 하 는 것 이 비교적 편리 하 며,Liux 아래 에 서 는 개인 적 으로 wget 을 사용 하 는 것 을 비교적 좋아한다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
작은 재료 : 결함 혼입, 테스트 레벨, 공정 책임결함은 후공정에서 적출할수록 비용이 부풀기 때문에 조기에 적출하는 것이 이상적입니다. 그럼에도 불구하고 결함의 종류에 따라 조기에 발견되는 것이나 후공정에서 처음으로 나타나게 되는 것이 있습니다. 예를 들어 컴파일러...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.