- Notifications
You must be signed in to change notification settings - Fork31
XayOn/pyrcrack
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Python aircrack-ng bindings
PyrCrack is a Python API exposing a common aircrack-ng API. As AircrackNg willrun in background processes, and produce parseable output both in files andstdout, the most pythonical approach are context managers, cleaning up after
This library exports a basic aircrack-ng API aiming to keep always a smallreadable codebase.
This has led to a simple library that executes each of the aircrack-ng's suite commandsand auto-detects its usage instructions. Based on that, it dinamically buildsclasses inheriting that usage as docstring and a run() method that acceptskeyword parameters and arguments, and checks them BEFORE trying to run them.
Some classes expose themselves as async iterators, as airodump-ng's wichreturns access points with its associated clients.
Thedocumentation is made withMaterialfor MkDocs and is hosted byGitHub Pages.
Be sure to check the pythonnotebook example
You can have also have a look at the examples/ folder for some usage examples,such as the basic "scan for targets", that will list available interfaces, letyou choose one, put it in monitor mode, and scan for targets updating resultseach 2 seconds.
importasyncioimportpyrcrackfromrich.consoleimportConsolefromrich.promptimportPromptasyncdefscan_for_targets():"""Scan for targets, return json."""console=Console()console.clear()console.show_cursor(False)airmon=pyrcrack.AirmonNg()interface=Prompt.ask('Select an interface',choices=[a['interface']forainawaitairmon.interfaces])asyncwithairmon(interface)asmon:asyncwithpyrcrack.AirodumpNg()aspdump:asyncforresultinpdump(mon.monitor_interface):console.clear()console.print(result.table)awaitasyncio.sleep(2)asyncio.run(scan_for_targets())
This snippet of code will produce the following results:
Pyrcrack is distributed under the terms of theGPL2+ license.