Rich5 / pyhashcat

Python bindings for hashcat
56 stars 37 forks source link

OS X Issues #18

Closed tankbusta closed 7 years ago

tankbusta commented 7 years ago

Hey Rich,

Out of curiosity, what platform are you using? I've been trying to get this to work on OS X but running into issues running the test.py script.

-------------------------------
---- Simple pyhashcat Test ----
-------------------------------
[+] Running hashcat
STATUS:  Initializing
Traceback (most recent call last):
  File "test.py", line 68, in <module>
    sleep(5)
RuntimeError: /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/OpenCL/: m

It looks like there is some automagical path calculation when looking for the kernels/OpenCL files where it's using the executable path instead of /usr/local/share/hashcat in https://github.com/Rich5/pyHashcat/blob/master/pyhashcat/pyhashcat.c#L546 (which does exist locally). This doesn't seem to be an issue on Linux though.

Rich5 commented 7 years ago

Yep it's probably this line

https://github.com/Rich5/pyHashcat/blob/master/pyhashcat/pyhashcat.c#L546

The first parameter is where Python is installed and the second is where you installed all the hashcat files.

I plan on making these configurable at install or runtime just haven't got to it yet. I don't have a Mac so please feel free to provide any feedback bad or good. I've only tested on Ubuntu so far.

Edit: So as you pointed out it uses the executable path instead of the /usr/local/share/hashcat path. That's the behavior of libhashcat. Try changing the first parameter to wherever Python is installed on your system.

-Rich

On Jan 30, 2017 4:35 PM, "Schmitt" notifications@github.com wrote:

Hey Rich,

Out of curiosity, what platform are you using? I've been trying to get this to work on OS X but running into issues running the test.py script.


---- Simple pyhashcat Test ----

[+] Running hashcat STATUS: Initializing Traceback (most recent call last): File "test.py", line 68, in sleep(5) RuntimeError: /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/OpenCL/: m

It looks like there is some automagical path calculation when looking for the kernels/OpenCL files where it's using the executable path instead of /usr/local/share/hashcat in https://github.com/Rich5/pyHashcat/blob/master/ pyhashcat/pyhashcat.c#L546 (which does exist locally). This doesn't seem to be an issue on Linux though.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Rich5/pyHashcat/issues/18, or mute the thread https://github.com/notifications/unsubscribe-auth/AHiWDznVO4LfGxAaIxy-SrUUI0V8l11Aks5rXlergaJpZM4Lx8o- .

Rich5 commented 7 years ago

This should be fixed. Now you can set the paths in the hashcat_session_execute()function like this:

hc.hashcat_session_execute(py_path="/usr/bin", hc_path="/usr/local/share/hashcat")

Note that the above paths are already the default settings so you should only have to set them if your install if different.