Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion data/yara/CAPE/Rhadamanthys.yar
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ rule Rhadamanthys
$anti = {50 68 [4] 68 [4] E8 [4] 83 C4 0C A3 [4] 85 C0 74}
$dnr = {99 52 50 8D 45 ?? 99 52 50 8B C7 99 52 50 8B C3 99 52 50}
$sys = {83 E4 F0 6A 33 E8 00 00 00 00 83 04 24 05 CB}
$cape_string = "cape_options"
condition:
2 of them
2 of them and not $cape_string
}

rule RhadamanthysLoader
Expand Down
5 changes: 2 additions & 3 deletions modules/reporting/gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def _iter_files_to_upload(self, source_directory, exclude_dirs, exclude_files):
continue

local_path = os.path.join(root, filename)
if not os.path.exists(local_path):
continue
relative_path = os.path.relpath(local_path, source_directory)
yield local_path, relative_path

Expand All @@ -130,15 +132,13 @@ def upload_zip_archive(self, bucket, analysis_id, source_directory, exclude_dirs
zip_name = "%s_tlp_%s.zip" % analysis_id, tlp
else:
zip_name = "%s.zip" % analysis_id

blob_name = zip_name

with tempfile.NamedTemporaryFile(delete=False, suffix=".zip") as tmp_zip_file:
tmp_zip_file_name = tmp_zip_file.name
with zipfile.ZipFile(tmp_zip_file, "w", zipfile.ZIP_DEFLATED) as archive:
for local_path, relative_path in self._iter_files_to_upload(source_directory, exclude_dirs, exclude_files):
archive.write(local_path, relative_path)

try:
log.debug("Uploading '%s' to '%s'", tmp_zip_file_name, blob_name)
blob = bucket.blob(blob_name)
Expand All @@ -153,7 +153,6 @@ def upload_files_individually(self, bucket, analysis_id, source_directory, exclu
folder_name = analysis_id
if tlp:
folder_name = "%s_tlp_%s" % analysis_id, tlp

for local_path, relative_path in self._iter_files_to_upload(source_directory, exclude_dirs, exclude_files):
blob_name = f"{folder_name}/{relative_path}"
log.debug("Uploading '%s' to '%s'", local_path, blob_name)
Expand Down
Loading