From a4e94c5458b7f523f264e0fe7f3216d26012f6c6 Mon Sep 17 00:00:00 2001 From: Davide Arcuri Date: Fri, 9 Feb 2024 16:54:46 +0100 Subject: [PATCH] folder, ws, yara 4.3 --- compose/local/dask/Dockerfile | 2 +- compose/local/django/Dockerfile | 2 +- orochi/static/css/style.css | 4 + orochi/templates/website/index.html | 65 ++++++++- orochi/templates/website/partial_folder.html | 28 ++++ orochi/templates/website/partial_indices.html | 16 ++- orochi/utils/volatility_dask_elk.py | 63 ++++++--- orochi/website/forms.py | 59 +++++++-- .../migrations/0050_folder_dump_folder.py | 52 ++++++++ ..._superuser.py => 0051_create_superuser.py} | 2 +- orochi/website/models.py | 14 ++ orochi/website/urls.py | 3 + orochi/website/views.py | 124 +++++++++--------- 13 files changed, 336 insertions(+), 98 deletions(-) create mode 100644 orochi/templates/website/partial_folder.html create mode 100644 orochi/website/migrations/0050_folder_dump_folder.py rename orochi/website/migrations/{0050_create_superuser.py => 0051_create_superuser.py} (92%) diff --git a/compose/local/dask/Dockerfile b/compose/local/dask/Dockerfile index 62ffba4b..e1e74f4e 100644 --- a/compose/local/dask/Dockerfile +++ b/compose/local/dask/Dockerfile @@ -36,7 +36,7 @@ RUN ./bootstrap.sh \ && make install \ && echo "Install yara-python..." WORKDIR /tmp -RUN git clone --branch v4.2.x --recursive https://github.com/VirusTotal/yara-python +RUN git clone --branch v4.3.x --recursive https://github.com/VirusTotal/yara-python WORKDIR /tmp/yara-python RUN python setup.py build \ && python setup.py install \ diff --git a/compose/local/django/Dockerfile b/compose/local/django/Dockerfile index 0543b135..ec13df63 100644 --- a/compose/local/django/Dockerfile +++ b/compose/local/django/Dockerfile @@ -48,7 +48,7 @@ RUN ./bootstrap.sh \ && make install \ && echo "Install yara-python..." WORKDIR /tmp -RUN git clone --branch v4.2.x --recursive https://github.com/VirusTotal/yara-python +RUN git clone --branch v4.3.x --recursive https://github.com/VirusTotal/yara-python WORKDIR /tmp/yara-python RUN python setup.py build diff --git a/orochi/static/css/style.css b/orochi/static/css/style.css index 43fe5621..eebad8ef 100644 --- a/orochi/static/css/style.css +++ b/orochi/static/css/style.css @@ -184,6 +184,10 @@ main { border: 0px; } +ul.nested-list li.list-group-item { + padding: 6px 1px 1px 5px; +} + /******************************************************** OROCHI LOGO ********************************************************/ diff --git a/orochi/templates/website/index.html b/orochi/templates/website/index.html index cb7c4b88..eaf10274 100644 --- a/orochi/templates/website/index.html +++ b/orochi/templates/website/index.html @@ -12,7 +12,14 @@ {% block sidebar %} {% include "website/partial_indices.html" %} @@ -156,15 +163,15 @@
History Log
}; // FILTER DUMP LIST - $("#filter_dump").on("keyup", function () { + $(document).on("keyup", "#filter_dump", function () { var value = $(this).val().toLowerCase(); - $("#index-list li").filter(function () { + $(".nested-list li").filter(function () { $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1) }); }); // FILTER PLUGIN LIST - $("#filter_plugin").on("keyup", function () { + $(document).on("keyup", "#filter_plugin", function () { var value = $(this).val().toLowerCase(); $("#list_plugin li").filter(function () { $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1) @@ -334,7 +341,6 @@
History Log
} }); - // RERUN PLUGIN FORM var res_call = null; $(document).on('click', '#btn-resubmit', function () { @@ -397,7 +403,7 @@
History Log
}); // ADD INDEX FORM - $(document).on("click", "#new_index", function () { + $(document).on("click", "#new-index", function () { $.ajax({ url: "{% url 'website:index_create'%}", type: 'get', @@ -443,6 +449,52 @@
History Log
}); }); + // ADD FOLDER FORM + $(document).on("click", "#new-folder", function () { + $.ajax({ + url: "{% url 'website:folder_create'%}", + type: 'get', + dataType: 'json', + beforeSend: function () { + $("#modal-update").modal("show"); + }, + success: function (data) { + $("#modal-update .modal-content").html(data.html_form); + } + }); + }); + + // ADD FOLDER FORM SUBMIT + $(document).on("submit", "#create-folder", function (e) { + e.preventDefault(); + var form = $(this); + $.ajax({ + url: form.attr("action"), + data: form.serialize(), + type: form.attr("method"), + dataType: 'json', + success: function (data) { + $.toast({ + title: 'Operation successful!', + content: 'Folder has been created', + type: 'success', + delay: 5000 + }); + $("#modal-update").modal('hide'); + }, + error: function () { + $.toast({ + title: 'Operation error!', + content: 'Error during folder creation.', + type: 'error', + delay: 5000 + }); + $("#modal-update").modal('hide'); + } + }); + }); + + // RESTART INDEX FORM SUBMIT $(document).on("click", ".restart-index", function (e) { var btn = $(this); @@ -489,7 +541,6 @@
History Log
}); }); - // DOWNLOAD SYMBOLS FROM BANNER FORM $(document).on("click", ".symbols-download", function () { var btn = $(this); diff --git a/orochi/templates/website/partial_folder.html b/orochi/templates/website/partial_folder.html new file mode 100644 index 00000000..d5bccc09 --- /dev/null +++ b/orochi/templates/website/partial_folder.html @@ -0,0 +1,28 @@ +{% load widget_tweaks %} + +
+ {{ form.media }} + {% csrf_token %} + + + +
diff --git a/orochi/templates/website/partial_indices.html b/orochi/templates/website/partial_indices.html index a375ebfd..ddba5838 100644 --- a/orochi/templates/website/partial_indices.html +++ b/orochi/templates/website/partial_indices.html @@ -1,7 +1,14 @@ {% if dumps %} +{% endif %} + + +{% endif %} +{% endfor %} {% else %}