2015-12-04 14:47:52 +00:00
|
|
|
oclHashcat build documentation
|
|
|
|
=
|
|
|
|
# Revision:
|
|
|
|
* 1.0
|
|
|
|
|
|
|
|
# Authors:
|
|
|
|
* Gabriele Gristina <<matrix@hashcat.net>>
|
|
|
|
* Christoph Heuwieser <<dropdead@hashcat.net>>
|
|
|
|
|
|
|
|
# Dependencies
|
|
|
|
|
|
|
|
To compile **oclHashcat** the following third party libraries are required:
|
|
|
|
|
|
|
|
ADL_SDK v8.0 - http://developer.amd.com/tools-and-sdks/graphics-development/display-library-adl-sdk/
|
|
|
|
cuda v7.5 - https://developer.nvidia.com/cuda-downloads
|
|
|
|
GDK v352_55 - https://developer.nvidia.com/gpu-deployment-kit
|
|
|
|
NVIDIA Driver v352.21 - https://www.nvidia.com/download/driverResults.aspx/86390/en-us
|
|
|
|
NVAPI R352 - https://developer.nvidia.com/nvapi
|
|
|
|
AMD-APP-SDK v3.0 - http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/
|
|
|
|
|
|
|
|
To be able to compile the ocl binaries, it is required to have the latest stable driver from AMD installed.
|
|
|
|
(fglxr must be installed and initialized)
|
|
|
|
|
|
|
|
http://support.amd.com/
|
|
|
|
|
2015-12-09 14:55:06 +00:00
|
|
|
The next thing to do is download all the third party libraries listed above and put these files into the *deps/tmp* directory.
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2015-12-09 14:55:06 +00:00
|
|
|
The following files are needed inside the *deps/tmp* directory:
|
2015-12-04 14:47:52 +00:00
|
|
|
|
|
|
|
ADL_SDK8.zip
|
|
|
|
R352-developer.zip
|
|
|
|
cuda_7.5.18_linux.run
|
|
|
|
NVIDIA-Linux-x86_64-352.21.run
|
|
|
|
gdk_linux_amd64_352_55_release.run
|
2015-12-09 12:33:21 +00:00
|
|
|
AMD-APP-SDKInstaller-v3.0.130.135-GA-linux64.tar.bz2
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2015-12-10 16:09:59 +00:00
|
|
|
Now just execute the following script to complete the installation of dependencies (check for an updated version in **tools/deps.sh**):
|
2015-12-04 14:47:52 +00:00
|
|
|
|
|
|
|
#!/bin/bash
|
|
|
|
# Author: Gabriele Gristina <matrix@hashcat.net>
|
2015-12-09 14:55:06 +00:00
|
|
|
# Revision: 1.02
|
2015-12-04 14:47:52 +00:00
|
|
|
|
|
|
|
## global vars
|
2015-12-09 14:55:06 +00:00
|
|
|
DEPS="make gcc g++ gcc-multilib g++-multilib libc6-dev-i386 mingw-w64 build-essential unzip"
|
2015-12-09 12:33:21 +00:00
|
|
|
DOWNLOAD_DEPS="ADL_SDK8.zip R352-developer.zip cuda_7.5.18_linux.run NVIDIA-Linux-x86_64-352.21.run gdk_linux_amd64_352_55_release.run AMD-APP-SDKInstaller-v3.0.130.135-GA-linux64.tar.bz2"
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2015-12-09 14:55:06 +00:00
|
|
|
## enter the deps directory
|
2015-12-09 12:33:21 +00:00
|
|
|
cur_directory=$(dirname ${0})
|
|
|
|
script_directory=$(cd ${cur_directory} && pwd -P)
|
2015-12-09 14:55:06 +00:00
|
|
|
deps_dir=${script_directory}/../deps
|
2015-12-09 12:33:21 +00:00
|
|
|
|
2015-12-09 14:55:06 +00:00
|
|
|
mkdir -p ${deps_dir} # but it should already exist (is part of the repository)
|
|
|
|
cd ${deps_dir}
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2015-12-09 14:55:06 +00:00
|
|
|
## cleanup the directories under the 'deps' folder
|
2015-12-09 12:33:21 +00:00
|
|
|
rm -rf {adl-sdk,cuda-7.5,NVIDIA-Linux-x86_64-352.21,nvidia-gdk,amd-app-sdk} && \
|
|
|
|
mkdir -p {tmp,adl-sdk,cuda-7.5,NVIDIA-Linux-x86_64-352.21,nvidia-gdk,amd-app-sdk} && \
|
|
|
|
cd tmp/
|
2015-12-04 14:47:52 +00:00
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
2015-12-09 14:55:06 +00:00
|
|
|
echo "! Cannot create deps directories."
|
2015-12-09 12:33:21 +00:00
|
|
|
exit 1
|
2015-12-04 14:47:52 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
## check dependencies
|
|
|
|
i=0
|
|
|
|
for d in ${DOWNLOAD_DEPS}; do
|
2015-12-09 12:33:21 +00:00
|
|
|
if [ ! -f "${d}" ]; then
|
|
|
|
echo "! ${d} not found."
|
|
|
|
((i++))
|
|
|
|
fi
|
2015-12-04 14:47:52 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
if [ ${i} -gt 0 ]; then
|
2015-12-09 14:55:06 +00:00
|
|
|
echo "! Please manually download all the above dependencies to the deps/tmp/ directory"
|
2015-12-09 12:33:21 +00:00
|
|
|
exit 1
|
2015-12-04 14:47:52 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
## installing needed packages
|
|
|
|
for pkg in ${DEPS}; do
|
2015-12-09 12:33:21 +00:00
|
|
|
|
|
|
|
# check if the package is already installed
|
|
|
|
dpkg -s ${pkg} &>/dev/null
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
## root check
|
|
|
|
if [ $(id -u) -ne 0 ]; then
|
|
|
|
echo "! Must be root to install the required package '${pkg}' with apt-get"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
apt-get -y install ${pkg}
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "! failed to install ${pkg}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2015-12-04 14:47:52 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
## extract ADL SDK
|
2015-12-09 14:55:06 +00:00
|
|
|
unzip ADL_SDK8.zip -d ${deps_dir}/adl-sdk-8
|
2015-12-04 14:47:52 +00:00
|
|
|
ret=$?
|
|
|
|
|
|
|
|
if [[ ${ret} -ne 0 ]] && [[ ${ret} -ne 1 ]]; then
|
2015-12-09 12:33:21 +00:00
|
|
|
echo "! failed to extract ADL SDK"
|
|
|
|
exit 1
|
2015-12-04 14:47:52 +00:00
|
|
|
fi
|
|
|
|
|
2015-12-09 14:55:06 +00:00
|
|
|
rm -rf ${deps_dir}/adl-sdk && ln -s ${deps_dir}/adl-sdk-8 ${deps_dir}/adl-sdk
|
2015-12-09 12:33:21 +00:00
|
|
|
|
2015-12-04 14:47:52 +00:00
|
|
|
if [ $? -ne 0 ]; then
|
2015-12-09 12:33:21 +00:00
|
|
|
echo "! failed to setup ADL SDK link"
|
|
|
|
exit 1
|
2015-12-04 14:47:52 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
## extract NVAPI
|
2015-12-09 14:55:06 +00:00
|
|
|
unzip R352-developer.zip -d ${deps_dir}
|
2015-12-04 14:47:52 +00:00
|
|
|
ret=$?
|
|
|
|
|
|
|
|
if [[ ${ret} -ne 0 ]] && [[ ${ret} -ne 1 ]]; then
|
2015-12-09 12:33:21 +00:00
|
|
|
echo "! failed to extract NVAPI"
|
|
|
|
exit 1
|
2015-12-04 14:47:52 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
## install CUDA SDK
|
|
|
|
chmod +x cuda_7.5.18_linux.run && \
|
2015-12-09 14:55:06 +00:00
|
|
|
./cuda_7.5.18_linux.run -toolkit -silent -override --toolkitpath=${deps_dir}/cuda-7.5
|
2015-12-04 14:47:52 +00:00
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
2015-12-09 12:33:21 +00:00
|
|
|
echo "! failed to install CUDA SDK"
|
|
|
|
exit 1
|
2015-12-04 14:47:52 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
## install NVIDIA Driver
|
|
|
|
chmod +x NVIDIA-Linux-x86_64-352.21.run && \
|
|
|
|
./NVIDIA-Linux-x86_64-352.21.run -x && \
|
2015-12-09 14:55:06 +00:00
|
|
|
mv NVIDIA-Linux-x86_64-352.21 ${deps_dir}/ && \
|
|
|
|
cd ${deps_dir}/NVIDIA-Linux-x86_64-352.21 && \
|
2015-12-04 14:47:52 +00:00
|
|
|
ln -s libnvidia-ml.so.352.21 libnvidia-ml.so && \
|
|
|
|
ln -s libcuda.so.352.21 libcuda.so && \
|
|
|
|
cd 32 && \
|
|
|
|
ln -s libnvidia-ml.so.352.21 libnvidia-ml.so && \
|
|
|
|
ln -s libcuda.so.352.21 libcuda.so && \
|
2015-12-09 14:55:06 +00:00
|
|
|
cd ${deps_dir}/tmp
|
2015-12-04 14:47:52 +00:00
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
2015-12-09 12:33:21 +00:00
|
|
|
echo "! failed to install NVIDIA Driver"
|
|
|
|
exit 1
|
2015-12-04 14:47:52 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
## install NVIDIA GPU Deployment Kit
|
|
|
|
chmod +x gdk_linux_amd64_352_55_release.run && \
|
2015-12-09 14:55:06 +00:00
|
|
|
./gdk_linux_amd64_352_55_release.run --silent --installdir=${deps_dir}/nvidia-gdk
|
2015-12-04 14:47:52 +00:00
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
2015-12-09 12:33:21 +00:00
|
|
|
echo "! failed to install NVIDIA GPU Deployment Kit"
|
|
|
|
exit 1
|
2015-12-04 14:47:52 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
## extract AMD APP SDK
|
2015-12-09 12:33:21 +00:00
|
|
|
tar xjf AMD-APP-SDKInstaller-v3.0.130.135-GA-linux64.tar.bz2 && \
|
2015-12-09 14:55:06 +00:00
|
|
|
./AMD-APP-SDK-v3.0.130.135-GA-linux64.sh --noexec --target ${deps_dir}/amd-app-sdk-v3.0.130.135
|
2015-12-04 14:47:52 +00:00
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
2015-12-09 12:33:21 +00:00
|
|
|
echo "! failed to extract AMD APP SDK"
|
|
|
|
exit 1
|
2015-12-04 14:47:52 +00:00
|
|
|
fi
|
|
|
|
|
2015-12-09 14:55:06 +00:00
|
|
|
rm -rf ${deps_dir}/amd-app-sdk && ln -s ${deps_dir}/amd-app-sdk-v3.0.130.135 ${deps_dir}/amd-app-sdk
|
2015-12-09 12:33:21 +00:00
|
|
|
|
2015-12-04 14:47:52 +00:00
|
|
|
if [ $? -ne 0 ]; then
|
2015-12-09 12:33:21 +00:00
|
|
|
echo "! failed to setup ADL SDK link"
|
|
|
|
exit 1
|
2015-12-04 14:47:52 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "> oclHashcat dependencies have been resolved."
|
|
|
|
|
|
|
|
# Building oclHashcat
|
|
|
|
First get a copy of **oclHashcat** repository
|
|
|
|
|
|
|
|
```sh
|
|
|
|
$ git clone https://github.com/hashcat/oclHashcat.git
|
|
|
|
```
|
|
|
|
|
|
|
|
Now simply jump in and type "make all"
|
|
|
|
|
|
|
|
```sh
|
|
|
|
$ cd oclHashcat
|
|
|
|
$ make all
|
|
|
|
```
|
|
|
|
|
|
|
|
Useful tricks:
|
|
|
|
- build only *Linux* binaries
|
|
|
|
```sh
|
|
|
|
$ make linux
|
|
|
|
```
|
|
|
|
- build only *Windows* binaries
|
|
|
|
```sh
|
|
|
|
$ make windows
|
|
|
|
```
|
|
|
|
|
|
|
|
=
|
|
|
|
Enjoy your fresh **oclHashcat** binaries ;)
|