Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install hashcat under linux system

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)05/31 Report--

Today I will talk to you about how to install hashcat under linux system, many people may not know much, in order to let everyone know more, Xiaobian summarized the following content for everyone, I hope you can harvest according to this article.

We have already talked about hashcat installation and compilation in Windows environment, today we will talk about hashcat installation in Linux environment. Always said that the installation is indeed a bit boring ah, but we bear with it, after installing the program, we can talk about the use of hashcat commands.

Install hashcat under Ubantu

Here we install hashcat-4.1.0. hashcat 4.0 integrates GPU and CPU versions in the source code. During installation, hashcat will determine your hardware and install the appropriate version.

Hashcat 4.0 has removed the gcc restriction, which omits a lot of things. This way when we install hashcat, we only need to install the opencl library as the support library for running hashcat. This saves a lot of configuration environment.

Install opencl

Opencl has many versions,Intel, nvida,AMD opencl can be used. Strike can follow its own hardware environment, using the corresponding opencl SDK.

Download opencl from the official website, I use opencl+runtime_16.1.2_x64_rh_6.4.0.37, download and extract to a path you are used to. Find install_GUI.sh in the folder. Run this file and the following interface will appear:

Then follow the prompts in the graphical interface and follow the steps to install opencl. Just in case, I also downloaded an opencl_headers archive with the *.c file in it. After installing opencl, the hashcat environment is configured.

Install hashcat

Download hashcat source code, you can go to hashcat website to download the source code. Or copy the hashcat source code directly from github to your host:

git clone https://github.com/hashcat/hashcat.git

After downloading hashcat, first look at the README.md,BUILD.md, Makefile three files in the source code. BUILD file is hashcat installation command, recommended as a reference. Makefile file is compiled code, including references to the various files and database path.

Submodule update

Make: After running make command, hashcat source code compilation will begin and relevant functions provided in makefile will be provided.

Make install: This command starts hashcat installation.

After installation, test hashcat by running the-b command. Passing the test means that hashcat was installed successfully.

If you install hashcat after 3.0, follow these steps to ensure that hashcat runs normally. If you're feeling attached to the older version of hashcat, check out the following.

Environment configuration of ancient hashcat

As we said earlier, the versions after hashcat 3.0 do not distinguish between CPU or GPU based calculations, but integrate GPU and CPU. But I also have hashcat 2.0 and ocl hashcat 2.01. Hashcat 2.0 performs calculations without GPU, oclhashcat can only run in an environment with GPU, and uses GPU to perform calculations. Now let's take a look at how these two versions of hashcat are installed.

The early hashcat had many restrictions and needed to run on gcc 4.9 and above. So we have to configure the computer gcc, or upgrade their GCC compiler to 4.9 or above. gcc requires GMP, MPFR,MPC libraries, so you need to install these support software first.

GMP Installation

Download Unzip

Configuration gcc environment, first to configure GMP, directly to the official website to download a clean and safe version of the good, I downloaded gmp-6.1.2.tar.lz from the official website.

If there is no decompression command installed, install the decompression command first:

Unzip the installation package with the lzip command and unzip gmp into a.tar file. Then use tar to extract the archive to a folder.

installation

./ configure -prefix=/usr/local/gmp6.1.1 (the parameters of the face after--prefix are optional, if not selected, it indicates the default installation location)

make

make insatll

Make and make install are commands that we've talked about before and won't repeat here.

In the process of GMP installation, the prompt is missing m4. This problem is not common to everyone. If there is no prompt for this problem, you can ignore this step.

So I installed m4 again, download and extract first, m4 installation command is the same as GMP installation command.

After successful installation remember to test it with the man command.

MPFR Installation

Download Unzip

You can download the MPFR installation package at ftp://gcc.gnu.org/pub/gcc/infrastructure

Here is a compressed package with the suffix.tar.b2z. The decompression command of b2z is different from the previous one.

installation

The installation method is the same as the GMP library installation command, so it is not repeated here.

1 ./ configure -prefix=/usr/local/mpfr-3.1.42 make3 make installMPC Install

Download Unzip

Download the MPC installation package from ftp://gcc.gnu.org/pub/gcc/infrastructure and extract it.

installation

1 ./ configure -prefix=/usr/local/mpc-1.0.32 make3 make installGcc's install

installation

Download decompression installation is too troublesome, this time is directly downloaded from the source gcc:

After installing gcc, you can view the version information of gcc by using the following command, and the output is as follows:

All right, that's all the configuration for the lower version of hashcat.

