{"record":{"id":"19ece51d4897703a","repo":"kgretzky/evilginx2","slug":"intercept-missing-domain-field","errorCode":null,"errorMessage":"intercept: missing `domain` field","messagePattern":"intercept: missing `domain` field","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/phishlet.go","lineNumber":494,"sourceCode":"\t\t\t}\n\t\t\tfor n := range *js.TriggerDomains {\n\t\t\t\t(*js.TriggerDomains)[n] = p.paramVal((*js.TriggerDomains)[n])\n\t\t\t}\n\t\t\tfor n := range *js.TriggerPaths {\n\t\t\t\t(*js.TriggerPaths)[n] = p.paramVal((*js.TriggerPaths)[n])\n\t\t\t}\n\t\t\terr := p.addJsInject(*js.TriggerDomains, *js.TriggerPaths, js.TriggerParams, p.paramVal(*js.Script))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\tif fp.Intercept != nil {\n\t\tfor _, ic := range *fp.Intercept {\n\t\t\tvar err error\n\t\t\tvar body, mime string\n\t\t\tif ic.Domain == nil {\n\t\t\t\treturn fmt.Errorf(\"intercept: missing `domain` field\")\n\t\t\t}\n\t\t\tif *ic.Domain == \"\" {\n\t\t\t\treturn fmt.Errorf(\"intercept: `domain` field cannot be empty\")\n\t\t\t}\n\t\t\tif ic.Path == nil {\n\t\t\t\treturn fmt.Errorf(\"intercept: missing `path` field\")\n\t\t\t}\n\t\t\tpath_re, err := regexp.Compile(*ic.Path)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"intercept: `path` invalid regular expression: %v\", err)\n\t\t\t}\n\t\t\tif ic.HttpStatus == nil {\n\t\t\t\treturn fmt.Errorf(\"intercept: missing `http_status` field\")\n\t\t\t}\n\t\t\tif ic.Body != nil {\n\t\t\t\tbody = *ic.Body\n\t\t\t}\n\t\t\tif ic.Mime != nil {","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/phishlet.go#L476-L512","documentation":"Each entry in the `intercept` list must define a `domain`, the host whose responses are intercepted and returned with the given body/mime. The parser found a nil `domain` field and aborts validation. Note the next check also rejects an empty string, so the field must be a non-empty hostname.","triggerScenarios":"A `intercept:` entry in the phishlet YAML omits the `domain:` key; core/phishlet.go's `if ic.Domain == nil` check fires while iterating fp.Intercept.","commonSituations":"Writing an intercept block with only path/body/mime; typo like `hostname:`; YAML indentation error that left domain on a sibling node; copying from docs that used a different field order.","solutions":["Add `domain: '<hostname>'` (e.g. `domain: 'api.example.com'`) to the intercept entry","Ensure the value is non-empty; an empty `domain: ''` also fails validation (empty-string check immediately after)","Reload and continue with the next reported field (path, then body/mime checks)"],"exampleFix":"// before\nintercept:\n  - path: '/health'\n    body: 'ok'\n    mime: 'text/plain'\n// after\nintercept:\n  - domain: 'api.example.com'\n    path: '/health'\n    body: 'ok'\n    mime: 'text/plain'","handlingStrategy":"validation","validationCode":"for i, ic in enumerate(cfg.get('intercept') or []):\n    d = ic.get('domain')\n    if d is None:\n        raise ValueError(f\"intercept[{i}]: missing `domain` field\")\n    if d == '':\n        raise ValueError(f\"intercept[{i}]: `domain` field cannot be empty\")","typeGuard":"func validIntercept(ic Intercept) bool { return ic.Domain != nil && *ic.Domain != \"\" }","tryCatchPattern":null,"preventionTips":["Include a non-empty hostname in every intercept entry — both nil and empty string are rejected","Use the same hostname format as phishlet host entries","Validate intercept blocks after any schema edits or copy/paste from docs"],"tags":["phishlet","config-validation","intercept","missing-field"],"backgroundTag":"missing-required-config-field","analyzedSha":"4c0988a1d9db4d172a185e979a38bfd0efdb5830","analyzedAt":"2026-09-05T19:23:07.238Z","contentChangedAt":"2026-09-05T19:23:07.238Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}