{"record":{"id":"9cd5faa55334ce94","repo":"projectdiscovery/nuclei","slug":"unsupported-goexec-method","errorCode":null,"errorMessage":"unsupported goexec method","messagePattern":"unsupported goexec method","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/js/libs/goexec/errors.go","lineNumber":13,"sourceCode":"package goexec\n\nimport \"errors\"\n\nvar (\n\tErrMissingAuth             = errors.New(\"goexec auth is required\")\n\tErrMissingUsername         = errors.New(\"goexec username is required for this auth mode\")\n\tErrMultipleCredentialModes = errors.New(\"goexec auth selects multiple primary credential modes\")\n\tErrMissingTarget           = errors.New(\"goexec target is required\")\n\tErrMissingCommand          = errors.New(\"goexec command is required\")\n\tErrMissingExecutable       = errors.New(\"goexec executable is required\")\n\tErrUnsupportedModule       = errors.New(\"unsupported goexec module\")\n\tErrUnsupportedMethod       = errors.New(\"unsupported goexec method\")\n\tErrUnsupportedOutputMethod = errors.New(\"unsupported goexec output method\")\n\tErrNetworkPolicyDenied     = errors.New(\"target denied by network policy\")\n\tErrInvalidMethodArguments  = errors.New(\"invalid goexec method arguments\")\n\tErrDomainControllerDenied  = errors.New(\"domain controller denied by network policy\")\n\tErrProxyDenied             = errors.New(\"proxy denied by network policy\")\n\tErrEndpointDenied          = errors.New(\"endpoint denied by network policy\")\n)\n","sourceCodeStart":1,"sourceCodeEnd":21,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/js/libs/goexec/errors.go#L1-L21","documentation":"Sentinel error from the goexec (Windows remote execution) helper library. The GoExecRunner dispatches each module with a per-module method switch: wmi accepts 'command', 'proc' and 'call'; tsch accepts 'demand' and 'create'; dcom accepts only 'mmc'; scmr has no method switch. When req.Method (lowercased, no trim) matches none of the selected module's cases, the runner returns ErrUnsupportedMethod (adapter_goexec.go:136,178,207). The error is stored on the JS result object (result.Error, OK=false) rather than propagated to the JS runtime as an exception.","triggerScenarios":"A code-protocol goexec call with Module='wmi' and Method='query' (not command/proc/call); Module='dcom' with any method except 'mmc'; Module='tsch' with Method='run' instead of demand/create.","commonSituations":"Template author copies a method name from a different module's docs; typo in the method field; nuclei version where a module's supported method set changed and the template was not updated.","solutions":["Set method to a value supported by the chosen module: wmi -> command | proc | call, tsch -> demand | create, dcom -> mmc","Check spelling; matching lowercases the value but does not trim whitespace, so remove leading/trailing spaces","Align the template with the goexec helper documentation shipped for your nuclei version"],"exampleFix":"// before (js template)\nreturn goexec.Run({target: t, module: 'dcom', method: 'wmiexec', ...});\n// after\nreturn goexec.Run({target: t, module: 'dcom', method: 'mmc', ...});","handlingStrategy":"validation","validationCode":"var goexecMethods = map[string][]string{\n    \"wmi\":  {\"command\", \"proc\", \"call\"},\n    \"tsch\": {\"demand\", \"create\"},\n    \"dcom\": {\"mmc\"},\n}\nfunc methodSupported(module, method string) bool {\n    for _, m := range goexecMethods[strings.ToLower(module)] {\n        if m == strings.ToLower(method) {\n            return true\n        }\n    }\n    return false\n}","typeGuard":"func isUnsupportedMethod(err error) bool { return errors.Is(err, goexec.ErrUnsupportedMethod) }","tryCatchPattern":"res, err := goexec.Run(req)\nif err == nil && res != nil && errors.Is(res.Err, goexec.ErrUnsupportedMethod) { /* adjust method and retry once */ }","preventionTips":["Keep a module->methods table next to template generation code","Lint goexec requests for unknown methods before submission","Pin template packs to the nuclei version they were written for"],"tags":["goexec","remote-execution","code-protocol","validation"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}