kgretzky/evilginx2 · error
array of parameters not found
Error message
array of parameters not found
What it means
This error is defined in importParamsFromFile but currently sits inside a commented-out JSON decoder block, so it is dead code in the present source: it was intended to signal that a JSON params file did not contain a top-level array of parameter objects. In the live code path, JSON files are parsed with json.Unmarshal and malformed input surfaces as a json library error instead. If you see this string at runtime you are running a build where the legacy decoder is active and the params file is not a JSON array.
Source
Thrown at core/terminal.go:1659
for r.More() {
t, err := r.Token()
if err != nil {
return ret, ret_params, err
}
if s, ok := t.(string); ok && s == "{" {
for r.More() {
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()View on GitHub (pinned to 4c0988a1d9)
Solutions
- Ensure the JSON file's root is an array of objects: '[{"k":"v"}, ...]'.
- Re-export the params file using this tool's own JSON format.
- Note that in current code the error is unreachable; any JSON error you actually see comes from json.Unmarshal, so fix the JSON syntax reported there.
Example fix
// before (params.json)
{"username":"victim"}
// after
[{"username":"victim"}] Defensive patterns
Strategy: validation
Validate before calling
data, err := ioutil.ReadFile(paramsFile)
if err != nil { return err }
var arr []map[string]interface{}
if err := json.Unmarshal(data, &arr); err != nil {
return fmt.Errorf("params file must be a JSON array of objects: %v", err)
}
if len(arr) == 0 {
return fmt.Errorf("params file contains no parameter objects")
} Type guard
func isJSONArrayOfObjects(data []byte) bool {
var arr []map[string]interface{}
return json.Unmarshal(data, &arr) == nil
} Try / catch
urls, params, err := t.importParamsFromFile(path, base, format)
if err != nil {
if strings.Contains(err.Error(), "array of parameters not found") || isJSONSyntaxErr(err) {
log.Printf("params file %s is not a JSON array of objects", path)
return
}
return err
} Prevention
- Always export params files with the tool's own JSON exporter
- Validate JSON root is an array before importing
- Diff hand-edited params files against a known-good export
When it happens
Trigger: Historically/conditionally: calling the lure parameter import with format 'json' on a file whose root is an object or scalar rather than an array of objects (e.g. '{"user":"x"}' instead of '[{"user":"x"}]').
Common situations: Exporting params from another tool as a single JSON object, hand-editing the file and dropping the enclosing brackets, or reading docs for an older version whose decoder used streaming tokens.
AI-assisted analysis of kgretzky/evilginx2@4c0988a1d9 (2026-09-05).
Data as JSON: /api/errors/5bb6bcc93864afff.
Report an issue: GitHub.