Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
739 B
1
Indexable
Never
class Archive:
	def __init__(self, path, description):
		self.path = path
		self.description = description
		self.password = None

	def getinfo(self):
		print("Path: " + self.path + "\nDesc: " + self.description + "\nPassword: " + str(self.password))


class Bruteforce:
	def __init__(self, dictionary):
		self.dictionary = dictionary

	def hack(self, archive):
		zip_file = zipfile.ZipFile(archive)
		password = None
		f = open(self.dictionary, 'r')
		for line in f.readlines():
			password = line.strip('\n')
			try:
				zip_file.extractall(pwd=password.encode())
				print("-------------------")
				print("RESULT: " + password)
				f.close()
				return (True, password)
			except:
				print(password)
		f.close()
		return (False, None)