Skip to content

Commit 6134535

Browse files
authored
demux (#2579)
1 parent 8e3e47f commit 6134535

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

conf/default/web.conf.default

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ expose_process_log = no
6565
reprocess_tasks = no
6666
# Allows you to define URL splitter, "," is default
6767
url_splitter = ,
68+
# Limit number of files extracted from archive in demux.py
69+
demux_files_limit = 10
6870

6971
# ratelimit for anon users
7072
[ratelimit]

lib/cuckoo/common/demux.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
tmp_path = cuckoo_conf.cuckoo.get("tmppath", "/tmp")
3535
linux_enabled = web_cfg.linux.get("enabled", False) or web_cfg.linux.get("static_only", False)
3636

37+
try:
38+
demux_files_limit = int(web_cfg.general.demux_files_limit)
39+
except ValueError:
40+
log.error("Invalid value for demux_files_limit in web.conf, defaulting to 10")
41+
demux_files_limit = 10 # Default value
42+
3743
demux_extensions_list = {
3844
b".accdr",
3945
b".exe",
@@ -359,4 +365,4 @@ def demux_sample(filename: bytes, package: str, options: str, use_sflock: bool =
359365
)
360366
new_retlist.append((filename, platform))
361367

362-
return new_retlist[:10], error_list
368+
return new_retlist[:demux_files_limit], error_list

0 commit comments

Comments
 (0)