kgretzky/evilginx2 · error
phishing urls and phishing parameters count do not match
Error message
phishing urls and phishing parameters count do not match
What it means
exportPhishUrls writes generated phishing URLs together with their per-URL parameter maps, and it refuses to run when the two slices have different lengths. Each URL must correspond 1:1 to a parameters map; a mismatch means the internal pairing was corrupted, so the export aborts to avoid writing misaligned rows.
Source
Thrown at core/terminal.go:1667
t, err := r.Token()
if err != nil {
return ret, ret_params, err
}
}
}
}
} else {
return ret, ret_params, fmt.Errorf("array of parameters not found")
}*/
}
return ret, ret_params, nil
}
func (t *Terminal) exportPhishUrls(export_path string, phish_urls []string, phish_params []map[string]string, format string) error {
if len(phish_urls) != len(phish_params) {
return fmt.Errorf("phishing urls and phishing parameters count do not match")
}
if !stringExists(format, []string{"text", "csv", "json"}) {
return fmt.Errorf("export format can only be 'text', 'csv' or 'json'")
}
f, err := os.OpenFile(export_path, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644)
if err != nil {
return err
}
defer f.Close()
if format == "text" {
for n, phish_url := range phish_urls {
var params string
m := 0
params_row := phish_params[n]
for k, v := range params_row {
if m > 0 {View on GitHub (pinned to 4c0988a1d9)
Solutions
- Build both slices together in the same loop iteration so they stay index-aligned.
- If filtering, filter both slices with the same predicate before calling exportPhishUrls.
- Assert len(urls) == len(params) at the call site to fail fast with a clearer message.
Example fix
// before
urls = append(urls, u)
if bad { params = append(params, p) }
// after
if !bad { urls = append(urls, u); params = append(params, p) } Defensive patterns
Strategy: validation
Validate before calling
if len(phishUrls) != len(phishParams) {
return fmt.Errorf("refusing export: %d urls vs %d param maps", len(phishUrls), len(phishParams))
}
err := t.exportPhishUrls(path, phishUrls, phishParams, format) Try / catch
if err := t.exportPhishUrls(path, urls, params, format); err != nil {
if strings.Contains(err.Error(), "count do not match") {
log.Printf("slice alignment bug: %d urls, %d params", len(urls), len(params))
return
}
return err
} Prevention
- Append to urls and params in the same code block
- Filter both slices with one shared predicate
- Add a debug assert on equal lengths in any custom import/export code
When it happens
Trigger: Programmatically calling exportPhishUrls (or the lure export path in handleLures that feeds it) with len(phish_urls) != len(phish_params), typically after building one slice but not the other or filtering one without the other.
Common situations: Custom builds/scripts that append to ret but skip ret_params on an error branch (note importParamsFromFile only appends both together), or manually constructed slices passed to the exported function.
AI-assisted analysis of kgretzky/evilginx2@4c0988a1d9 (2026-09-05).
Data as JSON: /api/errors/71c1d37e6ff99fcb.
Report an issue: GitHub.