kgretzky/evilginx2 · error

missing `proxy_hosts` section

Error message

missing `proxy_hosts` section

What it means

The phishlet parser validates the decoded ConfigPhishlet structure and requires the `proxy_hosts` section to be present. A nil ProxyHosts means the phishlet defines no host forwarding rules, making it unusable, so loading fails with this validation error.

Source

Thrown at core/phishlet.go:378

					val = *param.Default
				}

				p.customParams[param.Name] = val
			}
		}

		/*
			if customParams != nil {
				p.customParams = *customParams
			} else {
				for _, param := range *fp.Params {
					p.customParams[param.Name] = param.Default
				}
			}*/
	}

	if fp.ProxyHosts == nil {
		return fmt.Errorf("missing `proxy_hosts` section")
	}
	if fp.AuthTokens == nil {
		return fmt.Errorf("missing `auth_tokens` section")
	}
	if fp.Credentials == nil {
		return fmt.Errorf("missing `credentials` section")
	}
	if fp.Credentials.Username == nil {
		return fmt.Errorf("credentials: missing `username` section")
	}
	if fp.Credentials.Password == nil {
		return fmt.Errorf("credentials: missing `password` section")
	}
	if fp.LoginItem == nil {
		return fmt.Errorf("missing `login` section")
	}

	for _, ph := range *fp.ProxyHosts {

View on GitHub (pinned to 4c0988a1d9)

Solutions

  1. Add a `proxy_hosts` section with at least one entry to the phishlet YAML
  2. Fix the key spelling to exactly `proxy_hosts`
  3. Verify YAML indentation so proxy_hosts is a top-level key, not nested under another section
  4. Compare against a known-good phishlet example from the repo's phishlets/ directory

Example fix

# before
auth_tokens: []
# after (add missing section)
proxy_hosts:
  - phish_sub: ''
    orig_sub: 'www'
    domain: 'example.com'
    session: true
auth_tokens: []
Defensive patterns

Strategy: validation

Validate before calling

// quick YAML lint before loading
for _, section := range []string{"proxy_hosts", "auth_tokens", "credentials"} {
    if _, ok := doc[section]; !ok {
        return fmt.Errorf("phishlet missing section: %s", section)
    }
}

Type guard

func hasProxyHosts(fp *ConfigPhishlet) bool {
    return fp.ProxyHosts != nil
}

Try / catch

if err := cfg.LoadPhishlet(name, path, nil); err != nil {
    if strings.Contains(err.Error(), "missing `proxy_hosts`") {
        log.Error("add a proxy_hosts section to %s", path)
    }
}

Prevention

When it happens

Trigger: Loading a phishlet YAML that has no top-level `proxy_hosts:` key (or it is commented out / misspelled, e.g. `proxy_host:`), so fp.ProxyHosts is nil after unmarshal.

Common situations: Hand-writing a phishlet from scratch and forgetting the section, deleting proxy_hosts while pruning a phishlet, or YAML indentation making the section parse as a child of another key (thus nil).

Related errors


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