lvaccaro / truecrack

TrueCrack is a brute-force password cracker for TrueCrypt (Copyrigth) volumes. It works on Linux and it is optimized for Nvidia Cuda technology.
GNU General Public License v3.0
152 stars 58 forks source link

Truecrack make error - collect2: error: ld returned 1 exit status #53

Closed bszafarz closed 2 years ago

bszafarz commented 2 years ago

Hi! I'm trying to install truecrack on my WSL2.0 (previously on Ubuntu now on Kali). On both I've got several error messages which I managed to resolve however the dead end was reached with

collect2: error: ld returned 1 exit status

Here is the full output of the process:

┌──(user㉿hostname)-[/tmp/truecrack-master] └─$ ./configure --with-cuda=/usr/local/cuda-11.5 checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for style of include used by make... GNU checking dependency style of gcc... none checking for main in -lm... yes checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking for inttypes.h... (cached) yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking for memory.h... (cached) yes checking stddef.h usability... yes checking stddef.h presence... yes checking for stddef.h... yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking sys/mount.h usability... yes checking sys/mount.h presence... yes checking for sys/mount.h... yes checking for unistd.h... (cached) yes checking for int16_t... yes checking for int32_t... yes checking for int64_t... yes checking for int8_t... yes checking for size_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking for pow... yes checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for cudaMalloc in -lcudart... no configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands

┌──(user㉿hostname)-[/tmp/truecrack-master] └─$ make make all-recursive make[1]: Entering directory '/tmp/truecrack-master' Making all in src make[2]: Entering directory '/tmp/truecrack-master/src' /usr/local/cuda-11.5/bin/nvcc -o truecrack Cuda.o Volumes.o Crc.o Endian.o Core.o Charset.o Utils.o Main.o -g -I./Common/ -I./Crypto/ -I./Cuda/ -I./Main/ -I./ -I/usr/local/cuda/include/ -D_GPU_ -gencode arch=compute_61,code=sm_61 -ftz=true -use_fast_math -lm -O3 /usr/bin/ld: Main.o:/tmp/truecrack-master/src/Main/Core.h:39: multiple definition of CORE_wordsPath'; Core.o:/tmp/truecrack-master/src/Main/Core.h:39: first defined here /usr/bin/ld: Main.o:/tmp/truecrack-master/src/Main/Core.h:41: multiple definition of CORE_volumePath'; Core.o:/tmp/truecrack-master/src/Main/Core.h:41: first defined here /usr/bin/ld: Main.o:/tmp/truecrack-master/src/Main/Core.h:43: multiple definition of CORE_charset'; Core.o:/tmp/truecrack-master/src/Main/Core.h:43: first defined here /usr/bin/ld: Main.o:/tmp/truecrack-master/src/Main/Core.h:45: multiple definition of CORE_maxlength'; Core.o:/tmp/truecrack-master/src/Main/Core.h:45: first defined here /usr/bin/ld: Main.o:/tmp/truecrack-master/src/Main/Core.h:47: multiple definition of CORE_minlength'; Core.o:/tmp/truecrack-master/src/Main/Core.h:47: first defined here /usr/bin/ld: Main.o:/tmp/truecrack-master/src/Main/Core.h:49: multiple definition of CORE_typeAttack'; Core.o:/tmp/truecrack-master/src/Main/Core.h:49: first defined here /usr/bin/ld: Main.o:/tmp/truecrack-master/src/Main/Core.h:51: multiple definition of CORE_blocksize'; Core.o:/tmp/truecrack-master/src/Main/Core.h:51: first defined here /usr/bin/ld: Main.o:/tmp/truecrack-master/src/Main/Core.h:53: multiple definition of CORE_verbose'; Core.o:/tmp/truecrack-master/src/Main/Core.h:53: first defined here /usr/bin/ld: Main.o:/tmp/truecrack-master/src/Main/Core.h:55: multiple definition of CORE_keyDerivationFunction'; Core.o:/tmp/truecrack-master/src/Main/Core.h:55: first defined here /usr/bin/ld: Main.o:/tmp/truecrack-master/src/Main/Core.h:57: multiple definition of CORE_restore'; Core.o:/tmp/truecrack-master/src/Main/Core.h:57: first defined here /usr/bin/ld: Main.o:/tmp/truecrack-master/src/Main/Core.h:59: multiple definition of CORE_backup'; Core.o:/tmp/truecrack-master/src/Main/Core.h:59: first defined here /usr/bin/ld: Main.o:/tmp/truecrack-master/src/Main/Core.h:61: multiple definition of CORE_hidden'; Core.o:/tmp/truecrack-master/src/Main/Core.h:61: first defined here /usr/bin/ld: Main.o:/tmp/truecrack-master/src/Main/Core.h:63: multiple definition of CORE_encryptionAlgorithm'; Core.o:/tmp/truecrack-master/src/Main/Core.h:63: first defined here /usr/bin/ld: Main.o:/tmp/truecrack-master/src/Main/Core.h:65: multiple definition of CORE_prefix'; Core.o:/tmp/truecrack-master/src/Main/Core.h:65: first defined here collect2: error: ld returned 1 exit status make[2]: *** [Makefile:428: truecrack] Error 1 make[2]: Leaving directory '/tmp/truecrack-master/src' make[1]: *** [Makefile:360: all-recursive] Error 1 make[1]: Leaving directory '/tmp/truecrack-master' make: *** [Makefile:246: all] Error 2

bszafarz commented 2 years ago

This error occurred on WSL 2.0 Ubuntu 20.06 with CUDA 11.5. The same procedure on WSL 2.0 Ubuntu 16.04 with CUDA 10.0 works fine.

Taken steps:

  1. Install latest card driver for Windows (for me it was for GTX 1060)
  2. Install cuda toolkit on WSL using run file, which allows you to skip linux driver installation
  3. Download truecrack and modify src/Makefile, src/Makefile.am and src/Makefile.in files with:
  1. Followed github instruction of installation with my path to cuda (default symlink)

    ./configure --with-cuda=/usr/local/cuda make sudo make install

After that truecrack works as expected on WSL Ubuntu.