Exemple #1
0
    def downloadUpdates(self, items):
        """
        Download all new items
        :param items: items that we want download
        :return: None
        """
        base = join(dirname(__file__.split('rexploit')[0]), "rexploit")
        if len(items) > 0:
            for item in items:
                try:
                    item = item['path']
                except TypeError:
                    item = item[0]

                url = '{0}/{1}'.format(self.__URL, item)
                path = base + "/" + "rexploit" + "/" + item

                try:
                    Network.downloadFile(path, url)
                except KeyError:
                    return None
                except IOError:
                    # If we found a new folder we will create a package
                    path = "/".join(path.split("/")[:-1])
                    # Create a folder with a __init__.py file. It is a python package
                    if not exists(path):
                        makedirs(path)
                    # Create a package with a __init__.py file
                    open(join(path, "__init__.py"), 'w')

                    Network.downloadFile(join(path, item), url)
Exemple #2
0
 def fetchone(self, IP):
     self.connect()
     if Network.ping(IP):
         mac, oui = Network.arp(IP)
         return mac, self.query(oui)
     else:
         return None, None
Exemple #3
0
 def fetchone(self, IP):
     self.connect()
     if Network.ping(IP):
         mac, oui = Network.arp(IP)
         return mac, self.query(oui)
     else:
         return None, None
    def downloadUpdates(self, items):
        """
        Download all new items
        :param items: items that we want download
        :return: None
        """
        base = join(dirname(__file__.split('rexploit')[0]), "rexploit")
        if len(items) > 0:
            for item in items:
                try:
                    item = item['path']
                except TypeError:
                    item = item[0]

                url = '{0}/{1}'.format(self.__URL, item)
                path = base + "/" + "rexploit" + "/" + item

                try:
                    Network.downloadFile(path, url)
                except KeyError:
                    return None
                except IOError:
                    # If we found a new folder we will create a package
                    path = "/".join(path.split("/")[:-1])
                    # Create a folder with a __init__.py file. It is a python package
                    if not exists(path):
                        makedirs(path)
                    # Create a package with a __init__.py file
                    open(join(path, "__init__.py"), 'w')

                    Network.downloadFile(join(path, item), url)
Exemple #5
0
    def isIP(self):
        """
        Check if lineEdit IP is well formed
        :return: True if IP is well formed and it is reachable, False otherwise
        """

        IP = self.lineEditIP.text()
        if IP:
            # Verify if the IP "matches" the regular expression
            state = self.__validator.validate(IP, 0)[0]
            if state == QValidator.Acceptable:
                if Network.ping(IP):
                    return True
                else:
                    MessageBox.critical("Error",
                                        "Destination Host Unreachable.")
                    return False
            else:
                MessageBox.critical("Error",
                                    "You have to add a valid IP (0.0.0.0).")
                return False
        else:
            MessageBox.information("Information",
                                   "You have not add a IP on this project.")
            return True
Exemple #6
0
 def check(self):
     if Network.ping(self.exploit.ip):
         if not self.isPort() or not str(
                 self.lineEditUsers.text()) or not str(
                     self.lineEditPasswords.text()) or not str(
                         self.lineEditMaximum.text()):
             MessageBox.critical("Error",
                                 "You have to complete the information")
             return False
         else:
             users = str(self.lineEditUsers.text())
             lusers = str(self.lineEditLengthsUsers.text())
             passwords = str(self.lineEditPasswords.text())
             lpasswords = str(self.lineEditLengthsPasswords.text())
             maximum = str(self.lineEditMaximum.text())
             if not self.__generatorUsers.check(
                     users, lusers,
                     maximum) or not self.__generatorPasswords.check(
                         passwords, lpasswords, maximum):
                 MessageBox.critical("Error", "Each range need a length")
                 return False
             else:
                 return True
     else:
         MessageBox.critical("Error", "Destination Host Unreachable")
         return False
 def check(self):
     if Network.ping(self.exploit.ip):
         if not str(self.lineEditPath.text()).startswith("/"):
             MessageBox.critical("Error", "An absolute path is required.")
             return False
         else:
             return True
     else:
         MessageBox.critical("Error", "Destination Host Unreachable")
         return False
 def check(self):
     if Network.ping(self.exploit.ip):
         if str(self.lineEditData.text()):
             return True
         else:
             MessageBox.critical("Error", "You have to complete the data box")
             return False
     else:
         MessageBox.critical("Error", "Destination Host Unreachable")
         return False
 def check(self):
     if Network.ping(self.exploit.ip):
         if not str(self.lineEditPath.text()).startswith("/"):
             MessageBox.critical("Error", "An absolute path is required.")
             return False
         else:
             return True
     else:
         MessageBox.critical("Error", "Destination Host Unreachable")
         return False
