LoginSignup
0
0

More than 3 years have passed since last update.

【備忘録】Hashcat で CL_PLATFORM_NOT_FOUND_KHR エラー

Last updated at Posted at 2020-04-15

概要

Hashcatを実行したときに発生したCL_PLATFORM_NOT_FOUND_KHR というエラーを対応したときの備忘録です。

現在、ペネトレの訓練で某サーバを攻略中なのですがWebdavのパスワードハッシュがゲットできたのでクラックしようとしたところ、kaliの仮想マシンのリソースが貧弱だったのでhashcatが使えませんでした。
そこで別のUbuntuマシンを準備してHashcatを実行したところ前述のエラーが発生しました。

$ hashcat64 -m 1600 -a 0 hash.txt ./wordlists/rockyou.txt
hashcat (v5.1.0) starting...

clGetPlatformIDs(): CL_PLATFORM_NOT_FOUND_KHR

Started: Thu Apr 16 00:57:58 2020
Stopped: Thu Apr 16 00:57:58 2020

専用のグラフィックカードが無いと上記のエラーが発生するとのことで、URL(*1)を参考にさせていただきエラーを解消しております。

対応内容

Ubuntuのバージョンは以下です。

$ cat /etc/issue
Ubuntu 16.04.6 LTS \n \l

パッケージのダウンロード

まず、URL(*2)から Intel CPU Runtime for for OpenCL Applications 18.1 for Linux OS ダウンロードします。ダウンロードするにはIntelへのユーザ登録が必要となります。

Intel_opencl_p.png

ダウンロード以降の手順は、URL(*3)の Option B を参考としております。

インストールスクリプトの実行

// パッケージを解凍
$ tar -xzv l_opencl_p_18.1.0.015.tgz
$ cd l_opencl_p_18.1.0.015

// スクリプトの実行
$ sudo ./install.sh

インストールスクリプトはインタラクティブモードで以降は以下のように進めました。

  • Welcome を選択する。
Welcome
--------------------------------------------------------------------------------
Welcome to the Intel® CPU Runtime for OpenCL™ Applications 18.1
--------------------------------------------------------------------------------

You will complete the following steps:
   1.  Welcome
   2.  License Agreement
   3.  Intel® Software Improvement Program
   4.  Options
   5.  Installation
   6.  Complete
--------------------------------------------------------------------------------
Press "Enter" key to continue or "q" to quit: 1
  • ライセンスをアクセプトするために accept を入力するする。
License Agreement
--------------------------------------------------------------------------------
To continue with the installation of this product you are required to accept 
the terms and conditions of the End User License Agreement (EULA). The EULA 
is displayed using the 'more' utility. Press the spacebar to advance to the 
next page or enter 'q' to skip to the end. After reading the EULA, you must 
enter 'accept' to continue the installation or 'decline' to return to the 
previous menu.
--------------------------------------------------------------------------------
End User License Agreement for the Intel(R) Software Development Products
(Version May 2018)


* Other names and brands may be claimed as the property of others
--------------------------------------------------------------------------------
Type "accept" to continue or "decline" to go back to the previous menu: accept
  • Intelの情報収集を認めるなら1を、認めないなら2を入力する。
For more details, please refer to this article:
(https://software.intel.com/en-us/articles/software-improvement-program)

--------------------------------------------------------------------------------

   1. I consent to the collection of my Information
   2. I do NOT consent to the collection of my Information

   b. Back
   q. Quit installation

--------------------------------------------------------------------------------
Please type a selection: 2
  • 念のため、3を押下して要件チェックを事項する。問題なければ何も表示されない。
Missing optional prerequisites
-- Missing libraries
--------------------------------------------------------------------------------
   1. Skip prerequisites [ default ]
   2. Show the detailed info about issue(s)
   3. Re-check the prerequisites

   h. Help
   b. Back
   q. Quit installation

--------------------------------------------------------------------------------
Please type a selection or press "Enter" to accept default choice [ 1 ]: 3
  • 今度はEnterを押下して先に進む。
--------------------------------------------------------------------------------
Missing optional prerequisites
-- Missing libraries
--------------------------------------------------------------------------------
   1. Skip prerequisites [ default ]
   2. Show the detailed info about issue(s)
   3. Re-check the prerequisites

   h. Help
   b. Back
   q. Quit installation

--------------------------------------------------------------------------------
Please type a selection or press "Enter" to accept default choice [ 1 ]: 
  • Enterを押下してインストールを実行。
Options > Pre-install Summary
--------------------------------------------------------------------------------
Install location:
    /opt/intel


   Install space required:  355MB

--------------------------------------------------------------------------------

   1. Accept configuration and begin installation [ default ]
   2. Customize installation

   h. Help
   b. Back
   q. Quit installation

--------------------------------------------------------------------------------
Please type a selection or press "Enter" to accept default choice [ 1 ]: 
  • インストールの完了が表示されるのでEnterを押下。
Complete
--------------------------------------------------------------------------------
Thank you for installing Intel® CPU Runtime for OpenCL™ Applications 18.1.

--------------------------------------------------------------------------------
Press "Enter" key to quit: 

マシンの再起動

$ sudo shutdown -r now

Hashcatを再実行

Ubuntuの再起動後に再度Hashcatを実行すると、今度はパスワードハッシュをクラックすることに成功しました。

$ hashcat64 -m 1600 -a 0 hash.txt ./wordlists/rockyou.txt 
hashcat (v5.1.0) starting...

OpenCL Platform #1: Intel(R) Corporation
========================================
* Device #1: Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz, 1967/7869 MB allocatable, 4MCU

Hashes: 2 digests; 2 unique digests, 2 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates
Rules: 1

Applicable optimizers:
* Zero-Byte

Minimum password length supported by kernel: 0
Maximum password length supported by kernel: 256

Dictionary cache built:
* Filename..: ./wordlists/rockyou.txt
* Passwords.: 14344392
* Bytes.....: 139921507
* Keyspace..: 14344385
* Runtime...: 1 sec

$apr1$AXXXXXXX$.XXXXXXXXXXXXXXXXXXXXX:hacker

参考URL

*1. How to fix Hashcat:clGetPlatformIDs(): ...
*2. OpenCL Runtimes for Intel Processors
*3. 14.04 -Error CL_PLATFORM_NOT_FOUND_KHR in ...

編集後記

後で、仮想マシンのメモリを2倍(4GB -> 8GB)にして--forceオプションをつけてHashcat実行したらうまくいきました。仮想マシンを利用していてマシンリソースに余裕のある方は、そちらの方がはるかに簡単です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0