Skip to content

Commit 6b294e2

Browse files
committed
feat: show total permutation count in CLI output
Use count_patterns() to display how many permutations exist in total, e.g. "Scanning 5 of 111 permutations" instead of "Generated 5 permutations". Gives users visibility into the full scope of their pattern. Ref #184
1 parent 234e15b commit 6b294e2

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

user_scanner/__main__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
run_email_module_batch
3434
)
3535

36-
from user_scanner.core.patterns import expand_patterns_random
36+
from user_scanner.core.patterns import expand_patterns_random, count_patterns
3737

3838
# Color configs
3939
R = Fore.RED
@@ -242,9 +242,15 @@ def main():
242242
temp_targets = list(islice(expand_patterns_random(target_name), args.stop))
243243
targets.extend(temp_targets)
244244
if len(temp_targets) > 1:
245-
print(
246-
C + f"[+] Generated {len(temp_targets)} permutations" + Style.RESET_ALL
247-
)
245+
total = count_patterns(target_name)
246+
if total > len(temp_targets):
247+
print(
248+
C + f"[+] Scanning {len(temp_targets)} of {total} permutations" + Style.RESET_ALL
249+
)
250+
else:
251+
print(
252+
C + f"[+] Scanning {len(temp_targets)} permutations" + Style.RESET_ALL
253+
)
248254

249255
results = []
250256

0 commit comments

Comments
 (0)