Installing hashcat under ubantu is pretty simple, and it is unlikely to cause problems if you follow the sequence. If you want to install hashcat on your server, it's a bit complicated. The main thing is to be careful with the configuration.

1. download and extract

You can download the corresponding gcc installation package from ftp://gcc.gnu.org/pub/gcc/infrastructure and extract it.

2. compile and install

To install gcc under root privileges.

1 ./ configure --dis-checking --enable-languages=c,c++--disable-multilib -with-mpc=/usr/local2 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib3 make Note:make takes a long time to run.4 make install

3. modify environment variables

vim /etc/profile Add export PATH=$PATH:/usr/local/bin to the last line. Save exit. source/etc/profile Hashcat installation based on cuda

The CUDA version of Hashcat is oclhashcat. This is a version specifically designed for GPU computing. There is no hashcat around 2.0 on the official website anymore. Here I experiment with hashcats that I reserved a long time ago.

In this section, we introduce the branch in two parts: installation of the support software and compilation and installation of oclhashcat 2.01

Here we mainly introduce cuda and nvidia installation. Note: This installation is server-based

Tip: If you want to view and hardware information through system commands, you can use the following command to view CPU information,

You can obtain relevant information through specific parameters. The following command combination allows you to obtain the number of physical CPUs and CPU models.

You can view device memory information with the following command:

Installation of supporting software

The GMP library installation has been described above, so I won't repeat it here. This section mainly introduces the installation of Nvidia driver and CUDA. This is the unique support software required for CUDA-based hashcat.

Download nvidia driver

To download the official driver from nvidia official website, you need to be 346.59 or later.

chmod +x file name to make the file executable.

Modify system configuration (focus!!)

1. Close the graphical interface

Change init 5 to init3 in the system inittab file.

2. Uninstall installed NV drivers

dpkg-l|grep nvidia。

3. Blacklist open source drivers

This part is important, because I did not do this step at the beginning, resulting in various problems in the later installation, delaying a lot of time. This may be after I added the driver to the blacklist, so there was no uninstall and no problem above.

4. Install nvidia driver

Implementation of.../ NVIDIA-Linux-x86_64-346.59.run, installation process can be prompted, select the corresponding option. After the installation is complete, you can change init: 3 described in (1) back to 5, but I didn't change it. After the installation is complete, execute nvidia-smi, and you can see the following results, that is, the installation is correct. (In this system, I installed it in/opt/hashcat-deps/ NVIDIA-Linux-x86_64-346.59 for the convenience of cudaHashcat2.01 installation later.) Of course, you don't have to do this, you can specify it yourself.)

install CUDA

1. download the CUDA

Hashcat 2.01 requires CUDA version 7.5 or above, and the download and installation method of CUDA is the same as that of NVIDA driver.

2. Run CUDA

Follow the graphical interface prompts for installation.

Compile and install oclhashcat

1. Download and extract

I have said it many times before and will not repeat it. If you can find version 2.01, you can try it, but if you can't find it, you can try it.

2. Modify Makefile

As described above, Makefile under src In this system, because I only installed NV version under Linux64, I only modified the relevant contents in the configuration file. Enter src directory under oclHashcat2.01, open Makefile, modify corresponding parameter configuration, as shown below (other parts can be ignored):

CUDA := /usr/local/cuda-line 8.0 /31

CUDALIBPATH32 := /usr/lib /32 lines

CUDALIBPATH64 := /usr/lib64 /33 line

GDK :=/opt/hashcat-deps/NVIDIA-Linux-x86_64-346.59 /line 37

NV_BITNESS_ALL := 64 /109 lines

binaries_all:linux64 /126 lines

kernels_all:NV_all /128 lines

release:binaries /130 lines

linux:linux line 64 /132

linux64: cudaHashcat64.bin /159 line

The following figure lists some of the modified documents.

3. compile and install

Under oclhashcat, run make all, make linux, make nv-all.

When executing these three commands, a large number of errors will be generated. Ignore them. This is caused by the lack of support libraries in other versions. We are only using NV-64, and these errors do not affect us. If you feel that the error is an eyesore, go to the src/Makefile, delete or comment out the irrelevant content, and there will be no large-scale error.

4. collecting executable programs

Copy hashcat64.bin, hashcat. hcstat and all files under kenerls directory generated under oclhashcat directory into a folder, and ensure executable permissions of the application. Run hashcat64.bin -b to benchmark hashcat.

After reading the above, do you have any further information on how to install hashcat on linux? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report