Skip to content

Commit

Permalink
Sort Box-js IOCs; Bugfix in registry key output; update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-kevin committed Jan 18, 2024
1 parent 2cc6092 commit 670912f
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 60 deletions.
37 changes: 22 additions & 15 deletions jsjaws.py
Original file line number Diff line number Diff line change
Expand Up @@ -3667,78 +3667,85 @@ def _extract_boxjs_iocs(self, result: Result) -> None:
file_writes_result_section = ResultTextSection(
"The script wrote the following files", parent=ioc_result_section
)
file_writes_result_section.add_lines(list(file_writes))
sorted_file_writes = sorted(file_writes)
file_writes_result_section.add_lines(sorted_file_writes)
[
file_writes_result_section.add_tag("dynamic.process.file_name", file_write)
for file_write in list(file_writes)
for file_write in sorted_file_writes
]

if file_reads:
file_reads_result_section = ResultTextSection(
"The script read the following files", parent=ioc_result_section
)
file_reads_result_section.add_lines(list(file_reads))
sorted_file_reads = sorted(file_reads)
file_reads_result_section.add_lines(sorted_file_reads)
[
file_reads_result_section.add_tag("dynamic.process.file_name", file_read)
for file_read in list(file_reads)
for file_read in sorted_file_reads
]

if file_folder_exists:
file_folder_exists_result_section = ResultTextSection(
"The script checked if the following files/folders existed", parent=ioc_result_section
)
file_folder_exists_result_section.add_lines(list(file_folder_exists))
sorted_file_folder_exists = sorted(file_folder_exists)
file_folder_exists_result_section.add_lines(sorted_file_folder_exists)
[
file_folder_exists_result_section.add_tag("dynamic.process.file_name", file_folder_exist)
for file_folder_exist in list(file_folder_exists)
for file_folder_exist in sorted_file_folder_exists
]

if remote_scripts:
remote_scripts_result_section = ResultTextSection(
"The script contains the following remote scripts", parent=ioc_result_section
)
remote_scripts_result_section.add_lines(list(remote_scripts))
sorted_remote_scripts = sorted(remote_scripts)
remote_scripts_result_section.add_lines(sorted_remote_scripts)
[
add_tag(remote_scripts_result_section, "network.dynamic.uri", remote_script)
for remote_script in list(remote_scripts)
for remote_script in sorted_remote_scripts
]

if windows_installers:
windows_installers_result_section = ResultTextSection(
"The script contains the following Windows Installers", parent=ioc_result_section
)
windows_installers_result_section.add_lines(list(windows_installers))
sorted_windows_installers = sorted(windows_installers)
windows_installers_result_section.add_lines(sorted_windows_installers)
[
add_tag(windows_installers_result_section, "network.dynamic.uri", windows_installer)
for windows_installer in list(windows_installers)
for windows_installer in sorted_windows_installers
]

if regkey_reads:
regkey_reads_result_section = ResultTextSection(
"The script read the following registry keys", parent=ioc_result_section
)
regkey_reads_result_section.add_lines(list(windows_installers))
sorted_regkey_reads = sorted(regkey_reads)
regkey_reads_result_section.add_lines(sorted_regkey_reads)
[
regkey_reads_result_section.add_tag("dynamic.registry_key", regkey_read)
for regkey_read in list(regkey_reads)
for regkey_read in sorted_regkey_reads
]

if regkey_writes:
regkey_writes_result_section = ResultTextSection(
"The script wrote the following registry keys", parent=ioc_result_section
)
regkey_writes_result_section.add_lines(list(windows_installers))
sorted_regkey_writes = sorted(regkey_writes)
regkey_writes_result_section.add_lines(sorted_regkey_writes)
[
regkey_writes_result_section.add_tag("dynamic.registry_key", regkey_write)
for regkey_write in list(regkey_writes)
for regkey_write in sorted_regkey_writes
]

if new_resources_associated_with_url:
new_resources_associated_with_url_result_section = ResultMultiSection(
"The script created the following resources associated with a URL", parent=ioc_result_section
)

