Pyrit is old, is outdated and it's still Python2 I am currently attempting to rewrite it from scratch, so thanks for all the stars but remember to keep an eye for Python3 version.
Pyrit allows you to create massive databases of pre-computed WPA/WPA2-PSK authentication phase in a space-time-tradeoff. By using the computational power of Multi-Core CPUs and other platforms through ATI-Stream,Nvidia CUDA and OpenCL, it is currently by far the most powerful attack against one of the world's most used security-protocols.
WPA/WPA2-PSK is a subset of IEEE 802.11 WPA/WPA2 that skips the complex task of key distribution and client authentication by assigning every participating party the same pre shared key. This master key is derived from a password which the administrating user has to pre-configure e.g. on his laptop and the Access Point. When the laptop creates a connection to the Access Point, a new session key is derived from the master key to encrypt and authenticate following traffic. The "shortcut" of using a single master key instead of per-user keys eases deployment of WPA/WPA2-protected networks for home- and small-office-use at the cost of making the protocol vulnerable to brute-force-attacks against it's key negotiation phase; it allows to ultimately reveal the password that protects the network. This vulnerability has to be considered exceptionally disastrous as the protocol allows much of the key derivation to be pre-computed, making simple brute-force-attacks even more alluring to the attacker. For more background see this article on the project's blog (Outdated).
The author does not encourage or support using Pyrit for the infringement of peoples' communication-privacy. The exploration and realization of the technology discussed here motivate as a purpose of their own; this is documented by the open development, strictly sourcecode-based distribution and 'copyleft'-licensing.
Pyrit is free software - free as in freedom. Everyone can inspect, copy or modify it and share derived work under the GNU General Public License v3+. It compiles and executes on a wide variety of platforms including FreeBSD, MacOS X and Linux as operation-system and x86-, alpha-, arm-, hppa-, mips-, powerpc-, s390 and sparc-processors.
Attacking WPA/WPA2 by brute-force boils down to to computing Pairwise Master Keys as fast as possible. Every Pairwise Master Key is 'worth' exactly one megabyte of data getting pushed through PBKDF2-HMAC-SHA1. In turn, computing 10.000 PMKs per second is equivalent to hashing 9,8 gigabyte of data with SHA1 in one second.
These are examples of how multiple computational nodes can access a single storage server over various ways provided by Pyrit:
- A single storage (e.g. a MySQL-server)
- A local network that can access the storage-server directly and provide four computational nodes on various levels with only one node actually accessing the storage server itself.
- Another, untrusted network can access the storage through Pyrit's RPC-interface and provides three computional nodes, two of which actually access the RPC-interface.
- Fixed #479 and #481
- Pyrit CUDA now compiles in OSX with Toolkit 7.5
- Added use_CUDA and use_OpenCL in config file
- Improved cores listing and managing
- limit_ncpus now disables all CPUs when set to value <= 0
- Improve CCMP packet identification, thanks to yannayl
See CHANGELOG file for a better description.
Pyrit compiles and runs on Linux, MacOS X and BSD. Windows is not supported.
It still needs Python 2.7, which current Debian/Ubuntu/Kali images no longer ship. On those systems, install Python 2.7 with pyenv and the distro CUDA packages as shown below. Older notes that used python2-dev, sudo pip, apt-get install pyrit, or Kali 2018 NVIDIA DKMS steps will not work on a recent install.
There is also a Tutorial and a reference manual for the commandline-client.
sudo apt update
sudo apt upgrade -yReboot if the kernel was upgraded.
Skip this if you only want the CPU core.
lspci | grep -i vga
sudo apt install -y nvidia-driver nvidia-cuda-toolkit
sudo rebootAfter reboot, nvcc --version should work. hashcat -b is a useful extra check that the GPU stack is alive.
sudo apt install -y \
build-essential curl git \
libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev \
libpcap-devzlib-devel / openssl-dev are Fedora names; on Debian the packages are zlib1g-dev and libssl-dev.
curl https://pyenv.run | bashAdd this to ~/.zshrc (or ~/.bashrc if you use bash), then open a new shell:
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"pyenv install 2.7.18git clone https://github.com/JPaulMora/Pyrit.git
cd Pyrit
pyenv local 2.7.18
pip install 'scapy==2.4.5' 'sqlalchemy<2'
python setup.py clean
python setup.py build
python setup.py installDo not prefix those python/pip commands with sudo — that would ignore pyenv and hit the system interpreter.
scapy is required for analyze/attack. sqlalchemy is optional unless you use SQL storage; PostgreSQL also needs psycopg2==2.8.6.
Leave the source tree (cd) before running pyrit, so Python does not pick up the local cpyrit package instead of the installed one:
cd
pyrit list_cores
pyrit benchmarkThe distro nvidia-cuda-toolkit package puts nvcc on PATH (/usr/bin/nvcc). From the Pyrit tree, with the same pyenv Python 2.7:
cd modules/cpyrit_cuda
python setup.py build
python setup.py installThen set use_CUDA = true (and use_OpenCL = false) in ~/.pyrit/config and run pyrit list_cores again.
OpenCL is similar from modules/cpyrit_opencl. On OpenCL 2+ you may need #define CL_USE_DEPRECATED_OPENCL_1_2_APIS at the top of _cpyrit_opencl.c before building.
You may want to read this wiki-entry if interested in porting Pyrit to new hardware-platform. Contributions or bug reports you should [submit an Issue] (https://github.com/JPaulMora/Pyrit/issues).
