New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmdline change: always require -m for actions that act on hashes #1456

Open
roycewilliams opened this Issue Nov 21, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@roycewilliams
Contributor

roycewilliams commented Nov 21, 2017

Because the command line currently has an implied default mode (-m 0, MD5), a number of actions could become less ambiguous for naive users if -m was instead required.

For example, when using --show, the user must specify a hash type (to avoid ambiguous salts/separators, etc.)

Before the suggested change, the user gets this error, and the naive user has no idea what to do next, because hashcat defaults to MD5 and knows that this hash is the wrong length:

$ hashcat --show hashfile.sha1 
Hashfile 'hashfile.sha1' on line 1 (b89eaac7e61417341b710b727768294d0e6a277b): Line-length exception
No hashes loaded.

With the suggested change, the user might instead see something like:

$ hashcat --show hashfile.sha1 
Please specify a hashtype with -m.

If it's not desirable to require -m in most cases, then at least explicitly requiring it for features like --show/--left would improve usability.

More generally, iif any command that expects to act on hashes make the hash type explicit, then many naive users will not be confused by line-length exception errors, and could instead figure things out for themselves without having to ask, check the FAQ, etc.

(Side note: am I crazy, or is the default (-m 0, MD5) not documented in the help? Maybe in the example column, we could list -m 0 instead of -m 1000 and say "-m 0 (default)"? Or say it somewhere else, maybe in the hash modes list?)

[EDIT: If this idea is appealing, I can submit a PR, depending on what approach you recommend]

@jsteube

This comment has been minimized.

Show comment
Hide comment
@jsteube

jsteube Nov 21, 2017

Member

Some things to notice is that:

  • Removing the default just for --show and --left would be hard to explain. If we do, it should be global.
  • Some example scripts would be need to be patched, too (example0.cmd etc)
  • Removing the -m 0 default would also solve the missing default marker
  • Lot's of tutorials in the wild explain -m 0 to be the default (in case of critic on the change we can point to "it's a new version")
  • The "Please specify a hashtype with -m." misses a hint on -h to get a list of all available modes
Member

jsteube commented Nov 21, 2017

Some things to notice is that:

  • Removing the default just for --show and --left would be hard to explain. If we do, it should be global.
  • Some example scripts would be need to be patched, too (example0.cmd etc)
  • Removing the -m 0 default would also solve the missing default marker
  • Lot's of tutorials in the wild explain -m 0 to be the default (in case of critic on the change we can point to "it's a new version")
  • The "Please specify a hashtype with -m." misses a hint on -h to get a list of all available modes

@jsteube jsteube added the new feature label Nov 21, 2017

@jsteube

This comment has been minimized.

Show comment
Hide comment
@jsteube

jsteube Nov 22, 2017

Member

@roycewilliams feel free to send in a PR

Member

jsteube commented Nov 22, 2017

@roycewilliams feel free to send in a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment