Skip to main content

Pythonic aircrack-ng bindings

Project description


Python aircrack-ng bindings

PyrCrack is a Python API exposing a common aircrack-ng API. As AircrackNg will run in background processes, and produce parseable output both in files and stdout, the most pythonical approach are context managers, cleaning up after


This library is available on Pypi, you can install it directly with pip:

pip install pycrack


This library exports a basic aircrack-ng API aiming to keep always a small readable codebase.

This has led to a simple library that executes each of the aircrack-ng’s suite commands and auto-detects its usage instructions. Based on that, it dinamically builds classes inheriting that usage as docstring and a run() method that accepts keyword parameters and arguments, and checks them BEFORE trying to run them.

You can find some example usages in examples/ directory:

async with pyrcrack.AircrackNg() as pcrack:
    # This also sets pcrack.proc as the running
    # process, wich is a `Process` instance.

    # get_result() is specific of AircrackNg class.
    print(await pcrack.get_result())

# This will create temporary files needed, and
# cleanup process after if required.

There are some syntactic sugar methods, like “result_updater” on pyrcrack class.

The following example will automatically keep updating, for 10 seconds, a meta[“results”] property on pdump:

import pyrcrack
import sys
import asyncio
from async_timeout import timeout

async def test(max_timeout):
    async with pyrcrack.AirodumpNg() as pdump:
        with suppress(asyncio.TimeoutError):
            async with timeout(max_timeout):
                while True:
                    await asyncio.sleep(1)
        return await pdump.proc.terminate()

You can also list all available airmon interfaces, like so:

async with pyrcrack.AirmonZc() as airmon:
    print(await airmon.list_wifis())

This will return a nice dict with all information as is returned by airmon-zc

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrcrack-1.0.2.tar.gz (11.8 kB view hashes)

Uploaded source

Built Distribution

pyrcrack-1.0.2-py3-none-any.whl (13.8 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page