├── .gitignore ├── LICENSE ├── Dockerfile └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017-2020 Danylo Ulianych 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvidia/cuda:12.8.1-devel-ubuntu22.04 2 | 3 | LABEL com.nvidia.volumes.needed="nvidia_driver" 4 | 5 | RUN apt-get update && apt-get install -y --no-install-recommends \ 6 | ocl-icd-libopencl1 \ 7 | clinfo pkg-config && \ 8 | rm -rf /var/lib/apt/lists/* 9 | 10 | RUN mkdir -p /etc/OpenCL/vendors && \ 11 | echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd 12 | 13 | # nvidia-container-runtime 14 | ENV NVIDIA_VISIBLE_DEVICES all 15 | ENV NVIDIA_DRIVER_CAPABILITIES compute,utility 16 | ################################ end nvidia opencl driver ################################ 17 | 18 | ENV HASHCAT_VERSION v7.1.1 19 | ENV HASHCAT_UTILS_VERSION v1.9 20 | ENV HCXTOOLS_VERSION 6.3.5 21 | ENV HCXDUMPTOOL_VERSION 6.3.5 22 | ENV HCXKEYS_VERSION master 23 | 24 | # Update & install packages for installing hashcat 25 | RUN apt-get update && \ 26 | apt-get install -y wget make clinfo build-essential git libcurl4-openssl-dev libssl-dev zlib1g-dev libcurl4-openssl-dev libssl-dev pciutils libpcap-dev 27 | 28 | # Fetch PCI IDs list to display proper GPU names 29 | RUN update-pciids 30 | 31 | WORKDIR /root 32 | 33 | RUN git clone https://github.com/hashcat/hashcat.git && cd hashcat && git checkout ${HASHCAT_VERSION} && make install -j4 34 | 35 | RUN git clone https://github.com/hashcat/hashcat-utils.git && cd hashcat-utils/src && git checkout ${HASHCAT_UTILS_VERSION} && make 36 | RUN ln -s /root/hashcat-utils/src/cap2hccapx.bin /usr/bin/cap2hccapx 37 | 38 | RUN git clone https://github.com/ZerBea/hcxtools.git && cd hcxtools && git checkout ${HCXTOOLS_VERSION} && make install 39 | 40 | RUN git clone https://github.com/ZerBea/hcxdumptool.git && cd hcxdumptool && git checkout ${HCXDUMPTOOL_VERSION} && make install 41 | 42 | RUN git clone https://github.com/hashcat/kwprocessor.git && cd kwprocessor && git checkout ${HCXKEYS_VERSION} && make 43 | RUN ln -s /root/kwprocessor/kwp /usr/bin/kwp 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Docker Hub](http://dockeri.co/image/dizcza/docker-hashcat)](https://hub.docker.com/r/dizcza/docker-hashcat/) 2 | 3 | [![](https://img.shields.io/docker/image-size/dizcza/docker-hashcat/latest?label=latest)](https://hub.docker.com/r/dizcza/docker-hashcat/tags) 4 | [![](https://img.shields.io/docker/image-size/dizcza/docker-hashcat/cuda?label=cuda)](https://hub.docker.com/r/dizcza/docker-hashcat/tags) 5 | [![](https://img.shields.io/docker/image-size/dizcza/docker-hashcat/pocl?label=cuda12.1)](https://hub.docker.com/r/dizcza/docker-hashcat/tags) 6 | [![](https://img.shields.io/docker/image-size/dizcza/docker-hashcat/intel-cpu?label=intel-cpu)](https://hub.docker.com/r/dizcza/docker-hashcat/tags) 7 | [![](https://img.shields.io/docker/image-size/dizcza/docker-hashcat/intel-gpu?label=intel-gpu)](https://hub.docker.com/r/dizcza/docker-hashcat/tags) 8 | [![](https://img.shields.io/docker/image-size/dizcza/docker-hashcat/pocl?label=pocl)](https://hub.docker.com/r/dizcza/docker-hashcat/tags) 9 | 10 | 11 | [Hashcat](https://hashcat.net/hashcat/) with hashcat utils on Ubuntu 18.04 for Nvidia GPUs (`:cuda`), AMD GPUs (`:latest`), Intel GPUs (`:intel-gpu`), Intel CPUs (`:intel-cpu`), KVMs and AMD CPUs (`:pocl`). 12 | 13 | 14 | ``` 15 | docker pull dizcza/docker-hashcat 16 | 17 | docker run --gpus all -it dizcza/docker-hashcat /bin/bash 18 | ``` 19 | 20 | Then inside the docker container run 21 | 22 | ``` 23 | # list the available CUDA and OpenCL interfaces 24 | hashcat -I 25 | 26 | # run a bechmark 27 | hashcat -b 28 | ``` 29 | 30 | :point_right: Running RTX 5000 on vast.ai? Refer to the `:cuda` tag below. 31 | 32 | ## Troubleshooting 33 | 34 | * If you get the `nvrtcCompileProgram(): NVRTC_ERROR_INVALID_OPTION` error, switch to the OpenCL backend by adding `-d 2` to your command line: `hashcat -b -d 2`. 35 | 36 | * Warning "Device #1: Unstable OpenCL driver detected!" can be suppressed by adding the `--force` flag to a hashcat command (f.i., `hashcat -m2500 -b --force`). 37 | 38 | * If you get 39 | 40 | > docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]. 41 | 42 | while running a docker run command with the `--gpus all` flag enabled, install the nvidia-container-toolkit and restart the docker daemon: 43 | ``` 44 | sudo apt-get install nvidia-container-toolkit 45 | sudo systemctl restart docker 46 | ``` 47 | 48 | 49 | ## Tags 50 | 51 | ### latest 52 | 53 | `docker pull dizcza/docker-hashcat:latest` 54 | 55 | The `:latest` is a generic tag for both Nvidia and AMD GPUs. It includes CUDA and the (default) OpenCL backends. Hashcat will pick CUDA, if your hardware supports it, because CUDA is faster than OpenCL (see [thread](https://hashcat.net/forum/thread-9303.html)). If your compute device does not support CUDA, hashcat will fall back to the OpenCL backend. 56 | 57 | ### cuda 58 | 59 | `docker pull dizcza/docker-hashcat:cuda` 60 | 61 | Recommended for Nvidia GPUs. If you have any issues running this container with Nvidia GPU, please drop a comment in this [issue](https://github.com/dizcza/docker-hashcat/issues/6). 62 | 63 | ### cuda12.1 64 | 65 | `docker pull dizcza/docker-hashcat:cuda12.1` 66 | 67 | For old Nvidia GPU cards, if the `cuda` tag doesn't work, use the `cuda12.1` tag. 68 | 69 | ### intel-cpu 70 | 71 | `docker pull dizcza/docker-hashcat:intel-cpu` 72 | 73 | Suitable for Intel CPUs. 74 | 75 | 76 | ### intel-gpu 77 | 78 | `docker run -it --device /dev/dri:/dev/dri dizcza/docker-hashcat:intel-gpu` 79 | 80 | Intel NEO OpenCL driver (suitable for the majority of laptops with an embedded Intel graphics card). 81 | 82 | ### pocl 83 | 84 | `docker pull dizcza/docker-hashcat:pocl` 85 | 86 | An alternative to `:intel-cpu` tag, the `:pocl` tag provides an open-source (but not officially supported by HashCat) implementation of OpenCL, which you can find in the `pocl-opencl-icd` linux package (usually, outdated). Suitable for Intel & AMD CPUs and KVMs. For more information about using POCL in hashcat refer to the [discussion](https://github.com/hashcat/hashcat/issues/2398#issuecomment-628732757). 87 | 88 | Try `:pocl` tag if no other tag worked for you. 89 | 90 | ## Deprecated tags 91 | 92 | ### intel-cpu-legacy 93 | 94 | `docker pull dizcza/docker-hashcat:intel-cpu-legacy` 95 | 96 | The `:intel-cpu-legacy` tag keeps the latest successful build of Hashcat 6.2.6 + deprecated IntelCPU runtime file. Now it's superseded by the `:intel-cpu` tag, which contains up-to-date Intel OpenCL CPU drivers. 97 | 98 | 99 | ## Benchmark 100 | 101 | Benchmark command: `hashcat -m2500 -b` 102 | 103 | | Tag(s) | Device | Speed, H/s | 104 | |---|----------|-----------| 105 | |latest, cuda| GeForce GTX 1080 Ti | 603500 | 106 | |intel-gpu| Intel UHD Graphics 620 | 8240 | 107 | |intel-cpu| Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz | 11009 | 108 | |pocl| pthread-Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz | 7647 | 109 | 110 | If you have a laptop with an embedded Intel GPU card, you can combine `intel-cpu` and `intel-gpu` installations manually to utilize both CPU and GPU, increasing the speed up to 15000 H/s. 111 | 112 | ## Hashcat utils 113 | 114 | Along with the hashcat, the following utility packages are installed: 115 | 116 | * [hashcat-utils](https://github.com/hashcat/hashcat-utils) for converting raw Airodump to HCCAPX capture format; info `cap2hccapx -h` 117 | * [hcxtools](https://github.com/zerbea/hcxtools) for inspecting, filtering, and converting capture files; 118 | * [hcxdumptool](https://github.com/ZerBea/hcxdumptool) for capturing packets from wlan devices in any format you might think of; info `hcxdumptool -h` 119 | * [kwprocessor](https://github.com/hashcat/kwprocessor) for creating advanced keyboard-walk password candidates; info `kwp -h` 120 | 121 | 122 | ## Usages 123 | 124 | This Dockerfile is used in the [hashcat-wpa-server](https://github.com/dizcza/hashcat-wpa-server) project to automate WPA/WPA2 hashes cracking. 125 | 126 | To build upon this Dockerfile with your custom packages, create a new Dockerfile that starts with 127 | 128 | ```Dockerfile 129 | ARG branch=latest 130 | FROM dizcza/docker-hashcat:$branch 131 | ``` 132 | 133 | The `branch` arg can be any tag listed above. 134 | 135 | --------------------------------------------------------------------------------