kgretzky/evilginx2 · error

intercept: missing `path` field

Error message

intercept: missing `path` field

What it means

This error is thrown when validating a phishlet's `intercept` block: the `domain` field passed the checks, but the required `path` field is missing entirely. Every intercept entry must specify a regular expression matching the request path it applies to. The parser rejects the phishlet at load time.

Source

Thrown at core/phishlet.go:500

			}
			err := p.addJsInject(*js.TriggerDomains, *js.TriggerPaths, js.TriggerParams, p.paramVal(*js.Script))
			if err != nil {
				return err
			}
		}
	}
	if fp.Intercept != nil {
		for _, ic := range *fp.Intercept {
			var err error
			var body, mime string
			if ic.Domain == nil {
				return fmt.Errorf("intercept: missing `domain` field")
			}
			if *ic.Domain == "" {
				return fmt.Errorf("intercept: `domain` field cannot be empty")
			}
			if ic.Path == nil {
				return fmt.Errorf("intercept: missing `path` field")
			}
			path_re, err := regexp.Compile(*ic.Path)
			if err != nil {
				return fmt.Errorf("intercept: `path` invalid regular expression: %v", err)
			}
			if ic.HttpStatus == nil {
				return fmt.Errorf("intercept: missing `http_status` field")
			}
			if ic.Body != nil {
				body = *ic.Body
			}
			if ic.Mime != nil {
				mime = *ic.Mime
			}
			err = p.addIntercept(*ic.Domain, path_re, *ic.HttpStatus, body, mime)
			if err != nil {
				return err
			}

View on GitHub (pinned to 4c0988a1d9)

Solutions

  1. Add a `path` field with a valid regular expression to the intercept block (e.g. `path: ^/login$`).
  2. Check the phishlet against the current format documentation/example phishlets for required intercept fields.
  3. Validate the YAML indentation so `path` is actually parsed as a child of the intercept entry, not a sibling.

Example fix

// before (phishlet.yml)
intercept:
  - domain: accounts
// after
intercept:
  - domain: accounts
    path: ^/login$
Defensive patterns

Strategy: validation

Validate before calling

for i, ic := range cfg.Intercept {
    if ic.Path == nil {
        return fmt.Errorf("intercept[%d]: missing `path` field", i)
    }
}

Type guard

func hasPath(ic InterceptCfg) bool {
    return ic.Path != nil && *ic.Path != ""
}

Prevention

When it happens

Trigger: An intercept block in the phishlet YAML defines `domain` but omits the `path` key entirely, e.g. `intercept:\n - domain: accounts` with no `path:` line.

Common situations: Incomplete phishlet copied from an example; manually removing the path line; a generator or older phishlet format that did not include path in intercept entries.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of kgretzky/evilginx2@4c0988a1d9 (2026-09-05). Data as JSON: /api/errors/ea7b9fa661f8d56a. Report an issue: GitHub.