1

Basically, I want to crack hashes programatically using hashcat python without having to install hashcat binaries.

Python seem to have a module called hashcat (https://pypi.org/project/hashcat/) but I couldn't find any documentation on the web for how to use it.

Does anyone know how to crack hashes using python?

2
  • 5
    I'm pretty sure that there isn't a pure Python solution to this because it would be abysmally slow, so you're going to need some sort of C or other compiled code to do this, which probably means that the hashcat binares will be necessary.
    – bk2204
    Commented Dec 6, 2020 at 2:11
  • You basically want to reinvent the wheel
    – yeah_well
    Commented Dec 6, 2020 at 11:18

3 Answers 3

0

If you want to use hashcat (or the package you linked to that simply wraps hashcat), you will need to install or build the hashcat binaries.

Otherwise, you would likely need to look for another password-cracking library, or implement it yourself. However, you will not achieve the performance of hashcat by using Python.

0

I want to use hashcat, but I don't want to use the hashcat binaries.

This isn't how this works. First of all, let's have a look at the project documentation you linked to:

Little wrapper around hashcat so it can be installed via pip. Attempts to also correctly determine which binary you should run and adds hashcat to your path.

As you see, the point of this project is to allow you to install hashcat via pip. If you have a look at the files this project downloads, it's simply the hashcat binary, as well as a file called cli.py, which does a handful of things:

  1. Figure out which version of the hashcat executable to run.
  2. Turn all relative paths into absolute paths (due to this issue)
  3. Pass all command-line arguments to hashcat and run it.

As you can see, this doesn't implement hashcat's functionality in Python - why would it? Hashcat doesn't become better by being re-implemented in different languages.

0

There is a hashcat API - and there is a set of Python bindings for it:

https://github.com/Rich5/pyhashcat

This allows you to use all of the Python features that you would like, while using the full speed of hashcat itself (but hashcat does need to be present - there's no way to get that power otherwise)

Not the answer you're looking for? Browse other questions tagged .