mirror of https://github.com/CIRCL/AIL-framework
211 lines
6.7 KiB
HTML
211 lines
6.7 KiB
HTML
<link href="{{ url_for('static', filename='css/tags.css') }}" rel="stylesheet" type="text/css" />
|
|
<script src="{{ url_for('static', filename='js/tags.js') }}"></script>
|
|
|
|
{% with modal_add_tags=dict_object['metadata_card']['add_tags_modal']%}
|
|
{% include 'modals/add_tags.html' %}
|
|
{% endwith %}
|
|
|
|
{% include 'modals/edit_tag.html' %}
|
|
|
|
<div class="card my-3">
|
|
<div class="card-header" style="background-color:#d9edf7;font-size: 15px">
|
|
<h4 class="text-secondary">{{ dict_object["correlation_id"] }} :</h4>
|
|
<ul class="list-group mb-2">
|
|
<li class="list-group-item py-0">
|
|
<div class="row">
|
|
<div class="col-md-10">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Object type</th>
|
|
<th>Estimated type</th>
|
|
<th>First seen</th>
|
|
<th>Last seen</th>
|
|
<th>Size (Kb)</th>
|
|
<th>Nb seen</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>{{ dict_object["object_type"] }}</td>
|
|
<td>
|
|
<svg height="26" width="26">
|
|
<g class="nodes">
|
|
<circle cx="13" cy="13" r="13" fill="orange"></circle>
|
|
<text x="13" y="13" text-anchor="middle" dominant-baseline="central" class="graph_node_icon {{ dict_object["metadata_card"]["icon"]["icon_class"] }}" font-size="16px">{{ dict_object["metadata_card"]["icon"]["icon_text"] }}</text>
|
|
</g>
|
|
</svg>
|
|
{{ dict_object["metadata"]["file_type"] }}
|
|
</td>
|
|
<td>{{ dict_object["metadata"]['first_seen'] }}</td>
|
|
<td>{{ dict_object["metadata"]['last_seen'] }}</td>
|
|
<td>{{ dict_object["metadata"]['size'] }}</td>
|
|
<td>{{ dict_object["metadata"]['nb_seen'] }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="col-md-1">
|
|
<div id="sparkline"></div>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
<li class="list-group-item py-0">
|
|
<br>
|
|
<div class="mb-3">
|
|
Tags:
|
|
{% for tag in dict_object["metadata"]['tags'] %}
|
|
<button class="btn btn-{{ bootstrap_label[loop.index0 % 5] }}" data-toggle="modal" data-target="#edit_tags_modal"
|
|
data-tagid="{{ tag }}" data-objtype="decoded" data-objid="{{ dict_object["correlation_id"] }}">
|
|
{{ tag }}
|
|
</button>
|
|
{% endfor %}
|
|
<button type="button" class="btn btn-light" data-toggle="modal" data-target="#add_tags_modal">
|
|
<i class="far fa-plus-square"></i>
|
|
</button>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
|
|
{% if dict_object["metadata_card"]["vt"]["status"] %}
|
|
{% if not "link" in dict_object["metadata_card"]["vt"] %}
|
|
<darkbutton>
|
|
<button id="submit_vt_b" class="btn btn-primary" onclick="sendFileToVT('{{ dict_object["correlation_id"] }}')" style="font-size: 15px">
|
|
<i class="fas fa-paper-plane"></i> Send this file to VT
|
|
</button>
|
|
</darkbutton>
|
|
{% else %}
|
|
<a class="btn btn-primary" target="_blank" href="{{ dict_object["metadata_card"]["vt"]["link"] }}" style="font-size: 15px"><i class="fas fa-link"></i> VT Report</a>
|
|
{% endif %}
|
|
<button class="btn btn-outline-secondary" onclick="updateVTReport('{{ dict_object["correlation_id"] }}')" style="font-size: 15px">
|
|
<div id="report_vt_b"><i class="fas fa-sync-alt"></i> {{ dict_object["metadata_card"]["vt"]["report"] }}</div>
|
|
</button>
|
|
{% else %}
|
|
Virus Total submission is disabled
|
|
{% endif %}
|
|
|
|
<a href="{{ url_for('hashDecoded.downloadHash') }}?hash={{ dict_object["correlation_id"] }}" target="blank" class="float-right" style="font-size: 15px">
|
|
<button class='btn btn-info'><i class="fas fa-download"></i> Download Decoded file
|
|
</button>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="{{ url_for('static', filename='js/d3/sparklines.js')}}"></script>
|
|
<script>
|
|
sparkline("sparkline", {{ dict_object["metadata_card"]["sparkline"] }}, {});
|
|
</script>
|
|
|
|
<script>
|
|
function sendFileToVT(hash) {
|
|
//send file to vt
|
|
$.getJSON("{{ url_for('hashDecoded.send_file_to_vt_js') }}?hash="+hash,
|
|
function(data) {
|
|
var content = '<a id="submit_vt_b" class="btn btn-primary" target="_blank" href="'+ data['vt_link'] +'"><i class="fas fa-link"> '+ ' VT Report' +'</i></a>';
|
|
$('#submit_vt_b').remove();
|
|
$('darkbutton').append(content);
|
|
});
|
|
}
|
|
|
|
function updateVTReport(hash) {
|
|
//updateReport
|
|
$.getJSON("{{ url_for('hashDecoded.update_vt_result') }}?hash="+hash,
|
|
function(data) {
|
|
var content = '<i class="fas fa-sync-alt"></i> ' +data['report_vt'];
|
|
$( "#report_vt_b" ).html(content);
|
|
});
|
|
}
|
|
|
|
</script>
|
|
|
|
<script>
|
|
function create_line_chart(id, url){
|
|
|
|
var width = 900;
|
|
var height = Math.round(width / 4);
|
|
|
|
var margin = {top: 20, right: 55, bottom: 50, left: 40};
|
|
|
|
var x = d3.scaleTime().range([0, width]);
|
|
var y = d3.scaleLinear().rangeRound([height, 0]);
|
|
|
|
var xAxis = d3.axisBottom(x);
|
|
var yAxis = d3.axisLeft(y);
|
|
|
|
var parseTime = d3.timeParse("%Y-%m-%d");
|
|
|
|
var line = d3.line()
|
|
.x(function(d) {
|
|
return x(d.date);
|
|
}).y(function(d) {
|
|
return y(d.value);
|
|
});
|
|
|
|
var svg_line = d3.select('#'+id).append('svg')
|
|
.attr("id", "graph_div")
|
|
.attr("width", width + margin.left + margin.right)
|
|
.attr("height", height + margin.top + margin.bottom)
|
|
.append('g')
|
|
.attr('transform', "translate("+ margin.left +","+ margin.top +")");
|
|
|
|
var div = d3.select('body').append('div')
|
|
.attr('class', 'tooltip')
|
|
.style('opacity', 0);
|
|
|
|
//add div tooltip
|
|
|
|
d3.json(url)
|
|
.then(function(data){
|
|
|
|
data.forEach(function(d) {
|
|
d.date_label = d.date;
|
|
d.date = parseTime(d.date);
|
|
d.value = +d.value;
|
|
});
|
|
|
|
// fit the data
|
|
x.domain(d3.extent(data, function(d) { return d.date; }));
|
|
//x.domain(data.map(function (d) { return d.date; })); //E
|
|
y.domain([0, d3.max(data, function(d){ return d.value ; })]);
|
|
|
|
//line
|
|
svg_line.append("path")
|
|
.data([data])
|
|
.attr("class", "line_graph")
|
|
.attr("d", line);
|
|
|
|
// add X axis
|
|
svg_line.append("g")
|
|
.attr("transform", "translate(0," + height + ")")
|
|
.call(d3.axisBottom(x))
|
|
.selectAll("text")
|
|
.style("text-anchor", "end")
|
|
.attr("transform", "rotate(-45)" );
|
|
|
|
// Add the Y Axis
|
|
svg_line.append("g")
|
|
.call(d3.axisLeft(y));
|
|
|
|
//add a dot circle
|
|
svg_line.selectAll('dot')
|
|
.data(data).enter()
|
|
.append('circle')
|
|
.attr('r', 2)
|
|
.attr('cx', function(d) { return x(d.date); })
|
|
.attr('cy', function(d) { return y(d.value); })
|
|
|
|
.on('mouseover', function(d) {
|
|
div.transition().style('opacity', .9);
|
|
div.html('' + d.date_label+ '<br/>' + d.value).style('left', (d3.event.pageX) + 'px')
|
|
.style("left", (d3.event.pageX) + "px")
|
|
.style("top", (d3.event.pageY - 28) + "px");
|
|
})
|
|
.on('mouseout', function(d)
|
|
{
|
|
div.transition().style('opacity', 0);
|
|
});
|
|
|
|
});
|
|
}
|
|
</script>
|