Exemplo n.º 1
0
 def set_monitor_mode(self, mode="manager"):
     if not self.options.get("interface")[0] in Linux.get_interfaces().get("all"):
         print(display_messages("the interface not found!", error=True))
         sys.exit(1)
     os.system("ifconfig {} down".format(self.options.get("interface")[0]))
     os.system("iwconfig {} mode {}".format(self.options.get("interface")[0], mode))
     os.system("ifconfig {} up".format(self.options.get("interface")[0]))
Exemplo n.º 2
0
 def __init__(self, title="", message="", filename=None):
     self.message = message
     self.title = title
     # read file is exist in folder .conffig/exceptions
     self.filename = self.filename if filename == None else filename
     if self.filename:
         self.content = Linux.readFileExceptions(self.filename)
Exemplo n.º 3
0
 def get(self):
     proxy_plugins = self.root.proxy_controller.getInfo()
     connected_clints = Refactor.readFileDataToJson(C.CLIENTS_CONNECTED)
     list_clients_connted = []
     for item in connected_clints:
         connected_clints[item]["VENDOR"] = self.get_mac_vendor(
             connected_clints[item]["MAC"])
         list_clients_connted.append(connected_clints[item])
     return jsonify({"clients": list_clients_connted})
Exemplo n.º 4
0
    def getStationTrackFrame(self, pkt):
        if (
            pkt.haslayer(Dot11)
            and pkt.getlayer(Dot11).type == DOT11_REQUEST_SUBTYPE
            and not pkt.haslayer(EAPOL)
        ):

            sender = pkt.getlayer(Dot11).addr2
            receiver = pkt.getlayer(Dot11).addr1
            if sender in self.aps.keys():
                if Linux.check_is_mac(receiver):
                    if not receiver in self.whitelist:
                        self.aps[sender]["STA"] = {
                            "Frames": 1,
                            "BSSID": sender,
                            "Station": receiver,
                            "Probe": "",
                            "PWR": self.getRSSIPacketClients(pkt),
                        }
                    if "STA" in self.aps[sender]:
                        self.aps[sender]["STA"]["Frames"] += 1
                        self.aps[sender]["STA"]["PWR"] = self.getRSSIPacketClients(pkt)

            elif receiver in self.aps.keys():
                if Linux.check_is_mac(sender):
                    if not sender in self.whitelist:
                        self.aps[receiver]["STA"] = {
                            "Frames": 1,
                            "BSSID": receiver,
                            "Station": sender,
                            "Probe": "",
                            "PWR": self.getRSSIPacketClients(pkt),
                        }
                    if "STA" in self.aps[receiver]:
                        self.aps[receiver]["STA"]["Frames"] += 1
                        self.aps[receiver]["STA"]["PWR"] = self.getRSSIPacketClients(
                            pkt
                        )
Exemplo n.º 5
0
 def removeInactivityClient(self, client_mac):
     all_clients = Refactor.readFileDataToJson(C.CLIENTS_CONNECTED)
     if client_mac in all_clients.keys():
         del all_clients[client_mac]
     Refactor.writeFileDataToJson(C.CLIENTS_CONNECTED, all_clients)
Exemplo n.º 6
0
 def test_read_file_exception(self):
     self.result_content = "dhcp test massage"
     self.get_file_content = Linux.readFileExceptions("dhcp_test_message")
     self.assertEqual(self.result_content, self.get_file_content)
Exemplo n.º 7
0
 def show_help_command(self, filename):
     """read content file help command """
     print(Linux.readFileHelp(filename))