Esempio n. 1
0
    def check(self, value, initial_check=True):
        """
        """

        valid = True

        # check if it's malformed
        try:
            ntlm = value.split(':')[4]
            if len(ntlm) != 32:
                valid = false
        except:
            valid = False

        # check header
        if valid and not self.checktype()[0]:
            valid = False

        if not initial_check and valid and ntlm not in self.cracked_hashes:
            tmp = util.check_doozer(ntlm, self.type)
            if tmp:
                self.cracked(ntlm, tmp)
                valid = False

        if not initial_check and valid:
            # write out the entire line, because we need it
            util.msg("Appending hash %s" % value.upper())
            self.hashes.append(value.upper())
            self.clean_hash += 1

        if not initial_check:
            self.start_hash += 1

        return valid
Esempio n. 2
0
    def check(self, value, initial_check=True):
        """
        """

        valid = True

        # check if it's malformed
        try:
            ntlm = value.split(':')[4]
            if len(ntlm) != 48:
                valid = False
        except:
            valid = False        
            
        # check header
        if valid and not self.checktype()[0]:
            valid = False

        # check if we've already popped it
        if not initial_check and valid and ntlm not in self.cracked_hashes:
            tmp = util.check_doozer(ntlm, self.type)
            if tmp:
                self.cracked(ntlm, tmp)
                valid = False

        if not initial_check and valid:
            # write out the entire line, because we need it
            self.hashes.append(value.upper())
            self.clean_hash += 1

        if not initial_check:
            self.start_hash += 1

        return valid
Esempio n. 3
0
    def check(self, value, initial_check=True):
        """ Validate a hash value as a pwdump NT hash; if initial_check is
        not True, then we are preparing to crack hashes.  this will add them
        to an internal data structure.
        """

        bad_values = ["ASPNET", "IUSR_", "\\\\$"]
        valid = True

        if not initial_check:
            # check if it's a bad value
            for bad in bad_values:
                if bad in value:
                    valid = False

        # check if its malformed
        if valid:
            try:
                (_, nt) = value.split(":")[2:4]
                if len(nt) != 32:
                    valid = False
            except:
                valid = False

        # check if we've already popped it
        if valid and not initial_check and nt not in self.cracked_hashes:
            tmp = util.check_doozer(nt, self.type)
            if tmp:
                self.cracked(nt, tmp)
                valid = False

        # check header
        (match, ctype) = self.checktype()
        if valid and ((match is False) and (not ctype is None)):
            # special case for pwdump files; no type spec
            # means default to NT
            valid = False

        # if it's valid
        if not initial_check and valid:
            self.hashes.append(nt)
            self.clean_hash += 1

        if not initial_check:
            self.start_hash += 1

        return valid
Esempio n. 4
0
    def check(self, value, initial_check=True):
        """ Validate a hash value as a pwdump NT hash; if initial_check is
        not True, then we are preparing to crack hashes.  this will add them
        to an internal data structure.
        """

        bad_values = ["ASPNET", "IUSR_", "\\\\$"]
        valid = True

        if not initial_check:
            # check if it's a bad value
            for bad in bad_values:
                if bad in value:
                    valid = False

        # check if its malformed
        if valid:
            try:
                (_, nt) = value.split(':')[2:4]
                if len(nt) != 32:
                    valid = False
            except:
                valid = False

        # check if we've already popped it
        if valid and not initial_check and nt not in self.cracked_hashes:
            tmp = util.check_doozer(nt, self.type)
            if tmp:
                self.cracked(nt, tmp)
                valid = False

        # check header
        (match, ctype) = self.checktype()
        if valid and ((match is False) and (not ctype is None)):
            # special case for pwdump files; no type spec
            # means default to NT
            valid = False

        # if it's valid
        if not initial_check and valid:
            self.hashes.append(nt)
            self.clean_hash += 1

        if not initial_check:
            self.start_hash += 1

        return valid
Esempio n. 5
0
    def check(self, value, initial_check=True):
        """
        """

        bad_values = [
            "NO PASSWORD****", "aad3b435b51404eeaad3b435b51404ee",
            "00000000000000000000000000000000"
        ]
        valid = True

        if not initial_check:
            # check for bad values only when it's not a dry run check
            for bad in bad_values:
                if bad in value:
                    valid = False

        # check if it's malformed
        if valid:
            try:
                (lm, _) = value.split(':')[2:4]
                if len(lm) != 32:
                    valid = False
            except:
                valid = False

        # check if we've already popped it
        if valid and not initial_check:
            tmp = util.check_doozer(lm, self.type)
            if tmp:
                self.cracked(lm, tmp)
                valid = False

        # check header
        if valid and not self.checktype()[0]:
            valid = False

        # if it's valid
        if not initial_check and valid:
            self.hashes.append(lm)
            self.clean_hash += 1

        if not initial_check:
            self.start_hash += 1

        return valid
Esempio n. 6
0
    def check(self, value, initial_check=True):
        """
        """

        bad_values = ["NO PASSWORD****", "aad3b435b51404eeaad3b435b51404ee",
                      "00000000000000000000000000000000"
                     ]
        valid = True

        if not initial_check:
            # check for bad values only when it's not a dry run check
            for bad in bad_values:
                if bad in value:
                    valid = False

        # check if it's malformed
        if valid:
            try:
                (lm, _) = value.split(':')[2:4]
                if len(lm) != 32:
                    valid = False
            except:
                valid = False

        # check if we've already popped it
        if valid and not initial_check:
            tmp = util.check_doozer(lm, self.type)
            if tmp:
                self.cracked(lm, tmp)
                valid = False

        # check header
        if valid and not self.checktype()[0]:
            valid = False

        # if it's valid
        if not initial_check and valid:
            self.hashes.append(lm)
            self.clean_hash += 1

        if not initial_check:
            self.start_hash += 1

        return valid