Merge pull request #138 from ThePirateWhoSmellsOfSunflowers/fix_challenge

fix custom challenge in python3
This commit is contained in:
lgandx 2020-12-30 16:54:20 -03:00 committed by GitHub
commit 7842e51f12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -210,12 +210,16 @@ class Settings:
print(utils.color("[!] The challenge must be exactly 16 chars long.\nExample: 1122334455667788", 1))
sys.exit(-1)
self.Challenge = ""
self.Challenge = b''
if self.NumChal.lower() == 'random':
pass
else:
for i in range(0, len(self.NumChal),2):
self.Challenge += self.NumChal[i:i+2].decode("hex")
else:
if self.PY2OR3 == 'PY2':
for i in range(0, len(self.NumChal),2):
self.Challenge += self.NumChal[i:i+2].decode("hex")
else:
self.Challenge = bytes.fromhex(self.NumChal)
# Set up logging
logging.basicConfig(filename=self.SessionLogFile, level=logging.INFO, format='%(asctime)s - %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')