Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conf/default/processing.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,5 @@ enabled = no
# plain-text TLS streams into the task PCAP.
enabled = no

[network_proc_map]
[network_process_map]
enabled = no
2 changes: 2 additions & 0 deletions conf/default/web.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ reports_dl_allowed_to_all = yes
expose_process_log = no
# Show button to reprocess the task
reprocess_tasks = no
# Allow to reprocess failed processing tasks
reprocess_failed_processing = no
# Allows you to define URL splitter, "," is default
url_splitter = ,
# Limit number of files extracted from archive in demux.py
Expand Down
4 changes: 4 additions & 0 deletions modules/processing/network_process_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
"winhttpsendrequest",
"winhttpconnect",
"winhttpopen",
"internetopenurla",
"internetopenurlw",
"httpopenrequesta",
"httpopenrequestw",
}


Expand Down
3 changes: 2 additions & 1 deletion web/analysis/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
views.procdump,
name="procdump",
),
re_path(r"^reprocess/(?P<task_id>\d+)/$", views.reprocess_task, name="reprocess_tasks"),
re_path(r"^reprocess/(?P<task_id>\d+)/$", views.reprocess_tasks, name="reprocess_tasks"),
re_path(r"^failed/(?P<task_id>\d+)/$", views.failed_processing, name="failed_processing"),
re_path(r"^(?P<task_id>\d+)/pcapstream/(?P<conntuple>[.,\w]+)/$", views.pcapstream, name="pcapstream"),
re_path(r"^(?P<task_id>\d+)/comments/$", views.comments, name="comments"),
re_path(
Expand Down
25 changes: 23 additions & 2 deletions web/analysis/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from django.shortcuts import redirect, render
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST, require_safe
from django.urls import reverse
from rest_framework.decorators import api_view

sys.path.append(settings.CUCKOO_PATH)
Expand Down Expand Up @@ -2642,12 +2643,32 @@ def ban_user(request, user_id: int):


@conditional_login_required(login_required, settings.WEB_AUTHENTICATION)
def reprocess_task(request, task_id: int):
def reprocess_tasks(request, task_id: int):
if not settings.REPROCESS_TASKS:
return HttpResponseRedirect(request.META.get("HTTP_REFERER", "/"))

error, msg, _ = db.tasks_reprocess(task_id)
if error:
return render(request, "error.html", {"error": msg})
else:
return HttpResponseRedirect(request.META.get("HTTP_REFERER", "/"))
return HttpResponseRedirect(reverse("analysis"))


@require_safe
@conditional_login_required(login_required, settings.WEB_AUTHENTICATION)
def failed_processing(request, task_id):
task = db.view_task(task_id)
if not task:
return render(request, "error.html", {"error": "Task not found"})

process_log_path = os.path.join(CUCKOO_ROOT, "storage", "analyses", str(task_id), "process.log")

log_content = "Process log file not found."
if path_exists(process_log_path):
log_content = path_read_file(process_log_path, mode="text")

return render(request, "analysis/failed_processing.html", {
"task": task,
"process_log": log_content,
"settings": settings,
})
Loading