Skip to content

Commit

Permalink
ScanZip - Cleanup
Browse files Browse the repository at this point in the history
ryanohoro committed Jan 27, 2024
1 parent 3cb1408 commit 28a5aac
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/python/strelka/scanners/scan_zip.py
Original file line number Diff line number Diff line change
@@ -97,19 +97,18 @@ def scan(self, data, file, options, expire_at):
self.flags.append("encrypted")

for password in passwords:
print("Trying ", password)
try:
if extract:
print(
compressed_file.filename,
compressed_file.compress_type,
password,
)
extract_data = zip_obj.read(
compressed_file.filename, password
)
if extract_data:
print(extract_data[:25])
passwords.insert(
0,
passwords.pop(
passwords.index(password)
),
)
if password and crack_pws and log_pws:
if "password" not in self.event.keys():
self.event["password"] = []
@@ -120,10 +119,8 @@ def scan(self, data, file, options, expire_at):
password.decode("utf-8")
)
break
else:
print("no data")
except RuntimeError as e:
print("Error:", e)
except RuntimeError:
pass

# If there's data in it, and no limits have been met, emit the file
if extract_data and extract:

0 comments on commit 28a5aac

Please sign in to comment.