WiFi pineapple API Wrapper written in python
Documentation is a work in progress. It may not be complete for a while, but I believe the code to be very readable and if you do know python it shouldn't be too hard to figure out. Some hints:
- All modules have the same name they do on the pineapple (all lower case). To see what a module can do just run
help(fruit.getModule(modulename)) - To find out more about the WiFi Pineapple API itself, set
debug = Truewhen instantiating yourPineapple()s and it will log the HTTP requests it makes - Read the WiFi Pineapple php source located on your pineapple at
/pineapple/modules/$modulename/api/module.phpas well as the corresponding python files in this project
API_TOKEN = "xxxxxxxxxx..." from pineapple import * fruit = pineapple.Pineapple(API_TOKEN)
fruit.getModule("notifications").addNotification("test")
fruit.getModule("pineap").enable()
Deauth/dissasoc the clients 73:65:62:6b:69:6e and 6e:65:73:67:69:61 from the bssid 6e:74:64:69:63:6b 5 times on channel 1
fruit.getModule("pineap").deauth('6e:74:64:69:63:6b', ['73:65:62:6b:69:6e', '6e:65:73:67:69:61'], 5, 1)
p = fruit.getModule("pineap").getSSIDPool()
Returns a dict. The pool is on the key "ssidPool" separated by newlines. To get a quick list, do the following:
ssids = p['ssidPool'].split('\n')
Some support for download files via token was added to api and recon
fruit.getModule("recon").downloadResults(1)
Will return a dict with key "download" and a unique download token for the results of Scan ID 1. So knowing that, you can call api.download now to get the results
myScan = fruit.api.download(fruit.getModule("recon").downloadResults(1)['download'])
myScan will be the raw file text. In the case of a recon scan, it is json. So you can make it more usable with json.loads(myScan) To generate API tokens, use the API Tokens module