airoscriptng package

Submodules

airoscriptng.aircrack module

class airoscriptng.aircrack.Aircrack(attributes={})[source]

Bases: object

Exports a method foreach aircrack-ng binary that gets an OrderedDict with the desired parameters as argument.

Those parameters must match the ones specified in the json parameter file

callback(result)[source]

Plain aircrack-ng just logs the output and calls custom user callback (hence this callback).

An aircrack-ng session handler can be used to extend this class to avoid having multiple aircrack-ng processes loose

launch(*args, **kwargs)[source]

Launch a new pool with one thread for that one process. Then we call the callback.

exception airoscriptng.aircrack.AircrackError[source]

Bases: exceptions.Exception

Base aircrack exception

class airoscriptng.aircrack.AircrackSession(attributes={})[source]

Bases: airoscriptng.aircrack.Aircrack

Each session should have one or many aircrack-ng objects. An aircrack-ng object should be able to execute ONE of EACH aircrack-ng suite processes.

TODO:
  • Add some exceptions, there are processes of what we might

    want to have multiple instances running

callback(result)[source]
  • Remove the finished process from self.executing.
  • Then execute the user-defined callback if exists.
  • Otherwise just log output
execute(*args, **kwargs)[source]

Execute aircrack-ng command.

  • Parse parameters
  • Set up default callback
  • Check that proccess is not executing already
  • Then execute launch method.
executing = {}
class airoscriptng.aircrack.Executor(command='airmon-ng', _parameters={}, callback=False, shell=False, direct=False)[source]

Bases: object

Executor objects gets created to manage aircrack-ng execution.

It’s called from a threadpoolexecutor, this way the future returns this as result, having control of the commands called and callback.

airoscriptng.aircrack.parse_parameters(attributes, _parameters={}, command='airodump-ng')[source]

Main aircrack-ng parameter parsing from the json file is done here.

TODO:
  • Automatically generate the json this feeds on

Parameter format is as follows:

{
    'main_command': {
        'name_in_airoscript' : ['--flag_in_aircrack', "default_value"]
    }
}

If default_value is True, it’ll be assumed that is a flag that dont require an argument, and we want it by default enabled.

If it’s false, the same will be assumed, but will by default disabled.

All parameters can be overriden

airoscriptng.airoscriptng module

class airoscriptng.airoscriptng.Airoscript[source]

Bases: object

Main airoscript object. Contains not-that-direct aircrack-ng interaction methods and attacks

crack()[source]

Launches aircrack-ng in infinite mode against current target. :TODO: This should probably be better managed by set_target.

do_automated_hacking()[source]

Tries every possible tech reported to work by hackability status.

This means that every tech must be part of THIS class. External modules (capabilities) loaded in extra_capabilities will need to have a “crack” function that will be invoked when session._capability_name_ is invoked

end_scan()[source]

We send a kill signal to airodump-ng As aircrack object is not aware of this, we must manually change the status

generic_dissasociation()[source]

This does a generic dissasociation attack. Meaning that this attack is both useful on WEP and WPA.

This can be used both to get ARP replays and WPA handshake.

See : http://www.aircrack-ng.org/doku.php?id=deauthentication

get_wpa_handshake()[source]

Get WPA handshake, this right now is an alias for generic_dissasociation.

on_scan_bumped(pid)[source]

Callback to execute each time we rebump on scan(). This schedulles a re-rebump so it’s made periodically. That’s how we’ll get periodically (each second) updated csv files

This implements the plugin system, calling on_after_scan

pids = {}
pyrit()[source]
rebump(pid)[source]

Launches sigint to a process. In airodump-ng this means updating the csv contents

scan(options=OrderedDict())[source]

Main scanning function. Launches airodump-ng, saves its pid, and makes itself xmlrpc representable.

This implements the plugin system, calling on_before_scan

class airoscriptng.airoscriptng.AiroscriptSession(config={})[source]

Bases: airoscriptng.airoscriptng.Airoscript

Basic airoscriptng session object. This is the basic airoscriptng object. Handles network interfaces. Main interaction with outer world will be here.

