def run(self): conf.verb = self.verbose nm = self.scan(protocol='UDP') for host in nm.all_hosts(): if nm[host]['udp'][self.port]['state'] == "open": print_success("Host: %s, port:%s is open" % (host, self.port)) self.get_target_info(host=host, port=self.port) unique_device = [list(x) for x in set(tuple(x) for x in self.result)] print tabulate.tabulate(unique_device, headers=TABLE_HEADER)
def run(self): conf.verb = self.verbose self.sniff_mac_address = get_if_hwaddr(self.nic) p = threading.Thread(target=self.sniff_answer) p.setDaemon(True) p.start() self.exploit(target_mac=PROFINET_BROADCAST_ADDRESS_1) self.exploit(target_mac=PROFINET_BROADCAST_ADDRESS_2) self.sniff_finished.wait(self.timeout + 1) unique_device = [list(x) for x in set(tuple(x) for x in self.result)] print tabulate.tabulate(unique_device, headers=TABLE_HEADER)
def scan_target_ip(self, target_mac): p = threading.Thread(target=self.sniff_answer) p.setDaemon(True) p.start() packet = Ether(src=self.sniff_mac_address, dst=target_mac, type=0x8892) / ProfinetIO(frameID=0xFEFE) / \ PNDCPHeader(ServiceID=5, ServiceType=0, DCPBlocks=[PNDCPIdentRequest()]) sendp(packet, iface=self.nic) self.sniff_finished.wait(self.timeout + 1) unique_device = [list(x) for x in set(tuple(x) for x in self.result)] print(tabulate.tabulate(unique_device, headers=TABLE_HEADER)) print('\n')
def run(self): self.result = [] conf.verb = self.verbose nm = self.scan(protocol='TCP') for host in nm.all_hosts(): if nm[host]['tcp'][self.port]['state'] == "open": print_success("Host: %s, port:%s is open" % (host, self.port)) self.get_target_info(host=host, port=self.port) unique_device = [list(x) for x in set(tuple(x) for x in self.result)] if len(self.result) > 0: print_success("Find %s targets" % len(self.result)) print(tabulate.tabulate(unique_device, headers=TABLE_HEADER)) print('\r') else: print_error("Didn't find any target on network %s" % self.target)
def run(self): conf.verb = self.verbose self.exploit() unique_device = [list(x) for x in set(tuple(x) for x in self.result)] print tabulate.tabulate(unique_device, headers=TABLE_HEADER)