sandbox-cli 0.2.35__tar.gz → 0.2.36__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.35 → sandbox_cli-0.2.36}/PKG-INFO +1 -1
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/pyproject.toml +1 -1
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/cli/downloader.py +21 -9
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/utils/downloader/__init__.py +1 -1
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/.gitignore +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/LICENSE +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/NOTICE +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/README.md +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/__main__.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/cli/__init__.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/cli/images.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/cli/reporter.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/cli/rules/__init__.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/cli/scanner/__init__.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/cli/unpack.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/console.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/internal/__init__.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/internal/config.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/internal/helpers.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/models/__init__.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/models/detections.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/models/sandbox_arguments.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/utils/__init__.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/utils/compiler/__init__.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/utils/compiler/abc.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/utils/compiler/docker.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/utils/compiler/ssh.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/utils/extractors.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/utils/merge_dll_hooks.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/utils/scanner/__init__.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/utils/scanner/advanced.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/utils/scanner/rescan.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/utils/unpack/__init__.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/utils/unpack/plugins/__init__.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/utils/unpack/plugins/abc.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/utils/unpack/plugins/correlation.py +0 -0
- {sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/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.36
|
|
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
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import os
|
|
3
|
+
import sys
|
|
3
4
|
from collections.abc import Coroutine
|
|
4
5
|
from http import HTTPStatus
|
|
5
6
|
from pathlib import Path
|
|
@@ -11,6 +12,7 @@ import aiofiles
|
|
|
11
12
|
import aiohttp
|
|
12
13
|
import aiohttp.client_exceptions
|
|
13
14
|
import orjson
|
|
15
|
+
from colorama import init
|
|
14
16
|
from cyclopts import Parameter
|
|
15
17
|
from ptsandbox import Sandbox
|
|
16
18
|
from ptsandbox.models import Artifact, SandboxBaseTaskResponse
|
|
@@ -182,6 +184,8 @@ async def download_command(
|
|
|
182
184
|
Download any artifact from the sandbox.
|
|
183
185
|
"""
|
|
184
186
|
|
|
187
|
+
init() # colorama stuff for working on windows
|
|
188
|
+
|
|
185
189
|
progress = Progress(
|
|
186
190
|
SpinnerColumn(),
|
|
187
191
|
TextColumn("{task.description}"),
|
|
@@ -233,19 +237,23 @@ async def download_command(
|
|
|
233
237
|
async def create_task(sandbox: Sandbox, task_id: str) -> None:
|
|
234
238
|
progress_task_id = progress.add_task(description=rf"\[[green1]{task_id}[/]] fetching info", start=True)
|
|
235
239
|
|
|
240
|
+
def finalize_progress() -> None:
|
|
241
|
+
progress.remove_task(task_id=progress_task_id)
|
|
242
|
+
|
|
236
243
|
try:
|
|
237
244
|
result = await sandbox.get_report(task_id=task_id)
|
|
238
245
|
except aiohttp.client_exceptions.ClientResponseError as e:
|
|
239
246
|
if e.status == HTTPStatus.NOT_FOUND:
|
|
240
|
-
console.warning(f"
|
|
247
|
+
console.warning(f"Got 404 error for {task_id}")
|
|
248
|
+
finalize_progress()
|
|
241
249
|
return
|
|
242
250
|
|
|
243
251
|
if (report := result.get_long_report()) is None:
|
|
244
252
|
console.warning(f"Not found information for {task_id}")
|
|
253
|
+
finalize_progress()
|
|
245
254
|
return
|
|
246
255
|
|
|
247
|
-
|
|
248
|
-
progress.update(task_id=progress_task_id, visible=False)
|
|
256
|
+
finalize_progress()
|
|
249
257
|
|
|
250
258
|
tasks.append(
|
|
251
259
|
worker(
|
|
@@ -273,14 +281,16 @@ async def download_command(
|
|
|
273
281
|
limit = 40 if count > 40 else count
|
|
274
282
|
viewed, next_cursor = 0, ""
|
|
275
283
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
with progress:
|
|
284
|
+
with progress:
|
|
285
|
+
while viewed <= count:
|
|
286
|
+
response = await sandbox.get_tasks(query=query, limit=limit, next_cursor=next_cursor)
|
|
280
287
|
await asyncio.gather(*(create_task(sandbox, task.id) for task in response.tasks))
|
|
281
288
|
|
|
282
|
-
|
|
283
|
-
|
|
289
|
+
viewed += limit
|
|
290
|
+
next_cursor = response.next_cursor
|
|
291
|
+
|
|
292
|
+
# clear last line
|
|
293
|
+
sys.stdout.write("\033[F\033[K")
|
|
284
294
|
|
|
285
295
|
for task in tasks_id:
|
|
286
296
|
sandbox, task_id = get_key_and_task(key, task)
|
|
@@ -292,6 +302,8 @@ async def download_command(
|
|
|
292
302
|
with progress:
|
|
293
303
|
await asyncio.gather(*tasks)
|
|
294
304
|
|
|
305
|
+
# clear last line
|
|
306
|
+
sys.stdout.write("\033[F\033[K")
|
|
295
307
|
|
|
296
308
|
def download_email(
|
|
297
309
|
emails: Annotated[
|
|
@@ -139,7 +139,7 @@ async def download(
|
|
|
139
139
|
if sandbox_result.details.sandbox is None:
|
|
140
140
|
continue
|
|
141
141
|
|
|
142
|
-
if sandbox_result.details.sandbox.image and (image_id := sandbox_result.details.sandbox.image.image_id):
|
|
142
|
+
if sandbox_result.details.sandbox.image and (image_id := sandbox_result.details.sandbox.image.image_id) and out_dir.parts[-1] != image_id:
|
|
143
143
|
output = out_dir / image_id
|
|
144
144
|
else:
|
|
145
145
|
output = out_dir
|
|
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
|
|
File without changes
|
{sandbox_cli-0.2.35 → sandbox_cli-0.2.36}/sandbox_cli/utils/unpack/plugins/sort_by_plugins.py
RENAMED
|
File without changes
|