Exemple #10
0
 def check(self):
     if Network.ping(self.exploit.ip):
         if str(self.lineEditData.text()):
             return True
         else:
             MessageBox.critical("Error", "You must write a command")
             return False
     else:
         MessageBox.critical("Error", "Destination Host Unreachable")
         return False
 def check(self):
     if Network.ping(self.exploit.ip):
         if str(self.lineEditData.text()):
             return True
         else:
             MessageBox.critical("Error",
                                 "You have to complete the data box")
             return False
     else:
         MessageBox.critical("Error", "Destination Host Unreachable")
         return False
Exemple #12
0
 def pushButtonPingClicked(self):
     if Network.ping(str(self.lineEditIP.text())):
         buttons = self.buttonBox.buttons()
         buttons[0].setEnabled(True)
         mac, oui, company = self.__settingsController.getInformation(str(self.lineEditIP.text()))
         self.labelMAC.setText(mac)
         self.labelOUI.setText(oui)
         self.labelCompany.setText(company)
     else:
         buttons = self.buttonBox.buttons()
         buttons[0].setEnabled(False)
         MessageBox.critical("Error", "Destination Host Unreachable")
Exemple #13
0
 def pushButtonPingClicked(self):
     if Network.ping(str(self.lineEditIP.text())):
         buttons = self.buttonBox.buttons()
         buttons[0].setEnabled(True)
         mac, oui, company = self.__settingsController.getInformation(
             str(self.lineEditIP.text()))
         self.labelMAC.setText(mac)
         self.labelOUI.setText(oui)
         self.labelCompany.setText(company)
     else:
         buttons = self.buttonBox.buttons()
         buttons[0].setEnabled(False)
         MessageBox.critical("Error", "Destination Host Unreachable")
Exemple #14
0
 def check(self):
     if Network.ping(self.exploit.ip):
         if not self.isPort() or not str(self.lineEditUsers.text()) or not str(self.lineEditPasswords.text()) or not str(self.lineEditMaximum.text()):
             MessageBox.critical("Error", "You have to complete the information")
             return False
         else:
             users = str(self.lineEditUsers.text())
             lusers = str(self.lineEditLengthsUsers.text())
             passwords = str(self.lineEditPasswords.text())
             lpasswords = str(self.lineEditLengthsPasswords.text())
             maximum = str(self.lineEditMaximum.text())
             if not self.__generatorUsers.check(users, lusers, maximum) or not self.__generatorPasswords.check(passwords, lpasswords, maximum):
                 MessageBox.critical("Error", "Each range need a length")
                 return False
             else:
                 return True
     else:
         MessageBox.critical("Error", "Destination Host Unreachable")
         return False
Exemple #15
0
    def getJSONFiles(self):
        """
        Get a JSON files need for compare them.
        :return: local a update.json file remote is a server.json
        """
        self.createJSONLocal()
        base = expanduser("~")
        path = join(base, self.__updateFile)
        with open(path) as dataFile:
            local = load(dataFile)

        # Download file from server
        path = join(expanduser("~"), self.__serverFile)
        url = '{0}/{1}'.format(self.__URL, self.__serverFile)
        if Network.downloadFile(path, url):
            with open(path) as dataFile:
                remote = load(dataFile)

            return local, remote
        else:
            return None, None
Exemple #16
0
    def getJSONFiles(self):
        """
        Get a JSON files need for compare them.
        :return: local a update.json file remote is a server.json
        """
        self.createJSONLocal()
        base = expanduser("~")
        path = join(base, self.__updateFile)
        with open(path) as dataFile:
            local = load(dataFile)

        # Download file from server
        path = join(expanduser("~"), self.__serverFile)
        url = '{0}/{1}'.format(self.__URL, self.__serverFile)
        if Network.downloadFile(path, url):
            with open(path) as dataFile:
                remote = load(dataFile)

            return local, remote
        else:
            return None, None
Exemple #17
0
    def isIP(self):
        """
        Check if lineEdit IP is well formed
        :return: True if IP is well formed and it is reachable, False otherwise
        """

        IP = self.lineEditIP.text()
        if IP:
            # Verify if the IP "matches" the regular expression
            state = self.__validator.validate(IP, 0)[0]
            if state == QValidator.Acceptable:
                if Network.ping(IP):
                    return True
                else:
                    MessageBox.critical("Error", "Destination Host Unreachable.")
                    return False
            else:
                MessageBox.critical("Error", "You have to add a valid IP (0.0.0.0).")
                return False
        else:
            MessageBox.information("Information", "You have not add a IP on this project.")
            return True
 def check(self):
     if Network.ping(self.exploit.ip):
         return True
     else:
         MessageBox.critical("Error", "Destination Host Unreachable")
         return False
 def check(self):
     if Network.ping(self.exploit.ip):
         return True
     else:
         MessageBox.critical("Error", "Destination Host Unreachable")
         return False