sandbox-cli 0.2.44__tar.gz → 0.2.46__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/PKG-INFO +1 -1
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/pyproject.toml +1 -1
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/cli/scanner/__init__.py +18 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/scanner/advanced.py +36 -20
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/scanner/rescan.py +4 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/.gitignore +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/LICENSE +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/NOTICE +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/README.md +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/__main__.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/cli/__init__.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/cli/downloader.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/cli/images.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/cli/reporter.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/cli/rules/__init__.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/cli/unpack.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/console.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/internal/__init__.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/internal/config.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/internal/helpers.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/models/__init__.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/models/detections.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/models/sandbox_arguments.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/__init__.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/compiler/__init__.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/compiler/abc.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/compiler/docker.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/compiler/ssh.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/downloader/__init__.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/extractors.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/merge_dll_hooks.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/scanner/__init__.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/unpack/__init__.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/unpack/plugins/__init__.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/unpack/plugins/abc.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/unpack/plugins/correlation.py +0 -0
- {sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/unpack/plugins/sort_by_plugins.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sandbox-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.46
|
|
4
4
|
Summary: Command line tool for interaction with sandboxes
|
|
5
5
|
Project-URL: Homepage, https://github.com/Security-Experts-Community/sandbox-cli
|
|
6
6
|
Project-URL: Documentation, https://security-experts-community.github.io/sandbox-cli
|
|
@@ -514,6 +514,14 @@ async def scan_new(
|
|
|
514
514
|
group="Sandbox Options",
|
|
515
515
|
),
|
|
516
516
|
] = None,
|
|
517
|
+
fileextractor_excludes: Annotated[
|
|
518
|
+
Path | None,
|
|
519
|
+
Parameter(
|
|
520
|
+
name=["--fileextractor-excludes", "-fe"],
|
|
521
|
+
help="Path to file with fileextractor excludes",
|
|
522
|
+
group="Sandbox Options",
|
|
523
|
+
),
|
|
524
|
+
] = None,
|
|
517
525
|
custom_command: Annotated[
|
|
518
526
|
str | None,
|
|
519
527
|
Parameter(
|
|
@@ -699,6 +707,14 @@ async def scan_new(
|
|
|
699
707
|
negative="",
|
|
700
708
|
),
|
|
701
709
|
] = False,
|
|
710
|
+
preserve_filename: Annotated[
|
|
711
|
+
bool,
|
|
712
|
+
Parameter(
|
|
713
|
+
name=["--preserve-filename", "-pf"],
|
|
714
|
+
help="Do not change filename for analysis. \nWhen set to false (default behaviour): local/path/to/malware.exe[_~] -> sandbox/guest/os/malware.exe \nWhen set to true name will remain unchanged.",
|
|
715
|
+
negative="",
|
|
716
|
+
),
|
|
717
|
+
] = False,
|
|
702
718
|
) -> None:
|
|
703
719
|
"""
|
|
704
720
|
Send files to scan with the sandbox (advanced scan).
|
|
@@ -749,6 +765,7 @@ async def scan_new(
|
|
|
749
765
|
unimon_hooks=unimon_hooks,
|
|
750
766
|
custom_command=custom_command,
|
|
751
767
|
dll_hooks_dir=dll_hooks_dir,
|
|
768
|
+
fileextractor_excludes=fileextractor_excludes,
|
|
752
769
|
fake_name=fake_name,
|
|
753
770
|
unpack=unpack,
|
|
754
771
|
priority=priority,
|
|
@@ -771,5 +788,6 @@ async def scan_new(
|
|
|
771
788
|
procdumps=procdumps,
|
|
772
789
|
decompress=decompress,
|
|
773
790
|
open_browser=open_browser,
|
|
791
|
+
preserve_filename=preserve_filename,
|
|
774
792
|
outbound_connections=outbound_connections,
|
|
775
793
|
)
|
|
@@ -39,6 +39,7 @@ from sandbox_cli.utils.merge_dll_hooks import merge_dll_hooks
|
|
|
39
39
|
from sandbox_cli.utils.unpack import Unpack
|
|
40
40
|
|
|
41
41
|
DELIMETER = "\n"
|
|
42
|
+
SAFE_SUFFIXES = "_~"
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
async def _get_compiled_rules(progress: Progress, rules_dir: Path | None, is_local: bool) -> bytes | None:
|
|
@@ -93,6 +94,7 @@ async def _prepare_sandbox_new_scan(
|
|
|
93
94
|
syscall_hooks: Path | None,
|
|
94
95
|
unimon_hooks: Path | None,
|
|
95
96
|
dll_hooks_dir: Path | None,
|
|
97
|
+
filextractor_excludes: Path | None,
|
|
96
98
|
custom_command: str | None,
|
|
97
99
|
no_procdumps_on_finish: bool,
|
|
98
100
|
disable_lightweight_dumps: bool,
|
|
@@ -187,6 +189,13 @@ async def _prepare_sandbox_new_scan(
|
|
|
187
189
|
dll_hooks_uri = (await sandbox.api.upload_file(data)).data.file_uri
|
|
188
190
|
sandbox_options.debug_options["custom_dll_hooks"] = dll_hooks_uri
|
|
189
191
|
|
|
192
|
+
if filextractor_excludes:
|
|
193
|
+
progress.console.print(f"{console.INFO} Upload fileextractor excludes: {filextractor_excludes}")
|
|
194
|
+
async with aiofiles.open(filextractor_excludes, mode="rb") as fd:
|
|
195
|
+
data = await fd.read()
|
|
196
|
+
fileextractor_excludes_uri = (await sandbox.api.upload_file(data)).data.file_uri
|
|
197
|
+
sandbox_options.debug_options["custom_fileextractor_exclude"] = fileextractor_excludes_uri
|
|
198
|
+
|
|
190
199
|
if custom_command:
|
|
191
200
|
progress.console.print(f"{console.INFO} Commandline: {custom_command}")
|
|
192
201
|
sandbox_options.custom_command = custom_command
|
|
@@ -218,6 +227,7 @@ async def scan_internal_advanced(
|
|
|
218
227
|
syscall_hooks: Path | None,
|
|
219
228
|
unimon_hooks: Path | None,
|
|
220
229
|
dll_hooks_dir: Path | None,
|
|
230
|
+
fileextractor_excludes: Path | None,
|
|
221
231
|
custom_command: str | None,
|
|
222
232
|
fake_name: str | None,
|
|
223
233
|
unpack: bool,
|
|
@@ -241,6 +251,7 @@ async def scan_internal_advanced(
|
|
|
241
251
|
procdumps: bool,
|
|
242
252
|
decompress: bool,
|
|
243
253
|
open_browser: bool,
|
|
254
|
+
preserve_filename: bool,
|
|
244
255
|
outbound_connections: list[str] | None,
|
|
245
256
|
) -> None:
|
|
246
257
|
key = get_key_by_name(key_name)
|
|
@@ -282,9 +293,13 @@ async def scan_internal_advanced(
|
|
|
282
293
|
wait_time = wait_timeout
|
|
283
294
|
|
|
284
295
|
try:
|
|
296
|
+
guest_filename = file_path.name
|
|
297
|
+
if not preserve_filename:
|
|
298
|
+
guest_filename = guest_filename.rstrip(SAFE_SUFFIXES)
|
|
299
|
+
|
|
285
300
|
scan_result = await sandbox.create_advanced_scan(
|
|
286
301
|
file_path,
|
|
287
|
-
file_name=fake_name or
|
|
302
|
+
file_name=fake_name or guest_filename,
|
|
288
303
|
extra_files=extra_files,
|
|
289
304
|
async_result=True,
|
|
290
305
|
priority=priority,
|
|
@@ -389,25 +404,26 @@ async def scan_internal_advanced(
|
|
|
389
404
|
tasks: list[Coroutine[Any, Any, None]] = []
|
|
390
405
|
with progress:
|
|
391
406
|
sandbox, sandbox_options, images = await _prepare_sandbox_new_scan(
|
|
392
|
-
progress,
|
|
393
|
-
scan_images,
|
|
394
|
-
rules_dir,
|
|
395
|
-
key,
|
|
396
|
-
is_local,
|
|
397
|
-
analysis_duration,
|
|
398
|
-
syscall_hooks,
|
|
399
|
-
unimon_hooks,
|
|
400
|
-
dll_hooks_dir,
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
407
|
+
progress=progress,
|
|
408
|
+
scan_images=scan_images,
|
|
409
|
+
rules_dir=rules_dir,
|
|
410
|
+
sandbox_key=key,
|
|
411
|
+
is_local=is_local,
|
|
412
|
+
analysis_duration=analysis_duration,
|
|
413
|
+
syscall_hooks=syscall_hooks,
|
|
414
|
+
unimon_hooks=unimon_hooks,
|
|
415
|
+
dll_hooks_dir=dll_hooks_dir,
|
|
416
|
+
filextractor_excludes=fileextractor_excludes,
|
|
417
|
+
custom_command=custom_command,
|
|
418
|
+
no_procdumps_on_finish=no_procdumps_on_finish,
|
|
419
|
+
disable_lightweight_dumps=disable_lightweight_dumps,
|
|
420
|
+
bootkitmon=bootkitmon,
|
|
421
|
+
bootkitmon_duration=bootkitmon_duration,
|
|
422
|
+
mitm_disabled=mitm_disabled,
|
|
423
|
+
disable_clicker=disable_clicker,
|
|
424
|
+
skip_sample_run=skip_sample_run,
|
|
425
|
+
vnc_mode=vnc_mode,
|
|
426
|
+
outbound_connections=outbound_connections,
|
|
411
427
|
)
|
|
412
428
|
max_image_length = max(len(x) for x in images)
|
|
413
429
|
for i, image_id in enumerate(images):
|
|
@@ -76,6 +76,10 @@ async def _prepare_rescan_options(
|
|
|
76
76
|
|
|
77
77
|
sandbox_options = SandboxBaseScanTaskRequest.Options(analysis_depth=2, passwords_for_unpack=settings.passwords)
|
|
78
78
|
|
|
79
|
+
# some enabled options by default
|
|
80
|
+
# all debug options available in library
|
|
81
|
+
sandbox_options.debug_options["save_debug_files"] = True
|
|
82
|
+
|
|
79
83
|
# process custom options
|
|
80
84
|
compiled_rules = await _get_compiled_rules(rules_dir=rules_dir, is_local=is_local, progress=progress)
|
|
81
85
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sandbox_cli-0.2.44 → sandbox_cli-0.2.46}/sandbox_cli/utils/unpack/plugins/sort_by_plugins.py
RENAMED
|
File without changes
|