Telnet 并不支持 UDP 端口的測試,可以使用 nc 命令來進(jìn)行測試。nc 命令兩種都支持:
TCP
# nc -z -v -u [hostname/IP address] [port number]
# nc -z -v 192.168.10.12 22
Connection to 192.118.20.95 22 port [tcp/ssh] succeeded!
UDP
# nc -z -v [hostname/IP address] [port number]
# nc -z -v -u 192.168.10.12 123
Connection to 192.118.20.95 123 port [udp/ntp] succeeded!
下面是一些 nc 的簡單用例:文章來源:http://www.zghlxwxcb.cn/news/detail-771392.html
- Start a listener on the specified TCP port and send a file into it:
nc -l -p port < filename
- Connect to a target listener on the specified port and receive a file from it:
nc host port > received_filename
- Scan the open TCP ports of a specified host:
nc -v -z -w timeout_in_seconds host start_port-end_port
- Start a listener on the specified TCP port and provide your local shell access to the connected party (this is dangerous and can be abused):
nc -l -p port -e shell_executable
- Connect to a target listener and provide your local shell access to the remote party (this is dangerous and can be abused):
nc host port -e shell_executable
- Act as a proxy and forward data from a local TCP port to the given remote host:
nc -l -p local_port | nc host remote_port
- Send an HTTP GET request:
echo -e "GET / HTTP/1.1\nHost: host\n\n" | nc host 80
文章來源地址http://www.zghlxwxcb.cn/news/detail-771392.html
到了這里,關(guān)于Telnet 測試 UDP 端口?的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!