Skip to content

Enhance password-only handling in Telnet service#1053

Merged
vanhauser-thc merged 3 commits intovanhauser-thc:masterfrom
s-b-repo:master
Jan 5, 2026
Merged

Enhance password-only handling in Telnet service#1053
vanhauser-thc merged 3 commits intovanhauser-thc:masterfrom
s-b-repo:master

Conversation

@s-b-repo
Copy link
Contributor

Key ImprovementsAutomatic detection of password-only mode: After Telnet negotiation, checks banners for "password:" (or variants) without "login:" or "username:". Skips sending username if password-only detected — directly sends the password. More robust prompt detection: Added "pin:" and better draining of initial banners. Fallback safe: If server re-prompts for login after bad password, it correctly skips the pair. Works with empty login: Still supports manual -l "" for compatibility.

Key ImprovementsAutomatic detection of password-only mode: After Telnet negotiation, checks banners for "password:" (or variants) without "login:" or "username:".
Skips sending username if password-only detected — directly sends the password.
More robust prompt detection: Added "pin:" and better draining of initial banners.
Fallback safe: If server re-prompts for login after bad password, it correctly skips the pair.
Works with empty login: Still supports manual -l "" for compatibility.
Password-only mode: Automatically detected and skips sending username.
Extensive failure patterns: All provided indicators merged into is_failure() for reliable invalid credential detection.
Multilingual & variant prompts: Covers "password:", "passwd:", "пароль:", "contraseña:", etc.
Robust banner draining in service_telnet to ensure clean state before cracking.
Cleaner send logic and consistent handling of re-prompts.
Enhanced usage message explaining new features.
@s-b-repo
Copy link
Contributor Author

Password-only mode: Automatically detected and skips sending username.
Extensive failure patterns: All provided indicators merged into is_failure() for reliable invalid credential detection.
Multilingual & variant prompts: Covers "password:", "passwd:", "пароль:", "contraseña:", etc.
Robust banner draining in service_telnet to ensure clean state before cracking.
Cleaner send logic and consistent handling of re-prompts.
Enhanced usage message explaining new features.

strstr(buf, "pwd:") != NULL || strstr(buf, "pin:") != NULL ||
strstr(buf, "пароль:") != NULL || strstr(buf, "contraseña:") != NULL ||
strstr(buf, "enter password") != NULL || strstr(buf, "password for") != NULL) {
password_prompt_seen = 1;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please re-add strstr(buf, "ennwort") != NULL and also "asscode"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just at work

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this fine

@s-b-repo
Copy link
Contributor Author

s-b-repo commented Jan 3, 2026

Changes made:

1.Re-added hydra_strcasestr(buf, "ennwort") (German "Kennwort") in all password prompt checks
2.Re-added hydra_strcasestr(buf, "asscode") in all password prompt checks
3.Restored original login→password flow from upstream that was missing (wait for password prompt after sending username)
4.Fixed strlen(buffer) + 1 in hydra_send calls to match original
5.Added !is_failure(buf) check before success detection to prevent false positives
6.Kept all improvements (failure detection, password-only mode, multilingual support)

@vanhauser-thc
Copy link
Owner

looks better, thanks.

@vanhauser-thc vanhauser-thc merged commit 55037d5 into vanhauser-thc:master Jan 5, 2026
1 check failed
vanhauser-thc added a commit that referenced this pull request Jan 24, 2026
Fix: telnet compilation error in hydra-telnet.c from PR #1053
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants