def display_empty_text_show_options(self, line): entered = line.split() out = None if len(entered) < 3: out = self.complete_filter_command(self.show_options, "", entered) elif len(entered) >= 3: # list filter args (id, ssid, bssid, channel, etc...) if entered[1] == "sniffed_aps": out = vars(AccessPoint()).keys() elif entered[1] == "sniffed_clients": out = vars(WiFiClient()).keys() elif entered[1] == "sniffed_probes": out = vars(ProbeInfo()).keys() elif entered[1] == "ap_targets": out = vars(AccessPoint()).keys() elif entered[1] == "client_targets": out = vars(WiFiClient()).keys() elif entered[1] == "connected_clients": out = vars(Client()).keys() elif entered[1] == "wpa_handshakes" or entered[ 1] == "half_wpa_handshakes": out = vars(WPAHandshake()).keys() elif entered[1] == "wep_data_logs": out = vars(WEPDataFile()).keys() elif entered[1] == "caffelatte_data_logs": out = vars(CaffeLatteDataFile()).keys() return out
def display_to_complete_show_options(self, line, text): entered = line.split() out = None if len(entered) < 4: out = self.complete_filter_command(self.show_options, text, entered) elif len(entered) >= 4: start = entered[-1] if entered[1] in self.show_options: if entered[1] == "sniffed_aps": out = [ keyword for keyword in vars(AccessPoint()).keys() if keyword.startswith(start) ] elif entered[1] == "sniffed_clients": out = [ keyword for keyword in vars(WiFiClient()).keys() if keyword.startswith(start) ] elif entered[1] == "sniffed_probes": out = [ keyword for keyword in vars(ProbeInfo()).keys() if keyword.startswith(start) ] elif entered[1] == "ap_targets": out = [ keyword for keyword in vars(AccessPoint()).keys() if keyword.startswith(start) ] elif entered[1] == "client_targets": out = [ keyword for keyword in vars(WiFiClient()).keys() if keyword.startswith(start) ] elif entered[1] == "connected_clients": out = [ keyword for keyword in vars(Client()).keys() if keyword.startswith(start) ] elif entered[1] == "wpa_handshakes" or entered[ 1] == "half_wpa_handshakes": out = [ keyword for keyword in vars(WPAHandshake()).keys() if keyword.startswith(start) ] elif entered[1] == "wep_data_logs": out = [ keyword for keyword in vars(WEPDataFile()).keys() if keyword.startswith(start) ] elif entered[1] == "wep_data_logs": out = [ keyword for keyword in vars(CaffeLatteDataFile()).keys() if keyword.startswith(start) ] return out
def show_to_complete_show_options(self, line, text): entered = line.split() out = None if len(entered) < 4: out = self.complete_filter_command(self.show_options, text, entered) elif len(entered) >= 4: start = entered[-1] if entered[1] in self.show_options: if entered[1] == "sniffed_aps": out = [keyword for keyword in vars(AccessPoint()).keys() if keyword.startswith(start)] elif entered[1] == "sniffed_clients": out = [keyword for keyword in vars(WiFiClient()).keys() if keyword.startswith(start)] elif entered[1] == "sniffed_probes": out = [keyword for keyword in vars(ProbeInfo()).keys() if keyword.startswith(start)] elif entered[1] == "deauth_aps": out = [keyword for keyword in vars(DeauthAP()).keys() if keyword.startswith(start)] elif entered[1] == "deauth_clients": out = [keyword for keyword in vars(DeauthClient()).keys() if keyword.startswith(start)] elif entered[1] == "connected_clients": out = [keyword for keyword in vars(Client()).keys() if keyword.startswith(start)] elif entered[1] == "wpa_handshakes" or entered[1] == "half_wpa_handshakes": out = [keyword for keyword in vars(WPAHandshake()).keys() if keyword.startswith(start)] return out
def show_empty_text_show_options(self, line): entered = line.split() out = None if len(entered) < 3: out = self.complete_filter_command(self.show_options, "", entered) elif len(entered) >= 3: # list filter args (id, ssid, bssid, channel, etc...) if entered[1] == "sniffed_aps": out = vars(AccessPoint()).keys() elif entered[1] == "sniffed_clients": out = vars(WiFiClient()).keys() elif entered[1] == "sniffed_probes": out = vars(ProbeInfo()).keys() elif entered[1] == "deauth_aps": out = vars(DeauthAP()).keys() elif entered[1] == "deauth_clients": out = vars(DeauthClient()).keys() elif entered[1] == "connected_clients": out = vars(Client()).keys() elif entered[1] == "wpa_handshakes" or entered[1] == "half_wpa_handshakes": out = vars(WPAHandshake()).keys() return out
def __init__(self, history=[]): # Super for "old style" class Cmd.__init__(self) # Load command history for cmd in history: readline.add_history(cmd.strip()) # Backend Tools self.configmanager = ConfigurationManager( "core/ConfigurationManager/etf.conf") self.configs = self.configmanager.config self.aircommunicator = AirCommunicator( self.configs["etf"]["aircommunicator"]) self.etfitm = EvilInTheMiddle(self.configs["etf"]["mitmproxy"]) self.spawnmanager = SpawnManager(self.configs["etf"]["spawner"]) # Static strings to help with autocompletion self.basic_commands = [ "start", "stop", "status", "spawn", "restore", "getconf", "setconf", "config", "back", "listargs", "copy", "add", "del", "display", "new_session", "save_session", "load_session" ] self.services = [ "airhost", "airscanner", "airinjector", "aircracker", "mitmproxy" ] self.aux_services = ["aplauncher", "dnsmasqhandler"] self.spawners = ["mitmf", "beef-xss", "ettercap", "sslstrip"] self.filter_keywords = ["where", "only"] self.plugin_keyword = ["with"] self.airhost_plugins = ["dnsspoofer", "credentialsniffer", "karma"] self.airscanner_plugins = [ "packetlogger", "selfishwifi", "credentialsniffer", "arpreplayer", "caffelatte" ] self.airinjector_plugins = [ "credentialsniffer", "deauthenticator", "arpreplayer", "caffelatte" ] self.aircracker_types = ["wpa_crackers", "half_wpa_crackers"] self.aircrackers = ["cowpatty", "aircrack-ng", "halwpaid"] self.mitmproxy_plugins = [ "downloadreplacer", "beefinjector", "peinjector" ] self.copy_options = ["ap", "probe"] self.add_del_options = ["aps", "clients", "probes"] # Meant to be followed by ID self.display_options = [ "sniffed_aps", "sniffed_probes", "sniffed_clients", "ap_targets", "client_targets", "connected_clients", "wpa_handshakes", "half_wpa_handshakes", "wep_data_logs", "caffelatte_data_logs", "sessions" ] # Meant to be followed by filter self.crack_options = [ "wpa_handshakes", "half_wpa_handshakes", "wep_data", "caffelatte_data" ] # Meant to be followed by ID self.display_options_vars = { "sniffed_aps": vars(AccessPoint()).keys(), "sniffed_probes": vars(ProbeInfo()).keys(), "sniffed_clients": vars(WiFiClient()).keys(), "ap_targets": vars(AccessPoint()).keys(), "client_targets": vars(WiFiClient()).keys(), "connected_clients": vars(Client()).keys(), "wpa_handshakes": vars(WPAHandshake()).keys(), "half_wpa_handshakes": vars(WPAHandshake()).keys(), "wep_data_logs": vars(WEPDataFile()).keys(), "caffelatte_data_logs": vars(CaffeLatteDataFile()).keys(), "sessions": vars(Session()).keys() } self.display_options_methods = { "sniffed_aps": self.aircommunicator.print_sniffed_aps, "sniffed_clients": self.aircommunicator.print_sniffed_clients, "sniffed_probes": self.aircommunicator.print_sniffed_probes, "ap_targets": self.aircommunicator.print_ap_injection_targets, "client_targets": self.aircommunicator.print_client_injection_targets, "connected_clients": self.aircommunicator.print_connected_clients, "wpa_handshakes": self.aircommunicator.print_captured_handshakes, "half_wpa_handshakes": self.aircommunicator.print_captured_half_handshakes, "wep_data_logs": self.aircommunicator.print_wep_data_logs, "caffelatte_data_logs": self.aircommunicator.print_caffelatte_data_logs, "sessions": SessionManager().print_sessions } self.plugin_options = { "airhost": self.airhost_plugins, "airscanner": self.airscanner_plugins, "airinjector": self.airinjector_plugins, "mitmproxy": self.mitmproxy_plugins, } self.addel_options = { "aps": vars(AccessPoint()).keys(), "clients": vars(WiFiClient()).keys(), "probes": vars(ProbeInfo()).keys() } # Configuration Handling self.current_config_mode = self.configs["etf"]["aircommunicator"] self.config_mode_string = "etf/aircommunicator/"