项目作者: ph4r05

项目描述 :
Python plugin for Kismet to perform deauthentication to collect WPA2 handshakes
高级语言: Python
项目地址: git://github.com/ph4r05/kismet-deauth-wpa2-handshake-plugin.git
创建时间: 2016-10-02T10:59:40Z
项目社区:https://github.com/ph4r05/kismet-deauth-wpa2-handshake-plugin

开源协议:MIT License

下载


Deauth plugin for Kismet

This basic Python plugin for Kismet runclient.py.

The main purpose of the plugin is to collect WPA handshakes by actively deauthenticating
connected clients automatically.

The plugin communicates with Kismet server over the kismet protocol on TCP 2501.
Its listening to BSSID, SSID, Client events and builds an internal database of interesting targets.

Once a client on interesting SSID is captured, it is enqueued to a priority queue for deauth.
Another deauth thread scans the deauth queue and performs deauth & handshake collection.

Plugin is designed to use a different WiFi interface than kismet uses not to interfere with the scanning.
Plugin starts airodump-ng on a given channel to capture the handshake, performs deauth and keeps collecting for next
10 seconds waiting for client to authenticate again.

The plugin is based on kismetclient repo. For more details take a look at the
blog.

kismetclient

A Python client for the Kismet server protocol.

Start by creating a client:

  1. from kismetclient import Client as KismetClient
  2. address = ('127.0.0.1', 2501)
  3. k = KismetClient(address)

Then register any desired builtin protocol handlers:

  1. from kismetclient import handlers
  2. k.register_handler('TRACKINFO', handlers.print_fields)

Create and register a custom protocol handler:

  1. def handle_ssid(client, ssid, mac):
  2. print 'SSID spotted: "%s" with mac %s' % (ssid, mac)
  3. k.register_handler('SSID', handle_ssid)

and call the listen() method in a loop:

  1. while True:
  2. k.listen()

The listen() method will retrieve responses from the kismet server,
parsing them, and calling registered handlers as appropriate.

kismetclient is agnostic about how you loop this call; choose a
method that works well with the rest of your application’s
architecture. You could run it in a separate blocking thread that
handles events by parsing them and pushing to a queue, or you could
use gevent to avoid blocking during the socket read call.

A handler is a callable whose first argument is the client generating
the message, with all other arguments named after kismet’s protocol
capabilities. A handler may specify just client and **fields
parameters in order to get all fields for a message in the default
order. In general, your handlers should be quick to run and not
depend on other blocking code.

Handlers are registered by calling the register_handler method on
the client. The first argument is the name of the protocol to handle,
the second is the function to handle it. It is valid to register a
handler for a protocol which is already handled - in this case the new
handler overrides the old one.

Commands can be sent using client.cmd(cmd, *args):

  1. k.cmd('ENABLE', protocol, fields)

The first argument is the kismet command name, followed by the
command arguments.

A trivial example application is included in runclient.py. Reading
the source is also likely to be helpful.

To discover which protocols and capabilities your kismet server
supports, start the kismet server and use the interactive python
shell:

  1. >>> from kismetclient import Client
  2. >>> k = Client()
  3. >>> k.protocols.keys()
  4. ['CRITFAIL', 'ACK', 'PACKET', 'NETTAG', 'BTSCANDEV', 'CAPABILITY',
  5. 'SOURCE', 'COMMON', 'CLISRC', 'TRACKINFO', 'PROTOCOLS', 'BSSIDSRC',
  6. 'STATUS', 'WEPKEY', 'STRING', 'SPECTRUM', 'ERROR', 'CHANNEL', 'GPS',
  7. 'INFO', 'SSID', 'BSSID', 'PLUGIN', 'BATTERY', 'TERMINATE', 'REMOVE',
  8. 'ALERT', 'KISMET', 'CLIENT', 'TIME', 'CLITAG']
  9. >>> k.protocols['GPS']
  10. ['lat', 'lon', 'alt', 'spd', 'heading', 'fix', 'satinfo', 'hdop',
  11. 'vdop', 'connected']

To discover Kismet commands, grep the Kismet source for
RegisterClientCommand. At the time of this writing, this list
included: CAPABILITY, ENABLE, REMOVE, SHUTDOWN,
ADDTRACKERFILTER, ADDNETCLIFILTER, ADDNETTAG, DELNETTAG,
ADDCLITAG, DELCLITAG, ADDSOURCE, DELSOURCE, RESTARTSOURCE,
HOPSOURCE, and CHANSOURCE. For usage, consult the source or monitor an
interactive session between the official client and server using
wireshark.

This software is developed using Python 2.7 and the master branch of
Kismet. It may also work on Python 2.6 and earlier versions of Kismet,
but ymmv. Please open tickets for bugs using github.

Donating

This implementation is an open source. If you like the code or you do find it useful please feel free to donate to the
author whatever amount you would like by clicking on the paypal button below.
And if you don’t feel like donating, that’s OK too.

Bitcoin:

19MNw2vgnvymQK66AUEtCDpR3UPjnenqwj
19MNw2vgnvymQK66AUEtCDpR3UPjnenqwj