From 078ab632496aa1746b227d106ad8bfe95138cd0e Mon Sep 17 00:00:00 2001 From: Simone Margaritelli Date: Wed, 9 Oct 2019 23:14:02 +0200 Subject: [PATCH] new: grid plugin now reports brain.json info --- pwnagotchi/plugins/default/grid.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pwnagotchi/plugins/default/grid.py b/pwnagotchi/plugins/default/grid.py index 066b794a..40cd1c6d 100644 --- a/pwnagotchi/plugins/default/grid.py +++ b/pwnagotchi/plugins/default/grid.py @@ -8,6 +8,7 @@ import os import logging import requests import glob +import json import subprocess import pwnagotchi import pwnagotchi.utils as utils @@ -37,6 +38,13 @@ def get_api_token(last_session, keys): # sign the identity string to prove we own both keys _, signature_b64 = keys.sign(identity) + brain = {} + try: + with open('/root/brain.json') as fp: + brain = json.load(fp) + except: + pass + api_address = 'https://api.pwnagotchi.ai/api/v1/unit/enroll' enrollment = { 'identity': identity, @@ -53,7 +61,8 @@ def get_api_token(last_session, keys): 'associated': last_session.associated, 'handshakes': last_session.handshakes, 'peers': last_session.peers, - 'uname': subprocess.getoutput("uname -a") + 'uname': subprocess.getoutput("uname -a"), + 'brain': brain } }