Skip to content

Commit

Permalink
selfextracted passwd
Browse files Browse the repository at this point in the history
  • Loading branch information
doomedraven committed Dec 18, 2024
1 parent d060595 commit bb7756a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/cuckoo/common/integrations/file_extra_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ def generic_file_extractors(
data_dictionary["selfextract"][new_tool_name] = {
"extracted_files": metadata,
"extracted_files_time": func_result["took_seconds"],
"password": extraction_result.get("password", "")
}
finally:
if tempdir:
Expand Down Expand Up @@ -712,7 +713,7 @@ def Inno_extract(file: str, *, data_dictionary: dict, **_) -> ExtractorReturnTyp
universal_newlines=True,
stderr=subprocess.PIPE,
)
if "Warning: Setup contains encrypted files, use the --password option to extract them" in output:
if "Warning: Setup contains encrypted files, use the --password option to extract them" in output or "- encrypted" in output:
output = run_tool(
[innoextact_binary, "--crack", file],
universal_newlines=True,
Expand All @@ -726,6 +727,7 @@ def Inno_extract(file: str, *, data_dictionary: dict, **_) -> ExtractorReturnTyp
universal_newlines=True,
stderr=subprocess.PIPE,
)
ctx["password"] = password
ctx["extracted_files"] = collect_extracted_filenames(tempdir)

return ctx
Expand Down
6 changes: 6 additions & 0 deletions web/templates/analysis/generic/_file_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,12 @@
<th></th><td>
<div class="collapse" id="selfextract_{{name}}">
<div>
{% if details.password %}
<tr>
<th style="border-top: 0; width: 15%;">Archive password:</th>
<td style="border-top: 0; word-wrap: break-word;"><b>{{details.password}}</b></td>
</tr>
{% endif %}
{% for sub_file in details.extracted_files %}
{% include "analysis/generic/_subfile_info.html" %}
{% endfor %}
Expand Down

0 comments on commit bb7756a

Please sign in to comment.