chg: [UI correlation graph + UI domain] correlation screenshot: show img in toolip + show hash in ShowDomain

TODO: pixelate images
This commit is contained in:
Terrtia 2019-12-18 16:17:29 +01:00
parent 7420ee26a9
commit 7dbc96cee2
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0
4 changed files with 48 additions and 3 deletions

View file

@ -476,6 +476,8 @@ def get_domain_total_nb_correlation(correlation_dict):
total_correlation = 0 total_correlation = 0
if 'decoded' in correlation_dict: if 'decoded' in correlation_dict:
total_correlation += len(correlation_dict['decoded']) total_correlation += len(correlation_dict['decoded'])
if 'screenshot' in correlation_dict:
total_correlation += len(correlation_dict['screenshot'])
if 'cryptocurrency' in correlation_dict: if 'cryptocurrency' in correlation_dict:
total_correlation += correlation_dict['cryptocurrency'].get('nb', 0) total_correlation += correlation_dict['cryptocurrency'].get('nb', 0)
if 'pgp' in correlation_dict: if 'pgp' in correlation_dict:

View file

@ -32,7 +32,7 @@ def exist_screenshot(sha256_string):
def get_metadata(sha256_string): def get_metadata(sha256_string):
metadata_dict = {} metadata_dict = {}
metadata_dict['sha256'] = sha256_string metadata_dict['img'] = get_screenshot_rel_path(sha256_string)
return metadata_dict return metadata_dict

View file

@ -460,12 +460,16 @@ if (d.popover) {
desc = desc + "fa-times-circle\"></i>DOWN" desc = desc + "fa-times-circle\"></i>DOWN"
} }
desc = desc + "</div></dd>" desc = desc + "</div></dd>"
} else if (key!="tags" && key!="id") { } else if (key!="tags" && key!="id" && key!="img") {
desc = desc + "<dt class=\"col-sm-3 px-0\">" + sanitize_text(key) + "</dt><dd class=\"col-sm-9 px-0\">" + sanitize_text(data[key]) + "</dd>" desc = desc + "<dt class=\"col-sm-3 px-0\">" + sanitize_text(key) + "</dt><dd class=\"col-sm-9 px-0\">" + sanitize_text(data[key]) + "</dd>"
} }
}); });
desc = desc + "</dl>" desc = desc + "</dl>"
if (data["img"]) {
desc = desc + "<img src={{ url_for('showsavedpastes.screenshot', filename="") }}" + data["img"] +" class=\"img-thumbnail\" />";
}
if (data["tags"]) { if (data["tags"]) {
data["tags"].forEach(function(tag) { data["tags"].forEach(function(tag) {
desc = desc + "<span class=\"badge badge-warning\">"+ sanitize_text(tag) +"</span>"; desc = desc + "<span class=\"badge badge-warning\">"+ sanitize_text(tag) +"</span>";

View file

@ -270,7 +270,46 @@
{% endif %} {% endif %}
<!-- TODO: ADD HASH DECODED --> {% if 'screenshot' in dict_domain%}
<div id="accordionscreenshot" class="mt-3">
<div class="card">
<div class="card-header" id="headingScreenshot">
<div class="row">
<div class="col-11">
<div class="mt-2">
<i class="fas fa-lock-open"></i> Screenshot&nbsp;&nbsp;
<div class="badge badge-warning">{{dict_domain['screenshot']|length}}</div>
</div>
</div>
<div class="col-1">
<button class="btn btn-link collapsed rotate" data-toggle="collapse" data-target="#collapseScreenshot" aria-expanded="false" aria-controls="collapseDecoded">
<i class="fas fa-chevron-circle-down"></i>
</button>
</div>
</div>
</div>
<div id="collapseDecoded" class="collapse" aria-labelledby="headingDecoded" data-parent="#accordiondecoded">
<div class="card-body">
<table id="tabledecoded" class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Decoded</th>
</tr>
</thead>
<tbody>
{% for decoded in dict_domain['decoded']%}
<tr>
<td><a target="_blank" href="{{ url_for('correlation.show_correlation') }}?object_type=decoded&correlation_id={{ decoded }}&correlation_objects=domain">{{ decoded }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endif %}
{% if dict_domain["crawler_history"] %} {% if dict_domain["crawler_history"] %}
<hr class="my-4"> <hr class="my-4">