current_targets[source]

Returns current targets (getter)

del_mon_iface()[source]

Deletes own monitor interface from system (cleanup)

get_current_targets()[source]

Parses airodump-ng’s output file, creating a Target object for each AP found, with its currently detected clients.

get_mac_addr()[source]

Return mac address of the interface

get_target()[source]

Returns currently selected target, clean to send it via xmlrpc

listMethods()[source]

Hack to return public methods of this object via XMLRPC

TODO:
  • Make this work
list_wifi()[source]

Returns a list of all the available wireless networks

mon_iface[source]

Return current monitor interface name

set_mon_iface(result)[source]

Sets monitor interface. Checks that final monitor interface is really what it should be.

set_target(target)[source]

This way we only have to do something like self.target = current_targets[10] and it’ll automatically make an object from it.

setup_wifi(iface)[source]

Starts monitor mode interface and checks it’s ok.

TODO:
  • Injection test.
target[source]

Returns currently selected target (getter)

class airoscriptng.airoscriptng.AiroscriptSessionManager(wifi_iface)[source]

Bases: object

Airoscript-ng session manager.

We can have multiple airoscript-ng sessions running on different interfaces

Each one will have an aircrack-ng session so we can execute only one process of each kind in each interface, to avoid collisions.

A session manager object should be used on xmlrpc sessions (but a airoscript session alone can be used too)

create_session(name=False, sleep_time=2, scan_time=2)[source]

Create a AiroscriptSession object and assigns it to session_list

If no name provided it will take current time (used to create monitor wireless interface)

Note that this does not setup monitor mode so we have to call the session’s setup_wifi method each time.

get_session(session_name)[source]

XMLRPC method returning a specific session object.

class airoscriptng.airoscriptng.Target(parent=False)[source]

Bases: object

Target object, this represents an access point

cleanup()[source]

kill all related PIDS and clean them.

from_dict(dict_, clients=[])[source]

Do some magic, get only its clients from the client list, strip extra whitespace in properties, and get its hackability

get_hackability()[source]

This assets a network hackability based on:

  • Network power
  • Network encryption
  • WPS availability
  • Dictionary availability
get_key()[source]

XMLRPC function for key()

is_attack_finished()[source]

Return if the attack is finished. This is a more complete check that is_attack_running, it has in account if the network has been cracked and if the attack has actually started.

is_attack_running()[source]

Returns True if the ALL the attack processes are still executing This means that:

If part of the attack (I.E replaying) has stopped, will consider the attack finished.

If the processes don’t die after the attack is successful, it wont consider the attack finished.

That’s why we’ll combine it with is_cracked and key

is_network_cracked()[source]

If the network has been cracked we’ll save the key to a key file for that specific target. This function just asks if the network has been cracked. Possibly not going to be used as network_key returns False if not cracked.

key[source]

Return network key or False if network has not been cracked.

key_file[source]
airoscriptng.airoscriptng.airoscriptxmlrpc()[source]

Simple xmlrpc server for airoscriptsession. :TODO: - Make it multisession

airoscriptng.airoscriptng.clean_to_xmlrpc(element, to_clean)[source]

Cleans certain properties from dict representation of given object

airoscriptng.broken module

airoscriptng.broken.get_hackability_name(point)[source]

Return a more human-understandable name for a hackability statistic

airoscriptng.pluginmanager module

airoscriptng.pluginmanager.load_plugins(config_file)[source]

This reads a config file of a list of plugins to load. It ignores empty lines or lines beginning with a hash mark (#). It is so plugin imports are more dynamic and you don’t need to continue appending import statements to the top of a file.

airoscriptng.pluginmanager.register(*events)[source]

This decorator is to be used for registering a function as a plugin for a specific event or list of events.

airoscriptng.pluginmanager.trigger_event(event, *args, **kwargs)[source]

Call this function to trigger an event. It will run any plugins that have registered themselves to the event. Any additional arguments or keyword arguments you pass in will be passed to the plugins.

Module contents