{"id":111920,"date":"2026-10-02T07:25:01","date_gmt":"2026-10-01T23:25:01","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/111920.html"},"modified":"2026-10-02T07:25:01","modified_gmt":"2026-10-01T23:25:01","slug":"havoc-%e5%9b%a2%e9%98%9f%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%9a%84-hcl-%e9%85%8d%e7%bd%ae%e8%a7%a3%e7%a0%81%e8%bf%9b%e9%98%b6%ef%bc%9ahcl-%e5%ae%98%e6%96%b9%e6%8c%87%e5%8d%97%e4%b8%ad%e7%9a%84%e4%b8%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/111920.html","title":{"rendered":"Havoc \u56e2\u961f\u670d\u52a1\u5668\u7684 HCL \u914d\u7f6e\u89e3\u7801\u8fdb\u9636\uff1aHCL \u5b98\u65b9\u6307\u5357\u4e2d\u7684\u4e09\u5927\u590d\u6742\u7cfb\u7edf\u8bbe\u8ba1\u6a21\u5f0f"},"content":{"rendered":"<ul class=\"gcb-tag-list\">\n<li><span class=\"gcb-tag\">\u7f51\u7edc\u5b89\u5168<\/span><\/li>\n<\/ul>\n<h3 class=\"gcb-project-title\">\u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011Havoc<\/h3>\n<p class=\"gcb-project-desc\">The Havoc Framework<\/p>\n<p>    <span class=\"gcb-project-addr-label\">\u9879\u76ee\u5730\u5740&#xff1a;<\/span><br \/>\n    <span class=\"gcb-project-addr-link\">https:\/\/gitcode.com\/gh_mirrors\/ha\/Havoc<\/span> <\/p>\n<p>  <span class=\"gcb-project-btn\"> <span class=\"gcb-project-btn-main\">\u70b9\u51fb\u67e5\u770b<\/span> <span class=\"gcb-project-btn-sub\">\u514d\u8d39\u4e0b\u8f7d<\/span> <\/span> <\/p>\n<p>\u672c\u6587\u57fa\u4e8e Havoc \u6846\u67b6 teamserver \u5185\u5d4c\u7684 HCL \u89e3\u6790\u5e93&#xff08;teamserver\/pkg\/profile\/yaotl\/&#xff0c;\u5373 hashicorp\/go-cty \u751f\u6001\u7684 HCL \u5e93 vendored \u526f\u672c&#xff09;\u4e2d\u7684\u5b98\u65b9\u6307\u5357\u7ae0\u8282\u300aDesign Patterns for Complex Systems\u300b&#xff0c;\u7cfb\u7edf\u8bb2\u89e3\u4e09\u79cd\u5e94\u5bf9\u590d\u6742\u914d\u7f6e\u573a\u666f\u7684 HCL \u9759\u6001\u5206\u6790\u8bbe\u8ba1\u6a21\u5f0f&#xff1a;\u76f8\u4e92\u4f9d\u8d56\u7684\u5757&#xff08;Interdependent Blocks&#xff09;\u3001\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u7684\u914d\u7f6e\u6c42\u503c\u7b56\u7565&#xff08;AOT vs \u6e10\u8fdb\u5f0f\u6c42\u503c&#xff09;\u3001\u9759\u6001\u5f15\u7528\u4e0e\u9759\u6001\u5206\u6790\u51fd\u6570\u65cf&#xff08;ExprAsKeyword\u3001AbsTraversalForExpr\u3001ExprList\u3001ExprMap\u3001ExprCall \u7b49&#xff09;\u3002\u8bfb\u5b8c\u540e&#xff0c;\u4f60\u5c06\u7406\u89e3 Havoc \u7684 .yaotl \u914d\u7f6e\u6587\u4ef6\u662f\u5982\u4f55\u88ab\u4e00\u6b65\u6b65\u89e3\u7801\u4e3a Go \u7ed3\u6784\u4f53\u7684&#xff0c;\u4ee5\u53ca\u5f53\u914d\u7f6e\u8bed\u8a00\u9700\u8981&#034;\u5f15\u7528\u5176\u5b83\u5757\u4e2d\u5b9a\u4e49\u7684\u503c&#034;\u65f6&#xff0c;\u5e94\u5982\u4f55\u5229\u7528 Variables \u65b9\u6cd5\u3001\u4f9d\u8d56\u56fe\u4e0e\u62d3\u6251\u6392\u5e8f\u6765\u5b9e\u73b0\u5b89\u5168\u6c42\u503c\u3002<\/p>\n<p>Havoc \u56e2\u961f\u670d\u52a1\u5668&#xff08;teamserver&#xff09;\u4f7f\u7528 HCL \u8bed\u6cd5\u7f16\u5199\u7684\u914d\u7f6e\u6587\u4ef6&#xff08;.yaotl \u6587\u4ef6&#xff09;\u6765\u63cf\u8ff0\u670d\u52a1\u5668\u3001\u64cd\u4f5c\u5458\u3001\u76d1\u542c\u5668\u4e0e Demon \u8f7d\u8377\u7684\u6784\u5efa\u884c\u4e3a&#xff0c;\u4f8b\u5982 profiles\/havoc.yaotl\u3002\u4ed3\u5e93\u5728 teamserver\/pkg\/profile\/yaotl\/guide\/go_patterns.rst \u4e2d\u6536\u5f55\u4e86 HCL \u4e0a\u6e38\u7684\u8fd9\u7bc7\u8bbe\u8ba1\u6307\u5357&#xff0c;\u5b83\u56de\u7b54\u7684\u6838\u5fc3\u95ee\u9898\u662f&#xff1a;\u5f53&#034;\u4e00\u4e2a\u5757\u91cc\u53ef\u7528\u7684\u53d8\u91cf\u53d6\u51b3\u4e8e\u5176\u5b83\u5757\u5b9a\u4e49\u7684\u503c&#034;\u8fd9\u7c7b\u590d\u6742\u60c5\u51b5\u51fa\u73b0\u65f6&#xff0c;HCL API \u63d0\u4f9b\u4e86\u54ea\u4e9b\u673a\u5236\u2014\u2014\u8fd9\u6b63\u662f Havoc \u8fd9\u7c7b\u914d\u7f6e\u9a71\u52a8\u578b\u7cfb\u7edf\u7684\u901a\u7528\u8fdb\u9636\u4e3b\u9898\u3002<\/p>\n<h3>\u4ece Havoc \u7684\u914d\u7f6e\u89e3\u7801\u770b HCL \u5206\u5c42\u89e3\u7801\u4f53\u7cfb<\/h3>\n<p>\u5728\u5c55\u5f00\u4e09\u5927\u6a21\u5f0f\u4e4b\u524d&#xff0c;\u5148\u8bf4\u660e\u8fd9\u4e9b&#034;\u9ad8\u7ea7\u6a21\u5f0f&#034;\u5efa\u7acb\u5728\u4ec0\u4e48\u57fa\u7840\u4e4b\u4e0a\u3002\u6307\u5357\u5f00\u7bc7\u6307\u51fa&#xff1a;\u524d\u5e8f\u7ae0\u8282&#xff08;HCL Go \u89e3\u6790\u6307\u5357&#xff09;\u5df2\u7ecf\u4ecb\u7ecd\u4e86\u5e94\u7528\u6309 HCL \u8bed\u6cd5\u5b9a\u4e49\u540e\u89e3\u7801\u914d\u7f6e\u8bed\u8a00\u7684\u82e5\u5e72\u65b9\u5f0f&#xff0c;\u5bf9\u591a\u6570\u5e94\u7528\u800c\u8a00\u8fd9\u4e9b\u673a\u5236\u5df2\u7ecf\u8db3\u591f&#xff1b;\u4f46\u5b58\u5728\u4e00\u4e9b\u66f4\u590d\u6742\u7684\u573a\u666f&#xff0c;\u9700\u8981\u989d\u5916\u6280\u5de7\u3002<\/p>\n<p>Havoc \u7684\u914d\u7f6e\u6587\u4ef6\u89e3\u7801\u6070\u597d\u8d70\u4e86&#034;\u7b80\u5355\u8def\u5f84&#034;&#xff0c;\u53ef\u4ee5\u4f5c\u4e3a\u4e00\u4e2a\u5bf9\u7167\u57fa\u51c6\u3002teamserver\/pkg\/profile\/yaotl\/hclsimple\/hclsimple.go \u4e2d\u7684 DecodeFile \u51fd\u6570\u628a&#034;\u89e3\u6790 \u2192 \u89e3\u7801 \u2192 \u6c42\u503c&#034;\u4e09\u6b65\u538b\u7f29\u4e3a\u4e00\u6b21\u8c03\u7528&#xff1a;<\/p>\n<p>\/\/ DecodeFile \u662f Decode \u7684\u5c01\u88c5&#xff0c;\u4f1a\u5148\u4ece\u78c1\u76d8\u8bfb\u53d6\u7ed9\u5b9a\u6587\u4ef6<br \/>\nfunc DecodeFile(filename string, ctx *hcl.EvalContext, target interface{}) error {<br \/>\n    src, err :&#061; ioutil.ReadFile(filename)<br \/>\n    \/\/ &#8230; \u9519\u8bef\u5904\u7406 &#8230;<br \/>\n    return Decode(filename, src, ctx, target)<br \/>\n}<\/p>\n<p>\u800c Decode \u5185\u90e8\u4f9d\u6b21\u8c03\u7528 hclsyntax.ParseConfig&#xff08;\u628a\u6e90\u7801\u89e3\u6790\u4e3a\u62bd\u8c61\u8bed\u6cd5\u6811&#xff09;\u4e0e gohcl.DecodeBody&#xff08;\u6309\u7ed3\u6784\u4f53\u6807\u7b7e\u63d0\u53d6\u5b57\u6bb5&#xff09;\u3002Havoc \u5728 teamserver\/pkg\/profile\/profile.go \u4e2d\u6b63\u662f\u901a\u8fc7\u5b83\u5b8c\u6210\u6574\u4efd\u914d\u7f6e\u7684\u52a0\u8f7d&#xff1a;<\/p>\n<p>func (p *Profile) SetProfile(path string, def bool) error {<br \/>\n    err :&#061; yaotl.DecodeFile(path, nil, &amp;p.Config)<br \/>\n    \/\/ &#8230;<br \/>\n}<\/p>\n<p>\u5176\u4e2d ctx \u4f20\u5165 nil\u2014\u2014\u56e0\u4e3a Havoc \u7684\u914d\u7f6e&#xff08;\u5982 profiles\/havoc.yaotl \u4e2d\u7684 Teamserver\u3001Operators\u3001Demon \u7b49\u9876\u5c42\u5757&#xff09;\u4e0d\u5b58\u5728\u8de8\u5757\u53d8\u91cf\u5f15\u7528&#xff0c;\u9759\u6001\u4f5c\u7528\u57df\u5373\u8db3\u591f\u3002\u89e3\u7801\u76ee\u6807\u7ed3\u6784\u4f53 teamserver\/pkg\/profile\/config.go \u4e2d\u7684 HavocConfig \u5219\u5c55\u793a\u4e86 yaotl \u6807\u7b7e\u5982\u4f55\u6620\u5c04 HCL \u8bed\u6cd5\u7ed3\u6784&#xff1a;<\/p>\n<p>type HavocConfig struct {<br \/>\n    Server    *ServerProfile  &#096;yaotl:&#034;Teamserver,block&#034;&#096;<br \/>\n    Operators *OperatorsBlock &#096;yaotl:&#034;Operators,block&#034;&#096;<br \/>\n    Listener  *Listeners      &#096;yaotl:&#034;Listeners,block&#034;&#096;<br \/>\n    Demon     *Demon          &#096;yaotl:&#034;Demon,block&#034;&#096;<br \/>\n    Service   *ServiceConfig  &#096;yaotl:&#034;Service,block&#034;&#096;<br \/>\n    WebHook   *WebHookConfig  &#096;yaotl:&#034;WebHook,block&#034;&#096;<br \/>\n}<\/p>\n<p>\u6ce8\u610f block \u4e0e optional \u4e24\u7c7b\u6807\u7b7e&#xff1a;Listeners \u5757\u5185\u53c8\u7ec6\u5206\u51fa Http,block\u3001Smb,block\u3001External,block \u5b50\u5757&#xff0c;ListenerHTTP \u4e2d\u7684 UserAgent,optional \u7b49\u5b57\u6bb5\u5219\u662f\u53ef\u9009\u9879\u3002\u8fd9\u4e00\u7ed3\u6784\u4e0e\u6307\u5357\u4e2d\u53cd\u590d\u63d0\u53ca\u7684 gohcl \u89e3\u7801\u6a21\u578b\u5b8c\u5168\u5bf9\u5e94\u2014\u2014\u5f53\u4f60\u7684\u9700\u6c42\u8d85\u51fa&#034;\u4e00\u6b21\u6027\u89e3\u7801&#034;\u65f6&#xff0c;\u5c31\u9700\u8981\u4e0b\u9762\u4e09\u5957\u6a21\u5f0f\u4e86\u3002<\/p>\n<h3>\u6a21\u5f0f\u4e00&#xff1a;\u76f8\u4e92\u4f9d\u8d56\u7684\u5757&#xff08;Interdependent Blocks&#xff09;<\/h3>\n<p>\u5728\u4e00\u4e9b\u914d\u7f6e\u8bed\u8a00\u4e2d&#xff0c;\u4e00\u4e2a\u914d\u7f6e\u5757\u91cc\u53ef\u7528\u7684\u53d8\u91cf\u53d6\u51b3\u4e8e\u5176\u5b83\u5757\u4e2d\u5b9a\u4e49\u7684\u503c\u3002\u6307\u5357\u4ee5 Terraform \u4e3a\u4f8b\u5c55\u793a\u4e86\u8fd9\u79cd\u4f9d\u8d56\u7684\u5178\u578b\u5f62\u6001&#xff1a;<\/p>\n<p>variable &#034;network_numbers&#034; {<br \/>\n  type &#061; list(number)<br \/>\n}<\/p>\n<p>variable &#034;base_network_addr&#034; {<br \/>\n  type    &#061; string<br \/>\n  default &#061; &#034;10.0.0.0\/8&#034;<br \/>\n}<\/p>\n<p>locals {<br \/>\n  network_blocks &#061; {<br \/>\n    for x in var.number:<br \/>\n    x &#061;&gt; cidrsubnet(var.base_network_addr, 8, x)<br \/>\n  }<br \/>\n}<\/p>\n<p>resource &#034;cloud_subnet&#034; &#034;example&#034; {<br \/>\n  for_each &#061; local.network_blocks<\/p>\n<p>  cidr_block &#061; each.value<br \/>\n}<\/p>\n<p>output &#034;subnet_ids&#034; {<br \/>\n  value &#061; cloud_subnet.example[*].id<br \/>\n}<\/p>\n<p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d&#xff0c;variable &#034;network_numbers&#034; \u5757\u8ba9 var.network_numbers \u53ef\u7528\u4e8e\u8868\u8fbe\u5f0f&#xff0c;resource &#034;cloud_subnet&#034; &#034;example&#034; \u5757\u8ba9 cloud_subnet.example \u53ef\u7528\u4e8e\u8868\u8fbe\u5f0f&#xff0c;\u4f9d\u6b64\u7c7b\u63a8\u3002\u4e5f\u5c31\u662f\u8bf4&#xff1a;\u9876\u5c42\u7ed3\u6784\u672c\u8eab\u5c31\u9690\u5f0f\u5730\u5b9a\u4e49\u4e86\u4f9b\u5176\u5b83\u8868\u8fbe\u5f0f\u5f15\u7528\u7684\u503c&#xff0c;\u5757\u4e0e\u5757\u4e4b\u95f4\u5b58\u5728\u5f15\u7528\u5173\u7cfb\u3002<\/p>\n<p>\u6307\u5357\u7ed9\u51fa\u7684\u901a\u7528\u89e3\u6cd5\u5206\u4e3a\u56db\u6b65&#xff0c;Havoc \u5185\u5d4c\u7684 HCL \u5e93\u6e90\u7801\u53ef\u4ee5\u9010\u6b65\u5370\u8bc1&#xff1a;<\/p>\n<h4>\u7b2c 1 \u6b65&#xff1a;\u5148\u9694\u79bb\u5730\u89e3\u7801\u9876\u5c42\u7ed3\u6784<\/h4>\n<p>\u6307\u5357\u6307\u51fa&#xff0c;Terraform \u901a\u8fc7&#034;\u5148\u9694\u79bb\u5730\u89e3\u7801\u9876\u5c42\u7ed3\u6784&#034;\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002\u5b9e\u73b0\u65b9\u5f0f\u6709\u4e24\u79cd&#xff1a;<\/p>\n<li>\u4f7f\u7528 HCL \u4f4e\u7ea7 API&#xff1b;<\/li>\n<li>\u4f7f\u7528 gohcl&#xff0c;\u5e76\u5c06 hcl.Body \u7c7b\u578b\u7684\u5b57\u6bb5\u6253\u4e0a remain \u6807\u7b7e\u2014\u2014\u5373\u628a\u4e0d\u8ba4\u8bc6\u7684\u5757\u539f\u6837\u4fdd\u7559\u4e0b\u6765&#xff0c;\u7a0d\u540e\u518d\u5904\u7406\u3002<\/li>\n<h4>\u7b2c 2 \u6b65&#xff1a;\u7528 Variables \u68c0\u67e5\u6bcf\u4e2a\u5757\u5f15\u7528\u4e86\u54ea\u4e9b\u53d8\u91cf<\/h4>\n<p>\u62ff\u5230\u6bcf\u4e2a\u9876\u5c42\u5757\u7684\u72ec\u7acb Body \u540e&#xff0c;\u53ef\u4ee5\u68c0\u67e5\u5757\u5185\u6bcf\u4e2a\u5c5e\u6027\u8868\u8fbe\u5f0f\u5f15\u7528\u4e86\u54ea\u4e9b\u53d8\u91cf&#xff1a;<\/p>\n<ul>\n<li>\u901a\u8fc7 hcl.Expression \u7684 Variables \u65b9\u6cd5&#xff08;\u5bf9\u5355\u4e2a\u8868\u8fbe\u5f0f&#xff09;&#xff1b;<\/li>\n<li>\u6216\u8005&#xff0c;\u5982\u679c\u6700\u7ec8\u8981\u50cf Terraform \u90a3\u6837\u4f7f\u7528\u5176\u9ad8\u5c42 API \u89e3\u7801&#xff0c;\u5219\u4f7f\u7528 teamserver\/pkg\/profile\/yaotl\/hcldec\/variables.go \u4e2d hcldec \u5305\u7684 Variables \u51fd\u6570&#xff08;\u5bf9\u6574\u4e2a Body &#043; Spec \u7ec4\u5408&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u8be5\u51fd\u6570\u7684\u5b9e\u73b0\u503c\u5f97\u7ec6\u770b\u2014\u2014\u5b83\u5148\u63a8\u5bfc\u8bed\u4e49\u5316 schema&#xff0c;\u518d\u5bf9 Body \u505a\u90e8\u5206\u5185\u5bb9\u63d0\u53d6&#xff0c;\u6700\u540e\u9012\u5f52\u904d\u5386\u6240\u6709\u9700\u8981\u53d8\u91cf\u7684 spec \u8282\u70b9&#xff1a;<\/p>\n<p>\/\/ Variables \u5904\u7406\u7ed9\u5b9a\u7684 body \u4e0e spec&#xff0c;\u8fd4\u56de\u89e3\u7801\u540c\u4e00<br \/>\n\/\/ body\/spec \u7ec4\u5408\u6240\u5fc5\u9700\u7684\u53d8\u91cf\u904d\u5386&#xff08;traversal&#xff09;\u5217\u8868\u3002<br \/>\nfunc Variables(body hcl.Body, spec Spec) []hcl.Traversal {<br \/>\n    var vars []hcl.Traversal<br \/>\n    schema :&#061; ImpliedSchema(spec)<br \/>\n    content, _, _ :&#061; body.PartialContent(schema)<\/p>\n<p>    if vs, ok :&#061; spec.(specNeedingVariables); ok {<br \/>\n        vars &#061; append(vars, vs.variablesNeeded(content)&#8230;)<br \/>\n    }<\/p>\n<p>    var visitFn visitFunc<br \/>\n    visitFn &#061; func(s Spec) {<br \/>\n        if vs, ok :&#061; s.(specNeedingVariables); ok {<br \/>\n            vars &#061; append(vars, vs.variablesNeeded(content)&#8230;)<br \/>\n        }<br \/>\n        s.visitSameBodyChildren(visitFn)<br \/>\n    }<br \/>\n    spec.visitSameBodyChildren(visitFn)<\/p>\n<p>    return vars<br \/>\n}<\/p>\n<p>\u6ce8\u91ca\u4e2d\u540c\u65f6\u8bf4\u660e\u4e86\u4e00\u4e2a\u5b9e\u7528\u7ec6\u8282&#xff1a;Variables \u53ef\u7528\u4e8e&#034;\u6309\u6761\u4ef6\u586b\u5145\u4f20\u7ed9 Decode \u7684 EvalContext \u4e2d\u7684\u53d8\u91cf&#xff0c;\u9002\u7528\u4e8e\u9759\u6001\u4f5c\u7528\u57df\u4e0d\u591f\u7528\u7684\u573a\u666f&#034;&#xff1b;\u5e76\u4e14\u5982\u679c body \u4e0d\u7b26\u5408 schema&#xff0c;\u7ed3\u679c\u53ef\u80fd\u4e0d\u5b8c\u6574&#xff0c;\u4f46\u8fd9\u88ab\u8ba4\u4e3a\u53ef\u4ee5\u63a5\u53d7&#xff0c;\u56e0\u4e3a\u6700\u7ec8\u7684 Decode \u8c03\u7528\u53cd\u6b63\u4f1a\u4ea7\u751f\u9519\u8bef\u8bca\u65ad\u3002\u8868\u8fbe\u5f0f\u7ea7\u522b\u7684\u5b9e\u73b0\u5219\u5728 teamserver\/pkg\/profile\/yaotl\/hclsyntax\/variables.go\u3002<\/p>\n<h4>\u7b2c 3 \u6b65&#xff1a;\u6784\u5efa\u4f9d\u8d56\u56fe\u5e76\u62d3\u6251\u6392\u5e8f<\/h4>\n<p>\u68c0\u51fa\u7684\u53d8\u91cf\u5f15\u7528\u53ef\u7528\u4e8e\u5728\u5757\u4e4b\u95f4\u6784\u5efa\u4f9d\u8d56\u56fe&#xff0c;\u7136\u540e\u505a\u62d3\u6251\u6392\u5e8f&#xff0c;\u786e\u5b9a\u6bcf\u4e2a\u5757\u5185\u5bb9\u7684\u6b63\u786e\u6c42\u503c\u987a\u5e8f&#xff0c;\u4fdd\u8bc1&#034;\u503c\u5728\u88ab\u9700\u8981\u4e4b\u524d\u603b\u662f\u5df2\u7ecf\u53ef\u7528&#034;\u3002\u8fd9\u662f\u7eaf\u7cb9\u7684\u7b97\u6cd5\u5c42\u6280\u5de7&#xff0c;\u4e0e HCL API \u672c\u8eab\u65e0\u8026\u5408\u2014\u2014HCL \u53ea\u8d1f\u8d23\u544a\u8bc9\u4f60&#034;\u8c01\u5f15\u7528\u4e86\u8c01&#034;\u3002<\/p>\n<h4>\u7b2c 4 \u6b65&#xff1a;\u7528\u589e\u91cf\u7ed3\u6784\u4ee3\u66ff\u76f4\u63a5\u4fee\u6539 EvalContext<\/h4>\n<p>\u6307\u5357\u7279\u522b\u63d0\u793a\u4e86\u4e00\u4e2a cty \u5c42\u9762\u7684\u5173\u952e\u7ea6\u675f&#xff1a;\u7531\u4e8e cty \u503c\u662f\u4e0d\u53ef\u53d8\u7684&#xff08;immutable&#xff09;&#xff0c;\u5728\u8fd9\u7c7b\u6e10\u8fdb\u6c42\u503c\u8fc7\u7a0b\u4e2d\u76f4\u63a5\u4fee\u6539 hcl.EvalContext \u91cc\u7684\u503c\u5e76\u4e0d\u65b9\u4fbf\u3002\u6b63\u786e\u505a\u6cd5\u662f\u6784\u9020\u4e00\u4e2a\u4e13\u7528\u6570\u636e\u7ed3\u6784&#xff0c;\u4e3a\u6bcf\u4e2a\u5bf9\u8c61\u5355\u72ec\u5b58\u653e\u5176\u503c&#xff1b;\u6bcf\u5f53\u6709\u65b0\u503c\u53ef\u7528\u65f6&#xff0c;\u91cd\u65b0\u57fa\u4e8e\u8be5\u7ed3\u6784\u6784\u9020\u4e00\u4e2a\u65b0\u7684\u6c42\u503c\u4e0a\u4e0b\u6587\u3002<\/p>\n<p>\u6307\u5357\u8fd8\u6307\u51fa&#xff0c;\u5728\u6b64\u573a\u666f\u4e0b\u4f7f\u7528 hcldec \u6765\u6c42\u503c\u5757 Body \u5c24\u5176\u987a\u624b&#xff0c;\u56e0\u4e3a\u5b83\u4ea7\u51fa cty.Value \u7ed3\u679c&#xff0c;\u53ef\u4ee5\u76f4\u63a5\u5408\u5e76\u8fdb\u6c42\u503c\u4e0a\u4e0b\u6587\u2014\u2014\u65e0\u9700\u4e2d\u95f4\u8f6c\u6362\u3002<\/p>\n<h3>\u6a21\u5f0f\u4e8c&#xff1a;\u5206\u5e03\u5f0f\u7cfb\u7edf&#xff08;Distributed Systems&#xff09;<\/h3>\n<p>\u5206\u5e03\u5f0f\u7cfb\u7edf\u5e26\u6765\u4e00\u7cfb\u5217\u989d\u5916\u6311\u6218&#xff0c;\u914d\u7f6e\u7ba1\u7406\u5f88\u5c11\u662f\u5176\u4e2d\u6700\u574f\u7684&#xff0c;\u4f46&#034;\u57fa\u4e8e HCL \u7684\u914d\u7f6e\u5728\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u4f7f\u7528&#034;\u786e\u5b9e\u6709\u4e00\u4e9b\u4e13\u95e8\u7684\u8003\u91cf\u3002\u6307\u5357\u5c06\u6b64\u8282\u9650\u5b9a\u5728\u4e00\u79cd\u573a\u666f&#xff1a;\u81f3\u5c11\u6709\u4e24\u4e2a\u72ec\u7acb\u7ec4\u4ef6\u90fd\u4f9d\u8d56\u540c\u4e00\u4efd HCL \u914d\u7f6e\u6587\u4ef6\u7684\u5185\u5bb9\u3002\u73b0\u5b9e\u4f8b\u5b50\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>HashiCorp Nomad&#xff1a;\u670d\u52a1\u5668\u7aef\u52a0\u8f7d\u914d\u7f6e&#xff08;job \u89c4\u8303&#xff09;&#xff0c;\u4f46\u5176\u5ba2\u6237\u7aef\u4e0e\u5404\u7c7b\u9a71\u52a8\u63d2\u4ef6\u4e5f\u9700\u8981\u8fd9\u4e9b\u7ed3\u679c&#xff1b;<\/li>\n<li>HashiCorp Terraform&#xff1a;\u5728 Terraform Core \u4e2d\u89e3\u6790\u914d\u7f6e&#xff0c;\u4f46\u53ef\u4ee5\u628a\u90e8\u5206\u6c42\u503c\u540e\u7684\u6267\u884c\u8ba1\u5212\u5199\u5230\u78c1\u76d8&#xff0c;\u4e4b\u540e\u5728\u72ec\u7acb\u8fdb\u7a0b\u4e2d\u7ee7\u7eed\u6c42\u503c&#xff1b;\u8fd8\u5fc5\u987b\u628a\u914d\u7f6e\u503c\u4f20\u7ed9 provider \u63d2\u4ef6\u3002<\/li>\n<\/ul>\n<p>\u56f4\u7ed5&#034;\u8ba9\u591a\u4e2a\u5b50\u7cfb\u7edf\u90fd\u80fd\u8bbf\u95ee\u914d\u7f6e&#034;&#xff0c;\u6307\u5357\u7ed9\u51fa\u4e24\u79cd\u601d\u8def&#xff1a;<\/p>\n<h4>2.1 \u63d0\u524d\u6c42\u503c&#xff08;Ahead-of-time Evaluation&#xff09;<\/h4>\n<p>\u63d0\u524d\u6c42\u503c\u662f\u6700\u7b80\u5355\u7684\u8def\u5f84&#xff1a;\u914d\u7f6e\u6587\u4ef6\u5728\u7cfb\u7edf\u5165\u53e3\u5904\u5b8c\u5168\u6c42\u503c&#xff0c;\u5b50\u7cfb\u7edf\u4e4b\u95f4\u53ea\u4f20\u9012\u6c42\u503c\u540e\u7684\u5e38\u91cf\u503c\u3002<\/p>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u76f8\u5bf9\u76f4\u63a5&#xff0c;\u56e0\u4e3a\u7ed3\u679c cty.Value \u53ea\u8981\u5404\u7ec4\u4ef6\u5bf9\u9884\u671f\u7684\u503c\u7c7b\u578b\u8fbe\u6210\u4e00\u81f4&#xff0c;\u5c31\u53ef\u4ee5\u65e0\u635f\u5730\u5e8f\u5217\u5316\u4e3a JSON \u6216 msgpack\u3002\u9664\u4e86\u628a\u8fd9\u4e9b\u503c\u5728&#034;\u7ebf\u4e0a\u4f20\u9012&#034;\u4e4b\u5916&#xff0c;\u914d\u7f6e\u7684\u89e3\u6790\u4e0e\u89e3\u7801\u6309\u5e38\u89c4\u6d41\u7a0b\u8fdb\u884c\u5373\u53ef\u3002<\/p>\n<p>\u6307\u5357\u8fdb\u4e00\u6b65\u89e3\u91ca\u4e86\u4e3a\u4ec0\u4e48 Nomad \u4e0e Terraform \u5728\u4e0e\u63d2\u4ef6\u4ea4\u4e92\u65f6\u90fd\u91c7\u7528\u8fd9\u79cd\u65b9\u5f0f&#xff1a;\u63d2\u4ef6\u7531\u4e92\u4e0d\u7d27\u5bc6\u534f\u8c03\u7684\u4e0d\u540c\u56e2\u961f\u7f16\u5199&#xff0c;\u628a\u8868\u8fbe\u5f0f\u6c42\u503c\u5168\u90e8\u653e\u5728\u6838\u5fc3\u5b50\u7cfb\u7edf\u5b8c\u6210&#xff0c;\u65e2\u80fd\u4fdd\u8bc1\u63d2\u4ef6\u95f4\u7684\u4e00\u81f4\u6027&#xff0c;\u4e5f\u7b80\u5316\u4e86\u63d2\u4ef6\u5f00\u53d1\u3002\u4e24\u4e2a\u5e94\u7528\u4e2d\u90fd\u7ea6\u5b9a&#xff1a;\u63d2\u4ef6\u7528\u5e94\u7528\u7279\u5b9a\u534f\u8bae\u63cf\u8ff0\u5b83\u8d1f\u8d23\u7684\u6bcf\u4e2a\u914d\u7f6e\u5143\u7d20\u6240\u671f\u671b\u7684 schema&#xff0c;\u6838\u5fc3\u5b50\u7cfb\u7edf\u4ee3\u66ff\u63d2\u4ef6\u5b8c\u6210\u89e3\u7801&#xff0c;\u5e76\u4f20\u9012\u4e00\u4e2a\u4fdd\u8bc1\u7b26\u5408\u8be5 schema \u7684\u503c\u3002<\/p>\n<p>\u5bf9\u7167 Havoc&#xff1a;profiles\/havoc.yaotl \u8fd9\u7c7b\u6587\u4ef6\u5c31\u662f\u5178\u578b\u7684&#034;\u5355\u8fdb\u7a0b\u5165\u53e3\u6c42\u503c&#034;\u2014\u2014teamserver \u542f\u52a8\u65f6\u4e00\u6b21\u6027\u628a\u6574\u4efd profile \u89e3\u7801\u4e3a HavocConfig&#xff0c;\u4e4b\u540e\u5404\u6a21\u5757&#xff08;\u76d1\u542c\u5668\u3001builder\u3001demon \u6784\u5efa\u7ba1\u7ebf&#xff09;\u6d88\u8d39\u7684\u53ea\u662f\u89e3\u7801\u540e\u7684 Go \u7ed3\u6784\u4f53\u5b57\u6bb5&#xff0c;\u8fd9\u6b63\u662f\u63d0\u524d\u6c42\u503c\u6a21\u5f0f\u7684\u4f53\u73b0\u3002<\/p>\n<h4>2.2 \u6e10\u8fdb\u6c42\u503c&#xff08;Gradual Evaluation&#xff09;<\/h4>\n<p>\u63d0\u524d\u6c42\u503c\u7684\u663e\u8457\u7f3a\u70b9\u662f&#xff1a;\u6240\u6709\u53ef\u7ecf\u53d8\u91cf\u6216\u51fd\u6570\u8bbf\u95ee\u7684\u6570\u636e&#xff0c;\u5fc5\u987b\u88ab\u6267\u884c\u521d\u59cb\u6c42\u503c\u7684\u90a3\u4e2a\u5b50\u7cfb\u7edf\u6240\u77e5\u3002\u6307\u5357\u4e3e\u4e86 Terraform \u7684\u4f8b\u5b50&#xff1a;plan \u5b50\u547d\u4ee4\u8d1f\u8d23\u6c42\u503c\u914d\u7f6e\u5e76\u5411\u7528\u6237\u5c55\u793a\u6267\u884c\u8ba1\u5212&#xff0c;\u4f46\u8ba1\u5212\u4e2d\u7684\u67d0\u4e9b\u503c\u8981\u7b49\u5230 apply \u9636\u6bb5\u624d\u80fd\u786e\u5b9a&#xff0c;\u56e0\u4e3a\u5177\u4f53\u503c\u53d6\u51b3\u4e8e\u8fdc\u7a0b API \u7684\u51b3\u7b56&#xff08;\u5982\u5bf9\u8c61\u7684 opaque id \u5206\u914d&#xff09;\u3002\u56e0\u6b64 plan \u4e0e apply \u4e24\u8005\u90fd\u5728\u6c42\u503c\u914d\u7f6e&#xff0c;apply \u9636\u6bb5\u62e5\u6709\u66f4\u5b8c\u6574\u7684\u8f93\u5165\u503c\u96c6\u3001\u4ea7\u51fa\u66f4\u5b8c\u6574\u7684\u7ed3\u679c&#xff1b;\u4f46\u8fd9\u5c31\u610f\u5473\u7740 Terraform \u5fc5\u987b\u8ba9 apply \u8fdb\u7a0b\u80fd\u591f\u8bbf\u95ee\u539f\u59cb\u914d\u7f6e\u4e2d\u7684\u8868\u8fbe\u5f0f\u3002<\/p>\n<p>\u6307\u5357\u7531\u6b64\u7ed9\u51fa\u4e24\u6761\u5de5\u7a0b\u7ecf\u9a8c&#xff1a;<\/p>\n<p>\u5176\u4e00&#xff0c;\u5b50\u7cfb\u7edf\u95f4\u4f20\u9012\u914d\u7f6e\u6e90\u7801\u3002 \u826f\u597d\u7684\u53ef\u7528\u6027\u8981\u6c42\u9519\u8bef\u4e0e\u8b66\u544a\u4fe1\u606f\u80fd\u591f\u6307\u56de\u8f93\u5165\u914d\u7f6e\u7684\u5177\u4f53\u4f4d\u7f6e\u4f5c\u4e3a\u4e0a\u4e0b\u6587&#xff0c;\u800c\u5b9e\u73b0\u8fd9\u4e00\u70b9\u6700\u597d\u7684\u529e\u6cd5\u5c31\u662f\u628a\u914d\u7f6e\u6e90\u7801\u5728\u5b50\u7cfb\u7edf\u4e4b\u95f4\u4f20\u9012\u2014\u2014\u8fd9\u901a\u5e38\u662f\u4fdd\u7559\u6e90\u7801\u4f4d\u7f6e\u4fe1\u606f\u7684\u6700\u7d27\u51d1\u8868\u793a&#xff0c;\u4e5f\u907f\u514d\u4e86\u5f15\u5165\u53e6\u4e00\u79cd\u4e2d\u95f4\u5e8f\u5217\u5316\u9020\u6210\u4e0d\u4e00\u81f4\u3002Terraform \u7684\u5e8f\u5217\u5316\u8ba1\u5212\u91cc\u5c31\u540c\u65f6\u5305\u542b\u4e24\u90e8\u5206&#xff1a;\u63cf\u8ff0 plan \u9636\u6bb5\u90e8\u5206\u6c42\u503c\u7ed3\u679c\u7684\u6570\u636e\u7ed3\u6784&#xff0c;\u4ee5\u53ca\u4ea7\u51fa\u8fd9\u4e9b\u7ed3\u679c\u7684\u539f\u59cb\u914d\u7f6e\u6587\u4ef6\u2014\u2014apply \u9636\u6bb5\u518d\u91cd\u65b0\u6c42\u503c\u3002<\/p>\n<p>\u5176\u4e8c&#xff0c;\u7528&#034;\u672a\u77e5\u503c&#034;&#xff08;unknown values&#xff09;\u5728\u6bcf\u4e00\u72b6\u6001\u5c3d\u53ef\u80fd\u9a8c\u8bc1\u914d\u7f6e\u6b63\u786e\u6027\u3002 cty \u6709 unknown value \u7684\u6982\u5ff5&#xff0c;\u53ef\u4ee5\u4ee3\u8868\u5e94\u7528\u5c1a\u4e0d\u77e5\u9053\u7684\u503c&#xff0c;\u540c\u65f6\u4fdd\u7559\u6b63\u786e\u7684\u7c7b\u578b\u4fe1\u606f\u3002HCL \u8868\u8fbe\u5f0f\u6c42\u503c\u9047\u5230 unknown \u503c\u65f6&#xff0c;\u4f1a\u6267\u884c\u7c7b\u578b\u68c0\u67e5&#xff0c;\u7136\u540e\u8fd4\u56de\u53e6\u4e00\u4e2a unknown \u503c&#xff0c;\u4ece\u800c\u8ba9 unknown \u81ea\u52a8\u7a7f\u8fc7\u8868\u8fbe\u5f0f\u4f20\u64ad&#xff1a;<\/p>\n<p>ctx :&#061; &amp;hcl.EvalContext{<br \/>\n    Variables: map[string]cty.Value{<br \/>\n        &#034;name&#034;: cty.UnknownVal(cty.String),<br \/>\n        &#034;age&#034;:  cty.UnknownVal(cty.Number),<br \/>\n    },<br \/>\n}<br \/>\nval, moreDiags :&#061; expr.Value(ctx)<br \/>\ndiags &#061; append(diags, moreDiags&#8230;)<\/p>\n<p>\u6bcf\u5f53\u8868\u8fbe\u5f0f\u5e26\u7740\u66f4\u591a\u4fe1\u606f\u88ab\u91cd\u65b0\u6c42\u503c\u65f6&#xff0c;\u8f93\u5165\u4e2d\u7684 unknown \u8d8a\u5c11&#xff0c;\u7ed3\u679c\u4e2d\u5df2\u77e5\u7684\u90e8\u5206\u5c31\u8d8a\u591a\u3002\u6700\u7ec8&#xff0c;\u5e94\u7528\u5e94\u5f53\u4ee5\u6ca1\u6709\u4efb\u4f55 unknown \u503c\u7684\u72b6\u6001\u6c42\u503c\u8868\u8fbe\u5f0f&#xff0c;\u8fd9\u65f6\u5c31\u80fd\u4fdd\u8bc1\u7ed3\u679c\u4e5f\u662f\u5b8c\u5168\u5df2\u77e5\u7684\u3002<\/p>\n<h3>\u6a21\u5f0f\u4e09&#xff1a;\u9759\u6001\u5f15\u7528\u3001\u8c03\u7528\u3001\u5217\u8868\u4e0e\u6620\u5c04&#xff08;Static References, Calls, Lists, and Maps&#xff09;<\/h3>\n<p>\u5927\u591a\u6570\u65f6\u5019&#xff0c;\u5e94\u7528\u66f4\u5173\u5fc3\u8868\u8fbe\u5f0f\u7684\u6700\u7ec8\u7ed3\u679c\u503c&#xff0c;\u800c\u4e0d\u5173\u5fc3\u503c\u662f\u5982\u4f55\u5f97\u5230\u7684\u2014\u2014\u67d0\u4e2a list \u53c2\u6570\u53ef\u4ee5\u7531\u5143\u7ec4\u6784\u9020\u5668\u3001for \u8868\u8fbe\u5f0f\u3001\u6216\u4e00\u4e2a\u5177\u5907 list \u7c7b\u578b\u7684\u53d8\u91cf\u8d4b\u503c\u6765\u5b9a\u4e49\u3002\u4f46\u5728\u67d0\u4e9b\u7279\u6b8a\u573a\u666f\u4e0b&#xff0c;\u8868\u8fbe\u5f0f\u7684\u7ed3\u6784\u6bd4\u7ed3\u679c\u503c\u66f4\u91cd\u8981&#xff0c;\u751a\u81f3\u67d0\u4e2a\u8868\u8fbe\u5f0f\u6839\u672c\u6ca1\u6709\u5408\u7406\u7684\u7ed3\u679c\u503c\u3002<\/p>\n<p>\u6307\u5357\u4ee5 Terraform \u4e3a\u4f8b&#xff1a;\u5c11\u6570\u53c2\u6570\u8981\u6c42\u7528\u6237\u6309\u5f15\u7528\u547d\u540d\u53e6\u4e00\u4e2a\u5bf9\u8c61&#xff0c;\u800c\u4e0d\u662f\u63d0\u4f9b\u5bf9\u8c61\u503c&#xff1a;<\/p>\n<p>resource &#034;cloud_network&#034; &#034;example&#034; {<br \/>\n  # &#8230;<br \/>\n}<\/p>\n<p>resource &#034;cloud_subnet&#034; &#034;example&#034; {<br \/>\n  cidr_block &#061; &#034;10.1.2.0\/24&#034;<\/p>\n<p>  depends_on &#061; [<br \/>\n    cloud_network.example,<br \/>\n  ]<br \/>\n}<\/p>\n<p>\u7b2c\u4e8c\u4e2a resource \u5757\u91cc\u7684 depends_on \u53c2\u6570\u770b\u8d77\u6765\u50cf\u4e00\u4e2a\u4f1a\u6784\u9020\u5355\u5143\u7d20\u5143\u7ec4&#xff08;\u5185\u542b\u7b2c\u4e00\u4e2a resource \u5757\u5bf9\u8c61\u8868\u793a&#xff09;\u7684\u8868\u8fbe\u5f0f&#xff0c;\u4f46 Terraform \u7528\u5b83\u6765\u6784\u5efa\u4f9d\u8d56\u56fe\u2014\u2014\u5b83\u9700\u8981\u770b\u5230&#034;\u8fd9\u4e2a\u8868\u8fbe\u5f0f\u5f15\u7528\u4e86 cloud_network.example&#034;\u8fd9\u4e00\u4e8b\u5b9e&#xff0c;\u800c\u4e0d\u662f\u53bb\u6c42\u51fa\u4e00\u4e2a\u7ed3\u679c\u503c\u3002<\/p>\n<p>\u9488\u5bf9\u8fd9\u7c7b\u573a\u666f&#xff0c;HCL \u5728 hcl \u5305\u4e2d\u63d0\u4f9b\u4e86\u4e00\u7ec4&#034;\u9759\u6001\u5206\u6790&#034;\u51fd\u6570\u3002\u5b83\u4eec\u7684\u5171\u540c\u70b9&#xff1a;\u6bcf\u4e2a\u51fd\u6570\u90fd\u5bf9\u6240\u7ed9\u8868\u8fbe\u5f0f\u7684\u8bed\u6cd5\u6811\u65bd\u52a0\u7279\u5b9a\u7ea6\u675f&#xff0c;\u82e5\u8868\u8fbe\u5f0f\u7b26\u5408\u7ea6\u675f\u5219\u8fd4\u56de\u57fa\u4e8e\u8be5\u7ea6\u675f\u63a8\u5bfc\u51fa\u7684\u7ed3\u679c&#xff1b;\u4e0d\u7b26\u5408\u5219\u8fd4\u56de\u9519\u8bef\u8bca\u65ad&#xff08;Diagnostics&#xff09;&#xff0c;\u6b64\u65f6\u7ed3\u679c\u65e0\u6548\u3001\u4e0d\u5e94\u4f7f\u7528\u3002\u4ee5\u4e0b\u9010\u4e00\u4ecb\u7ecd&#xff0c;\u5e76\u7ed9\u51fa\u4ed3\u5e93\u4e2d\u7684\u5b9e\u73b0\u4f4d\u7f6e\u3002<\/p>\n<h4>ExprAsKeyword(expr Expression) string<\/h4>\n<p>\u5c1d\u8bd5\u628a\u8868\u8fbe\u5f0f\u89e3\u91ca\u4e3a\u5355\u4e2a\u5173\u952e\u5b57&#xff0c;\u6210\u529f\u5219\u8fd4\u56de\u8be5\u5173\u952e\u5b57\u5b57\u7b26\u4e32\u3002<\/p>\n<ul>\n<li>&#034;\u5173\u952e\u5b57&#034;\u6307\u53ef\u7406\u89e3\u4e3a\u6709\u6548\u5355\u4e2a\u6807\u8bc6\u7b26\u7684\u8868\u8fbe\u5f0f&#xff1a;\u7b80\u5355\u53d8\u91cf\u5f15\u7528 foo \u53ef\u4ee5&#xff0c;\u800c foo.bar \u4e0d\u884c&#xff1b;<\/li>\n<li>\u7279\u4f8b&#xff1a;\u8bed\u8a00\u7ea7\u5173\u952e\u5b57 true\u3001false\u3001null \u4e5f\u88ab\u89c6\u4e3a\u5408\u6cd5\u5173\u952e\u5b57&#xff0c;\u8ba9\u8c03\u7528\u65b9\u53ef\u4ee5\u65e0\u89c6\u5176\u901a\u5e38\u8bed\u4e49&#xff1b;<\/li>\n<li>\u82e5\u8868\u8fbe\u5f0f\u65e0\u6cd5\u7f29\u51cf\u4e3a\u5355\u4e2a\u5173\u952e\u5b57&#xff0c;\u8fd4\u56de\u7a7a\u5b57\u7b26\u4e32\u2014\u2014\u7531\u4e8e\u7a7a\u5b57\u7b26\u4e32\u6c38\u8fdc\u4e0d\u662f\u5408\u6cd5\u5173\u952e\u5b57&#xff0c;\u8fd9\u4e00\u7ed3\u679c\u65e0\u6b67\u4e49\u5730\u8868\u793a\u5931\u8d25\u3002<\/li>\n<\/ul>\n<p>\u5b9e\u73b0\u4f4d\u4e8e teamserver\/pkg\/profile\/yaotl\/traversal_for_expr.go\u3002\u4ece\u6e90\u7801\u7ed3\u6784\u770b&#xff0c;\u5b83\u662f AbsTraversalForExpr \u7684\u53d8\u4f53&#xff1a;\u590d\u7528\u540c\u4e00\u5957 AsTraversal() \u63a5\u53e3&#xff0c;\u4ec5\u5f53\u904d\u5386\u957f\u5ea6\u6070\u597d\u4e3a 1 \u65f6\u8fd4\u56de RootName()&#xff0c;\u5426\u5219\u8fd4\u56de\u7a7a\u4e32\u3002\u6ce8\u91ca\u4e2d\u7ed9\u51fa\u4e86\u63a8\u8350\u60ef\u7528\u6cd5\u2014\u2014\u914d\u5408 switch \u8bc6\u522b\u56fa\u5b9a\u5173\u952e\u5b57\u96c6\u5408&#xff1a;<\/p>\n<p>switch hcl.ExprAsKeyword(expr) {<br \/>\ncase &#034;allow&#034;:<br \/>\n    \/\/ &#xff08;\u5bf9\u5173\u952e\u5b57 &#034;allow&#034; \u91c7\u53d6\u9002\u5f53\u52a8\u4f5c&#xff09;<br \/>\ncase &#034;deny&#034;:<br \/>\n    \/\/ &#xff08;\u5bf9\u5173\u952e\u5b57 &#034;deny&#034; \u91c7\u53d6\u9002\u5f53\u52a8\u4f5c&#xff09;<br \/>\ndefault:<br \/>\n    diags &#061; append(diags, &amp;hcl.Diagnostic{<br \/>\n        \/\/ &#8230; &#034;invalid keyword&#034; \u8bca\u65ad\u4fe1\u606f &#8230;<br \/>\n    })<br \/>\n}<\/p>\n<p>\u8fd9\u79cd\u5199\u6cd5\u5bf9&#034;\u7528\u4e86\u672a\u8bc6\u522b\u5173\u952e\u5b57&#034;\u4e0e&#034;\u6839\u672c\u6ca1\u4f7f\u7528\u5173\u952e\u5b57&#034;\u4f1a\u7ed9\u51fa\u76f8\u540c\u62a5\u9519&#xff0c;\u5728\u62a5\u9519\u4fe1\u606f\u660e\u786e\u8bf4\u660e&#034;\u6b64\u5904\u5fc5\u987b\u662f\u67d0\u4e2a\u56fa\u5b9a\u5217\u8868\u4e2d\u7684\u5173\u952e\u5b57&#034;\u65f6\u901a\u5e38\u662f\u5408\u7406\u7684\u3002\u6ce8\u91ca\u8fd8\u63d0\u9192&#xff1a;\u7531\u4e8e\u628a\u8868\u8fbe\u5f0f\u89e3\u91ca\u4e3a\u5173\u952e\u5b57\u4f1a\u7ed5\u8fc7\u5e38\u89c4\u6c42\u503c&#xff0c;\u5e94\u8c28\u614e\u5730\u4ec5\u7528\u4e8e&#034;\u67d0\u4e2a\u7279\u6b8a\u5c5e\u6027\u4ee5\u7ed3\u6784\u5316\u7684\u65b9\u5f0f\u4f7f\u7528\u56fa\u5b9a\u5173\u952e\u5b57\u96c6\u5408\u6765\u5f71\u54cd\u5757\u7684\u540e\u7eed\u5904\u7406&#034;\u7684\u573a\u666f\u3002<\/p>\n<h4>AbsTraversalForExpr(expr Expression) (Traversal, Diagnostics)<\/h4>\n<p>ExprAsKeyword \u7684\u6cdb\u5316&#xff1a;\u63a5\u53d7\u4efb\u4f55\u53ef\u89e3\u91ca\u4e3a\u904d\u5386&#xff08;traversal&#xff09;\u7684\u8868\u8fbe\u5f0f\u2014\u2014\u53d8\u91cf\u540d\u540e\u8ddf\u96f6\u4e2a\u6216\u591a\u4e2a\u4ee5\u5e38\u91cf\u4e3a\u64cd\u4f5c\u6570\u7684\u5c5e\u6027\u8bbf\u95ee\u6216\u7d22\u5f15\u8fd0\u7b97\u7b26\u3002<\/p>\n<ul>\n<li>foo\u3001foo.bar\u3001foo[0] \u90fd\u662f\u5408\u6cd5\u904d\u5386&#xff1b;<\/li>\n<li>foo[bar] \u4e0d\u5408\u6cd5&#xff0c;\u56e0\u4e3a bar \u7d22\u5f15\u975e\u5e38\u91cf\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u6b63\u662f Terraform \u7528\u6765\u89e3\u8bfb\u4e0a\u9762 depends_on \u5e8f\u5217\u4e2d\u6bcf\u4e00\u9879\u7684\u51fd\u6570\u3002\u4e0e ExprAsKeyword \u4e00\u6837\u5b58\u5728\u7279\u4f8b&#xff1a;true\u3001false\u3001null \u4f1a\u88ab\u5f53\u4f5c\u53d8\u91cf\u540d\u63a5\u53d7&#xff0c;\u4f7f\u5f97 null.foo \u53ef\u4ee5\u88ab\u89e3\u91ca\u4e3a\u904d\u5386&#xff0c;\u5c3d\u7ba1\u5b83\u5728\u6c42\u503c\u65f6\u662f\u975e\u6cd5\u7684\u3002\u8fd4\u56de\u9519\u8bef\u8bca\u65ad\u65f6&#xff0c;\u904d\u5386\u7ed3\u679c\u65e0\u6548\u3001\u4e0d\u5e94\u4f7f\u7528\u3002<\/p>\n<p>\u5b9e\u73b0\u540c\u6837\u5728 traversal_for_expr.go \u4e2d&#xff1a;\u51fd\u6570\u5148\u7ecf UnwrapExpressionUntil \u5265\u79bb\u8868\u8fbe\u5f0f\u5305\u88c5&#xff0c;\u518d\u5c1d\u8bd5\u65ad\u8a00\u5185\u90e8\u7684 AsTraversal() \u63a5\u53e3\u3002\u5931\u8d25\u65f6\u7684\u8bca\u65ad\u4fe1\u606f\u672c\u8eab\u4e5f\u662f\u4e00\u4efd\u5f88\u597d\u7684\u6587\u6863&#xff1a;<\/p>\n<p>&#034;A single static variable reference is required: only attribute access and indexing with constant keys. No calculations, function calls, template expressions, etc are allowed here.&#034;<\/p>\n<h4>RelTraversalForExpr(expr Expression) (Traversal, Diagnostics)<\/h4>\n<p>\u4e0e AbsTraversalForExpr \u975e\u5e38\u76f8\u4f3c&#xff0c;\u4f46\u8fd4\u56de\u76f8\u5bf9\u904d\u5386&#xff1a;\u5176\u9996\u4e2a\u540d\u5b57\u88ab\u89c6\u4e3a\u67d0\u4e2a&#xff08;\u9690\u542b\u7684&#xff09;\u5176\u5b83\u5bf9\u8c61\u7684\u5c5e\u6027\u3002\u5904\u7406\u89c4\u5219\u4e0e\u7edd\u5bf9\u7248\u5b8c\u5168\u76f8\u540c&#xff0c;\u552f\u4e00\u4f8b\u5916\u662f\u2014\u2014\u8fd4\u56de\u904d\u5386\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u88ab\u6807\u8bb0\u4e3a\u5c5e\u6027&#xff08;TraverseAttr&#xff09;\u800c\u975e\u6839\u53d8\u91cf&#xff08;TraverseRoot&#xff09;\u3002\u6e90\u7801\u4e2d\u53ef\u4ee5\u770b\u5230\u5b83\u76f4\u63a5\u590d\u7528\u7edd\u5bf9\u7248\u7684\u7ed3\u679c&#xff0c;\u518d\u628a traversal[0] \u4ece TraverseRoot \u8f6c\u6362\u4e3a TraverseAttr&#xff1a;<\/p>\n<p>func RelTraversalForExpr(expr Expression) (Traversal, Diagnostics) {<br \/>\n    traversal, diags :&#061; AbsTraversalForExpr(expr)<br \/>\n    if len(traversal) &gt; 0 {<br \/>\n        ret :&#061; make(Traversal, len(traversal))<br \/>\n        copy(ret, traversal)<br \/>\n        root :&#061; traversal[0].(TraverseRoot)<br \/>\n        ret[0] &#061; TraverseAttr{<br \/>\n            Name:     root.Name,<br \/>\n            SrcRange: root.SrcRange,<br \/>\n        }<br \/>\n        return ret, diags<br \/>\n    }<br \/>\n    return traversal, diags<br \/>\n}<\/p>\n<h4>ExprList(expr Expression) ([]Expression, Diagnostics)<\/h4>\n<p>\u8981\u6c42\u7ed9\u5b9a\u8868\u8fbe\u5f0f\u662f\u5143\u7ec4\u6784\u9020\u5668&#xff08;tuple constructor&#xff09;&#xff0c;\u82e5\u662f\u5219\u8fd4\u56de\u5176\u4e2d\u5143\u7d20\u8868\u8fbe\u5f0f\u7684\u5207\u7247&#xff1b;\u5e94\u7528\u53ef\u4ee5\u5bf9\u5176\u505a\u8fdb\u4e00\u6b65\u9759\u6001\u5206\u6790&#xff0c;\u4e5f\u53ef\u4ee5\u50cf\u5f80\u5e38\u4e00\u6837\u6c42\u503c\u3002\u8fd4\u56de\u9519\u8bef\u8bca\u65ad\u65f6\u7ed3\u679c\u65e0\u6548\u3002<\/p>\n<p>Terraform \u6b63\u662f\u5148\u7528\u5b83\u89e3\u8bfb depends_on \u6240\u8d4b\u7684\u8868\u8fbe\u5f0f&#xff0c;\u518d\u5bf9\u6bcf\u4e2a\u5185\u90e8\u8868\u8fbe\u5f0f\u8c03\u7528 AbsTraversalForExpr\u2014\u2014\u5373&#034;\u5916\u5c42\u62c6\u5217\u8868\u3001\u5185\u5c42\u53d6\u5f15\u7528&#034;\u7684\u4e24\u6bb5\u5f0f\u9759\u6001\u5206\u6790\u3002\u5b9e\u73b0\u89c1 teamserver\/pkg\/profile\/yaotl\/expr_list.go&#xff1a;\u7ecf UnwrapExpressionUntil \u627e\u5230\u652f\u6301 ExprList() []Expression \u65b9\u6cd5\u7684\u7269\u7406\u8868\u8fbe\u5f0f&#xff0c;\u63d0\u53d6\u5931\u8d25\u5219\u8fd4\u56de&#034;A static list expression is required.&#034;\u8bca\u65ad\u3002<\/p>\n<h4>ExprMap(expr Expression) ([]KeyValuePair, Diagnostics)<\/h4>\n<p>\u8981\u6c42\u8868\u8fbe\u5f0f\u662f\u5bf9\u8c61\u6784\u9020\u5668&#xff08;object constructor&#xff09;&#xff0c;\u82e5\u662f\u5219\u8fd4\u56de\u5143\u7d20\u952e\/\u503c\u5bf9\u7684\u5207\u7247&#xff08;KeyValuePair \u4e3a Key\/Value \u4e24\u4e2a Expression&#xff09;&#xff0c;\u540c\u6837\u53ef\u8fdb\u4e00\u6b65\u9759\u6001\u5206\u6790\u6216\u7167\u5e38\u6c42\u503c&#xff1b;\u8fd4\u56de\u9519\u8bef\u8bca\u65ad\u65f6\u7ed3\u679c\u65e0\u6548\u3002\u5b9e\u73b0\u4e0e KeyValuePair \u7c7b\u578b\u5b9a\u4e49\u89c1 teamserver\/pkg\/profile\/yaotl\/expr_map.go\u3002<\/p>\n<h4>ExprCall(expr Expression) (*StaticCall, Diagnostics)<\/h4>\n<p>\u8981\u6c42\u8868\u8fbe\u5f0f\u662f\u51fd\u6570\u8c03\u7528&#xff0c;\u82e5\u662f\u5219\u8fd4\u56de\u63cf\u8ff0\u88ab\u8c03\u7528\u51fd\u6570\u540d\u53ca\u5176\u53c2\u6570\u8868\u8fbe\u5f0f\u7684\u5bf9\u8c61\u3002\u5b9e\u73b0\u89c1 teamserver\/pkg\/profile\/yaotl\/expr_call.go&#xff0c;\u8fd4\u56de\u7684 StaticCall \u7ed3\u6784\u4f53\u643a\u5e26\u4e86\u5b8c\u6574\u7684\u6e90\u7801\u4f4d\u7f6e\u4fe1\u606f&#xff0c;\u53ef\u4f9b\u8bca\u65ad\u4f7f\u7528&#xff1a;<\/p>\n<p>\/\/ StaticCall \u8868\u793a\u901a\u8fc7 ExprCall \u4ece\u8868\u8fbe\u5f0f\u4e2d\u9759\u6001\u63d0\u53d6\u51fa\u7684\u51fd\u6570\u8c03\u7528<br \/>\ntype StaticCall struct {<br \/>\n    Name      string<br \/>\n    NameRange Range<br \/>\n    Arguments []Expression<br \/>\n    ArgsRange Range<br \/>\n}<\/p>\n<h4>Variables \u65b9\u6cd5&#xff1a;\u5185\u5efa\u7684&#034;\u9759\u6001\u5206\u6790&#034;\u57fa\u7840\u80fd\u529b<\/h4>\n<p>hcl.Expression \u4e0a\u7684 Variables \u65b9\u6cd5\u4e5f\u88ab\u89c6\u4e3a&#034;\u9759\u6001\u5206\u6790&#034;\u8f85\u52a9&#xff0c;\u4e14\u56e0\u4e3a\u88ab\u5185\u5efa\u4e3a\u57fa\u672c\u7279\u6027\u2014\u2014\u5f15\u7528\u53d8\u91cf\u7684\u5206\u6790\u5bf9\u9759\u6001\u6821\u9a8c\u4ee5\u53ca\u4e0a\u6587&#034;\u76f8\u4e92\u4f9d\u8d56\u7684\u5757&#034;\u6a21\u5f0f\u7684\u5b9e\u73b0\u90fd\u5f88\u91cd\u8981\u3002\u6b64\u5916&#xff0c;hcl \u5305\u8fd8\u63d0\u4f9b static_expr.go \u4e2d\u7684 StaticExpr(val cty.Value, rng Range) \u5de5\u5177&#xff1a;\u8fd4\u56de\u4e00\u4e2a\u6052\u7b49\u4e8e\u7ed9\u5b9a\u503c\u7684 Expression&#xff0c;\u7528\u4e8e\u66ff\u6362\u914d\u7f6e\u4e2d\u672a\u663e\u5f0f\u7ed9\u51fa\u7684\u9ed8\u8ba4\u503c\u8868\u8fbe\u5f0f&#xff08;\u6b64\u65f6\u539f\u672c\u6ca1\u6709 Expression \u53ef\u8fd4\u56de&#xff09;&#xff0c;\u8c03\u7528\u65b9\u5fc5\u987b\u4e3a\u5176\u63d0\u4f9b\u4e00\u4e2a\u6e90\u7801\u8303\u56f4&#xff08;\u53ef\u4ee5\u662f\u5408\u6210\u7684\u7a7a\u6587\u4ef6\u540d\u8303\u56f4&#xff09;\u3002<\/p>\n<h3>\u4e09\u5927\u6a21\u5f0f\u5c0f\u7ed3\u4e0e\u5728 Havoc \u4e2d\u7684\u9002\u7528\u8fb9\u754c<\/h3>\n<table>\n<tr>\u6a21\u5f0f\u89e6\u53d1\u573a\u666f\u6838\u5fc3\u673a\u5236\u4ed3\u5e93\u4e2d\u7684\u5bf9\u5e94\u5b9e\u73b0<\/tr>\n<tbody>\n<tr>\n<td>\u76f8\u4e92\u4f9d\u8d56\u7684\u5757<\/td>\n<td>\u4e00\u4e2a\u5757\u5f15\u7528\u7684\u53d8\u91cf\u7531\u5176\u5b83\u5757\u5b9a\u4e49<\/td>\n<td>gohcl remain \u6807\u7b7e\u9694\u79bb\u9876\u5c42 \u2192 Variables \u68c0\u51fa\u5f15\u7528 \u2192 \u4f9d\u8d56\u56fe\u62d3\u6251\u6392\u5e8f \u2192 \u9010\u503c\u91cd\u5efa EvalContext<\/td>\n<td>hcldec\/variables.go\u3001hclsyntax\/variables.go<\/td>\n<\/tr>\n<tr>\n<td>\u5206\u5e03\u5f0f\u7cfb\u7edf<\/td>\n<td>\u591a\u4e2a\u5b50\u7cfb\u7edf\/\u8fdb\u7a0b\u6d88\u8d39\u540c\u4e00\u4efd\u914d\u7f6e<\/td>\n<td>\u63d0\u524d\u6c42\u503c&#xff08;cty.Value \u5e8f\u5217\u5316\u4e3a JSON\/msgpack \u4f20\u9012&#xff09;\u6216\u6e10\u8fdb\u6c42\u503c&#xff08;\u4f20\u9012\u914d\u7f6e\u6e90\u7801 &#043; unknown values \u4f20\u64ad&#xff09;<\/td>\n<td>hclsimple\/hclsimple.go \u4f53\u73b0\u4e00\u6b21\u6027\u63d0\u524d\u6c42\u503c<\/td>\n<\/tr>\n<tr>\n<td>\u9759\u6001\u5f15\u7528<\/td>\n<td>\u9700\u8981\u8868\u8fbe\u5f0f\u7ed3\u6784\u800c\u975e\u7ed3\u679c\u503c&#xff08;\u5982\u4f9d\u8d56\u58f0\u660e\u3001\u56fa\u5b9a\u5173\u952e\u5b57&#xff09;<\/td>\n<td>ExprAsKeyword \/ AbsTraversalForExpr \/ RelTraversalForExpr \/ ExprList \/ ExprMap \/ ExprCall<\/td>\n<td>traversal_for_expr.go\u3001expr_list.go\u3001expr_map.go\u3001expr_call.go<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5c31\u5f53\u524d\u4ed3\u5e93\u800c\u8a00&#xff0c;Havoc teamserver \u7684\u914d\u7f6e\u89e3\u7801\u8d70\u7684\u662f hclsimple \u7684\u4e00\u6b65\u5f0f\u8def\u7ebf&#xff08;SetProfile \u2192 DecodeFile \u2192 HavocConfig&#xff09;&#xff0c;\u9759\u6001\u4f5c\u7528\u57df\u5373\u53ef\u6ee1\u8db3\u9700\u6c42\u3002\u4f46\u4ed3\u5e93\u5b8c\u6574\u4fdd\u7559\u4e86 hcldec\u3001hclsyntax\u3001gohcl \u7b49\u4e0b\u5c42 API&#xff0c;\u4e0a\u8ff0\u4e09\u79cd\u6a21\u5f0f\u6b63\u662f\u5f53\u914d\u7f6e\u8bed\u8a00\u9700\u6c42\u589e\u957f&#xff08;\u4f8b\u5982 profile \u4e2d\u5f15\u5165\u8de8\u5757\u5f15\u7528\u3001\u6216\u9700\u8981\u628a\u90e8\u5206\u89e3\u7801\u4ea7\u7269\u4f20\u9012\u7ed9\u72ec\u7acb\u6784\u5efa\u8fdb\u7a0b&#xff09;\u65f6\u53ef\u7528\u7684\u5347\u7ea7\u8def\u5f84\u3002\u7406\u89e3\u8fd9\u4efd\u6307\u5357&#xff0c;\u5c31\u7406\u89e3\u4e86 Havoc .yaotl \u914d\u7f6e\u6587\u4ef6\u4ece\u6587\u672c\u5230 HavocConfig \u7ed3\u6784\u4f53\u80cc\u540e\u90a3\u5957 HCL \u89e3\u7801\u4f53\u7cfb\u7684\u80fd\u529b\u8fb9\u754c\u4e0e\u6269\u5c55\u65b9\u5411\u3002<\/p>\n<p>  <img loading=\"lazy\" decoding=\"async\" class=\"gcb-icon-like\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261001232500-6abeebcc74289.svg\" alt=\"\" width=\"16\" height=\"16\" \/> <span class=\"gcb-like-text\">\u8d5e<\/span>  <\/p>\n<p>   <span class=\"gcb-share-text\">\u5206\u4eab<\/span>  <\/p>\n<ul class=\"gcb-tag-list\">\n<li><span class=\"gcb-tag\">\u7f51\u7edc\u5b89\u5168<\/span><\/li>\n<\/ul>\n<h3 class=\"gcb-project-title\">\u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011Havoc<\/h3>\n<p class=\"gcb-project-desc\">The Havoc Framework<\/p>\n<p>    <span class=\"gcb-project-addr-label\">\u9879\u76ee\u5730\u5740&#xff1a;<\/span><br \/>\n    <span class=\"gcb-project-addr-link\">https:\/\/gitcode.com\/gh_mirrors\/ha\/Havoc<\/span> <\/p>\n<p>  <span class=\"gcb-project-btn\"> <span class=\"gcb-project-btn-main\">\u70b9\u51fb\u67e5\u770b<\/span> <span class=\"gcb-project-btn-sub\">\u514d\u8d39\u4e0b\u8f7d<\/span> <\/span> <\/p>\n<h4 class=\"gcb-related-title\">\u76f8\u5173\u63a8\u8350<\/h4>\n<ul class=\"gcb-related-list\">\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">Havoc TeamServer \u914d\u7f6e\u5b50\u7cfb\u7edf\u5b9e\u8df5&#xff1a;\u5728 Go \u5e94\u7528\u4e2d\u4f7f\u7528 yaotl&#xff08;HCL&#xff09;\u5e93\u89e3\u6790\u4e0e\u89e3\u7801\u914d\u7f6e\u6587\u4ef6<\/h5>\n<p class=\"gcb-related-item-desc\">Havoc TeamServer \u914d\u7f6e\u5b50\u7cfb\u7edf\u5b9e\u8df5&#xff1a;\u5728 Go \u5e94\u7528\u4e2d\u4f7f\u7528 yaotl&#xff08;HCL&#xff09;\u5e93\u89e3\u6790\u4e0e\u89e3\u7801\u914d\u7f6e\u6587\u4ef6 \u672c\u7bc7\u6280\u672f\u6587\u7ae0\u56f4\u7ed5 Havoc \u4ed3\u5e93\u4e2d\u5185\u7f6e\u7684\u914d\u7f6e<\/p>\n<p>     <span class=\"gcb-tag\">\u7f51\u7edc\u5b89\u5168<\/span>\n      <\/li>\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">Havoc Teamserver \u914d\u7f6e\u89e3\u6790\u6df1\u5165&#xff1a;yaotl \u4f4e\u5c42 HCL \u89e3\u7801 API&#xff08;hcl.Body \u4e0e hcl.Expression&#xff09;\u89e3\u6790\u6307\u5357<\/h5>\n<p class=\"gcb-related-item-desc\">Havoc Teamserver \u914d\u7f6e\u89e3\u6790\u6df1\u5165&#xff1a;yaotl \u4f4e\u5c42 HCL \u89e3\u7801 API&#xff08;hcl.Body \u4e0e hcl.Expression&#xff09;\u89e3\u6790\u6307\u5357 \u672c\u7bc7\u57fa\u4e8e <\/p>\n<p>     <span class=\"gcb-tag\">\u7f51\u7edc\u5b89\u5168<\/span>\n      <\/li>\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\"> HCL hclwrite\u7f16\u7a0b\u5f0f\u751f\u6210&#xff1a;\u52a8\u6001\u521b\u5efa\u548c\u4fee\u6539HCL\u914d\u7f6e\u7684\u7ec8\u6781\u6307\u5357<\/h5>\n<p class=\"gcb-related-item-desc\">HCL hclwrite\u7f16\u7a0b\u5f0f\u751f\u6210&#xff1a;\u52a8\u6001\u521b\u5efa\u548c\u4fee\u6539HCL\u914d\u7f6e\u7684\u7ec8\u6781\u6307\u5357 HCL&#xff08;HashiCorp\u914d\u7f6e\u8bed\u8a00&#xff09;\u662fTerraform\u3001Packer\u7b49DevOps\u5de5\u5177<\/p>\n<p>     <span class=\"gcb-tag\">\u5f00\u53d1\u5de5\u5177<\/span>\n      <\/li>\n<\/ul>\n<p>  <span class=\"gcb-prev-next-label\">\u4e0a\u4e00\u7bc7&#xff1a;<\/span><br \/>\n  \u82f1\u6587\u5199\u4f5c\u603b\u88ab\u6311\u523a&#xff1f;Harper \u8fd9\u6b3e\u79bb\u7ebf\u8bed\u6cd5\u68c0\u67e5\u5de5\u5177&#xff0c;\u4e09\u5206\u949f\u5c31\u80fd\u4e0a\u624b <\/p>\n<p>  <span class=\"gcb-prev-next-label\">\u4e0b\u4e00\u7bc7&#xff1a;<\/span><br \/>\n   3\u5927\u540e\u53f0\u5f00\u53d1\u75db\u70b9&#xff0c;\u8fd9\u4e2a\u5f00\u6e90\u6846\u67b6\u5982\u4f55\u8ba9\u6548\u7387\u63d0\u5347200%&#xff1f; <\/p>\n<p>\u521b\u4f5c\u58f0\u660e\uff1a\u672c\u6587\u90e8\u5206\u5185\u5bb9\u7531AI\u8f85\u52a9\u751f\u6210\uff08AIGC\uff09\uff0c\u4ec5\u4f9b\u53c2\u8003<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7f51\u7edc\u5b89\u5168 \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011Havoc The Havoc Framework \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/gh_mirrors\/ha\/Havoc \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d  \u672c\u6587\u57fa\u4e8e Havoc \u6846\u67b6 teamserver \u5185\u5d4c\u7684 HCL \u89e3\u6790\u5e93&#xff08;teamserver\/pkg\/profile\/yaotl\/&#xff0c;\u5373 hashicorp\/go-cty \u751f\u6001\u7684 HCL \u5e93 vendored \u526f\u672c&#xff09;\u4e2d\u7684\u5b98\u65b9\u6307\u5357\u7ae0\u8282<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-111920","post","type-post","status-publish","format-standard","hentry","category-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Havoc \u56e2\u961f\u670d\u52a1\u5668\u7684 HCL \u914d\u7f6e\u89e3\u7801\u8fdb\u9636\uff1aHCL \u5b98\u65b9\u6307\u5357\u4e2d\u7684\u4e09\u5927\u590d\u6742\u7cfb\u7edf\u8bbe\u8ba1\u6a21\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/111920.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Havoc \u56e2\u961f\u670d\u52a1\u5668\u7684 HCL \u914d\u7f6e\u89e3\u7801\u8fdb\u9636\uff1aHCL \u5b98\u65b9\u6307\u5357\u4e2d\u7684\u4e09\u5927\u590d\u6742\u7cfb\u7edf\u8bbe\u8ba1\u6a21\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u7f51\u7edc\u5b89\u5168 \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011Havoc The Havoc Framework \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/gh_mirrors\/ha\/Havoc \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d \u672c\u6587\u57fa\u4e8e Havoc \u6846\u67b6 teamserver \u5185\u5d4c\u7684 HCL \u89e3\u6790\u5e93&#xff08;teamserver\/pkg\/profile\/yaotl\/&#xff0c;\u5373 hashicorp\/go-cty \u751f\u6001\u7684 HCL \u5e93 vendored \u526f\u672c&#xff09;\u4e2d\u7684\u5b98\u65b9\u6307\u5357\u7ae0\u8282\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/111920.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-01T23:25:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261001232500-6abeebcc74289.svg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/111920.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/111920.html\",\"name\":\"Havoc \u56e2\u961f\u670d\u52a1\u5668\u7684 HCL \u914d\u7f6e\u89e3\u7801\u8fdb\u9636\uff1aHCL \u5b98\u65b9\u6307\u5357\u4e2d\u7684\u4e09\u5927\u590d\u6742\u7cfb\u7edf\u8bbe\u8ba1\u6a21\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-01T23:25:01+00:00\",\"dateModified\":\"2026-10-01T23:25:01+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/111920.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/111920.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/111920.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Havoc \u56e2\u961f\u670d\u52a1\u5668\u7684 HCL \u914d\u7f6e\u89e3\u7801\u8fdb\u9636\uff1aHCL \u5b98\u65b9\u6307\u5357\u4e2d\u7684\u4e09\u5927\u590d\u6742\u7cfb\u7edf\u8bbe\u8ba1\u6a21\u5f0f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Havoc \u56e2\u961f\u670d\u52a1\u5668\u7684 HCL \u914d\u7f6e\u89e3\u7801\u8fdb\u9636\uff1aHCL \u5b98\u65b9\u6307\u5357\u4e2d\u7684\u4e09\u5927\u590d\u6742\u7cfb\u7edf\u8bbe\u8ba1\u6a21\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/111920.html","og_locale":"zh_CN","og_type":"article","og_title":"Havoc \u56e2\u961f\u670d\u52a1\u5668\u7684 HCL \u914d\u7f6e\u89e3\u7801\u8fdb\u9636\uff1aHCL \u5b98\u65b9\u6307\u5357\u4e2d\u7684\u4e09\u5927\u590d\u6742\u7cfb\u7edf\u8bbe\u8ba1\u6a21\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u7f51\u7edc\u5b89\u5168 \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011Havoc The Havoc Framework \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/gh_mirrors\/ha\/Havoc \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d \u672c\u6587\u57fa\u4e8e Havoc \u6846\u67b6 teamserver \u5185\u5d4c\u7684 HCL \u89e3\u6790\u5e93&#xff08;teamserver\/pkg\/profile\/yaotl\/&#xff0c;\u5373 hashicorp\/go-cty \u751f\u6001\u7684 HCL \u5e93 vendored \u526f\u672c&#xff09;\u4e2d\u7684\u5b98\u65b9\u6307\u5357\u7ae0\u8282","og_url":"https:\/\/www.wsisp.com\/helps\/111920.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-01T23:25:01+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261001232500-6abeebcc74289.svg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/111920.html","url":"https:\/\/www.wsisp.com\/helps\/111920.html","name":"Havoc \u56e2\u961f\u670d\u52a1\u5668\u7684 HCL \u914d\u7f6e\u89e3\u7801\u8fdb\u9636\uff1aHCL \u5b98\u65b9\u6307\u5357\u4e2d\u7684\u4e09\u5927\u590d\u6742\u7cfb\u7edf\u8bbe\u8ba1\u6a21\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-01T23:25:01+00:00","dateModified":"2026-10-01T23:25:01+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/111920.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/111920.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/111920.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Havoc \u56e2\u961f\u670d\u52a1\u5668\u7684 HCL \u914d\u7f6e\u89e3\u7801\u8fdb\u9636\uff1aHCL \u5b98\u65b9\u6307\u5357\u4e2d\u7684\u4e09\u5927\u590d\u6742\u7cfb\u7edf\u8bbe\u8ba1\u6a21\u5f0f"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/111920","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=111920"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/111920\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=111920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=111920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=111920"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=111920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}