diff --git a/orochi/templates/website/index.html b/orochi/templates/website/index.html index 6f36164f..887b254b 100644 --- a/orochi/templates/website/index.html +++ b/orochi/templates/website/index.html @@ -626,24 +626,18 @@
History Log
$.ajax({ url: "{% url 'website:index_info'%}", data: { 'index': btn.data('index') }, - dataType: 'json', + beforeSend: function () { + $("#modal-update").modal("show"); + $("#modal-update").addClass("modal-xl"); + }, success: function (data) { - bootbox.alert({ - message: ` -

${data.name}

-
-
md5
${data.md5}
-
sha256
${data.sha256}
-
size
${data.size}
-
index
${data.index}
-
filepath
${data.upload}
-
comment
${data.comment}
-
`, - size: 'large' - }); + $("#modal-update .modal-content").html(data); } }); }); + $(document).on("hidden.bs.modal", ".modal-xl", function (e) { + $(this).removeClass("modal-xl"); + }); // EDIT INDEX FORM $(document).on("click", ".edit-index", function (e) { diff --git a/orochi/templates/website/partial_info.html b/orochi/templates/website/partial_info.html new file mode 100644 index 00000000..923e98bf --- /dev/null +++ b/orochi/templates/website/partial_info.html @@ -0,0 +1,26 @@ + + + diff --git a/orochi/utils/volatility_dask_elk.py b/orochi/utils/volatility_dask_elk.py index eaf0ba83..b94698c1 100644 --- a/orochi/utils/volatility_dask_elk.py +++ b/orochi/utils/volatility_dask_elk.py @@ -560,6 +560,7 @@ def run_plugin(dump_obj, plugin_obj, params=None, user_pk=None): .isoformat(), }, ), + refresh=True, ) # set max_windows_size on new created index diff --git a/orochi/website/views.py b/orochi/website/views.py index 2f9cb0ce..b25486bc 100644 --- a/orochi/website/views.py +++ b/orochi/website/views.py @@ -43,6 +43,7 @@ from orochi.utils.plugin_install import plugin_install from orochi.utils.volatility_dask_elk import ( check_runnable, + get_banner, get_parameters, refresh_symbols, run_plugin, @@ -1047,18 +1048,7 @@ def info(request): dump = get_object_or_404(Dump, index=request.GET.get("index")) if dump not in get_objects_for_user(request.user, "website.can_see"): Http404("404") - return JsonResponse( - { - "index": dump.index, - "name": dump.name, - "md5": dump.md5, - "sha256": dump.sha256, - "size": dump.size, - "upload": dump.upload.path, - "comment": dump.comment, - }, - safe=False, - ) + return TemplateResponse(request, "website/partial_info.html", {"dump": dump}) @login_required @@ -1448,6 +1438,15 @@ def delete_symbol(request): def reload_symbols(request): """reload symbols""" dump = get_object_or_404(Dump, index=request.GET.get("index")) + + # Try to reload banner from elastic if first time was not successful + if not dump.banner: + banner = dump.result_set.get(plugin__name="banners.Banners") + banner_result = get_banner(banner) + if banner_result: + dump.banner = banner_result.strip("\"'") + dump.save() + change = False if check_runnable(dump.pk, dump.operating_system, dump.banner): change = True