1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-22 22:58:30 +00:00

issue #14: move /opt/hashcat-deps/ to [git_clone_dir]/hascat-deps/

This commit is contained in:
philsmd 2015-12-09 13:33:21 +01:00
parent 5333ca020a
commit 29547c4f9b
5 changed files with 115 additions and 89 deletions

View File

@ -23,140 +23,153 @@ To be able to compile the ocl binaries, it is required to have the latest stable
http://support.amd.com/ http://support.amd.com/
The next thing to do is download all the third party libraries listed above and put files into */opt/hashcat-deps/tmp* directory. The next thing to do is download all the third party libraries listed above and put these files into the *hashcat-deps/tmp* directory.
The following files are needed inside the */opt/hashcat-deps/tmp* directory: The following files are needed inside the *hashcat-deps/tmp* directory:
ADL_SDK8.zip ADL_SDK8.zip
R352-developer.zip R352-developer.zip
cuda_7.5.18_linux.run cuda_7.5.18_linux.run
NVIDIA-Linux-x86_64-352.21.run NVIDIA-Linux-x86_64-352.21.run
gdk_linux_amd64_352_55_release.run gdk_linux_amd64_352_55_release.run
AMDAPPSDK-3.0-linux64.tar.bz2 AMD-APP-SDKInstaller-v3.0.130.135-GA-linux64.tar.bz2
Now just execute the following script to complete the installation of dependencies (check for an updated version in **docs/deps.sh**): Now just execute the following script to complete the installation of dependencies (check for an updated version in **docs/deps.sh**):
#!/bin/bash #!/bin/bash
# Author: Gabriele Gristina <matrix@hashcat.net> # Author: Gabriele Gristina <matrix@hashcat.net>
# Revision: 1.0 # Revision: 1.01
## global vars ## global vars
DEPS="make gcc-4.9 g++-4.9 gcc-4.9-multilib g++-4.9-multilib libc6-dev-i386 mingw-w64 build-essential unzip" DEPS="make gcc-4.9 g++-4.9 gcc-4.9-multilib g++-4.9-multilib libc6-dev-i386 mingw-w64 build-essential unzip"
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 AMDAPPSDK-3.0-linux64.tar.bz2" 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"
## root check ## enter the hashcat-deps directory
if [ $(id -u) -ne 0 ]; then cur_directory=$(dirname ${0})
echo "! Must be root" script_directory=$(cd ${cur_directory} && pwd -P)
exit 1 hashcat_deps_dir=${script_directory}/../hashcat-deps
fi
## cleanup 'hashcat-deps' directories mkdir -p ${hashcat_deps_dir} # but it should already exist (is part of the repository)
rm -rf /opt/hashcat-deps/{adl-sdk,cuda-7.5,NVIDIA-Linux-x86_64-352.21,nvidia-gdk,amd-app-sdk} && \ cd ${hashcat_deps_dir}
mkdir -p /opt/hashcat-deps/{tmp,adl-sdk,cuda-7.5,NVIDIA-Linux-x86_64-352.21,nvidia-gdk,amd-app-sdk} && \
cd /opt/hashcat-deps/tmp ## cleanup the directories under the 'hashcat-deps' folder
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/
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "! Cannot create hashcat-deps directories." echo "! Cannot create hashcat-deps directories."
exit 1 exit 1
fi fi
## check dependencies ## check dependencies
i=0 i=0
for d in ${DOWNLOAD_DEPS}; do for d in ${DOWNLOAD_DEPS}; do
if [ ! -f "${d}" ]; then if [ ! -f "${d}" ]; then
echo "! ${d} not found." echo "! ${d} not found."
((i++)) ((i++))
fi fi
done done
if [ ${i} -gt 0 ]; then if [ ${i} -gt 0 ]; then
echo "! Please download manually into the directory /opt/hashcat-deps/tmp" echo "! Please manually download all the above dependencies to the hashcat-deps/tmp/ directory"
exit 1 exit 1
fi fi
## installing needed packages ## installing needed packages
for pkg in ${DEPS}; do for pkg in ${DEPS}; do
apt-get -y install ${pkg}
if [ $? -ne 0 ]; then # check if the package is already installed
echo "! failed to install ${pkg}" dpkg -s ${pkg} &>/dev/null
exit 1 if [ $? -ne 0 ]; then
fi ## 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
done done
## extract ADL SDK ## extract ADL SDK
unzip ADL_SDK8.zip -d /opt/hashcat-deps/adl-sdk-8 unzip ADL_SDK8.zip -d ${hashcat_deps_dir}/adl-sdk-8
ret=$? ret=$?
if [[ ${ret} -ne 0 ]] && [[ ${ret} -ne 1 ]]; then if [[ ${ret} -ne 0 ]] && [[ ${ret} -ne 1 ]]; then
echo "! failed to extract ADL SDK" echo "! failed to extract ADL SDK"
exit 1 exit 1
fi fi
rm -rf /opt/hashcat-deps/adl-sdk && ln -s /opt/hashcat-deps/adl-sdk-8 /opt/hashcat-deps/adl-sdk rm -rf ${hashcat_deps_dir}/adl-sdk && ln -s ${hashcat_deps_dir}/adl-sdk-8 ${hashcat_deps_dir}/adl-sdk
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "! failed to setup ADL SDK link" echo "! failed to setup ADL SDK link"
exit 1 exit 1
fi fi
## extract NVAPI ## extract NVAPI
unzip R352-developer.zip -d /opt/hashcat-deps/ unzip R352-developer.zip -d ${hashcat_deps_dir}
ret=$? ret=$?
if [[ ${ret} -ne 0 ]] && [[ ${ret} -ne 1 ]]; then if [[ ${ret} -ne 0 ]] && [[ ${ret} -ne 1 ]]; then
echo "! failed to extract NVAPI" echo "! failed to extract NVAPI"
exit 1 exit 1
fi fi
## install CUDA SDK ## install CUDA SDK
chmod +x cuda_7.5.18_linux.run && \ chmod +x cuda_7.5.18_linux.run && \
./cuda_7.5.18_linux.run -toolkit -silent -override --toolkitpath=/opt/hashcat-deps/cuda-7.5 ./cuda_7.5.18_linux.run -toolkit -silent -override --toolkitpath=${hashcat_deps_dir}/cuda-7.5
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "! failed to install CUDA SDK" echo "! failed to install CUDA SDK"
exit 1 exit 1
fi fi
## install NVIDIA Driver ## install NVIDIA Driver
chmod +x NVIDIA-Linux-x86_64-352.21.run && \ chmod +x NVIDIA-Linux-x86_64-352.21.run && \
./NVIDIA-Linux-x86_64-352.21.run -x && \ ./NVIDIA-Linux-x86_64-352.21.run -x && \
mv NVIDIA-Linux-x86_64-352.21 /opt/hashcat-deps/ && \ mv NVIDIA-Linux-x86_64-352.21 ${hashcat_deps_dir}/ && \
cd /opt/hashcat-deps/NVIDIA-Linux-x86_64-352.21 && \ cd ${hashcat_deps_dir}/NVIDIA-Linux-x86_64-352.21 && \
ln -s libnvidia-ml.so.352.21 libnvidia-ml.so && \ ln -s libnvidia-ml.so.352.21 libnvidia-ml.so && \
ln -s libcuda.so.352.21 libcuda.so && \ ln -s libcuda.so.352.21 libcuda.so && \
cd 32 && \ cd 32 && \
ln -s libnvidia-ml.so.352.21 libnvidia-ml.so && \ ln -s libnvidia-ml.so.352.21 libnvidia-ml.so && \
ln -s libcuda.so.352.21 libcuda.so && \ ln -s libcuda.so.352.21 libcuda.so && \
cd /opt/hashcat-deps/tmp cd ${hashcat_deps_dir}/tmp
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "! failed to install NVIDIA Driver" echo "! failed to install NVIDIA Driver"
exit 1 exit 1
fi fi
## install NVIDIA GPU Deployment Kit ## install NVIDIA GPU Deployment Kit
chmod +x gdk_linux_amd64_352_55_release.run && \ chmod +x gdk_linux_amd64_352_55_release.run && \
./gdk_linux_amd64_352_55_release.run --silent --installdir=/opt/hashcat-deps/nvidia-gdk ./gdk_linux_amd64_352_55_release.run --silent --installdir=${hashcat_deps_dir}/nvidia-gdk
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "! failed to install NVIDIA GPU Deployment Kit" echo "! failed to install NVIDIA GPU Deployment Kit"
exit 1 exit 1
fi fi
## extract AMD APP SDK ## extract AMD APP SDK
tar xjf AMDAPPSDK-3.0-linux64.tar.bz2 && \ tar xjf AMD-APP-SDKInstaller-v3.0.130.135-GA-linux64.tar.bz2 && \
./AMD-APP-SDK-v3.0.130.135-GA-linux64.sh --noexec --target /opt/hashcat-deps/amd-app-sdk-v3.0.130.135 ./AMD-APP-SDK-v3.0.130.135-GA-linux64.sh --noexec --target ${hashcat_deps_dir}/amd-app-sdk-v3.0.130.135
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "! failed to extract AMD APP SDK" echo "! failed to extract AMD APP SDK"
exit 1 exit 1
fi fi
rm -rf /opt/hashcat-deps/amd-app-sdk && ln -s /opt/hashcat-deps/amd-app-sdk-v3.0.130.135 /opt/hashcat-deps/amd-app-sdk rm -rf ${hashcat_deps_dir}/amd-app-sdk && ln -s ${hashcat_deps_dir}/amd-app-sdk-v3.0.130.135 ${hashcat_deps_dir}/amd-app-sdk
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "! failed to setup ADL SDK link" echo "! failed to setup ADL SDK link"
exit 1 exit 1
fi fi
echo "> oclHashcat dependencies have been resolved." echo "> oclHashcat dependencies have been resolved."

