我正在尝试在我的
Zen Archlinux
上运行 hashcat,我使用的是 4.15.4-1-zen
内核版本。我有一个 NVIDIA Geforce 920MX 和一个 Intel i6189DU。
我安装了最新的 nvidia-dkms
驱动程序以及 opencl-nvidia
软件包。
我还安装了最新的Hashcat版本。
当我运行 hashcat 命令时,我收到此错误:
clGetPlatformIDs(): CL_PLATFORM_NOT_FOUND_KHR
。
我使用一个工具来确定可用的 openCL 平台 clinfo
,输出仅显示我的 CPU 平台而不是我的 GPU,但 hashcat
命令仍然输出相同的错误。
有什么帮助吗?
这里的弓箭手同事,我找到了一种修复损坏的 hashcat 的方法,如您所见:
$ hashcat -b
hashcat (...) starting in benchmark mode...
clGetPlatformIDs(): CL_PLATFORM_NOT_FOUND_KHR
ATTENTION! No OpenCL-compatible or CUDA-compatible platform found.
You are probably missing the OpenCL or CUDA runtime installation.
$ pacman -S clinfo
$ clinfo
Number of platforms 0
修复此问题的一种方法是安装 pocl(Portable OpenCL 是 OpenCL 的开源实现):
$ pacman -S pocl
$ clinfo
Number of platforms 1
Platform Name Portable Computing Language
Platform Vendor The pocl project
...
$ hashcat -b
hashcat (...) starting in benchmark mode...
OpenCL API (...) - Platform #1 [The pocl project]
=========================================================================================================================
* Device #1: pthread-Intel(R) ...
Benchmark relevant options:
===========================
* --optimized-kernel-enable
Hashmode: 0 - MD5
Speed.#1.........: ...
...
快乐破解! ( ͡° ͜ʖ ͡°)
Linuxmint 22.1:
sudo apt-get install pocl-opencl-icd
import binascii, hashlib
import sys
def generate_ntlm_hash(text):
ntlm_hash = binascii.hexlify(hashlib.new('md4', text.encode('utf-16le')).digest())
return ntlm_hash
min_distance = float('inf')
closest_hash = ""
closest_word = ""
def read_hashes_from_file(filename):
hashes = []
with open(filename, 'r') as file:
for line in file:
line = line.strip()
if line:
hashes.append(line)
return hashes
def hamming_distance(hash1, hash2):
bin_hash1 = bin(int(hash1, 16))[2:].zfill(32)
bin_hash2 = bin(int(hash2, 16))[2:].zfill(32)
distance = sum(bit1 != bit2 for bit1, bit2 in zip(bin_hash1, bin_hash2))
return distance
def find_closest_hash(target_hash, hash_list, word):
global min_distance
global closest_hash
global closest_word
for hash_value in hash_list:
distance = hamming_distance(target_hash, hash_value)
if distance < min_distance:
min_distance = distance
closest_hash = hash_value
closest_word = word
return
def main():
dictionary_file = input("Enter the name of the dictionary file (e.g., michael.txt): ")
hash_file = input("Enter the name of the hashes file (e.g., hashes.txt): ")
try:
with open(dictionary_file, 'r') as file:
words = [word.strip() for word in file]
except FileNotFoundError:
print("Dictionary file not found.")
return
known_hashes = read_hashes_from_file(hash_file)
total_words = len(words)
current_word = 0
for word in words:
ntlm_hash = generate_ntlm_hash(word)
if ntlm_hash in known_hashes:
print(f"Word: {word}, NTLM Hash: {ntlm_hash}, Status: Cracked!")
else:
find_closest_hash(ntlm_hash, known_hashes,word)
completion_percentage = (current_word / total_words) * 100
sys.stdout.write(f"\rProcessing: {completion_percentage:.2f}% closest_word: {closest_word}, Min_distance: {min_distance:.2f}")
sys.stdout.flush()
current_word += 1
print(f"Word: {closest_word}, Closest Hash: {closest_hash}")
print("\nProcessing completed.")
if __name__ == "__main__":
main()
现在它确实显示了破解的百分比,并找到您尝试过的所有密码文本中最接近的汉明距离,并且还打印了最接近的单词。