kgretzky/evilginx2 · info

command not found

Error message

command not found

What it means

PrintBrief in core/help.go returns this when asked to print brief help for a command name that does not exist in the Help registry (h.line_help). The registry is populated from registered console commands, so the lookup key must exactly match a registered command. It is a guard against unknown command names passed to the help printer.

Source

Thrown at core/help.go:124

				pcmd := cmd
				if layer&h.cmd_layers[cmd] != 0 {
					pcmd = lb.Sprint(cmd)
				}
				line_help, _ := h.line_help[cmd]
				rows = append(rows, pcmd)
				vals = append(vals, line_help)
			}
			out += AsRows(rows, vals)
		}
	}
	log.Printf("\n%s\n", out)
}

func (h *Help) PrintBrief(cmd string) error {
	yw := color.New(color.FgYellow)
	var out string
	if _, ok := h.line_help[cmd]; !ok {
		return fmt.Errorf("command not found")
	}
	out += fmt.Sprintf(" %s\n\n", yw.Sprint(cmd))
	if cmd_info, ok := h.cmd_infos[cmd]; ok {
		if len(cmd_info) > 0 {
			max_line := 64
			n_line := 0
			var out_info []rune
			out_info = append(out_info, ' ')
			r_info := []rune(cmd_info)
			for _, r := range r_info {
				if r == ' ' && n_line > max_line {
					out_info = append(out_info, '\n')
					n_line = 0
				} else if r == '\n' {
					out_info = append(out_info, '\n')
					out_info = append(out_info, ' ')
					n_line = 0
					continue

View on GitHub (pinned to 4c0988a1d9)

Solutions

  1. Check the exact command name with plain `help` (no arguments) to list available commands
  2. Fix the spelling or casing of the command passed to PrintBrief / the help command
  3. Verify the command is actually registered before calling PrintBrief
  4. If scripting, enumerate valid commands first instead of guessing names

Example fix

// before
h.PrintBrief("proxys")
// after
h.PrintBrief("proxy") // exact registered command name
Defensive patterns

Strategy: validation

Validate before calling

if _, ok := h.line_help[cmd]; !ok {
    return fmt.Errorf("unknown command: %s", cmd) // check registry before printing
}

Type guard

func commandExists(h *Help, cmd string) bool {
    _, ok := h.line_help[cmd]
    return ok
}

Try / catch

if err := h.PrintBrief(cmd); err != nil {
    if strings.Contains(err.Error(), "command not found") {
        log.Warn("no help for %q; run 'help' to list commands", cmd)
    }
}

Prevention

When it happens

Trigger: Calling h.PrintBrief(cmd) (directly or via DoWork handling a console command like 'help <cmd>' or 'help <cmd> <sub>') with a string that is not a key in h.line_help — e.g. a typo'd command, an unregistered subcommand, or a command from a different version of evilginx.

Common situations: Typing 'help proxys' instead of 'proxy', asking help for a subcommand that doesn't exist on this command, or help invoked for a command removed/renamed between evilginx versions.

Related errors


AI-assisted analysis of kgretzky/evilginx2@4c0988a1d9 (2026-09-05). Data as JSON: /api/errors/a07cd1e98a76a7e2. Report an issue: GitHub.