0
hashcat-deps/.lock Normal file
View File

0
hashcat-deps/tmp/.lock Normal file
View File

View File

@ -24,18 +24,18 @@ endif
## Library Paths ## Library Paths
## ##
OCL := /opt/hashcat-deps/amd-app-sdk OCL := hashcat-deps/amd-app-sdk
OCLLIBPATH32 := $(OCL)/lib/x86 OCLLIBPATH32 := $(OCL)/lib/x86
OCLLIBPATH64 := $(OCL)/lib/x86_64 OCLLIBPATH64 := $(OCL)/lib/x86_64
CUDA := /opt/hashcat-deps/cuda-7.5 CUDA := hashcat-deps/cuda-7.5
CUDALIBPATH32 := /opt/hashcat-deps/NVIDIA-Linux-x86_64-352.21/32 CUDALIBPATH32 := hashcat-deps/NVIDIA-Linux-x86_64-352.21/32
CUDALIBPATH64 := /opt/hashcat-deps/NVIDIA-Linux-x86_64-352.21 CUDALIBPATH64 := hashcat-deps/NVIDIA-Linux-x86_64-352.21
ADL := /opt/hashcat-deps/adl-sdk ADL := hashcat-deps/adl-sdk
GDK := /opt/hashcat-deps/nvidia-gdk GDK := hashcat-deps/nvidia-gdk
NVAPI := /opt/hashcat-deps/R352-developer NVAPI := hashcat-deps/R352-developer
NVMLINCPATH := $(GDK)/usr/include/nvidia/gdk/ NVMLINCPATH := $(GDK)/usr/include/nvidia/gdk/
NVMLLIBPATH32 := $(CUDALIBPATH32) NVMLLIBPATH32 := $(CUDALIBPATH32)

