{"record":{"id":"e86343fb7feb0b40","repo":"kgretzky/evilginx2","slug":"please-disable-the-proxy-before-making-changes-to","errorCode":null,"errorMessage":"please disable the proxy before making changes to its configuration","messagePattern":"please disable the proxy before making changes to its configuration","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/terminal.go","lineNumber":352,"sourceCode":"\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tt.cfg.EnableProxy(true)\n\t\t\tlog.Important(\"you need to restart evilginx for the changes to take effect!\")\n\t\t\treturn nil\n\t\tcase \"disable\":\n\t\t\terr := t.p.setProxy(false, t.p.cfg.proxyConfig.Type, t.p.cfg.proxyConfig.Address, t.p.cfg.proxyConfig.Port, t.p.cfg.proxyConfig.Username, t.p.cfg.proxyConfig.Password)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tt.cfg.EnableProxy(false)\n\t\t\treturn nil\n\t\t}\n\t} else if pn == 2 {\n\t\tswitch args[0] {\n\t\tcase \"type\":\n\t\t\tif t.cfg.proxyConfig.Enabled {\n\t\t\t\treturn fmt.Errorf(\"please disable the proxy before making changes to its configuration\")\n\t\t\t}\n\t\t\tt.cfg.SetProxyType(args[1])\n\t\t\treturn nil\n\t\tcase \"address\":\n\t\t\tif t.cfg.proxyConfig.Enabled {\n\t\t\t\treturn fmt.Errorf(\"please disable the proxy before making changes to its configuration\")\n\t\t\t}\n\t\t\tt.cfg.SetProxyAddress(args[1])\n\t\t\treturn nil\n\t\tcase \"port\":\n\t\t\tif t.cfg.proxyConfig.Enabled {\n\t\t\t\treturn fmt.Errorf(\"please disable the proxy before making changes to its configuration\")\n\t\t\t}\n\t\t\tport, err := strconv.Atoi(args[1])\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tt.cfg.SetProxyPort(port)","sourceCodeStart":334,"sourceCodeEnd":370,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/terminal.go#L334-L370","documentation":"handleProxy ('proxy type' command) refuses to change proxy settings (type/address/port/credentials) while the proxy is currently enabled, because live configuration changes would leave the running proxy in an inconsistent state. It is a state-validation guard requiring the user to disable the proxy first.","triggerScenarios":"Running 'proxy type <type>' (e.g. 'proxy type http' or 'proxy type socks5') while proxy is enabled (cfg.proxyConfig.Enabled == true).","commonSituations":"Trying to switch proxy type mid-engagement after 'proxy on'; scripted terminal automation that reconfigures proxy without checking state.","solutions":["Run 'proxy off' first, then 'proxy type <type>', then 'proxy on'","Verify current state with 'proxy' (no args) before editing","Reorder automation scripts to apply proxy config before enabling"],"exampleFix":"// before\nproxy type socks5\n// after\nproxy off\nproxy type socks5\nproxy on","handlingStrategy":"validation","validationCode":"if cfg.GetProxyEnabled() {\n\treturn errors.New(\"disable proxy first: run 'proxy off' before 'proxy type'\")\n}","typeGuard":null,"tryCatchPattern":"if err := t.handleProxy(args); err != nil {\n\tif strings.Contains(err.Error(), \"disable the proxy\") {\n\t\tt.handleProxy([]string{\"off\"}); err = t.handleProxy(args); t.handleProxy([]string{\"on\"})\n\t}\n}","preventionTips":["Check proxy status with bare 'proxy' before any field change","Apply all proxy config while disabled, then enable once","In automation, always emit 'proxy off' before config lines"],"tags":["cli","proxy","state-conflict"],"backgroundTag":"proxy-enabled-config-locked","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"}