kgretzky/evilginx2 · warning

incorrect number of arguments

Error message

incorrect number of arguments

What it means

The `lures create <phishlet>` command requires exactly the phishlet name argument; if the argument count doesn't match what the create branch expects, handleLures returns 'incorrect number of arguments'. Lures are per-phishlet phishing link definitions that require an existing phishlet.

Source

Thrown at core/terminal.go:736

		return nil
	}
	if pn > 0 {
		switch args[0] {
		case "create":
			if pn == 2 {
				_, err := t.cfg.GetPhishlet(args[1])
				if err != nil {
					return err
				}
				l := &Lure{
					Path:     "/" + GenRandomString(8),
					Phishlet: args[1],
				}
				t.cfg.AddLure(args[1], l)
				log.Info("created lure with ID: %d", len(t.cfg.lures)-1)
				return nil
			}
			return fmt.Errorf("incorrect number of arguments")
		case "get-url":
			if pn >= 2 {
				l_id, err := strconv.Atoi(strings.TrimSpace(args[1]))
				if err != nil {
					return fmt.Errorf("get-url: %v", err)
				}
				l, err := t.cfg.GetLure(l_id)
				if err != nil {
					return fmt.Errorf("get-url: %v", err)
				}
				pl, err := t.cfg.GetPhishlet(l.Phishlet)
				if err != nil {
					return fmt.Errorf("get-url: %v", err)
				}
				bhost, ok := t.cfg.GetSiteDomain(pl.Name)
				if !ok || len(bhost) == 0 {
					return fmt.Errorf("no hostname set for phishlet '%s'", pl.Name)
				}

View on GitHub (pinned to 4c0988a1d9)

Solutions

  1. Run `lures create <phishlet-name>` with exactly one argument naming an existing phishlet
  2. Verify the phishlet exists and is not a template (`phishlets` listing) before creating the lure
  3. Check the handleLures source for the exact expected argument count in your version

Example fix

// before
lures create
// after
lures create o365:corp
Defensive patterns

Strategy: validation

Validate before calling

func validateLuresCreate(args []string) error {
    if len(args) != 2 { return fmt.Errorf("usage: lures create <phishlet>") }
    if _, err := t.cfg.GetPhishlet(args[1]); err != nil { return err }
    return nil
}

Try / catch

if err := t.handleLures(args); err != nil {
    if strings.Contains(err.Error(), "incorrect number of arguments") {
        log.Info("usage: lures create <phishlet>")
    } else { log.Error("%v", err) }
}

Prevention

When it happens

Trigger: Running `lures create` with no phishlet name, or with extra unexpected arguments such that pn doesn't satisfy the create branch conditions in handleLures.

Common situations: Forgot the phishlet argument; pasted a multi-word phishlet name that shell-split; used syntax from a different fork where create takes more params.

Related errors


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