HowTo: Hashcat and hcxtools on Arch Linux Live USB
#1
Hi, there!
How to run Hashcat v6.2.6 on Arch Live USB? See below for details, an Internet connection is required.
My thanks to ZerBea, his tools inspired me to learn Arch.
This post is a continuation of my previous post
https://hashcat.net/forum/thread-10548.html
Use at your own risk, corrections and improvements are welcome.

My main OS is still Windows. I use a Live USB to boot and run Arch.
https://en.wikipedia.org/wiki/Live_USB
My notebook has an Intel Celeron CPU.
Be advised, notebooks are generally not suitable for hashcat.
https://hashcat.net/forum/thread-4160.html
https://hashcat.net/forum/thread-10788.html

Download Arch Linux image (currently the latest version is archlinux-2023.03.01-x86_64.iso)
https://archlinux.org/download/

Create a bootable USB flash drive (Live USB)
https://wiki.archlinux.org/title/USB_fla...ion_medium
I prefer Rufus in ISO image mode.

Download the latest hashcat.
https://hashcat.net/files/hashcat-6.2.6.7z
Extract this archive to folder hashcat-6.2.6

Copy this folder to USB flash drive.
Copy also three scripts:
  pre.sh  connecting to wifi, preparing to run the graphical user interface (GUI)
  hcx.sh  installing hcxdumptool and hcxtools
  hcat.sh  installing the software needed to run hashcat on my Intel CPU

Edit pre.sh
Enter your favorite Arch mirror, wireless device, SSID and passphrase, timezone.

Keep in mind, the GUI is just for user convenience.
Hashcat, hcxdumptool and hcxtools do not need GUI.
Use CLI instead of GUI to save memory and CPU cycles.

Boot from USB flash drive.
Then check which device corresponds to flash drive.
lsblk -f
Usually it is sdb1

mount -m /dev/sdb1 /mnt/sdb1
/mnt/sdb1/pre.sh

After pre.sh is finished, run hcx.sh or hcat.sh

To run the GUI as non-root, switch to tty2 and run from there:
Ctrl + Alt + F2
startx

Main key combinations of i3 (a tiling window manager)
mod + Shift + e to exit i3
mod + Enter to open terminal
mod + d to open dmenu
mod + 1 to switch to 1st workspace
mod + 2 to switch to 2nd workspace

mod is the Win key or the Alt key
https://i3wm.org/docs/userguide.html#_de...eybindings
https://i3wm.org/docs/refcard.html
https://wiki.archlinux.org/title/i3

Code:
pre.sh #!/bin/bash cd ~ systemctl stop reflector.service systemctl disable reflector.service echo 'Server = https://de.arch.mirror.kescher.at/$repo/os/$arch'    > /etc/pacman.d/mirrorlist echo 'Server = https://mirror.osbeck.com/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist cat /etc/pacman.d/mirrorlist iwctl --passphrase PASSPHRASE station wlan0 connect SSID iw device wlan0 link while :; do ping 8.8.8.8 -c 1 -w 1 -q && break || sleep 3; done timedatectl set-ntp true timedatectl set-timezone Zone/SubZone while ! systemctl show pacman-init.service | grep SubState=exited; do   systemctl --no-pager --lines=0 status pacman-init.service || true   sleep 3 done timedatectl status mount --options remount,size=3000M /run/archiso/cowspace pacman --sync --refresh --color=auto pacman --sync --needed --noconfirm --quiet --color=auto archlinux-keyring pacman --sync --needed --noconfirm --quiet --color=auto xorg-server xorg-xinit xterm pacman --sync --needed --noconfirm --quiet --color=auto i3-wm i3status dmenu pacman --sync --needed --noconfirm --quiet --color=auto firefox nss rm --force /var/cache/pacman/pkg/* useradd --create-home --gid users --groups audio,wheel --shell /usr/bin/zsh user echo 'user:user' | chpasswd echo 'user ALL=(ALL:ALL) ALL' >> /etc/sudoers echo 'Section "InputClass"'              > /etc/X11/xorg.conf.d/30-touchpad.conf echo '  Identifier "touchpad"'          >> /etc/X11/xorg.conf.d/30-touchpad.conf echo '  Driver "libinput"'              >> /etc/X11/xorg.conf.d/30-touchpad.conf echo '  MatchIsTouchpad "on"'            >> /etc/X11/xorg.conf.d/30-touchpad.conf echo '  Option "Tapping" "on"'          >> /etc/X11/xorg.conf.d/30-touchpad.conf echo '  Option "TappingButtonMap" "lmr"' >> /etc/X11/xorg.conf.d/30-touchpad.conf echo 'EndSection'                        >> /etc/X11/xorg.conf.d/30-touchpad.conf echo 'if [ -d /etc/X11/xinit/xinitrc.d ] ; then'      > ~/.xinitrc echo ' for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do' >> ~/.xinitrc echo '  [ -x "$f" ] && . "$f"'                      >> ~/.xinitrc echo ' done'                                        >> ~/.xinitrc echo ' unset f'                                      >> ~/.xinitrc echo 'fi'                                            >> ~/.xinitrc echo 'exec i3'                                      >> ~/.xinitrc cp .xinitrc /home/user/ chown user:users /home/user/.xinitrc mkdir /etc/systemd/system/getty@tty2.service.d/ echo '[Service]'                                                                      > /etc/systemd/system/getty@tty2.service.d/autologin.conf echo 'ExecStart='                                                                    >> /etc/systemd/system/getty@tty2.service.d/autologin.conf echo "ExecStart=-/sbin/agetty -o '-p -f -- \\\u' --noclear --autologin user - \$TERM" >> /etc/systemd/system/getty@tty2.service.d/autologin.conf mc

Code:
hcx.sh #!/bin/bash sudo pacman --sync --needed --noconfirm --quiet git gcc make pkg-config cd ~ git clone https://github.com/ZerBea/hcxdumptool.git cd hcxdumptool make && sudo make install cd ~ git clone https://github.com/ZerBea/hcxtools.git cd hcxtools make && sudo make install cd ~ df --human-readable / hcxdumptool -I read -p $'\n  Press ENTER to stop iwd ... ' sudo systemctl stop iwd


Code:
hcat.sh #!/bin/bash sudo pacman --sync --needed --noconfirm --quiet git gcc make fakeroot ocl-icd gpg --recv-keys 19882D92DDA4C400C22C0D56CC2AF4472167BE03 cd ~ git clone https://aur.archlinux.org/ncurses5-compat-libs.git cd ncurses5-compat-libs makepkg --syncdeps --install --needed --noconfirm --clean cd ~ git clone https://aur.archlinux.org/intel-opencl-runtime.git cd intel-opencl-runtime makepkg --syncdeps --install --needed --noconfirm --clean cd ~ df --human-readable / /mnt/sdb1/hashcat-6.2.6/hashcat.bin -I
Reply


Messages In This Thread
HowTo: Hashcat and hcxtools on Arch Linux Live USB - by v71221 - 03-19-2023, 09:23 AM