for new_resource in list(new_resources_associated_with_url):
for new_resource in sorted(new_resources_associated_with_url):
nr = loads(new_resource)
new_resources_associated_with_url_result_section.add_tag("dynamic.process.file_name", nr["path"])
add_tag(new_resources_associated_with_url_result_section, "network.dynamic.uri", nr["url"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,36 +279,6 @@
"title_text": "The script wrote the following files",
"zeroize_on_tag_safe": false
},
{
"auto_collapse": false,
"body": [
[
"KEY_VALUE",
{
"description": "The script created a resource.",
"type": "NewResource",
"value": {
"latestUrl": "",
"md5": "c7f02b93dd5d6fd8bb467b870e958b70",
"path": "URL_Blob_file_0",
"sha1": "65fdb009507f70cce46f07c7dc22d180117c6a5a",
"sha256": "dc7a6e43134675e424d383d96caa04a04e20e1501fbaefb97cfb8580602eeccc",
"type": "Zip archive data, at least v1.0 to extract, compression method=store"
}
},
{}
]
],
"body_config": {},
"body_format": "MULTI",
"classification": "TLP:C",
"depth": 1,
"heuristic": null,
"promote_to": null,
"tags": {},
"title_text": "The script did the following other interesting things",
"zeroize_on_tag_safe": false
},
{
"auto_collapse": false,
"body": "\t\tObfuscated code was found that was obfuscated by: obfuscator.io",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
},
{
"auto_collapse": false,
"body": null,
"body": "HKCU\\SOFTWARE\\Andysoftware\\pdf2html\\register",
"body_config": {},
"body_format": "TEXT",
"classification": "TLP:C",
Expand All @@ -361,7 +361,7 @@
},
{
"auto_collapse": false,
"body": null,
"body": "HKCU\\SOFTWARE\\Andysoftware\\pdf2html\\register",
"body_config": {},
"body_format": "TEXT",
"classification": "TLP:C",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
},
{
"auto_collapse": false,
"body": "https://tapasyaevents.com/fmu/fmu.php?55724\nhttps://iscast.com.br/udit/udit.php?68977\nhttps://dealsontrainers.org/tete/tete.php?85434",
"body": "https://dealsontrainers.org/tete/tete.php?85434\nhttps://iscast.com.br/udit/udit.php?68977\nhttps://tapasyaevents.com/fmu/fmu.php?55724",
"body_config": {},
"body_format": "TEXT",
"classification": "TLP:C",
Expand All @@ -188,19 +188,19 @@
"network": {
"dynamic": {
"domain": [
"tapasyaevents.com",
"dealsontrainers.org",
"iscast.com.br",
"dealsontrainers.org"
"tapasyaevents.com"
],
"uri": [
"https://tapasyaevents.com/fmu/fmu.php?55724",
"https://dealsontrainers.org/tete/tete.php?85434",
"https://iscast.com.br/udit/udit.php?68977",
"https://dealsontrainers.org/tete/tete.php?85434"
"https://tapasyaevents.com/fmu/fmu.php?55724"
],
"uri_path": [
"/fmu/fmu.php?55724",
"/tete/tete.php?85434",
"/udit/udit.php?68977",
"/tete/tete.php?85434"
"/fmu/fmu.php?55724"
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
},
{
"auto_collapse": false,
"body": null,
"body": "HKCU\\SOFTWARE\\Xeonitox\\MP3Conv\\Cfg",
"body_config": {},
"body_format": "TEXT",
"classification": "TLP:C",
Expand All @@ -361,7 +361,7 @@
},
{
"auto_collapse": false,
"body": null,
"body": "HKCU\\SOFTWARE\\Xeonitox\\MP3Conv\\Cfg",
"body_config": {},
"body_format": "TEXT",
"classification": "TLP:C",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
},
{
"auto_collapse": false,
"body": null,
"body": "HKCU\\SOFTWARE\\Firm\\Soft\\Name",
"body_config": {},
"body_format": "TEXT",
"classification": "TLP:C",
Expand All @@ -361,7 +361,7 @@
},
{
"auto_collapse": false,
"body": null,
"body": "HKCU\\SOFTWARE\\Firm\\Soft\\Name",
"body_config": {},
"body_format": "TEXT",
"classification": "TLP:C",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
},
{
"auto_collapse": false,
"body": null,
"body": "HKCU\\SOFTWARE\\cqptlz\\ug9o\\b8kvyy",
"body_config": {},
"body_format": "TEXT",
"classification": "TLP:C",
Expand All @@ -361,7 +361,7 @@
},
{
"auto_collapse": false,
"body": null,
"body": "HKCU\\SOFTWARE\\cqptlz\\ug9o\\b8kvyy",
"body_config": {},
"body_format": "TEXT",
"classification": "TLP:C",
Expand Down

0 comments on commit 670912f

Please sign in to comment.