View File

@ -1,21 +1,23 @@
#!/bin/bash #!/bin/bash
# Author: Gabriele Gristina <matrix@hashcat.net> # Author: Gabriele Gristina <matrix@hashcat.net>
# Revision: 1.0 # Revision: 1.01
## global vars ## global vars
DEPS="make gcc-4.9 g++-4.9 gcc-4.9-multilib g++-4.9-multilib libc6-dev-i386 mingw-w64 build-essential unzip" DEPS="make gcc-4.9 g++-4.9 gcc-4.9-multilib g++-4.9-multilib libc6-dev-i386 mingw-w64 build-essential unzip"
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 AMDAPPSDK-3.0-linux64.tar.bz2" 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"
## root check ## enter the hashcat-deps directory
if [ $(id -u) -ne 0 ]; then cur_directory=$(dirname ${0})
echo "! Must be root" script_directory=$(cd ${cur_directory} && pwd -P)
exit 1 hashcat_deps_dir=${script_directory}/../hashcat-deps
fi
## cleanup 'hashcat-deps' directories mkdir -p ${hashcat_deps_dir} # but it should already exist (is part of the repository)
rm -rf /opt/hashcat-deps/{adl-sdk,cuda-7.5,NVIDIA-Linux-x86_64-352.21,nvidia-gdk,amd-app-sdk} && \ cd ${hashcat_deps_dir}
mkdir -p /opt/hashcat-deps/{tmp,adl-sdk,cuda-7.5,NVIDIA-Linux-x86_64-352.21,nvidia-gdk,amd-app-sdk} && \
cd /opt/hashcat-deps/tmp ## cleanup the directories under the 'hashcat-deps' folder
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/
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "! Cannot create hashcat-deps directories." echo "! Cannot create hashcat-deps directories."
@ -32,21 +34,32 @@ for d in ${DOWNLOAD_DEPS}; do
done done
if [ ${i} -gt 0 ]; then if [ ${i} -gt 0 ]; then
echo "! Please download manually into the directory /opt/hashcat-deps/tmp" echo "! Please manually download all the above dependencies to the hashcat-deps/tmp/ directory"
exit 1 exit 1
fi fi
## installing needed packages ## installing needed packages
for pkg in ${DEPS}; do for pkg in ${DEPS}; do
apt-get -y install ${pkg}
# check if the package is already installed
dpkg -s ${pkg} &>/dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "! failed to install ${pkg}" ## root check
exit 1 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 fi
done done
## extract ADL SDK ## extract ADL SDK
unzip ADL_SDK8.zip -d /opt/hashcat-deps/adl-sdk-8 unzip ADL_SDK8.zip -d ${hashcat_deps_dir}/adl-sdk-8
ret=$? ret=$?
if [[ ${ret} -ne 0 ]] && [[ ${ret} -ne 1 ]]; then if [[ ${ret} -ne 0 ]] && [[ ${ret} -ne 1 ]]; then
@ -54,7 +67,7 @@ if [[ ${ret} -ne 0 ]] && [[ ${ret} -ne 1 ]]; then
exit 1 exit 1
fi fi
rm -rf /opt/hashcat-deps/adl-sdk && ln -s /opt/hashcat-deps/adl-sdk-8 /opt/hashcat-deps/adl-sdk rm -rf ${hashcat_deps_dir}/adl-sdk && ln -s ${hashcat_deps_dir}/adl-sdk-8 ${hashcat_deps_dir}/adl-sdk
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "! failed to setup ADL SDK link" echo "! failed to setup ADL SDK link"
@ -62,7 +75,7 @@ if [ $? -ne 0 ]; then
fi fi
## extract NVAPI ## extract NVAPI
unzip R352-developer.zip -d /opt/hashcat-deps/ unzip R352-developer.zip -d ${hashcat_deps_dir}
ret=$? ret=$?
if [[ ${ret} -ne 0 ]] && [[ ${ret} -ne 1 ]]; then if [[ ${ret} -ne 0 ]] && [[ ${ret} -ne 1 ]]; then
@ -72,7 +85,7 @@ fi
## install CUDA SDK ## install CUDA SDK
chmod +x cuda_7.5.18_linux.run && \ chmod +x cuda_7.5.18_linux.run && \
./cuda_7.5.18_linux.run -toolkit -silent -override --toolkitpath=/opt/hashcat-deps/cuda-7.5 ./cuda_7.5.18_linux.run -toolkit -silent -override --toolkitpath=${hashcat_deps_dir}/cuda-7.5
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "! failed to install CUDA SDK" echo "! failed to install CUDA SDK"
@ -82,14 +95,14 @@ fi
## install NVIDIA Driver ## install NVIDIA Driver
chmod +x NVIDIA-Linux-x86_64-352.21.run && \ chmod +x NVIDIA-Linux-x86_64-352.21.run && \
./NVIDIA-Linux-x86_64-352.21.run -x && \ ./NVIDIA-Linux-x86_64-352.21.run -x && \
mv NVIDIA-Linux-x86_64-352.21 /opt/hashcat-deps/ && \ mv NVIDIA-Linux-x86_64-352.21 ${hashcat_deps_dir}/ && \
cd /opt/hashcat-deps/NVIDIA-Linux-x86_64-352.21 && \ cd ${hashcat_deps_dir}/NVIDIA-Linux-x86_64-352.21 && \
ln -s libnvidia-ml.so.352.21 libnvidia-ml.so && \ ln -s libnvidia-ml.so.352.21 libnvidia-ml.so && \
ln -s libcuda.so.352.21 libcuda.so && \ ln -s libcuda.so.352.21 libcuda.so && \
cd 32 && \ cd 32 && \
ln -s libnvidia-ml.so.352.21 libnvidia-ml.so && \ ln -s libnvidia-ml.so.352.21 libnvidia-ml.so && \
ln -s libcuda.so.352.21 libcuda.so && \ ln -s libcuda.so.352.21 libcuda.so && \
cd /opt/hashcat-deps/tmp cd ${hashcat_deps_dir}/tmp
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "! failed to install NVIDIA Driver" echo "! failed to install NVIDIA Driver"
@ -98,7 +111,7 @@ fi
## install NVIDIA GPU Deployment Kit ## install NVIDIA GPU Deployment Kit
chmod +x gdk_linux_amd64_352_55_release.run && \ chmod +x gdk_linux_amd64_352_55_release.run && \
./gdk_linux_amd64_352_55_release.run --silent --installdir=/opt/hashcat-deps/nvidia-gdk ./gdk_linux_amd64_352_55_release.run --silent --installdir=${hashcat_deps_dir}/nvidia-gdk
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "! failed to install NVIDIA GPU Deployment Kit" echo "! failed to install NVIDIA GPU Deployment Kit"
@ -106,15 +119,15 @@ if [ $? -ne 0 ]; then
fi fi
## extract AMD APP SDK ## extract AMD APP SDK
tar xjf AMDAPPSDK-3.0-linux64.tar.bz2 && \ tar xjf AMD-APP-SDKInstaller-v3.0.130.135-GA-linux64.tar.bz2 && \
./AMD-APP-SDK-v3.0.130.135-GA-linux64.sh --noexec --target /opt/hashcat-deps/amd-app-sdk-v3.0.130.135 ./AMD-APP-SDK-v3.0.130.135-GA-linux64.sh --noexec --target ${hashcat_deps_dir}/amd-app-sdk-v3.0.130.135
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "! failed to extract AMD APP SDK" echo "! failed to extract AMD APP SDK"
exit 1 exit 1
fi fi
rm -rf /opt/hashcat-deps/amd-app-sdk && ln -s /opt/hashcat-deps/amd-app-sdk-v3.0.130.135 /opt/hashcat-deps/amd-app-sdk rm -rf ${hashcat_deps_dir}/amd-app-sdk && ln -s ${hashcat_deps_dir}/amd-app-sdk-v3.0.130.135 ${hashcat_deps_dir}/amd-app-sdk
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "! failed to setup ADL SDK link" echo "! failed to setup ADL SDK link"