changes to support plugins requesting parts of session, and get notice of events

This commit is contained in:
Sniffleupagus
2023-04-04 14:11:23 -07:00
parent 544314b88c
commit 70bffe5200
2 changed files with 10 additions and 2 deletions

View File

@ -324,6 +324,12 @@ class Agent(Client, Automata, AsyncAdvertiser, AsyncTrainer):
found_handshake = False
jmsg = json.loads(msg)
# give plugins access to the events
try:
plugins.on('bcap_%s' % re.sub(r"[^a-z0-9_]+", "_", jmsg['tag'].lower()), self, jmsg)
except Exception as err:
logging.error("Processing event: %s" % err)
if jmsg['tag'] == 'wifi.client.handshake':
filename = jmsg['data']['file']
sta_mac = jmsg['data']['station']