{"id":1833,"date":"2019-01-20T21:12:44","date_gmt":"2019-01-20T13:12:44","guid":{"rendered":"https:\/\/zocodev.com\/?p=306"},"modified":"2019-01-20T21:12:44","modified_gmt":"2019-01-20T13:12:44","slug":"debian9-frp-internal-network-penetration","status":"publish","type":"post","link":"https:\/\/cloudbool.com\/archive\/debian9-frp-internal-network-penetration.html","title":{"rendered":"Debian9\u7cfb\u7edf\u4f7f\u7528FRP\u5185\u7f51\u7a7f\u900f"},"content":{"rendered":"<p>\u4e4b\u524d\u8bf4<a href=\"https:\/\/zocodev.com\/phicomm-n1-box.html\">\u5165\u624b\u4e86\u4e00\u4e2a\u6590\u8bafN1\u76d2\u5b50<\/a>\uff0c\u81ea\u4ece\u5b89\u88c5\u597d\u7cfb\u7edf\u4e4b\u540e\u4e00\u76f4\u653e\u5728\u516c\u53f8\u89d2\u843d\u5403\u7070\uff0c\u8dd1\u4e86\u4e2aNginx+PHP+MySQL\u5c31\u6ca1\u7ba1\u4e86\uff0c\u5e73\u65f6\u5728\u516c\u53f8\u8fd8\u597d\uff0c\u76f4\u63a5SSH\u8fde\u4e0a\u53bb\u5c31\u884c\uff0c\u4f46\u662f\u6709\u7684\u65f6\u5019\u4e0d\u5728\u516c\u53f8\u6bd4\u5982\u8bf4\u5468\u672b\u5728\u5bb6\u7684\u65f6\u5019\u60f3\u8fde\u4e0a\u53bb\u5e72\u70b9\u5565\u5c31\u6709\u70b9\u9ebb\u70e6\u4e86\uff0c\u4e8e\u662f\u82b1\u4e86\u70b9\u65f6\u95f4\uff0c\u5229\u7528\u4e00\u53f0\u95f2\u7f6e\u7684\u516c\u7f51\u670d\u52a1\u5668\u8fdb\u884c\u5185\u7f51\u7a7f\u900f\u4e86\u4e00\u4e0b\uff0c\u8fd9\u6837\u65e0\u8bba\u5728\u54ea\u90fd\u80fd\u76f4\u63a5\u8fde\u4e0a\u5185\u7f51\u7684\u8fd9\u53f0\u201c\u670d\u52a1\u5668\u201d\u4e86\u3002<br \/>\n<!--more--><\/p>\n<p>\u5176\u5b9e\u6211\u7684\u8981\u6c42\u5f88\u7b80\u5355\uff0c\u5c31\u662f\u60f3\u5728\u6709\u516c\u7f51\u7684\u73af\u5883\u4e0b\u80fd\u8bbf\u95ee\u5230\u4f4d\u4e8e\u516c\u53f8\u5185\u7f51\u7684\u8fd9\u53f0N1\u76d2\u5b50\uff0c\u5982\u679c\u80fd\u987a\u5e26\u8bbf\u95ee\u5185\u7f51\u7684\u522b\u7684\u673a\u5668\u5c31\u66f4\u597d\u4e86\uff0c\u627e\u6765\u627e\u53bb\u53d1\u73b0\u5c31FRP\u6700\u597d\u4e86\uff0c\u529f\u80fd\u5f3a\u5927\uff0c\u914d\u7f6e\u7b80\u5355\uff0c\u8fd8\u514d\u8d39\u5f00\u6e90\uff0c\u6298\u817e\u4e86\u4e0b\uff0c\u53d1\u73b0\u786e\u5b9e\u5f88\u7b80\u5355\uff0c\u8fd9\u91cc\u505a\u4e2a\u8bb0\u5f55\u4ee5\u5907\u540e\u7528\u3002<\/p>\n<p>\u6211\u662f\u7528\u7684\u662f\u56fd\u5185\u7684\u4e91\u670d\u52a1\u5668\uff0c\u5982\u679c\u4f60\u4e5f\u548c\u6211\u4e00\u6837\u6709\u8fd9\u6837\u7684\u9700\u6c42\uff0c\u53c8\u4e0d\u60f3\u5728\u56fd\u5185\u8d2d\u4e70\u670d\u52a1\u5668\uff0c\u90a3\u53ef\u4ee5\u8003\u8651\u4e0b\u8fd9\u4e2a<a href=\"https:\/\/zocodev.com\/bandwagonhost-cn2-gia.html\">CN2 GIA\u7ebf\u8def\u7684VPS<\/a>\uff0c\u56fd\u5185\u4e09\u7f51\u76f4\u8fde\uff0cFRP\u8bbf\u95ee\u5feb\u901f\u3002<\/p>\n<h2>\u524d\u63d0<\/h2>\n<p>\u4f4d\u4e8e\u516c\u7f51\u7684\u670d\u52a1\u5668\u4ee5\u53ca\u672c\u5730\u7684N1\u76d2\u5b50\u5b89\u88c5\u7684\u90fd\u662fDebian9\u7cfb\u7edf\uff0c\u533a\u522b\u662f\u516c\u7f51\u7684\u670d\u52a1\u5668\u7cfb\u7edf\u662fDebian 9 AMD64\uff0c\u800c\u5185\u7f51\u7684N1\u76d2\u5b50\u662fDebian 9 arm64\uff0c\u8fd9\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u5e94\u7684FRP\u7248\u672c\u90fd\u80fd\u5728FRP\u7684github release\u9875\u9762\u627e\u5230\uff0c\u94fe\u63a5\u5982\u4e0b\uff1a<\/p>\n<pre><code>https:\/\/github.com\/fatedier\/frp\/releases\n<\/code><\/pre>\n<h2>FRPS-\u670d\u52a1\u5668\u7aef\u914d\u7f6e<\/h2>\n<p>\u4e0b\u8f7d\u89e3\u538b\u4e4b\u540e\u5f97\u5230\u4e00\u4e2a\u540d\u79f0\u4e3a<strong>frp_0.23.0_linux_amd64<\/strong>\u7684\u76ee\u5f55\uff0c\u6211\u4eec\u8981\u7528\u5230\u7684\u662f\u91cc\u9762\u7684<strong>frps<\/strong>\u548c<strong>frps.ini<\/strong>\u6587\u4ef6\uff0c\u8fd9\u4e24\u4e2a\u6587\u4ef6\u5206\u522b\u662ffrps\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u548c\u914d\u7f6e\u6587\u4ef6\uff0c\u6211\u4e60\u60ef\u5c06\u81ea\u5b9a\u4e49\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u653e\u5230<strong>\/usr\/bin\/<\/strong>\uff0c\u914d\u7f6e\u6587\u4ef6\u653e\u7f6e\u5230<strong>\/etc\/<\/strong>\u5bf9\u5e94\u7684\u7a0b\u5e8f\u540d\u6587\u4ef6\u5939\u4e0b\u9762\uff0c\u4e8e\u662f\uff1a<\/p>\n<pre><code>cd frp_0.23.0_linux_amd64\n\/\/\u8d4b\u4e88frps\u53ef\u6267\u884c\u6743\u9650\nchmod +x frps\n\/\/\u5c06frps\u653e\u5230path\u76ee\u5f55\u4e0b\ncp frps \/usr\/bin\/\n\n\/\/\u5efa\u7acb\u914d\u7f6e\u6587\u4ef6\u76ee\u5f55\nmkdir \/etc\/frp\/\n\/\/\u5c06\u914d\u7f6e\u6587\u4ef6\u590d\u5236\u5230\u5bf9\u5e94\u7684\u914d\u7f6e\u6587\u4ef6\u76ee\u5f55\ncp frps.ini \/etc\/frp\/\n<\/code><\/pre>\n<p>\u7136\u540e\u5c31\u662f\u914d\u7f6e\u5f00\u673a\u542f\u52a8\u4e86\uff0c\u56e0\u4e3aDebian 9\u4f7f\u7528\u7684\u662fsystemd\uff0c\u6211\u4eec\u80fd\u5f88\u7b80\u5355\u7684\u5c31\u80fd\u63a7\u5236frps\u7684\u8fdb\u7a0b\u4e86\uff1a<\/p>\n<pre><code>vim \/etc\/systemd\/system\/frps.service\n\n[Unit]\nDescription=FRP Server Daemon\n\n[Service]\nType=simple\nExecStartPre=-\/usr\/sbin\/setcap cap_net_bind_service=+ep \/usr\/bin\/frps\nExecStart=\/usr\/bin\/frps -c \/etc\/frps.ini\nRestart=always\nRestartSec=20s\nUser=nobody\nPermissionsStartOnly=true\n\n[Install]\nWantedBy=multi-user.target\n<\/code><\/pre>\n<p>\u56e0\u4e3a\u6211\u4eec\u8981\u501f\u52a9\u516c\u7f51\u670d\u52a1\u5668\u8fdb\u884c\u7a7f\u900f\uff0c\u6240\u4ee5\uff0c\u516c\u7f51\u670d\u52a1\u5668\u548c\u4f4d\u4e8e\u5185\u7f51\u7684FRPC\u5bf9\u5e94\u7684\u9700\u8981\u653e\u884c\uff0c\u56e0\u4e3a\u8003\u8651\u5230\u9664\u4e86\u8ddf\u5185\u7f51\u901a\u4fe1\u7684\u7aef\u53e3\u672c\u8eab\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u4e00\u4e9b\u522b\u7684\u670d\u52a1\u7684\u7aef\u53e3\uff0c\u6bd4\u5982\u8bf4\u542f\u7528\u4e00\u4e2aSSH\u670d\u52a1\uff0c\u8fd9\u53c8\u9700\u8981\u4e00\u4e2a\u53e6\u5916\u7684\u7aef\u53e3\u3002\u6211\u7528\u7684\u662f\u817e\u8baf\u4e91\uff0c\u6253\u7b97\u5206\u914d3001-3100\u7ed9FRPS\u4f7f\u7528\uff0c\u4e8e\u662f\u5bf9\u5e94\u7684\u5b89\u5168\u7ec4\u653e\u884c\u89c4\u5219\u622a\u56fe\u5982\u4e0b\uff1a<br \/>\n<img decoding=\"async\" src=\"https:\/\/cloudbool.com\/archive\/wp-content\/uploads\/2019\/01\/cloud-server-port-allow.png\" alt=\"cloud-server-port-allow\" \/><\/p>\n<p>\u6240\u4ee5\uff0c<strong>frps.ini<\/strong>\u91cc\u9762\u7684<strong>bind_port<\/strong>\u5c31\u8981\u8bbe\u7f6e\u6210\u4e0a\u9762\u5206\u914d\u533a\u95f4\u7684\u7aef\u53e3\uff0c\u6bd4\u5982\u8bf43001\u3002<\/p>\n<h2>FRPC-\u5ba2\u6237\u7aef\u914d\u7f6e<\/h2>\n<p>\u8fd9\u90e8\u5206\u914d\u7f6e\u662f\u5728\u4f4d\u4e8e\u5185\u7f51\u7684\u673a\u5668\u4e0a\u914d\u7f6e\u7684\uff0c\u6211\u7684\u5185\u7f51\u673a\u5668\u5c31\u662fN1\u76d2\u5b50\u4e86\uff0c\u548c\u4e0a\u9762\u914d\u7f6e\u516c\u7f51\u670d\u52a1\u5668\u7c7b\u4f3c\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<pre><code>cd frp_0.23.0_linux_arm64\n\/\/\u8d4b\u4e88frps\u53ef\u6267\u884c\u6743\u9650\nchmod +x frpc\n\/\/\u5c06frpc\u653e\u5230path\u76ee\u5f55\u4e0b\ncp frpc \/usr\/bin\/\n\n\/\/\u5efa\u7acb\u914d\u7f6e\u6587\u4ef6\u76ee\u5f55\nmkdir \/etc\/frp\/\n\/\/\u5c06\u914d\u7f6e\u6587\u4ef6\u590d\u5236\u5230\u5bf9\u5e94\u7684\u914d\u7f6e\u6587\u4ef6\u76ee\u5f55\ncp frpc.ini \/etc\/frp\/\n<\/code><\/pre>\n<p>systemd\u6587\u4ef6\uff1a<\/p>\n<pre><code>vim \/etc\/systemd\/system\/frpc.service\n\n[Unit]\nDescription=FRP Client Daemon\nAfter=network.target\nWants=network.target\n\n[Service]\nType=simple\nExecStart=\/usr\/bin\/frpc -c \/etc\/frpc.ini\nRestart=always\nRestartSec=20s\nUser=nobody\n\n[Install]\nWantedBy=multi-user.target\n<\/code><\/pre>\n<p>\u6839\u636e\u5b9e\u9645\u9700\u6c42\u4fee\u6539\u5c31\u597d\u4e86\u3002<\/p>\n<p>\u5230\u8fd9\u4e00\u6b65\u5c31\u5b8c\u6210\u4e86FRPS\u548cFRPC\u7684\u57fa\u672c\u914d\u7f6e\uff0c\u5df2\u7ecf\u53ef\u4ee5\u901a\u8fc7systemd\u76f8\u5173\u547d\u4ee4\u8fdb\u884c\u542f\u52a8\u505c\u6b62\u4e86\uff1a<\/p>\n<pre><code>systemctl start frps #\u542f\u52a8\nsystemctl stop frps #\u505c\u6b62\nsystemctl restart frps #\u91cd\u542f\nsystemctl status frps #\u67e5\u770b\u72b6\u6001\nsystemctl enable frps #\u5f00\u673a\u542f\u52a8frp\n\nsystemctl start frpc\nsystemctl stop frpc\nsystemctl restart frpc\nsystemctl status frpc\nsystemctl enable frpc\n<\/code><\/pre>\n<h2>FRPS\u914d\u7f6e<\/h2>\n<p>\u9ed8\u8ba4\u7684<strong>frps.ini<\/strong>\u53ea\u6709\u4e00\u4e2a\u7ed1\u5b9a\u7aef\u53e3\u914d\u7f6e\uff0c\u51fa\u4e8e\u5b89\u5168\u8003\u8651\uff0c\u6211\u4eec\u6700\u597d\u8fd8\u662f\u52a0\u4e2a\u5bc6\u7801\uff0c\u5982\u679c\u9700\u8981\uff0c\u4e5f\u53ef\u4ee5\u5f00\u542f\u4e00\u4e0bDashboard\uff0c\u6240\u4ee5\uff0c\u76ee\u524d\u6211\u7684<strong>frps.ini<\/strong>\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n<pre><code>[common]\nbind_port = 3001\n\ntoken = zocodev\n\ndashboard_port = 3100\ndashboard_user = zocodev\ndashboard_pwd = zocodev\n<\/code><\/pre>\n<h2>FRPC\u914d\u7f6e<\/h2>\n<p>\u4e0a\u9762\u8bf4\u4e86\uff0c\u6211\u4f7f\u7528FRP\u7684\u76ee\u7684\u5c31\u662f\u60f3\u8981\u4f7f\u7528\u516c\u7f51\u7684\u670d\u52a1\u5668\u8fdb\u884c\u5185\u7f51\u7a7f\u900f\uff0c\u6240\u4ee5\uff0c\u6211\u9700\u8981\u914d\u7f6eFRPC\u5c06\u672c\u5730\u7684SSH\u7a7f\u900f\u5230\u516c\u7f51\u670d\u52a1\u5668\u4e0a\uff0c\u5b8c\u6574\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n<pre><code>[common]\nserver_addr = 111.231.1.1\nserver_port = 3001\ntoken = zocodev\n\n[ssh]\ntype = tcp\nlocal_ip = 127.0.0.1\nlocal_port = 22\nremote_port = 3022\n<\/code><\/pre>\n<p>\u4e0a\u65b9\u7684remote_port\u5c31\u662f\u6211\u4eec\u201c\u8fde\u63a5\u201dSSH\u4f7f\u7528\u7684\u7aef\u53e3\u3002<\/p>\n<h2>\u5229\u7528FRP\u8fdb\u884c\u5185\u7f51\u7a7f\u900f<\/h2>\n<p>\u914d\u7f6e\u597d\u4e4b\u540e\uff0c\u91cd\u542fFRPS\u548cFRPC\uff0c\u7136\u540e\u6253\u5f00SSH\u8fde\u63a5\u5de5\u5177\uff0c\u6bd4\u5982\u8bf4\u6211\u7684\u516c\u7f51IP\u4e3a111.231.1.1\uff0c\u5219\u76f8\u5173\u547d\u4ee4\u5c31\u662f\uff1a<\/p>\n<pre><code>ssh username@111.231.1.1 -p 3022\n<\/code><\/pre>\n<p>\u540e\u9762\u7684<strong>-p<\/strong>\u53c2\u6570\u5c31\u662f\u521a\u5728<strong>frpc.ini<\/strong>\u91cc\u9762\u6307\u5b9a\u7684<strong>remote_port<\/strong>\u53c2\u6570\uff0c\u5982\u679c\u6ca1\u610f\u5916\u7684\u8bdd\uff0c\u5e94\u8be5\u80fd\u6b63\u5e38\u901a\u8fc7\u516c\u7f51\u670d\u52a1\u5668\u8fde\u63a5\u5230\u5185\u7f51\u7684N1\u76d2\u5b50\u4e86\uff0c\u622a\u4e2a\u56fe\u5982\u4e0b\uff1a<br \/>\n<img decoding=\"async\" src=\"https:\/\/cloudbool.com\/archive\/wp-content\/uploads\/2019\/01\/frp-internal-network-penetration.png\" alt=\"frp-internal-network-penetration.png\" \/><\/p>\n<p>\u9664\u4e86SSH\u4e4b\u5916\uff0c\u8fd8\u80fd\u5229\u7528FRP\u8fdb\u884c\u5f88\u591a\u64cd\u4f5c\uff0c\u5b98\u65b9\u6587\u6863\u5728\u8fd9\uff1ahttps:\/\/github.com\/fatedier\/frp\/blob\/master\/README_zh.md<\/p>\n<p>\u6587\u4e2dsystemd\u76f8\u5173\u5185\u5bb9\u6765\u81ea\u8fd9\u91cc\uff1ahttps:\/\/gist.github.com\/ihipop\/4dc607caef7c874209521b10d18e35af<\/p>\n<p>\u611f\u8c22\u76f8\u5173\u5f00\u53d1\u8005\u7684\u4ed8\u51fa\u548c\u52aa\u529b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e4b\u524d\u8bf4\u5165\u624b\u4e86\u4e00\u4e2a\u6590\u8bafN1\u76d2\u5b50\uff0c\u81ea\u4ece\u5b89\u88c5\u597d\u7cfb\u7edf\u4e4b\u540e\u4e00\u76f4\u653e\u5728\u516c\u53f8\u89d2\u843d\u5403\u7070\uff0c\u8dd1\u4e86\u4e2aNginx+PHP+MySQL\u5c31\u6ca1 &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/cloudbool.com\/archive\/debian9-frp-internal-network-penetration.html\"> <span class=\"screen-reader-text\">Debian9\u7cfb\u7edf\u4f7f\u7528FRP\u5185\u7f51\u7a7f\u900f<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[10],"tags":[27,29,41],"class_list":["post-1833","post","type-post","status-publish","format-standard","hentry","category-server","tag-debian","tag-debian-9","tag-frp"],"_links":{"self":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts\/1833","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/comments?post=1833"}],"version-history":[{"count":0,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts\/1833\/revisions"}],"wp:attachment":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/media?parent=1833"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/categories?post=1833"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/tags?post=1833"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}