Merge pull request #285 from cdiemel/plugin.on-callback

on_unfiltered_ap_list() for plugins
This commit is contained in:
evilsocket 2019-10-14 10:42:11 +02:00 committed by GitHub
commit e32be6ff27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View File

@ -190,6 +190,7 @@ class Agent(Client, AsyncAdvertiser, AsyncTrainer):
aps = []
try:
s = self.session()
plugins.on("unfiltered_ap_list", self, s['wifi']['aps'])
for ap in s['wifi']['aps']:
if ap['hostname'] not in whitelist:
if self._filter_included(ap):

View File

@ -0,0 +1,22 @@
__author__ = 'diemelcw@gmail.com'
__version__ = '1.0.0'
__name__ = 'unfiltered_example'
__license__ = 'GPL3'
__description__ = 'An example plugin for pwnagotchi that implements on_unfiltered_ap_list(agent,aps)'
import logging
# Will be set with the options in config.yml config['main']['plugins'][__name__]
OPTIONS = dict()
# called when the plugin is loaded
def on_loaded():
logging.warning("%s plugin loaded" % __name__)
# called when AP list is ready, before whitelist filtering has occured
def on_unfiltered_ap_list(agent,aps):
logging.info("Unfiltered AP list to follow")
for ap in aps:
logging.info(ap['hostname'])
## Additional logic here ##