1

I'm trying to learn more about hashes and cryptography and doing my own pentesting, but I seem to be stuck on this problem.

The hash function being used is SHA1.

If I'm trying to determine a password and I know that the last X characters of the password are: endofpassword#.

And I know that the beginning of the hash is: e921a7cde9e64d612b, but not the rest of the characters for the hash, is it possible still to determine the password and what tool would you use for this?

I believe Hashcat would not be suited for this sort of attack but I may be wrong.

techraf
  • 9,159
  • 11
  • 45
  • 63
ark
  • 111
  • 4

2 Answers2

1

Considering that I am reading your question correctly you know the first section of an SHA1 hash and then the characters in plain text after the hash.

To successfully pull off this attack you would need to write a script that guesses passwords as Password1! + randombytes# and hashing the full combo with SHA1 and then checking to ensure the beginning of the hash of the guessed password equals e921a7cde9e64d612b and adding it to a list of potential passwords.

You mentioned using hashcat however due to the nature of your attack method as mentioned above it would be easier to write a simple script in a language of your choice to pull off your attack.

In short the attack is possible but would be more difficult since you do not have the full hash.

techraf
  • 9,159
  • 11
  • 45
  • 63
1

Knowing part of the password gives you a good start at building a list of possible passwords, but that could be a massive list depending on the max length and charset. Say it's a max of 50 chars and you have 14, that leaves 36 chars worth of entropy in the unknown range.

By knowing part of the hash you can invalidate a lot of those, but without the whole hash you need to search the whole unknown range looking for matches to your part of a hash. The time this takes is considerable, even with GPU help (a tool like oclHashCat) you are talking about decades of work since the part of the hash you know doesn't speed it up; you need to run the hash and then compare it to your fragment. You can't stop as soon as you find one that matches, either, because you have no way of knowing that its the only match and therefore must exhaust the entire space.

If you do exhaust the space with only one match, you have found the password. If you have multiple results you have not found the password. I think the answer to "is it possible still to determine the password" is a solid "maybe" since you will only know if there is 1 possible password until after you check.

Jeff Meden
  • 3,976
  • 14
  • 16