{"id":51172,"date":"2023-11-02T02:24:47","date_gmt":"2023-11-01T18:24:47","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=51172"},"modified":"2023-11-02T02:24:47","modified_gmt":"2023-11-01T18:24:47","slug":"nc-port-open","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/nc-port-open.html","title":{"rendered":"\u5982\u4f55\u67e5\u770b\u8fdc\u7a0b\u7aef\u53e3\u662f\u5426\u6253\u5f00"},"content":{"rendered":"
\u7aef\u53e3<\/strong>\u662f\u4e0e Linux \u64cd\u4f5c\u7cfb\u7edf\u4e0a\u7684\u5e94\u7528\u6216\u8fdb\u7a0b\u7684\u901a\u8baf\u7aef\u70b9\u7684\u903b\u8f91\u5b9e\u4f53\u3002\u5728\u4f7f\u7528\u4e4b\u524d\uff0c\u4e86\u89e3\u76ee\u6807\u673a\u5668\u4e0a\u54ea\u4e9b\u7aef\u53e3\u662f\u6253\u5f00\u5e76\u6b63\u5728\u8fd0\u884c\u670d\u52a1\u662f\u975e\u5e38\u6709\u7528\u7684\u3002<\/p>\n \u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 netstat \u6216\u5176\u4ed6\u51e0\u4e2a Linux \u547d\u4ee4\u5982 NMAP \u5728\u672c\u5730\u673a\u5668\u4e0a\u8f7b\u677e\u5730\u5217\u51fa Linux \u4e2d\u7684\u6253\u5f00\u7aef\u53e3\u3002<\/p>\n <\/p>\n \u5728\u672c\u6307\u5357\u4e2d\uff0c\u6211\u4eec\u5c06\u5411\u4f60\u5c55\u793a\u5982\u4f55\u4f7f\u7528\u7b80\u5355\u7684 netcat<\/span> \uff08\u7b80\u79f0 nc<\/span>\uff09\u547d\u4ee4\u6765\u786e\u5b9a\u8fdc\u7a0b\u4e3b\u673a\u4e0a\u7684\u7aef\u53e3\u662f\u5426\u53ef\u8bbf\u95ee\/\u6253\u5f00\u3002<\/p>\n netcat<\/span>\uff08\u6216\u7b80\u79f0 nc<\/span> \uff09\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u4e14\u6613\u4e8e\u4f7f\u7528\u7684\u7a0b\u5e8f\uff0c\u53ef\u7528\u4e8e Linux \u4e2d\u4e0e TCP\u3001UDP \u6216 UNIX \u57df\u5957\u63a5\u5b57\u76f8\u5173\u7684\u4efb\u4f55\u4e8b\u60c5\u3002<\/p>\n \u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5b83\uff1a\u6253\u5f00 TCP \u8fde\u63a5\u3001\u4fa6\u542c\u4efb\u610f TCP \u548c UDP \u7aef\u53e3\u3001\u53d1\u9001 UDP \u6570\u636e\u5305\u3001\u5728 IPv4 \u548c IPv6 \u8fdb\u884c\u7aef\u53e3\u626b\u63cf\u3002<\/p>\n \u4f7f\u7528 netcat<\/strong>\uff0c\u4f60\u53ef\u4ee5\u68c0\u67e5\u5355\u4e2a\u6216\u591a\u4e2a\u6216\u4e00\u6bb5\u6253\u5f00\u7684\u7aef\u53e3\u8303\u56f4\uff0c\u5982\u4e0b\u6240\u793a\u3002\u4e0b\u9762\u7684\u547d\u4ee4\u5c06\u5e2e\u52a9\u6211\u4eec\u67e5\u770b\u7aef\u53e3 22 \u662f\u5426\u5728\u4e3b\u673a 192.168.56.10 \u4e0a\u6253\u5f00\uff1a<\/p>\n \u4e0a\u9762\u7684\u547d\u4ee4\u4e2d\uff0c\u8fd9\u4e9b\u6807\u5fd7\u662f\uff1a<\/p>\n \u4e0b\u9762\u7684\u547d\u4ee4\u4f1a\u68c0\u67e5\u8fdc\u7a0b\u4e3b\u673a 192.168.5.10 \u4e0a\u662f\u5426\u6253\u5f00\u4e86\u7aef\u53e3 80\u300122 \u548c 21\uff08\u6211\u4eec\u4e5f\u53ef\u4ee5\u4f7f\u7528\u4e3b\u673a\u540d\uff09\uff1a<\/p>\n \u4e5f\u53ef\u4ee5\u6307\u5b9a\u7aef\u53e3\u626b\u63cf\u7684\u8303\u56f4\uff1a<\/p>\n \u66f4\u591a\u5173\u4e8e netcat \u547d\u4ee4\u7684\u4f8b\u5b50\u548c\u4f7f\u7528\uff0c\u9605\u8bfb\u6211\u4eec\u4e0b\u9762\u7684\u6587\u7ae0\u3002<\/p>\n \u5c31\u662f\u8fd9\u6837\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u89e3\u91ca\u4e86\u5982\u4f55\u4f7f\u7528 netcat \u547d\u4ee4\u68c0\u6d4b\u8fdc\u7a0b\u4e3b\u673a\u7aef\u53e3\u662f\u5426\u53ef\u8fbe\/\u6253\u5f00\u3002<\/p>\n via: http:\/\/www.tecmint.com\/check-remote-port-in-linux\/<\/a><\/p>\n \u4f5c\u8005\uff1aAaron Kili<\/a> \u8bd1\u8005\uff1ageekpi<\/a> \u6821\u5bf9\uff1ajasminepeng<\/a><\/p>\n \u672c\u6587\u7531 LCTT<\/a> \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd<\/a> \u8363\u8a89\u63a8\u51fa<\/p>\n \u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-8186-1.html<\/a><\/p>\n# yum install nc [\u5728 CentOS\/RHEL \u4e2d]\r\n# dnf install nc [\u5728 Fedora 22+ \u4e2d]\r\n$ sudo apt-get install netcat [\u5728 Debian\/Ubuntu \u4e2d]\r\n<\/pre>\n
$ nc -zv 192.168.1.15 22\r\n<\/pre>\n
\n
nc -zv 192.168.56.10 80 22 21\r\n<\/pre>\n
$ nc -zv 192.168.56.10 20-80\r\n<\/pre>\n
\n
\n\n