def exploit(self):
search = ServiceSearch()<EOL>host_search = HostSearch()<EOL>services = search.get_services(tags=['<STR_LIT>'])<EOL>services = [service for service in services]<EOL>if len(services) == <NUM_LIT:0>:<EOL><INDENT>print_error("<STR_LIT>")<EOL>return<EOL><DEDENT>if self.auto:<EOL><INDENT>print_success("<STR_LIT>".format(len(services)))<EOL>for service in services:<EOL><INDENT>print_success("<STR_LIT>" + str(service.address))<EOL>host = host_search.id_to_object(str(service.address))<EOL>system_os = '<STR_LIT>'<EOL>if host.os:<EOL><INDENT>system_os = host.os<EOL><DEDENT>else:<EOL><INDENT>system_os = self.detect_os(str(service.address))<EOL>host.os = system_os<EOL>host.save()<EOL><DEDENT>text = self.exploit_single(str(service.address), system_os)<EOL>print_notification(text)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>service_list = []<EOL>for service in services:<EOL><INDENT>host = host_search.id_to_object(str(service.address))<EOL>system_os = '<STR_LIT>'<EOL>if host.os:<EOL><INDENT>system_os = host.os<EOL><DEDENT>else:<EOL><INDENT>system_os = self.detect_os(str(service.address))<EOL>host.os = system_os<EOL>host.save()<EOL><DEDENT>service_list.append({'<STR_LIT>': service.address, '<STR_LIT>': system_os, '<STR_LIT:string>': "<STR_LIT>".format(ip=service.address, os=system_os, hostname=host.hostname)})<EOL><DEDENT>draw_interface(service_list, self.callback, "<STR_LIT>")<EOL><DEDENT>
Starts the exploiting phase, you should run setup before running this function.
if auto is set, this function will fire the exploit to all systems. Otherwise a curses interface is shown.