How To Install Pyrit In Kali Linux ((full)) -
Installing Pyrit on modern Kali Linux is a complex process because the tool is based on Python 2, which has been removed from official repositories. To successfully install it, you must compile it from source and manually resolve legacy dependency issues. Important: Pyrit vs. Microsoft PyRIT Ensure you are installing the correct tool:
Pyrit (Classic): A legacy tool for pre-computing WPA/WPA2-PSK databases.
Microsoft PyRIT: A modern tool for red-teaming generative AI (Large Language Models). If you need the AI tool, install it via pip install pyrit. Step-by-Step Installation for Classic Pyrit 1. Install Required Dependencies
Since modern Kali lacks these by default, you must install the development libraries for Python 2 and network packet capturing. sudo apt-get update
sudo apt-get install -y git python2-dev libssl-dev zlib1g-dev libpcap-dev 2. Clone and Patch the Source Code
The original source often fails to compile on newer systems due to an aesni_key error. You must "fudge" the code to bypass this.
Clone the repository:git clone https://github.com/JPaulMora/Pyrit.git
Apply the AES-NI Patch:cd Pyritsed -i "s/COMPILE_AESNI/COMPILE_AESNIX/" cpyrit/_cpyrit_cpu.c 3. Build and Install Use Python 2 specifically to run the setup script. sudo python2 setup.py clean sudo python2 setup.py build sudo python2 setup.py install 4. Verify the Installation
Check if the cores are correctly identified and run a benchmark to ensure functionality.
Installing on modern versions of Kali Linux (2021-2024) requires manual compilation from source because it was removed from the official repositories due to its dependency on Prerequisites
Before you begin, ensure you have an active internet connection to download necessary files. Since Python 2 is end-of-life, you must explicitly install its development headers. Step-by-Step Installation Guide Update System and Install Dependencies
Open your terminal and run the following command to install the required development libraries for Python 2, OpenSSL, and packet capturing:
sudo apt update && sudo apt install git python2-dev libssl-dev libpcap-dev -y Clone the Pyrit Repository Download the latest source code from the maintained GitHub repository git clone https://github.com/JPaulMora/Pyrit.git --depth=1 Apply AES-NI Workaround How to install Pyrit in Kali Linux
Modern kernels often cause an error with Pyrit's AES implementation. You must "fudge" the code by renaming a constant in the source file before compiling:
sed -i "s/COMPILE_AESNI/COMPILE_AESNIX/" cpyrit/_cpyrit_cpu.c Compile and Install Run the setup script using to build and install the tool to your system: python2 setup.py clean python2 setup.py build sudo python2 setup.py install Verify the Installation
Test if Pyrit is correctly installed by checking the help menu or running a benchmark: pyrit benchmark Summary Table: Key Installation Components Requirement Component / Command Python 2.7 Required for execution libpcap-dev Essential for packet capture analysis COMPILE_AESNI Prevents "aesni_key not found" errors GPU (Optional) Accelerates password cracking Important Troubleshooting Note If you encounter errors related to
, you may need to install a specific older version compatible with Python 2: sudo python2 -m pip install scapy==2.3.2 configure GPU acceleration for Pyrit to further increase its cracking speed? How to install Pyrit in Kali Linux? - blackMORE Ops 12 May 2015 —
Conclusion
Installing Pyrit on modern Kali Linux is no longer a simple apt-get command, but it’s far from impossible. Whether you choose the Python 3 fork, brave the CUDA compilation, or wrap everything in Docker, Pyrit can still serve as a valuable entry point into the world of wireless password cracking.
That said, the broader security community has moved on. Use this guide to install Pyrit for its historical value and educational merit, but invest your serious cracking time into learning Hashcat. It’s faster, more versatile, and—most importantly—actively maintained.
Now go forth, audit responsibly, and always get written permission before testing networks you don’t own.
This article was last tested on Kali Linux 2024.4. Commands and repositories are subject to change; check GitHub for the latest Pyrit forks.
Installing on modern versions of Kali Linux (2024 and newer) can be tricky because the tool was originally built for
, which has been deprecated in favor of Python 3. Since Pyrit is no longer in the official Kali repositories, you must install it from source and apply a specific code "fudge" to prevent compilation errors. Prerequisites
Before starting, ensure you have an active internet connection and your system is up to date. Step 1: Install Dependencies
Open your terminal and install the required development libraries. You will specifically need python2-dev as the core of Pyrit still relies on it. Installing Pyrit on modern Kali Linux is a
sudo apt update sudo apt install git python2-dev libssl-dev libpcap-dev python-is-python2 -y Use code with caution. Copied to clipboard Step 2: Clone the Pyrit Repository Download the source code directly from the official JPaulMora/Pyrit GitHub repository
Installing on modern Kali Linux is a common challenge for security enthusiasts, as the tool was officially removed from Kali’s repositories in 2020 due to its reliance on Python 2. However, you can still install it by compiling it from source. Kali Linux Package Tracker Important Note:
There are now two distinct tools with this name. This guide is for the classic Wireless Auditing tool . If you are looking for Microsoft's Python Risk Identification Tool for Generative AI, that is a separate library installed via about.gitlab.com Blog Post: Getting Pyrit Back on Kali Linux Introduction
Pyrit was once a staple in the Kali Linux toolkit, famous for its ability to utilize GPU power to accelerate WPA/WPA2 cracking. While newer tools like Hashcat have largely taken its place, many legacy scripts and workflows still rely on it. Because it was removed from official repositories, we’ll walk through how to build it from the JPaulMora GitHub repository Step 1: Install Required Dependencies
Since Pyrit is built on Python 2, you need the legacy development files and specific libraries for packet capture and encryption. Open your terminal and run:
sudo apt update -y sudo apt install git python2-dev libssl-dev libpcap-dev python2 -y Use code with caution. Copied to clipboard Step 2: Clone the Pyrit Repository
Download the source code directly from the maintained GitHub mirror:
Installing Pyrit on modern Kali Linux requires manual compilation from source, as it is no longer available in the default repositories and relies on Python 2. Pyrit is a powerful tool for pre-computing WPA/WPA2-PSK authentication phases to speed up password cracking. Step-by-Step Installation Guide 1. Update System and Install Dependencies
First, ensure your system is up-to-date and install the necessary libraries for building Python 2 applications.
sudo apt-get update sudo apt-get install git python2-dev libssl-dev zlib1g-dev libpcap-dev -y Use code with caution. Copied to clipboard 2. Clone the Pyrit Source Code
Download the latest source from the active GitHub repository maintained by the community. git clone https://github.com/JPaulMora/Pyrit.git cd Pyrit Use code with caution. Copied to clipboard 3. Build and Install Pyrit Compile the main module using Python 2. sudo python2 setup.py build sudo python2 setup.py install Use code with caution. Copied to clipboard 4. Verify the Installation
Check if Pyrit is installed correctly by listing the available computing cores. pyrit list_cores Use code with caution. Copied to clipboard Conclusion Installing Pyrit on modern Kali Linux is
You should see a list of your CPU cores. If you have an NVIDIA or AMD GPU, additional setup for CUDA or OpenCL is required to unlock GPU acceleration. Optional: Modern "PyRIT" (Microsoft Tool)
If you are looking for Microsoft's Python Risk Identification Tool (PyRIT) for AI red-teaming, the installation is different and uses Python 3.8+: Clone: git clone https://github.com/Azure/PyRIT.git Setup: Use a virtual environment and install via pip:
python3 -m venv pyrit-env source pyrit-env/bin/activate pip install -r requirements.txt pip install -e . Use code with caution. Copied to clipboard
Important Note: Traditional Pyrit (for Wi-Fi) is an older tool; many users now prefer Hashcat for GPU-accelerated WPA cracking because it supports modern drivers and hardware out of the box.
Step 1: Install Dependencies
sudo apt install -y python3-pip python3-dev libssl-dev libpcap-dev build-essential git
For GPU support (optional):
- CUDA (NVIDIA):
sudo apt install nvidia-cuda-toolkit - OpenCL:
sudo apt install opencl-headers ocl-icd-libopencl1
Step 3: Run Pyrit in a Container
docker run -it --rm jpaulmora/pyrit pyrit --help
To use Pyrit with capture files on your host system, mount a volume:
docker run -it --rm -v /path/to/your/captures:/data jpaulmora/pyrit pyrit -r /data/handshake.cap analyze
Note: GPU passthrough in Docker requires nvidia-docker, which adds complexity. For GPU cracking, stick with Method 2 or use hashcat.
3.1. Method 1: Install via APT Repository (Easiest but Often Outdated)
Kali’s official repository sometimes includes an older, working version.
sudo apt install pyrit -y
Verification:
pyrit --version
Note: As of Kali 2023.4+, this may fail due to missing dependencies (e.g., scapy for Python 3). If it fails, use Method 2 or 3.
How to Install Pyrit in Kali Linux
Step 2: Install Pyrit
Pyrit is available in the Kali Linux repository, making it easy to install. Run the following command to install Pyrit:
sudo apt-get install pyrit
