From f77593ad268a673bb3f9224cf3289d638edd8339 Mon Sep 17 00:00:00 2001 From: David Francos Date: Fri, 9 Feb 2018 17:54:21 +0100 Subject: [PATCH] Added most aircrack-ng suite commands - Airbase - Airdecap - Airdecloack - Aireplay - Airmon-ng and Airmon-zc --- pyrcrack/__init__.py | 5 ++++ pyrcrack/airbase.py | 58 +++++++++++++++++++++++++++++++++++++ pyrcrack/airdecap.py | 25 ++++++++++++++++ pyrcrack/airdecloack.py | 39 +++++++++++++++++++++++++ pyrcrack/aireplay.py | 63 +++++++++++++++++++++++++++++++++++++++++ pyrcrack/airmon.py | 31 ++++++++++++++++++++ 6 files changed, 221 insertions(+) create mode 100644 pyrcrack/airbase.py create mode 100644 pyrcrack/airdecap.py create mode 100644 pyrcrack/airdecloack.py create mode 100644 pyrcrack/aireplay.py create mode 100644 pyrcrack/airmon.py diff --git a/pyrcrack/__init__.py b/pyrcrack/__init__.py index f15623f..5e94c05 100644 --- a/pyrcrack/__init__.py +++ b/pyrcrack/__init__.py @@ -3,3 +3,8 @@ Aircrack-NG python bindings """ from .aircrack import AircrackNg # noqa +from .airdecap import AirdecapNg # noqa +from .aireplay import AireplayNg # noqa +from .airmon import AirmonNg, AirmonZc # noqa +from .airbase import AirbaseNg # noqa +from .airdecloack import AirdecloackNg # noqa diff --git a/pyrcrack/airbase.py b/pyrcrack/airbase.py new file mode 100644 index 0000000..ef486e8 --- /dev/null +++ b/pyrcrack/airbase.py @@ -0,0 +1,58 @@ +"""Airbase-ng.""" + +from .executor import ExecutorHelper + + +class AirbaseNg(ExecutorHelper): + """Airbase-ng 1.2 beta3 - (C) 2008-2013 Thomas d'Otreppe. + + Original work: Martin Beck + http://www.aircrack-ng.org + + usage: airbase-ng + + Options: + + -a bssid : set Access Point MAC address + -i iface : capture packets from this interface + -w WEP key : use this WEP key to en-/decrypt packets + -h MAC : source mac for MITM mode + -f disallow : disallow specified client MACs (default: allow) + -W 0|1 : [don't] set WEP flag in beacons 0|1 (default: auto) + -q : quiet (do not print statistics) + -v : verbose (print more messages) + -A : Ad-Hoc Mode (allows other clients to peer) + -Y in|out|both : external packet processing + -c channel : sets the channel the AP is running on + -X : hidden ESSID + -s : force shared key authentication (default: auto) + -S : set shared key challenge length (default: 128) + -L : Caffe-Latte WEP attack + (use if driver can't send frags) + -N : cfrag WEP attack (recommended) + -x nbpps : number of packets per second (default: 100) + -y : disables responses to broadcast probes + -0 : set all WPA,WEP,open tags. + can't be used with -z & -Z + -z type : sets WPA1 tags. 1=WEP40 2=TKIP 3=WRAP + 4=CCMP 5=WEP104 + -Z type : same as -z, but for WPA2 + -V type : fake EAPOL 1=MD5 2=SHA1 3=auto + -F prefix : write all sent and received frames into pcap file + -P : respond to all probes, even when specifying ESSIDs + -I interval : sets the beacon interval value in ms + -C seconds : enables beaconing of probed ESSID values + (requires -P) + + Filter options: + --bssid MAC : BSSID to filter/use + --bssids file : read a list of BSSIDs out of that file + --client MAC : MAC of client to filter + --clients file : read a list of MACs out of that file + --essid ESSID : specify a single ESSID (default: default) + --essids file : read a list of ESSIDs out of that file + + --help : Displays this usage screen + """ + command = 'airbase-ng' + sync = True diff --git a/pyrcrack/airdecap.py b/pyrcrack/airdecap.py new file mode 100644 index 0000000..3d29571 --- /dev/null +++ b/pyrcrack/airdecap.py @@ -0,0 +1,25 @@ +"""Airdecap-ng.""" +from .executor import ExecutorHelper + + +class AirdecapNg(ExecutorHelper): + """Airdecap-ng 1.2 beta3 - (C) 2006-2013 Thomas d'Otreppe + + http://www.aircrack-ng.org + + Usage: airdecap-ng [options] + + Options: + + -l : don't remove the 802.11 header + -b : access point MAC address filter + -e : target network SSID + -w : target network WEP key in hex + -p : target network WPA passphrase + -k : WPA Pairwise Master Key in hex + + --help : Displays this usage screen + """ + + command = 'airdecap-ng' + sync = False diff --git a/pyrcrack/airdecloack.py b/pyrcrack/airdecloack.py new file mode 100644 index 0000000..a9ce65e --- /dev/null +++ b/pyrcrack/airdecloack.py @@ -0,0 +1,39 @@ +"""Airdecloack-ng.""" + +from .executor import ExecutorHelper + + +class AirdecloackNg(ExecutorHelper): + """Airdecloak-ng 1.2 beta3 - (C) 2008-2013 Thomas d'Otreppe. + http://www.aircrack-ng.org + + usage: airdecloak-ng -i= [Options] + + Options: + + -i : Input capture file + --ssid : ESSID of the network to filter + --bssid : BSSID of the network to filter + --filters : Apply filters (separated by a comma). Filters: + signal: Try to filter based on signal. + duplicate_sn: Remove all duplicate sequence numbers + for both the AP and the client. + duplicate_sn_ap: Remove duplicate sequence number for + the AP only. + duplicate_sn_client: Remove duplicate sequence number for the + client only. + consecutive_sn: Filter based on the fact that IV should + be consecutive (only for AP). + duplicate_iv: Remove all duplicate IV. + signal_dup_consec_sn: Use signal (if available), duplicate and + consecutive sequence number (filtering is + much more precise than using all these + filters one by one). + --null-packets : Assume that null packets can be cloaked. + --disable-base_filter : Do not apply base filter. + --drop-frag : Drop fragmented packets + + --help : Displays this usage screen + """ + command = "airdecloack-ng" + sync = False diff --git a/pyrcrack/aireplay.py b/pyrcrack/aireplay.py new file mode 100644 index 0000000..ff291f5 --- /dev/null +++ b/pyrcrack/aireplay.py @@ -0,0 +1,63 @@ +"""Aireplay-ng""" + +from .executor import ExecutorHelper + + +class AireplayNg(ExecutorHelper): + """ + Aireplay-ng 1.2 beta3 - (C) 2006-2013 Thomas d'Otreppe + http://www.aircrack-ng.org + + Usage: aireplay-ng + + Options: + + -b bssid : MAC address, Access Point + -d dmac : MAC address, Destination + -s smac : MAC address, Source + -m len : minimum packet length + -n len : maximum packet length + -u type : frame control, type field + -v subt : frame control, subtype field + -t tods : frame control, To DS bit + -f fromds : frame control, From DS bit + -w iswep : frame control, WEP bit + -D : disable AP detection + -x nbpps : number of packets per second + -p fctrl : set frame control word (hex) + -a bssid : set Access Point MAC address + -c dmac : set Destination MAC address + -h smac : set Source MAC address + -g value : change ring buffer size (default: 8) + -F : choose first matching packet + -e essid : set target AP SSID + -o npckts : number of packets per burst (0=auto, default: 1) + -q sec : seconds between keep-alives + -Q : send reassociation requests + -y prga : keystream for shared key auth + -T n : exit after retry fake auth request n time + -j : inject FromDS packets + -k IP : set destination IP in fragments + -l IP : set source IP in fragments + -B : activates the bitrate test + -i iface : capture packets from this interface + -r file : extract packets from this pcap file + -R : disable /dev/rtc usage + --ignore-negative-one : if the interface's channel can't be determined + ignore the mismatch + --deauth count : deauthenticate 1 or all stations (-0) + --fakeauth delay : fake authentication with AP (-1) + --interactive : interactive frame selection (-2) + --arpreplay : standard ARP-request replay (-3) + --chopchop : decrypt/chopchop WEP packet (-4) + --fragment : generates valid keystream (-5) + --caffe-latte : query a client for new IVs (-6) + --cfrag : fragments against a client (-7) + --migmode : attacks WPA migration mode (-8) + --test : tests injection and quality (-9) + + --help : Displays this usage screen + """ + + command = 'aireplay-ng' + sync = True diff --git a/pyrcrack/airmon.py b/pyrcrack/airmon.py new file mode 100644 index 0000000..02f6849 --- /dev/null +++ b/pyrcrack/airmon.py @@ -0,0 +1,31 @@ +from .executor import ExecutorHelper + + +class AirmonZc(ExecutorHelper): + """ Airmon-ZC + Usage: airmon-zc [channel or frequency] + """ + + command = 'airmon-zc' + sync = False + + def run(self, *args, **kwargs): + """Check argument position. Forced for this one.""" + assert any(a in args[0] for a in ('start', 'stop', 'check')) + assert len(args) > 1 + return super().run(*args, **kwargs) + + +class AirmonNg(ExecutorHelper): + """ Airmon-ZC + Usage: airmon-zc [channel or frequency] + """ + + command = 'airmon-ng' + sync = False + + def run(self, *args, **kwargs): + """Check argument position. Forced for this one.""" + assert any(a in args[0] for a in ('start', 'stop', 'check')) + assert len(args) > 1 + return super().run(*args, **kwargs)