#!/bin/bash
gpuids=${1:-""}
timeout=${2:-"60"}

printf "2b576acbe6bcfda7294d6bd18041b8fe\n" > hashes.ntlm

device_arg=""
if [ -n "$gpuids" ]; then
  device_arg="-d $gpuids"
fi

docker run --rm -it --runtime=nvidia -v "$PWD:/work" -w /work \
  dizcza/docker-hashcat:cuda \
  hashcat -m 1000 -a 3 hashes.ntlm '?1?1?1?1?1?1?1?1?1' -1 '?l?u?d' \
  -D 2 $device_arg \
  -w 4 --status --status-timer 5 \
  -O --keep-guessing --runtime $timeout
