{"record":{"id":"cf5dbb2085a9d5cd","repo":"kgretzky/evilginx2","slug":"edit-redirector-directory-does-not-exist-s","errorCode":null,"errorMessage":"edit: redirector directory does not exist: %s","messagePattern":"edit: redirector directory does not exist: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/terminal.go","lineNumber":1028,"sourceCode":"\t\t\t\t\t\t}\n\t\t\t\t\t\tl.OgUrl = u.String()\n\t\t\t\t\t} else {\n\t\t\t\t\t\tl.OgUrl = \"\"\n\t\t\t\t\t}\n\t\t\t\t\tdo_update = true\n\t\t\t\t\tlog.Info(\"og_url = '%s'\", l.OgUrl)\n\t\t\t\tcase \"redirector\":\n\t\t\t\t\tif val != \"\" {\n\t\t\t\t\t\tpath := val\n\t\t\t\t\t\tif !filepath.IsAbs(val) {\n\t\t\t\t\t\t\tredirectors_dir := t.cfg.GetRedirectorsDir()\n\t\t\t\t\t\t\tpath = filepath.Join(redirectors_dir, val)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif _, err := os.Stat(path); !os.IsNotExist(err) {\n\t\t\t\t\t\t\tl.Redirector = val\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn fmt.Errorf(\"edit: redirector directory does not exist: %s\", path)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tl.Redirector = \"\"\n\t\t\t\t\t}\n\t\t\t\t\tdo_update = true\n\t\t\t\t\tlog.Info(\"redirector = '%s'\", l.Redirector)\n\t\t\t\tcase \"ua_filter\":\n\t\t\t\t\tif val != \"\" {\n\t\t\t\t\t\tif _, err := regexp.Compile(val); err != nil {\n\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tl.UserAgentFilter = val\n\t\t\t\t\t} else {\n\t\t\t\t\t\tl.UserAgentFilter = \"\"\n\t\t\t\t\t}\n\t\t\t\t\tdo_update = true\n\t\t\t\t\tlog.Info(\"ua_filter = '%s'\", l.UserAgentFilter)","sourceCodeStart":1010,"sourceCodeEnd":1046,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/terminal.go#L1010-L1046","documentation":"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.","triggerScenarios":"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`).","commonSituations":"Typo in the redirector folder name, redirector files never created/imported, or running from a working directory where the redirectors dir path differs.","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"],"exampleFix":"// before (dir missing)\nlures edit 0 redirector my-redirector\n// after\nmkdir -p ~/.evilginx/redirectors/my-redirector\nlures edit 0 redirector my-redirector","handlingStrategy":"validation","validationCode":"path := filepath.Join(redirectorsDir, name)\nif _, err := os.Stat(path); os.IsNotExist(err) {\n    return fmt.Errorf(\"create redirector dir first: %s\", path)\n}","typeGuard":"func redirectorExists(dir, name string) bool {\n    _, err := os.Stat(filepath.Join(dir, name))\n    return !os.IsNotExist(err)\n}","tryCatchPattern":"if _, err := os.Stat(path); os.IsNotExist(err) {\n    if mkErr := os.MkdirAll(path, 0o755); mkErr != nil {\n        return mkErr\n    }\n}","preventionTips":["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"],"tags":["cli","filesystem","evilginx2"],"backgroundTag":"file-not-found","analyzedSha":"4c0988a1d9db4d172a185e979a38bfd0efdb5830","analyzedAt":"2026-09-05T19:23:07.238Z","contentChangedAt":"2026-09-05T19:23:07.238Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}