new: saving unit's fingerprint to /etc/pwnagotchi/fingerprint for easy access
This commit is contained in:
parent
f8a28d375b
commit
a8a0f842a3
@ -37,7 +37,7 @@ if __name__ == '__main__':
|
|||||||
keypair = KeyPair(view=display)
|
keypair = KeyPair(view=display)
|
||||||
agent = Agent(view=display, config=config, keypair=keypair)
|
agent = Agent(view=display, config=config, keypair=keypair)
|
||||||
|
|
||||||
logging.info("%s@%s (v%s)" % (pwnagotchi.name(), agent._keypair.fingerprint, pwnagotchi.version))
|
logging.info("%s@%s (v%s)" % (pwnagotchi.name(), agent.fingerprint(), pwnagotchi.version))
|
||||||
|
|
||||||
for _, plugin in plugins.loaded.items():
|
for _, plugin in plugins.loaded.items():
|
||||||
logging.debug("plugin '%s' v%s loaded from %s" % (plugin.__name__, plugin.__version__, plugin.__file__))
|
logging.debug("plugin '%s' v%s loaded from %s" % (plugin.__name__, plugin.__version__, plugin.__file__))
|
||||||
|
@ -16,6 +16,7 @@ class KeyPair(object):
|
|||||||
self.priv_key = None
|
self.priv_key = None
|
||||||
self.pub_path = "%s.pub" % self.priv_path
|
self.pub_path = "%s.pub" % self.priv_path
|
||||||
self.pub_key = None
|
self.pub_key = None
|
||||||
|
self.fingerprint_path = os.path.join(path, "fingerprint")
|
||||||
self._view = view
|
self._view = view
|
||||||
|
|
||||||
if not os.path.exists(self.path):
|
if not os.path.exists(self.path):
|
||||||
@ -46,6 +47,9 @@ class KeyPair(object):
|
|||||||
self.pub_key_pem_b64 = base64.b64encode(pem_ascii).decode("ascii")
|
self.pub_key_pem_b64 = base64.b64encode(pem_ascii).decode("ascii")
|
||||||
self.fingerprint = hashlib.sha256(pem_ascii).hexdigest()
|
self.fingerprint = hashlib.sha256(pem_ascii).hexdigest()
|
||||||
|
|
||||||
|
with open(self.fingerprint_path, 'w+t') as fp:
|
||||||
|
fp.write(self.fingerprint)
|
||||||
|
|
||||||
# no exception, keys loaded correctly.
|
# no exception, keys loaded correctly.
|
||||||
self._view.on_starting()
|
self._view.on_starting()
|
||||||
return
|
return
|
||||||
|
@ -29,6 +29,9 @@ class AsyncAdvertiser(object):
|
|||||||
self._peers = {}
|
self._peers = {}
|
||||||
self._closest_peer = None
|
self._closest_peer = None
|
||||||
|
|
||||||
|
def fingerprint(self):
|
||||||
|
return self._keypair.fingerprint
|
||||||
|
|
||||||
def _update_advertisement(self, s):
|
def _update_advertisement(self, s):
|
||||||
self._advertisement['pwnd_run'] = len(self._handshakes)
|
self._advertisement['pwnd_run'] = len(self._handshakes)
|
||||||
self._advertisement['pwnd_tot'] = utils.total_unique_handshakes(self._config['bettercap']['handshakes'])
|
self._advertisement['pwnd_tot'] = utils.total_unique_handshakes(self._config['bettercap']['handshakes'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user