<commit_before># Copyright (C) 2016-2017 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.

import json

from django.http import JsonResponse
from django.shortcuts import redirect
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_http_methods

from cuckoo.common.config import config
from cuckoo.core.submit import SubmitManager
from cuckoo.web.utils import api_post, JsonSerialize, json_error_response

submit_manager = SubmitManager()

def defaults():
    machinery = config("cuckoo:cuckoo:machinery")

    if config("routing:vpn:enabled"):
        vpns = config("routing:vpn:vpns")
    else:
        vpns = []

    return {
        "machine": config("%s:%s:machines" % (machinery, machinery)),
        "package": None,
        "priority": 2,
        "timeout": config("cuckoo:timeouts:default"),
        "routing": {
            "route": config("routing:routing:route"),
            "drop": config("routing:routing:drop"),
            "internet": config("routing:routing:internet") != "none",
            "inetsim": config("routing:inetsim:enabled"),
            "tor": config("routing:tor:enabled"),
            "vpns": vpns,
        },
        "options": {
            "enforce-timeout": False,
            "full-memory-dump": config("cuckoo:cuckoo:memory_dump"),
            "enable-injection": True,
            "process-memory-dump": True,
            "simulated-human-interaction": True,
        },
    }

class SubmissionApi(object):
    @staticmethod
    @csrf_exempt
    @require_http_methods(["POST"])
    def presubmit(request):
        files = request.FILES.getlist("files[]")
        data = []

        if files:
            for f in files:
                data.append({<commit_msg>add default value for remotecontrol task option<commit_after># Copyright (C) 2016-2017 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.

import json

from django.http import JsonResponse
from django.shortcuts import redirect
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_http_methods

from cuckoo.common.config import config
from cuckoo.core.submit import SubmitManager
from cuckoo.web.utils import api_post, JsonSerialize, json_error_response

submit_manager = SubmitManager()

def defaults():
    machinery = config("cuckoo:cuckoo:machinery")

    if config("routing:vpn:enabled"):
        vpns = config("routing:vpn:vpns")
    else:
        vpns = []

    return {
        "machine": config("%s:%s:machines" % (machinery, machinery)),
        "package": None,
        "priority": 2,
        "timeout": config("cuckoo:timeouts:default"),
        "routing": {
            "route": config("routing:routing:route"),
            "drop": config("routing:routing:drop"),
            "internet": config("routing:routing:internet") != "none",
            "inetsim": config("routing:inetsim:enabled"),
            "tor": config("routing:tor:enabled"),
            "vpns": vpns,
        },
        "options": {
            "enable-injection": True,
            "enforce-timeout": False,
            "full-memory-dump": config("cuckoo:cuckoo:memory_dump"),
            "process-memory-dump": True,
            "remotecontrol": False,
            "simulated-human-interaction": True,
        },
    }

class SubmissionApi(object):
    @staticmethod
    @csrf_exempt
    @require_http_methods(["POST"])
    def presubmit(request):
        files = request.FILES.getlist("files[]")
        data = []

        if files:
            for f in files:
                data.append({
{'fraction_non_alphanumeric': 0.12839637719765584, 'fraction_numerical': 0.004794885455514118, 'mean_word_length': 2.835546475995914, 'pattern_counts': {'":': 35, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3617129', 'n_tokens_mistral': 1132, 'n_tokens_neox': 1125, 'n_words': 243}