Exemplo n.º 1
0
 def _update_advertisement(self, s):
     run_handshakes = len(self._handshakes)
     tot_handshakes = core.total_unique_handshakes(self._config['bettercap']['handshakes'])
     started = s['started_at'].split('.')[0]
     started = datetime.strptime(started, '%Y-%m-%dT%H:%M:%S')
     started = time.mktime(started.timetuple())
     self._advertiser.update({ \
         'pwnd_run': run_handshakes,
         'pwnd_tot': tot_handshakes,
         'uptime': time.time() - started,
         'epoch': self._epoch.epoch})
Exemplo n.º 2
0
 def on_manual_mode(self, log):
     self.set('mode', 'MANU')
     self.set('face', faces.SAD if log.handshakes == 0 else faces.HAPPY)
     self.set('status', self._voice.on_log(log))
     self.set('epoch', "%04d" % log.epochs)
     self.set('uptime', log.duration)
     self.set('channel', '-')
     self.set('aps', "%d" % log.associated)
     self.set('shakes', '%d (%s)' % (log.handshakes, \
                                     core.total_unique_handshakes(self._config['bettercap']['handshakes'])))
     self.set_closest_peer(log.last_peer)
Exemplo n.º 3
0
    def _update_handshakes(self, new_shakes=0):
        if new_shakes > 0:
            self._epoch.track(handshake=True, inc=new_shakes)

        tot = core.total_unique_handshakes(self._config['bettercap']['handshakes'])
        txt = '%d (%d)' % (len(self._handshakes), tot)

        if self._last_pwnd is not None:
            txt += ' [%s]' % self._last_pwnd[:20]

        self._view.set('shakes', txt)

        if new_shakes > 0:
            self._view.on_handshakes(new_shakes)