Skip to content

Removing sha for dexo_func + adding |safe to dexofuzzy_hash #140 #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 1 addition & 2 deletions bazaar/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from scipy.spatial.distance import pdist
import pandas as pd


def get_sha256_of_file_path(file_path):
sha256_hash = hashlib.sha256()
with open(file_path, "rb") as f:
Expand Down Expand Up @@ -240,7 +239,7 @@ def get_matching_items_by_ssdeep(ssdeep_value, threshold_grade, index, sha256):
return sha256_list_to_return


def get_matching_items_by_ssdeep_func(ssdeep_value, threshold_grade, index, sha256):
def get_matching_items_by_ssdeep_func(ssdeep_value, threshold_grade, index):
chunksize, chunk, double_chunk = ssdeep_value.split(':')
chunksize = int(chunksize)
es = Elasticsearch(settings.ELASTICSEARCH_HOSTS)
Expand Down
2 changes: 1 addition & 1 deletion bazaar/front/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def do_search(self, sha=''):
if algorithm == 'ssdeep':
results = get_matching_items_by_ssdeep(hash, 25, settings.ELASTICSEARCH_SSDEEP_APK_INDEX, sha)
if algorithm == 'func_hash':
results = get_matching_items_by_ssdeep_func(hash, 25, settings.ELASTICSEARCH_APK_INDEX, sha)
results = get_matching_items_by_ssdeep_func(hash, 25, settings.ELASTICSEARCH_APK_INDEX)

except Exception as e:
print(e)
Expand Down
6 changes: 3 additions & 3 deletions bazaar/templates/front/report/m_androcfg.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ <h4>{{ r.rule.title }}</h4>
{% for f in r.findings %}
<li>
<a class="btn btn-sm btn-link p-0 text-decoration-none" target="_blank"
href="{% url "front:get_andgrocfg_code" sha256 f.evidence_file %}">{{f.call_by}}</a>
<a class="btn btn-sm btn-link p-0 text-decoration-none" href="{% url 'front:similarity_search' %}?hash={{ f.dexofuzzy_hash }}&algorithm=func_hash">
<i class="nf nf-oct-search"></i></a>
href="{% url "front:get_andgrocfg_code" sha256 f.evidence_file %}">{{f.call_by}}</a>
<a class="btn btn-sm btn-link p-0 text-decoration-none" href="{% url 'front:similarity_search' %}?hash={{ f.dexofuzzy_hash|urlencode }}&algorithm=func_hash">
<i class="nf nf-oct-search"></i></a>
</li>
{% endfor %}
</ul>
Expand Down