Beispiel #1
0
    def _add_client(self, probe):
        if probe.ap_ssid == "" and probe.type != "ASSO":
            return

        with self.client_lock:
            client_id = len(self.get_wifi_clients())
            wifiClient = WiFiClient(client_id, probeInfo=probe)
            try:
                if wifiClient not in self.get_wifi_clients():
                    self.clients[probe.client_mac] = wifiClient
                    self._log_client(probe)
                    SessionManager().update_session_data(
                        "sniffed_clients", self.clients)
                else:
                    wifiClient = self.clients[probe.client_mac]
                    wifiClient.probed_ssids.add(probe.ap_ssid)

                    if probe.type == "ASSO":
                        try:
                            wifiClient.associated_ssid = probe.ap_ssid
                            wifiClient.associated_bssid = probe.ap_bssids[0]
                        except:
                            pass
                    elif probe.type == "REQ":
                        wifiClient.rssi = probe.rssi

                    SessionManager().update_session_data(
                        "sniffed_clients", self.clients)
            except Exception as e:
                print "Error in airscanner._add_client"
                print e
    def _add_client(self, probe):
        if probe.ap_ssid == "" and probe.type != "ASSO":
            return

        with self.client_lock:
            client_id = len(self.get_wifi_clients())
            wifiClient = WiFiClient(client_id, probeInfo = probe)
            try:
                if wifiClient not in self.get_wifi_clients():
                    self.clients[probe.client_mac] = wifiClient
                    self._log_client(probe)
                    SessionManager().update_session_data("sniffed_clients", self.clients)
                else:
                    wifiClient = self.clients[probe.client_mac]
                    wifiClient.probed_ssids.add(probe.ap_ssid)

                    if probe.type == "ASSO":
                        try:
                            wifiClient.associated_ssid = probe.ap_ssid
                            wifiClient.associated_bssid = probe.ap_bssids[0]
                        except: pass
                    elif probe.type == "REQ":
                        wifiClient.rssi = probe.rssi

                    SessionManager().update_session_data("sniffed_clients", self.clients)
            except Exception as e:
                print "Error in airscanner._add_client"
                print e
    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_addel_options(self, line, text):
        entered = line.split()
        out = None
        if len(entered) <= 3:
            out = self.complete_filter_command(self.add_del_options, text,
                                               entered)
        elif len(entered) > 3:
            start = entered[-1]
            addel = entered[0]
            if addel == "add":
                if entered[1] == "aps":
                    out = [
                        keyword for keyword in vars(AccessPoint()).keys()
                        if keyword.startswith(start)
                    ]
                elif entered[1] == "probes":
                    out = [
                        keyword for keyword in vars(ProbeInfo()).keys()
                        if keyword.startswith(start)
                    ]
            elif addel == "del":
                if entered[1] == "aps":
                    out = [
                        keyword for keyword in vars(AccessPoint()).keys()
                        if keyword.startswith(start)
                    ]
                elif entered[1] == "clients":
                    out = [
                        keyword for keyword in vars(WiFiClient()).keys()
                        if keyword.startswith(start)
                    ]

        return out
 def add_client(self, client_mac, associated_bssid, associated_ssid):
     deauth_client = WiFiClient(len(self._client_targets), client_mac,
                                associated_bssid, associated_ssid)
     self._client_targets.add(
         deauth_client)  # Don't verify duplicates because it's a set
     SessionManager().update_session_data("client_targets",
                                          self._client_targets)
    def show_empty_text_addel_options(self, line):
        entered = line.split()
        out = None
        if len(entered) < 3:
            out = self.complete_filter_command(self.add_del_options, "",
                                               entered)
        elif len(entered) >= 3:
            # list filter args (id, ssid, bssid, channel, etc...)
            addel = entered[0]
            if addel == "add":
                if entered[1] == "aps":
                    out = vars(AccessPoint()).keys()
                elif entered[1] == "probes":
                    out = vars(ProbeInfo()).keys()
            elif addel == "del":
                if entered[1] == "aps":
                    out = vars(AccessPoint()).keys()
                elif entered[1] == "clients":
                    out = vars(WiFiClient()).keys()

        return out
Beispiel #8
0
 def add_client(self, client_mac, associated_bssid, associated_ssid):
     deauth_client = WiFiClient(len(self._client_targets), client_mac,
                                associated_bssid, associated_ssid)
     self._client_targets.add(
         deauth_client)  # Don't verify duplicates because it's a set
Beispiel #9
0
    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/"