{"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

\"\u4f7f\u7528<\/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

# 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

\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

$ nc -zv 192.168.1.15 22\r\n<\/pre>\n

\u4e0a\u9762\u7684\u547d\u4ee4\u4e2d\uff0c\u8fd9\u4e9b\u6807\u5fd7\u662f\uff1a<\/p>\n

    \n
  1. -z<\/span> \u00a0\u2013 \u8bbe\u7f6e nc \u53ea\u662f\u626b\u63cf\u4fa6\u542c\u5b88\u62a4\u8fdb\u7a0b\uff0c\u5b9e\u9645\u4e0a\u4e0d\u5411\u5b83\u4eec\u53d1\u9001\u4efb\u4f55\u6570\u636e\u3002<\/li>\n
  2. -v<\/span> \u00a0\u2013 \u542f\u7528\u8be6\u7ec6\u6a21\u5f0f<\/li>\n<\/ol>\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

    nc -zv 192.168.56.10 80 22 21\r\n<\/pre>\n

    \u4e5f\u53ef\u4ee5\u6307\u5b9a\u7aef\u53e3\u626b\u63cf\u7684\u8303\u56f4\uff1a<\/p>\n

    $ nc -zv 192.168.56.10 20-80\r\n<\/pre>\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

      \n
    1. \u00a0\u4f7f\u7528 netcat \u547d\u4ee4\u5728 Linux \u670d\u52a1\u5668\u95f4\u4f20\u8f93\u6587\u4ef6<\/li>\n
    2. \u00a0Linux \u7f51\u7edc\u914d\u7f6e\u53ca\u6392\u969c\u8c03\u8bd5\u547d\u4ee4<\/li>\n<\/ol>\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


      \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

      \n

      \u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-8186-1.html<\/a><\/p>\n

      \u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/nc-port-open.html<\/a>\u7f16\u8f91\u5458\uff1a\u5f20\u96c4\uff0c\u5ba1\u6838\u5458\uff1a\u738b\u6bc5<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

      \u7aef\u53e3\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","protected":false},"author":643,"featured_media":81441,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-51172","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/51172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/643"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=51172"}],"version-history":[{"count":9,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/51172\/revisions"}],"predecessor-version":[{"id":81894,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/51172\/revisions\/81894"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/81441"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=51172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=51172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=51172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}