Skip to content

ValueError: too many values to unpack` when selecting multiple targets using dash separator #536

Description

@Wr1ghtShade

Version: 2.9.9b0 (master)
Python: 3.13
OS: Kali Linux, kernel 6.19

Hey, ran into a crash today when selecting targets.

At the prompt I typed 6-10-11-12 — which felt natural since the prompt itself says targets can be entered "separated by commas, dashes or all". Instead of selecting those targets, wifite crashed:

 [!] ValueError: too many values to unpack (expected 2)
 [!]    File ".../wifite/util/scanner.py", line 742, in _prompt_user_for_targets_classic
 [!]        (lower, upper) = [int(x) - 1 for x in choice.split('-')]
 [!]        ^^^^^^^^^^^^^^

The issue is in scanner.py line 742 — the parser assumes a dash-separated input always produces exactly 2 values (a range like 6-10). With more than one dash, unpacking fails.

Workaround is to use commas (6,10,11,12) or a single range (6-12), but ideally multiple dashes should either be parsed correctly or return a friendly error instead of a traceback.

Thanks for the great tool regardless!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions