Hashcat не видит видеокарту
Describe the bug
I have error "No devices found/left" if try to benchmark CPU devices, when GPU and CPU drivers installed.
GPU (GTX 1650) benchmarks are fine in all variants of drivers (nvidia, pocl).
CPU benchmarks fine, only if all GPU drivers are removed (just move .icd files outside the /etc/OpenCL/vendor).
Devices support variants:
- nvidia support GPU
- pocl support GPU & CPU (pocl with cuda support)
- pocl support CPU (pocl recompiled without cuda suport)
- intel support CPU
Expected behavior
Hashcat must make CPU benchmark as usual in all configurations of drivers.
Hardware/Compute device (please complete the following information):
Hashcat version (please complete the following information):
- OS: Gentoo
- Distribution: default/linux/amd64/17.1/no-multilib/hardened/selinux
- Version: 2.6
Diagnostic output compute devices:
nvidia-smi
clinfo
hashcat -I
lspci -k
If GPU and CPU drivers are stored in the /etc/OpenCL/vendor directory:
If only CPU drivers from intel is stored in the /etc/OpenCL/vendor directory:
If only CPU drivers from pocl (w/o cuda support) is stored in the /etc/OpenCL/vendor directory:
Установка OpenCL Runtime for Intel
Проверяем, что изменилось в списке распознаваемых устройств:
Добавилось новое устройство, к сожалению, в моих тестах Hashcat не смогла использовать его, возможно из-за того, что устройство имеет OpenCL 2.1, а драйвер отображения Intel предназначен для работы с OpenCL 3.0.
Установка драйвера NVIDIA
Выберите версию вашей видеокарты и вашей операционной системы, скачайте и установите драйвер.
Следующей командой можно проверить, какие устройства CUDA и OpenCL может видеть Hashcat:
Expected behaviour
I expect without -D and with -d parameters I specify accurate and limited list of devices, regardless of their platforms.
Comments (7)
This appears to be a command issue and not an error. Pass -D 1 -d 3 and the CPU will work in the original configuration. CPU devices are skipped by default. The reason it is working in the later tests with POCL is because it appears as a GPU i believe, and the Radeon Graphics that are built in are either being used for the identification or the computing or both. No CPU device is visible in the 2 later tests, only the GPU devices.
Bogdan107 commented on December 19, 2021 1
With -D 1 -d 3 options benchmarking start correctly, even if GPU and CPU platform drivers are presented at the same time.
Смотрите также:
Ошибка «CUDA SDK Toolkit not installed or incorrectly installed. CUDA SDK Toolkit required for proper device support and utilization. Falling back to OpenCL runtime»
Причина проблемы в том, что не установлена NVIDIA CUDA и/или видео драйвер NVIDIA. Установите их как показано выше и проблема будет решена.
Установка CUDA Toolkit
Введите параметры вашей системы:
- Operating System — операционная система
- Architecture — архитектура
- Version — версия
- Installer Type — тип установщика: exe (local) — это файл для офлайн установки; exe (network) — это файл для установки по сети
Скаченный файл имеет размер более 2 Гигабайт. Запустите его и следуйте подсказкам установщика.
Вы можете отказаться от установки GeForce Experience и другого ПО в котором у вас нет необходимости. Если вы уже установили драйвер графической карты, то можете отказаться от его установки на данном этапе.
Данное окно сообщает, что из-за отсутствия Visual Studio не будут установлены компоненты, необходимые для интеграции с ней — нам это не помешает, просто поставьте галочку для продолжения.
После завершения установки CUDA Toolkit для просмотра, какие устройства распознаёт Hashcat, введите команду:
Если вы не умеете работать с Hashcat, то смотрите статью для самых начинающих пользователей: Инструкция по hashcat: запуск и использование программы для взлома паролей
Установка видеодрайвера Intel CPU
Центральные процессы могут иметь видеоядра, которые также могут использоваться для взлома паролей.
Операционные системы Windows 11 и Windows 10 могут самостоятельно, без участия пользователя, установить драйвер для использования графического ядра центрального процессора Intel. Мой предыдущий бенчмарк показал, что ЦП уже используется.
Проверим версию драйвер для Intel CPU в Менеджере устройств:
Автоматически установленная версия: 27.20.100.8681.
Программа под названием «Центр управления графикой Intel», которая также была установлена автоматически, показывает эту же версию драйвера и сообщает, что это последняя версия.
Я обновил данный драйвер в своей системе, как можно убедиться, версия драйвера стала 30.0.101.1191:
Проверяем, что изменилось в списке распознаваемых устройств:
Обратите внимание, что установка обновлённого драйвера подняла версию ЦП OpenCL с 2.1 до OpenCL 3.0.
Why I need this behaviour?
I write script, which benchmarks the speed of different drivers (nvidia/pocl/rocm for GPU, or intel/pocl for CPU) with hashcat program and I want to specify just id of device, without specifying device type.
Currently, I need to do additional parsing, which is not trivial in bash (awk helps, but --json option is highly required for me).
Как установить Hashcat в Windows
Hashcat — это программа для взлома паролей путём перебора (брут-форса). Hashcat работает на Windows и Linux и является очень функциональной. Данная программа поддерживает множество алгоритмов для брут-форса и несколько видов атак, в том числе атаку по словарю и атаку по маске.
Hashcat является портативной программой и не требует установки. Но для её работы необходимы видео драйверы и дополнительное ПО. Hashcat является утилитой командной строки, о том, как скачать и запустить эту программу смотрите подробно в этой статье.
Для работы Hashcat в Windows необходимы следующие драйвера видеокарт и программное обеспечение:
- Видеокарты AMD на Windows требуют "AMD Radeon Adrenalin 2020 Edition" (20.2.2 или более поздняя версия)
- Intel CPUs требует "OpenCL Runtime for Intel Core and Intel Xeon Processors" (16.1.1 или более поздняя версия)
- Видеокарты NVIDIA требуют "NVIDIA Driver" (440.64 или более поздняя) и "CUDA Toolkit" (9.0 или более поздняя)
Таким образом, рассмотрим, как установить драйверы, CUDA и другое необходимое для работы Hashcat программное обеспечение. Данная инструкция предназначена для следующей конфигурации:
- видеокарта NVIDIA
- центральный процессор Intel
Which changes I want?
May be -d option, in conjunction without -D , specify list of devices, which need to be forced used without ignore CPU devices by default rule?
For example:
Why this changes must be implemented in hashcat, not in my own script?
The expected behavior is consistent with the process of my human thinking, regardless of understanding the specificity of hashcat program.
Features of hashcat can be programmed in the script, but human thinking has priority over the algorithm of the program. So I think, that algorithm of hashcat command line parsers is broken.
Chick3nman commented on December 20, 2021 1
Just specify -D1,2,3 and then you can use -d for any device at any time. No need to change anything, the functionality is already there.
millerreyes commented on December 24, 2021
Bogdan107 commented on January 8, 2022
This means, that options "-D 1,2,3 -d 2" instruct hashcat:
- use all devices with OpenCL device-type 1 (CPU);
- AND use all devices wtih OpenCL device-type 2 (GPU);
- AND use all devices wtihOpenCL device-type 3 (FPGA, DSP, Co-Processor);
- AND use device with id 2.
Why "-D 1,2,3 -d 2" use only device with id 2, not all devices plus device with id 2? (e.g.-D option is ignored)
Why "-D 1,2,3" use only device with id 1 (best device by hashcat program), not all devices? (e.g.-D option is ignored)
Why "-D 1 -d 1" not found any device, while I expect, that hashcat must use all CPU's plus preffered GPU (which id is 1)? (e.g.-D option is used as "use all devices from -d list, only if they OpenCL type are in from -D list")
Algorithm of arguments parser is not logical or help info is wrong.
Chick3nman commented on January 9, 2022
I'm not sure I understand the problem here. -D makes devices available or unavailable by selecting which runtimes hashcat can use. Hashcat's preference for GPU>CPU and CUDA>OpenCL will still come into play unless you choose which devices specifically, from those in available runtimes, you want to use. This is actually a required behavior and the preferences could not really be disabled without forcing a user to choose every device, every single time. The default value for -D is 2, so that GPUs(if available and barring some other factors like unstable runtimes) are always selected first and other devices are skipped. From the set of GPU devices that -D 2 makes available, there are usually several that can not be run in parallel. Namely, in your case, devices 1, 4, and 6. This is because they are the same hardware device so hashcat must choose 1 of them to run and ignore the others.
To explain your behavior questions,
Why "-D 1,2,3 -d 2" use only device with id 2, not all devices plus device with id 2? (e.g.-D option is ignored)
"-D 1,2,3 -d 2" has allowed hashcat to use any runtime and any device, you have selected only device ID 2 alone, from that superset of devices
Why "-D 1,2,3" use only device with id 1 (best device by hashcat program), not all devices? (e.g.-D option is ignored)
This should use, in your case, exactly 2 devices be default if hashcat is able to choose a stable runtime/device for your CPU. Devices 1 and 2 in your case appear to be devices it should select automatically.
Why "-D 1 -d 1" not found any device, while I expect, that hashcat must use all CPU's plus preffered GPU (which id is 1)? (e.g.-D option is used as "use all devices from -d list, only if they OpenCL type are in from -D list")
"-D 1" has selected CPU devices, but device ID 1 in your case is clearly a GPU device, device ID 2 is one of the runtimes where your CPU device is available. By telling hashcat "I want you to only use CPUs, and only this GPU device" you have confused it and there are no devices for it to select when you apply both those limitations. "-D 1 -d 2" or "-D 1 -d 3" would both work.
Without specifying -D, since it is default 2, you cant select a device such as device ID 2, since that device would not fall in the GPU subset and therefore hashcat doesn't see it is a valid selection.
thomashooo commented on March 31, 2022
Just specify -D1,2,3 and then you can use -d for any device at any time. No need to change anything, the functionality is already there.
Что значит «не видит»?
Где логи xorg-server, вывод dmesg?
Заливай на pastebin, а сюда ссылки.
Когда у меня была nvidia, она с блобом не работала без xorg.conf, так что пробуй sudo nvidia-xconfig. Ещё поищи свою видеокарту в выводе lspci | grep VGA или 3D или программой lshw; точные параметры для отсева лишнего не помню, тк не за компом сейчас
Debian. Вот тебе дистрибутив с apt. Собственно, он является основой как для Kali, так и для Ubuntu, так и для всех прочих.
Возможно, у него всего навсего проблема с secureboot, что не загружается неподписанный модуль.
В любом случае нужно в начале посмотреть логи.
Без логов можно только гадать что он имеет в виду под «не видит».
Пытался, мне он очень понравился, но он слишком голый, нету стандартных пакетов, даже ntfs не умеет читать по дефолту, так что надо бы что-то как кали или федора (но в ней dnf а не apt)
У меня слишком мало знаний, я не знаю где я могу полусить эти логи, а secureboot я выключил до установки линукса
А что там сложного?
dnf install
dnf remove
dnf update и т.д.
Из apt-based тогда pclinuxos и altlinux остались
Где логи xorg-server, вывод dmesg?
Идёшь в гугл и спрашиваешь где лежат логи xorg-server, обычно это /var/log/Xorg.0.log.
Ну а вывод dmesg - просто набираешь команду
и смотришь её вывод.
Заливаешь на любой pastebin сервис, что это такое так же можешь узнать в гугл.
Без логов ничем тебе помочь нельзя.
аже ntfs не умеет читать по дефолту, т
Читать NTFS умеет, а вот писать нужно поставить пакет ntfs-3g.
Если у тебя что-то не работает и нужно настроить, то идёшь в гугл и спрашиваешь, в данном случае нужно было спросить: «Debian настройка записи на ntfs».
Выключи ребёнка и включи мужчину.
Если ты чего-то не знаешь, то спроси в гугл: «Linux логи xorg-server», хватит говорить я не знаю, тебе сказано, что нужно предоставить, разберись как.
Удалось решить задачу лишь наполовину: после выполнения команды
и рестарта Иксов, Hashcat таки начинает перебирать двумя видеокартами, но Иксы думают что у меня подключен второй монитор, поэтому у правой части экрана пропадает граница. Также на экране логина изображение не помещается в границы экрана. Помогите заставить Hashcat видеть две видеокарты, а Иксы рисовать изображение для одного экрана.
Не знаю, никогда это не мешало. Зачем вообще монитор подключать?
Предлагаю тебе изучить справку aticonfig, в частности Display attribute options. Еще можно man xorg.conf, там screen options или что-то в этом роде.
Еще как вариант, попробовать запустить в отдельных иксах. Т.е. создать 2 конфига иксов и пуска скажем на :0 с конфигом для 1 видеокарты и с DE, а на :1 запускать иксы с конфигом для 2-х видеокарт. Программу соответственно запускать с export DISPLAY=:1.
А кто подключал монитор? Я этого не говорил. Если бы я не читал ман, я бы сюда не писал. Все что ни пробовал - не дало желаемых результатов. Вот решил совета спросить, может кто сталкивался и решил как-то?
Я имею в виду, зачем вообще вывод изображения с видеокарт которые задействованы в вычислениях? То что у тебя ноут я мимо глаз пропустил. Да и единственным нормальным решением тут будет вынуть платы из корпуса, отключить все лишнее (в том числе и матрицу) и поставить на них нормальное охлаждение.
В любом случае я тебе предложил возможные варианты решения: принудительно задать размеры дисплея, либо запустить вторые иксы для твоего приложения. Но ты ничего не это не ответил, так что вопрос считаю исчерпанным.
И да, обычно конфиг создают с помощью aticonfig --initial --adapter=all. addch - это вроде вообще к кроссфаеру относится, который здесь нахрен не нужен.
Попробуй сделать не расширение рабочего стола на вторую карту и «монитор», а клонирование
Я имею в виду, зачем вообще вывод изображения с видеокарт которые задействованы в вычислениях?
А картинка там особо и не нужна, просто лишь бы иксы карточку инициализировали нормально. Хотя в целом сейчас это разве что для ADL нужно.
Покажи вывод xrandr.
И да, обычно конфиг создают с помощью aticonfig --initial --adapter=all. addch - это вроде вообще к кроссфаеру относится, который здесь нахрен не нужен.
Да, конфиг создается через aticonfig --initial --adapter=all, это понятно. addch нужен, как ниже заметили, чтобы иксы карточку инициализировали, конечно может есть более простой и очевидный способ, но увы я его не нашел. По поводу принудительного задания разрешения - попробую сегодня вечером.
Попробуй сделать не расширение рабочего стола на вторую карту и «монитор», а клонирование
Не подскажешь как луше это сделать?
разумеется я тебе написал способ, при котором будут инициализироваться все найденные видеокарты
Сделал через вторые иксы, спасибо за совет. Но всеравно это немного костыльно, хотелось бы в идеале более тонкое решение.
Как я уже сказал у меня такой проблемы не стояло, так что точного решения не подскажу.
Можно логически подумать: в иксах для каждого адаптера назначется минимум 1 screen, которым в свою очередь выставляется определенный порядок.
Если посмотреть в сгенеренный конфиг, то там строки примерно такого содержания:
Здесь стоит обратить внимание на RightOf. Т.е. решение кроется где-то в опциях screen (как правильно заметил коллега, возможно что-то вроде clone). Вот например для aticonfig можно найти опцию --dtop, для которой есть параметр clone. В общем я предлагаю тебе дальше изучать возможности aticonfig, сверяя при этом сгенеренный конфиг с man xorg.conf :)
I can't get Hashcat to use my GPU, and it is not running anywhere near correct when it does run. Here is hopefully all the relevant information.
Computer
HP Desktop Series 8200
OS
Ubuntu 18.04
Processor
3.1 GHz Intel Core i5
RAM
Corsair Vengance Pro Series 24 GB DDR3
Hard drive
Seagate 500 GB SSD
GPU
4 GB AMD RX 560 LP
I run this command,
sudo hashcat -m 2500 -a 0 q.hccapx rockyou.txt -w 3
and get this. with -a 0.
Hashes: 3 digests; 1 unique digests, 1 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates
Rules: 1
- Zero-Byte
- Single-Hash
- Single-Salt
- Slow-Hash-SIMD-LOOP
Minimum password length supported by kernel: 8
Maximum password length supported by kernel: 63
Watchdog: Hardware monitoring interface not found on your system.
Watchdog: Temperature abort trigger disabled.
Starting attack in stdin mode.
ATTENTION! Read timeout in stdin mode. The password candidates input is too slow:
- Are you sure that you are using the correct attack mode (--attack-mode or -a)?
- Are you sure that you want to use input from standard input (stdin)?
- If so, are you sure that the input from stdin (the pipe) is working correctly and is fast enough?
So I tried this
sudo hashcat -m 2500 -a 3 -o rockyou.txt q.hccapx -w 3
and got this.
hashcat (v5.1.0) starting.
Hashes: 3 digests; 1 unique digests, 1 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates
- Zero-Byte
- Single-Hash
- Single-Salt
- Brute-Force
- Slow-Hash-SIMD-LOOP
Minimum password length supported by kernel: 8
Maximum password length supported by kernel: 63
Watchdog: Hardware monitoring interface not found on your system.
Watchdog: Temperature abort trigger disabled.
Skipping mask '123456' because it is smaller than the minimum password length.
Skipping mask '12345' because it is smaller than the minimum password length.
Approaching final keyspace - workload adjusted.
Approaching final keyspace - workload adjusted.
Then I tried to get the GPU to run Hashcat the following two ways I get these results.
sudo DRI_PRIME=1 hashcat -m 2500 -a 0 -o rockyou.txt q.hccapx -w 3
hashcat (v5.1.0) starting.
Hashes: 3 digests; 1 unique digests, 1 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates
Rules: 1
- Zero-Byte
- Single-Hash
- Single-Salt
- Slow-Hash-SIMD-LOOP
Minimum password length supported by kernel: 8
Maximum password length supported by kernel: 63
Watchdog: Hardware monitoring interface not found on your system.
Watchdog: Temperature abort trigger disabled.
Starting attack in stdin mode.
ATTENTION! Read timeout in stdin mode. The password candidates input is too slow:
- Are you sure that you are using the correct attack mode (--attack-mode or -a)?
- Are you sure that you want to use input from standard input (stdin)?
- If so, are you sure that the input from stdin (the pipe) is working correctly and is fast enough?
sudo DRI_PRIME=1 hashcat -m 2500 -a 3 -o rockyou.txt q.hccapx -w 3
hashcat (v5.1.0) starting.
Hashes: 3 digests; 1 unique digests, 1 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates
- Zero-Byte
- Single-Hash
- Single-Salt
- Brute-Force
- Slow-Hash-SIMD-LOOP
Minimum password length supported by kernel: 8
Maximum password length supported by kernel: 63
Watchdog: Hardware monitoring interface not found on your system.
Watchdog: Temperature abort trigger disabled.
[s]tatus [p]ause [b]ypass [c]heckpoint [q]uit => s
[s]tatus [p]ause [b]ypass [c]heckpoint [q]uit =>
I can only get it to run by running,
sudo DRI_PRIME=1 hashcat -m 2500 -a 3 -o rockyou.txt q.hccapx -w 3
When I check it with,
sudo lshw -c display
*-display
description: VGA compatible controller
product: Baffin [Radeon RX 550 640SP / RX 560/560X]
vendor: Advanced Micro Devices, Inc. [AMD/ATI]
physical id: 0
bus info: pci@0000:01:00.0
version: cf
width: 64 bits
clock: 33MHz
capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
configuration: driver=amdgpu latency=0
resources: irq:30 memory:e0000000-efffffff memory:f0000000-f01fffff ioport:e000(size=256) memory:f7e00000-f7e3ffff memory:c0000-dffff
With,
lsmod | grep -i amd
amdgpu 3522560 32
chash 16384 1 amdgpu
amd_iommu_v2 20480 1 amdgpu
gpu_sched 32768 1 amdgpu
ttm 102400 1 amdgpu
drm_kms_helper 180224 1 amdgpu
drm 483328 21 gpu_sched,drm_kms_helper,amdgpu,ttm
i2c_algo_bit 16384 1 amdgpu
These are the instructions I followed.
Benchmarking uses hand-optimized kernel code by default.
You can use it in your cracking session by setting the -O option.
Note: Using optimized kernel code limits the maximum supported password length.
To disable the optimized kernel code in benchmark mode, use the -w option.
Hashmode: 0 - MD5
Hashmode: 100 - SHA1
Hashmode: 1400 - SHA2-256
Hashmode: 1700 - SHA2-512
Hashmode: 2500 - WPA-EAPOL-PBKDF2 (Iterations: 4096)
Hashmode: 1000 - NTLM
Hashmode: 3000 - LM
If you look at these,
If you notice sudo DRI_PRIME=1 hashcat -m 2500 -a 3 -o rockyou.txt q.hccapx -w 3 is the only one that sort of works, but backwards the list is before the .hccapx file. None of them even when I select my GPU to run Hashcat sees the GPU. I have tried everything possible on here and the internet and Hashcat Forum I have tried Unbuntu 16.04, Unbuntu 18.04, Kali Linux 2019.3 (The Rocm install ruined two of Kali. They wouldn't boot after install.) Windows 10 Pro it wont load the opencl. I just want you to understand I have been battling this for over a week before asking. I almost have it beat Unbuntu 18.04 is the first time I didn't get any benchmark errors and it has run correctly. I have installed it between the systems at least twenty times. This is the best I have got. Please anyone can you help me fix this problem ?
Robert
Этичный хакинг и тестирование на проникновение, информационная безопасность
Связанные статьи:
факультете информационной безопасности от GeekBrains? Комплексная годовая программа практического обучения с охватом всех основных тем, а также с дополнительными курсами в подарок. По итогам обучения выдаётся свидетельство установленного образца и сертификат. По этой ссылке специальная скидка на любые факультеты и курсы!
Читайте также: