Hashcat on Spark Cluster

Hashcat on Spark Cluster

Databricks Notebook for Hashcat

·

1 min read

This was more of an experimental attempt to see if and how well Hashcat would run on a Databricks Spark Cluster. If you have spare machines lying around, you can leverage their computing with [Hashtopolis](https://github.com/hashtopolis/server). The notebook notes various ways of installing Hashcat and HXCTOOLs as well as running them. See previous post on cracking .zip and .rar archives.

If you are not able to mount to an Azure Storage Account, S3 or some external location this section might be an alternative.

import base64

# RAR in this case.
handshakes = """BASE64_ENCODED_ARCHIVE_OF_HANDSHAKES"""
decoded_bytes = base64.b64decode(handshakes)
with open("/tmp/handshakes.rar", "wb") as text_file:
    text_file.write(decoded_bytes)

The cells above illustrate the base64 encoded string of an image that is decoded and rendered. Note, that just using base64 in shell won't finish or takes too long for large strings. Using Python string to bytes and writing to file works better.

This was run on a cluster that had access to 4 NVIDIA GPUs. Not sure of the spec. I had trouble getting the CUDA drivers working. Hashcat via Linode is probably a better option to take advantage of the GPUs.

TODO: Benchmarks with and without CUDA if I ever get back to it.

References