kgretzky/evilginx2 · error
edit: redirector directory does not exist: %s
Error message
edit: redirector directory does not exist: %s
What it means
In 'lures edit <id> redirector <name>', the resolved redirector directory (joined with the redirectors dir if the value was relative) does not exist on disk, verified via os.Stat. The lure cannot reference a non-existent redirector, so the edit fails without changes.
Source
Thrown at core/terminal.go:1028
}
l.OgUrl = u.String()
} else {
l.OgUrl = ""
}
do_update = true
log.Info("og_url = '%s'", l.OgUrl)
case "redirector":
if val != "" {
path := val
if !filepath.IsAbs(val) {
redirectors_dir := t.cfg.GetRedirectorsDir()
path = filepath.Join(redirectors_dir, val)
}
if _, err := os.Stat(path); !os.IsNotExist(err) {
l.Redirector = val
} else {
return fmt.Errorf("edit: redirector directory does not exist: %s", path)
}
} else {
l.Redirector = ""
}
do_update = true
log.Info("redirector = '%s'", l.Redirector)
case "ua_filter":
if val != "" {
if _, err := regexp.Compile(val); err != nil {
return err
}
l.UserAgentFilter = val
} else {
l.UserAgentFilter = ""
}
do_update = true
log.Info("ua_filter = '%s'", l.UserAgentFilter)View on GitHub (pinned to 4c0988a1d9)
Solutions
- Create the directory first: mkdir -p <redirectors_dir>/<name> and place the redirector files there
- List existing redirector directories and use an exact existing name
- Run the tool from the directory containing the expected redirectors/ folder
Example fix
// before (dir missing) lures edit 0 redirector my-redirector // after mkdir -p ~/.evilginx/redirectors/my-redirector lures edit 0 redirector my-redirector
Defensive patterns
Strategy: validation
Validate before calling
path := filepath.Join(redirectorsDir, name)
if _, err := os.Stat(path); os.IsNotExist(err) {
return fmt.Errorf("create redirector dir first: %s", path)
} Type guard
func redirectorExists(dir, name string) bool {
_, err := os.Stat(filepath.Join(dir, name))
return !os.IsNotExist(err)
} Try / catch
if _, err := os.Stat(path); os.IsNotExist(err) {
if mkErr := os.MkdirAll(path, 0o755); mkErr != nil {
return mkErr
}
} Prevention
- Create the redirector directory before assigning it
- Verify the exact directory name with a listing
- Run evilginx2 from a location where the redirectors dir resolves correctly
When it happens
Trigger: Running `lures edit <id> redirector <name>` where `<redirectors_dir>/<name>` does not exist, or with a bare name when no default redirector directory is configured (path resolves directly to `val`).
Common situations: Typo in the redirector folder name, redirector files never created/imported, or running from a working directory where the redirectors dir path differs.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- edit: redirect url must be absolute
- edit: image url must be absolute
- edit: site url must be absolute
- delete: %v
- failed to list certificates in directory '%s': %v
AI-assisted analysis of kgretzky/evilginx2@4c0988a1d9 (2026-09-05).
Data as JSON: /api/errors/cf5dbb2085a9d5cd.
Report an issue: GitHub.