diff --git a/conf/default/processing.conf.default b/conf/default/processing.conf.default index d6fbb887f08..4ea1a3124af 100644 --- a/conf/default/processing.conf.default +++ b/conf/default/processing.conf.default @@ -324,5 +324,5 @@ enabled = no # plain-text TLS streams into the task PCAP. enabled = no -[network_proc_map] +[network_process_map] enabled = no diff --git a/conf/default/web.conf.default b/conf/default/web.conf.default index c02a0eff07f..e8bfe9b141e 100644 --- a/conf/default/web.conf.default +++ b/conf/default/web.conf.default @@ -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 diff --git a/modules/processing/network_process_map.py b/modules/processing/network_process_map.py index 4acdfc95e80..4d692d1f82e 100644 --- a/modules/processing/network_process_map.py +++ b/modules/processing/network_process_map.py @@ -40,6 +40,10 @@ "winhttpsendrequest", "winhttpconnect", "winhttpopen", + "internetopenurla", + "internetopenurlw", + "httpopenrequesta", + "httpopenrequestw", } diff --git a/web/analysis/urls.py b/web/analysis/urls.py index 3b8120b5ec4..29cef3af083 100644 --- a/web/analysis/urls.py +++ b/web/analysis/urls.py @@ -37,7 +37,8 @@ views.procdump, name="procdump", ), - re_path(r"^reprocess/(?P\d+)/$", views.reprocess_task, name="reprocess_tasks"), + re_path(r"^reprocess/(?P\d+)/$", views.reprocess_tasks, name="reprocess_tasks"), + re_path(r"^failed/(?P\d+)/$", views.failed_processing, name="failed_processing"), re_path(r"^(?P\d+)/pcapstream/(?P[.,\w]+)/$", views.pcapstream, name="pcapstream"), re_path(r"^(?P\d+)/comments/$", views.comments, name="comments"), re_path( diff --git a/web/analysis/views.py b/web/analysis/views.py index 174de09bdd5..c493340aba2 100644 --- a/web/analysis/views.py +++ b/web/analysis/views.py @@ -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) @@ -2642,7 +2643,7 @@ 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", "/")) @@ -2650,4 +2651,24 @@ def reprocess_task(request, task_id: int): 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, + }) diff --git a/web/static/css/style.css b/web/static/css/style.css index e4919d45ace..05238de3a49 100644 --- a/web/static/css/style.css +++ b/web/static/css/style.css @@ -1,8 +1,9 @@ html { background: #1c1c1c; } + body { - font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; padding-top: 60px; background: #1c1c1c repeat-x; @@ -15,22 +16,22 @@ body { @media (max-width: 979px) { body { - padding-top: 0px; - padding-bottom: 0px; + padding-top: 0; + padding-bottom: 0; } } a { - color: white + color: white; } -.navbar-collapse.in { +/* Bootstrap 5: collapse uses .show (not .in) */ +.navbar-collapse.show { display: block !important; } -.alert-primary, .alert-info -{ - background-color: #1c1c1c +.alert-primary, .alert-info { + background-color: #1c1c1c; } .alert-info code { @@ -41,32 +42,28 @@ a { padding: .5rem 1rem; } -element.style { - font-size: 14px; -} - .card-body { padding: 1.0rem; } a:hover { - color: #EE1B2F + color: #EE1B2F; } .btn-link { - color: red + color: red; } .btn-link:hover { - color: #EE1B2F + color: #EE1B2F; } .page-link { - background-color: #444 + background-color: #444; } .page-link:hover { - background-color: #EE1B2F + background-color: #EE1B2F; } .page-link-active { @@ -74,18 +71,18 @@ a:hover { } .text-success { - color: #62c462!important + color: #62c462 !important; } -.text-sucess:hover { - color: #62c462 +.text-success:hover { + color: #62c462 !important; } .page-item.active .page-link { - z-index:3; - color:#fff; - background-color:#ee1b2f; - border-color:transparent + z-index: 3; + color: #fff; + background-color: #ee1b2f; + border-color: transparent; } footer { @@ -95,73 +92,86 @@ footer { width: 100%; color: #ccc; } + footer a:link, footer a:visited { color: #ccc; text-decoration: none; } + footer a:hover { color: #ccc; text-decoration: underline; } + #footer-extra { background: #1c1c1c; padding: 10px 0; font-size: 11px; color: #999; } + #footer-extra a:link, #footer-extra a:visited { color: #999; font-weight: bold; text-decoration: none; } + #footer-extra a:hover { color: #ccc; text-decoration: underline; } + .center { text-align: center; } + td code { white-space: pre-wrap; word-break: break-all; } + .content { - background-color: white; - padding: 40px; - padding-top: 15px; - -moz-border-radius-bottomleft: 15px; - -moz-border-radius-bottomright: 15px; - -webkit-border-bottom-left-radius: 15px; - -webkit-border-bottom-right-radius: 15px; + background-color: #fff; + padding: 15px 40px 40px; /* top right/left bottom */ + border-bottom-left-radius: 15px; + border-bottom-right-radius: 15px; } + .section-title { border-bottom: 1px solid #eee; margin-bottom: 15px; margin-top: 20px; padding-bottom: 3px; } + span.block-title { font-size: 18px; font-weight: bold; } + img.opaque { opacity: 0.3; filter: alpha(opacity=30); } + img.opaque:hover { opacity: 1.0; filter: alpha(opacity=100); } + .gray { color: #666; } + .table-centered { margin: 0 auto !important; float: none !important; } + .table-bordered tfoot th, .table-bordered tfoot td { border-top: 4px solid #444; } + a.tag-label { color: white; } @@ -173,14 +183,13 @@ h4, .h4 { .page-header { margin-bottom: 10px; } + .filter-box { - display : none; + display: none; padding-top: 15px; - height : auto; - width : 40%; + height: auto; + width: 40%; } -/* Fix the icon tab override */ -.nav-tabs > .active > a > [class^="icon-"],.nav-tabs>.active>a>[class*=" icon-"] { background-image:url("../img/glyphicons-halflings.png") !important; } td { word-wrap: break-word; @@ -192,14 +201,13 @@ td { } .row-active { - background-color:darkred; + background-color: darkred; } pre { - white-space: -moz-pre-wrap; - white-space: -pre-wrap; - white-space: -o-pre-wrap; - word-wrap: break-word; + white-space: pre-wrap; + overflow-wrap: anywhere; + word-break: break-word; } .extracted-config > table > tbody > tr > td { @@ -210,26 +218,27 @@ pre { .tcp-flow { list-style-type: none; } + .tcp-flow li { margin-bottom: 20px; } -.tcp-out { -} + .tcp-out pre { padding: 0; border: 0; - /*background-color: white;*/ color: #d9534f; } + .tcp-in { padding-left: 100px; } + .tcp-in pre { padding: 0; border: 0; - /*background-color: white;*/ color: #5bc0de; } + .filter-toggle { display: inline-block; cursor: pointer; @@ -240,46 +249,57 @@ pre { background-color: #ffe3c5; color: black; } + .registry { background-color: #ffc5c5; color: black; } + .process { background-color: #c5e0ff; color: black; } + .threading { background-color: #d3e0ff; color: black; } + .services { background-color: #ccc5ff; color: black; } + .device { background-color: #d3c5cc; color: black; } + .network { background-color: #d3ffc5; color: black; } + .socket { background-color: #d3ffc5; color: black; } + .synchronization { background-color: #f9c5ff; color: black; } + .browser { background-color: #dfffdf; color: black; } + .crypto { background-color: #f0f2c5; color: black; } + /* Linux Syscall Categories */ .kernel { background-color: #ffc5c5; @@ -330,27 +350,92 @@ pre { background-color: #fffcc5; color: black; } + .windows { background-color: #ffc5ee; color: black; } /* Category buttons (base colors) */ -.btn-cat-default { background-color: #696969; color: #000; border-color: #696969; } -.btn-cat-filesystem { background-color: #ffe3c5; color: #000; border-color: #ffe3c5; } -.btn-cat-registry { background-color: #ffc5c5; color: #000; border-color: #ffc5c5; } -.btn-cat-process { background-color: #c5e0ff; color: #000; border-color: #c5e0ff; } -.btn-cat-threading { background-color: #d3e0ff; color: #000; border-color: #d3e0ff; } -.btn-cat-services { background-color: #ccc5ff; color: #000; border-color: #ccc5ff; } -.btn-cat-device { background-color: #d3c5cc; color: #000; border-color: #d3c5cc; } -.btn-cat-network { background-color: #d3ffc5; color: #000; border-color: #d3ffc5; } -.btn-cat-socket { background-color: #d3ffc5; color: #000; border-color: #d3ffc5; } -.btn-cat-synchronization { background-color: #f9c5ff; color: #000; border-color: #f9c5ff; } -.btn-cat-browser { background-color: #dfffdf; color: #000; border-color: #dfffdf; } -.btn-cat-crypto { background-color: #f0f2c5; color: #000; border-color: #f0f2c5; } -.btn-cat-all { background-color: #198754; color: #000; border-color: #198754; } - -/* Hover + selected */ +.btn-cat-default { + background-color: #696969; + color: #000; + border-color: #696969; +} + +.btn-cat-filesystem { + background-color: #ffe3c5; + color: #000; + border-color: #ffe3c5; +} + +.btn-cat-registry { + background-color: #ffc5c5; + color: #000; + border-color: #ffc5c5; +} + +.btn-cat-process { + background-color: #c5e0ff; + color: #000; + border-color: #c5e0ff; +} + +.btn-cat-threading { + background-color: #d3e0ff; + color: #000; + border-color: #d3e0ff; +} + +.btn-cat-services { + background-color: #ccc5ff; + color: #000; + border-color: #ccc5ff; +} + +.btn-cat-device { + background-color: #d3c5cc; + color: #000; + border-color: #d3c5cc; +} + +.btn-cat-network { + background-color: #d3ffc5; + color: #000; + border-color: #d3ffc5; +} + +.btn-cat-socket { + background-color: #d3ffc5; + color: #000; + border-color: #d3ffc5; +} + +.btn-cat-synchronization { + background-color: #f9c5ff; + color: #000; + border-color: #f9c5ff; +} + +.btn-cat-browser { + background-color: #dfffdf; + color: #000; + border-color: #dfffdf; +} + +.btn-cat-crypto { + background-color: #f0f2c5; + color: #000; + border-color: #f0f2c5; +} + +.btn-cat-all { + background-color: #198754; + color: #000; + border-color: #198754; +} + +/* Active state border colors (your current behavior) */ .btn-cat-default.active, .btn-cat-default:active, .show > .btn-cat-default.dropdown-toggle { @@ -474,38 +559,49 @@ pre { .table tbody tr.system > th, .table tbody tr.windows > td, .table tbody tr.windows > th { - background-color: inherit; /* inherit the TR background-color */ - color: inherit; /* inherit the TR text color */ + background-color: inherit; /* inherit the TR background-color */ + color: inherit; /* inherit the TR text color */ } /* Hover/focus states */ -.form-control[type="file"]::file-selector-button:hover{ - background-color: #3f474e; +.form-control[type="file"]::file-selector-button:hover { + background-color: #3f474e; } -/* Mid-gray form controls for Darkly */ +/* Mid-gray form controls */ :root { - --form-bg: #5c5c5c; /* ← adjust here (try #4f4f4f to #5c5c5c) */ - --form-border: #666; - --form-text: #fff; - --form-placeholder: rgba(255,255,255,.55); + --form-bg: #5c5c5c; + --form-border: #666; + --form-text: #fff; + --form-placeholder: rgba(255, 255, 255, .55); } .form-control, .form-select { - background-color: var(--form-bg) !important; - color: var(--form-text) !important; - border-color: var(--form-border) !important; + background-color: var(--form-bg) !important; + color: var(--form-text) !important; + border-color: var(--form-border) !important; } .form-control::placeholder { - color: var(--form-placeholder) !important; + color: var(--form-placeholder) !important; } .form-control:focus, .form-select:focus { - background-color: var(--form-bg) !important; - border-color: #007ABCFF !important; /* Darkly success color */ - box-shadow: 0 0 0 .25rem rgba(0, 38, 60, 0.25); + background-color: var(--form-bg) !important; + border-color: #007ABCFF !important; + box-shadow: 0 0 0 .25rem rgba(0, 38, 60, 0.25); +} + +/* Global: no underlines anywhere in BS5 UI */ +a, a:hover, a:focus, a:active { + text-decoration: none !important; +} + +/* Keep footer behavior only (if you want underline there) */ +footer a:hover, +#footer-extra a:hover { + text-decoration: underline !important; } diff --git a/web/templates/analysis/failed_processing.html b/web/templates/analysis/failed_processing.html new file mode 100644 index 00000000000..a42280a834c --- /dev/null +++ b/web/templates/analysis/failed_processing.html @@ -0,0 +1,52 @@ +{% extends "base.html" %} +{% block content %} +
+ {% if user.is_staff %} +
+
Admin
+
+
+
Task ID
+
+ {{task.id}} + Delete + {% if settings.REPROCESS_FAILED_PROCESSING %} + + Reprocess + + {% endif %} +
+
+ {% if task.user_id %} +
+
Task created by user
+
+ {{task.user_id}} + Ban User + Ban All User Tasks +
+
+ {% endif %} +
+
+ {% endif %} +
+
+
+ + Task {{ task.id }} Failed Processing +
+
+
+
Target: {{ task.target }}
+
+
Process Log
+
+
+
{{ process_log }}
+
+
+
+
+
+{% endblock %} diff --git a/web/templates/analysis/index.html b/web/templates/analysis/index.html index 3f99ea8c67d..7a575886d36 100644 --- a/web/templates/analysis/index.html +++ b/web/templates/analysis/index.html @@ -114,6 +114,8 @@
Rece {{analysis.id}} {% elif analysis.status in "running,completed,distributed" %} {{analysis.id}} + {% elif analysis.status == "failed_processing" %} + {{analysis.id}} {% else %} {{analysis.id}} {% endif %} @@ -133,6 +135,8 @@
Rece {{analysis.filename}} {% elif analysis.status in "running,completed,distributed" %} {{analysis.filename}} + {% elif analysis.status == "failed_processing" %} + {{analysis.filename}} {% else %} {{analysis.filename}} {% endif %} @@ -144,6 +148,8 @@
Rece {{analysis.sample.md5}} {% elif analysis.status in "running,completed,distributed" %} {{analysis.sample.md5}} + {% elif analysis.status == "failed_processing" %} + {{analysis.sample.md5}} {% else %} {{analysis.sample.md5}} {% endif %} @@ -155,6 +161,8 @@
Rece {% elif analysis.status in "running,completed,distributed" %} {{analysis.sample.sha256}} + {% elif analysis.status == "failed_processing" %} + {{analysis.sample.sha256}} {% else %} {{analysis.sample.sha256}} {% endif %} @@ -276,6 +284,8 @@
Rece {% else %} reported {% endif%} + {% elif analysis.status == "failed_processing" %} + {{analysis.status}} {% else %} {{analysis.status}} {% endif %} @@ -401,6 +411,8 @@
{{analysis.sample.md5}} {% elif analysis.status in "running,completed,distributed" %} {{analysis.sample.md5}} + {% elif analysis.status == "failed_processing" %} + {{analysis.sample.md5}} {% else %} {{analysis.sample.md5}} {% endif %} @@ -411,6 +423,8 @@
{{analysis.sample.sha256}} {% elif analysis.status in "running,completed,distributed" %} {{analysis.sample.sha256}} + {% elif analysis.status == "failed_processing" %} + {{analysis.sample.sha256}} {% else %} {{analysis.sample.sha256}} {% endif %} @@ -502,6 +516,8 @@
{% else %} reported {% endif%} + {% elif analysis.status == "failed_processing" %} + {{analysis.status}} {% else %} {{analysis.status}} {% endif %} @@ -641,6 +657,8 @@
Rece {% elif analysis.status in "running,completed,distributed" %} {{analysis.target}} + {% elif analysis.status == "failed_processing" %} + {{analysis.target}} {% else %} {{analysis.target}} {% endif %} @@ -734,6 +752,8 @@
Rece processing {% elif analysis.status == "reported" %} reported + {% elif analysis.status == "failed_processing" %} + {{analysis.status}} {% else %} {{analysis.status}} {% endif %} @@ -866,6 +886,8 @@
< {% elif analysis.status in "running,completed,distributed" %} {{analysis.sample.md5}} + {% elif analysis.status == "failed_processing" %} + {{analysis.sample.md5}} {% else %} {{analysis.sample.md5}} {% endif %} @@ -877,6 +899,8 @@
< {% elif analysis.status in "running,completed,distributed" %} {{analysis.sample.sha256}} + {% elif analysis.status == "failed_processing" %} + {{analysis.sample.sha256}} {% else %} {{analysis.sample.sha256}} {% endif %} @@ -959,6 +983,8 @@
< {% else %} reported {% endif%} + {% elif analysis.status == "failed_processing" %} + {{analysis.status}} {% else %} {{analysis.status}} {% endif %} diff --git a/web/web/settings.py b/web/web/settings.py index a924a55cfb0..78b48c40d4c 100644 --- a/web/web/settings.py +++ b/web/web/settings.py @@ -35,6 +35,7 @@ pro_cfg = Config("processing") REPROCESS_TASKS = web_cfg.general.reprocess_tasks +REPROCESS_FAILED_PROCESSING = web_cfg.general.reprocess_failed_processing # CSRF TRUSTED ORIGINS # For requests that include the Origin header, Django's CSRF protection # requires that header match the origin present in the Host header. @@ -97,7 +98,7 @@ ADMIN = web_cfg.admin.enabled ANON_VIEW = web_cfg.general.anon_viewable ALLOW_DL_REPORTS_TO_ALL = web_cfg.general.reports_dl_allowed_to_all -NETWORK_PROC_MAP = pro_cfg.network_proc_map.enabled +NETWORK_PROC_MAP = pro_cfg.network_process_map.enabled # If false run next command # python3 manage.py runserver_plus 0.0.0.0:8000 --traceback --keep-meta-shutdown @@ -312,6 +313,8 @@ "WEB_OAUTH", "ZIPPED_DOWNLOAD_ALL", "NETWORK_PROC_MAP", + "REPROCESS_TASKS", + "REPROCESS_FAILED_PROCESSING", ] EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"