2019-08-14 09:44:49 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
|
|
|
<title>AIL Framework - AIL</title>
|
|
|
|
<link rel="icon" href="{{ url_for('static', filename='image/ail-icon.png') }}">
|
|
|
|
|
|
|
|
<!-- Core CSS -->
|
|
|
|
<link href="{{ url_for('static', filename='css/bootstrap4.min.css') }}" rel="stylesheet">
|
|
|
|
<link href="{{ url_for('static', filename='css/font-awesome.min.css') }}" rel="stylesheet">
|
|
|
|
<link href="{{ url_for('static', filename='css/daterangepicker.min.css') }}" rel="stylesheet">
|
2019-09-11 15:33:04 +02:00
|
|
|
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.min.css') }}" rel="stylesheet">
|
2019-08-14 09:44:49 +02:00
|
|
|
|
|
|
|
<!-- JS -->
|
|
|
|
<script src="{{ url_for('static', filename='js/jquery.js')}}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/popper.min.js')}}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/bootstrap4.min.js')}}"></script>
|
2019-09-11 15:33:04 +02:00
|
|
|
<script src="{{ url_for('static', filename='js/jquery.dataTables.min.js')}}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/dataTables.bootstrap.min.js')}}"></script>
|
2019-08-14 09:44:49 +02:00
|
|
|
<script language="javascript" src="{{ url_for('static', filename='js/d3.min.js') }}"></script>
|
2019-09-12 14:37:48 +02:00
|
|
|
<script src="{{ url_for('static', filename='js/d3/sparklines.js')}}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/d3/graphlinesgroup.js')}}"></script>
|
2019-08-14 09:44:49 +02:00
|
|
|
<script language="javascript" src="{{ url_for('static', filename='js/moment.min.js') }}"></script>
|
|
|
|
<script language="javascript" src="{{ url_for('static', filename='js/jquery.daterangepicker.min.js') }}"></script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.btn-link {
|
|
|
|
color: #000000
|
|
|
|
}
|
|
|
|
.mouse_pointer{
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
{% include 'nav_bar.html' %}
|
|
|
|
|
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="row">
|
|
|
|
|
2019-09-11 15:33:04 +02:00
|
|
|
{% include 'hunter/menu_sidebar.html' %}
|
2019-08-14 09:44:49 +02:00
|
|
|
|
|
|
|
<div class="col-12 col-lg-10" id="core_content">
|
|
|
|
|
|
|
|
<div class="card my-3">
|
|
|
|
<div class="card-header" style="background-color:#d9edf7;font-size: 15px">
|
2019-09-11 15:33:04 +02:00
|
|
|
<h4 class="text-secondary">{{ tracker_metadata['uuid'] }} </h4>
|
2019-09-13 16:33:34 +02:00
|
|
|
<div class="text-info">
|
|
|
|
{%if tracker_metadata['description']%}
|
|
|
|
{{ tracker_metadata['description'] }}
|
|
|
|
{%endif%}
|
|
|
|
<span class="btn-link btn-interaction mouse_pointer" title="Edit Tracker description" onclick="edit_description();"><i class="fas fa-pencil-alt" style="color:Red;"></i></span></th>
|
|
|
|
</div>
|
2019-08-14 09:44:49 +02:00
|
|
|
<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>Type</th>
|
2019-09-11 15:33:04 +02:00
|
|
|
<th>Tracker</th>
|
2019-08-14 09:44:49 +02:00
|
|
|
<th>Date added</th>
|
|
|
|
<th>Level</th>
|
|
|
|
<th>Created by</th>
|
|
|
|
<th>First seen</th>
|
|
|
|
<th>Last seen</th>
|
|
|
|
<th>Tags <span class="btn-link btn-interaction mouse_pointer" title="Edit Tags List" onclick="edit_tags();"><i class="fas fa-pencil-alt" style="color:Red;"></i></span></th>
|
|
|
|
<th>Email <span class="btn-link btn-interaction mouse_pointer" title="Edit Email List" onclick="edit_mails();"><i class="fas fa-pencil-alt" style="color:Red;"></i></span></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
2019-09-11 15:33:04 +02:00
|
|
|
<td>{{ tracker_metadata['type'] }}</td>
|
|
|
|
<td>{{ tracker_metadata['term'] }}</td>
|
|
|
|
<td>{{ tracker_metadata['date'][0:4] }}/{{ tracker_metadata['date'][4:6] }}/{{ tracker_metadata['date'][6:8] }}</td>
|
|
|
|
<td>{{ tracker_metadata['level'] }}</td>
|
|
|
|
<td>{{ tracker_metadata['user_id'] }}</td>
|
2019-08-14 09:44:49 +02:00
|
|
|
<td>
|
2019-09-11 15:33:04 +02:00
|
|
|
{% if tracker_metadata['first_seen'] %}
|
|
|
|
{{ tracker_metadata['first_seen'][0:4] }}/{{ tracker_metadata['first_seen'][4:6] }}/{{ tracker_metadata['first_seen'][6:8] }}
|
2019-08-14 09:44:49 +02:00
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
<td>
|
2019-09-11 15:33:04 +02:00
|
|
|
{% if tracker_metadata['last_seen'] %}
|
|
|
|
{{ tracker_metadata['last_seen'][0:4] }}/{{ tracker_metadata['last_seen'][4:6] }}/{{ tracker_metadata['last_seen'][6:8] }}
|
2019-08-14 09:44:49 +02:00
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
<td>
|
2019-09-11 15:33:04 +02:00
|
|
|
{% for tag in tracker_metadata['tags'] %}
|
2020-01-20 15:13:03 +01:00
|
|
|
<a href="{{ url_for('tags_ui.get_obj_by_tags') }}?object_type=item<ags={{ tag }}">
|
2019-08-14 09:44:49 +02:00
|
|
|
<span class="badge badge-{{ bootstrap_label[loop.index0 % 5] }}">{{ tag }}</span>
|
|
|
|
</a>
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
</td>
|
|
|
|
<td>
|
2019-09-11 15:33:04 +02:00
|
|
|
{% for mail in tracker_metadata['mails'] %}
|
2019-08-14 09:44:49 +02:00
|
|
|
{{ mail }}<br>
|
|
|
|
{% endfor %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-1">
|
|
|
|
<div id="sparkline"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
2019-09-13 16:33:34 +02:00
|
|
|
<div id="div_edit_description">
|
|
|
|
<form action="{{ url_for('hunter.update_tracker_description') }}" method='post'>
|
|
|
|
<input name="uuid" type="text" value="{{tracker_metadata['uuid']}}" hidden>
|
|
|
|
<div>Update this tracker description: </div>
|
|
|
|
<div class="input-group mb-2 mr-sm-2">
|
|
|
|
<div class="input-group-prepend">
|
|
|
|
<div class="input-group-text"><i class="fas fa-pencil-alt"></i></div>
|
|
|
|
</div>
|
|
|
|
<input id="description" name="description" class="form-control" placeholder="Tracker Description" type="text"
|
|
|
|
value="{%if tracker_metadata['description']%}{{tracker_metadata['description']}}{%endif%}">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<button class="btn btn-info">
|
|
|
|
<i class="fas fa-pencil-alt"></i> Edit Description
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2019-08-14 09:44:49 +02:00
|
|
|
<div id="div_edit_tags">
|
2019-09-11 15:33:04 +02:00
|
|
|
<form action="{{ url_for('hunter.update_tracker_tags') }}" method='post'>
|
|
|
|
<input name="uuid" type="text" value="{{tracker_metadata['uuid']}}" hidden>
|
2019-08-14 09:44:49 +02:00
|
|
|
<div>All Tags added for this tracker, space separated: </div>
|
|
|
|
<div class="input-group mb-2 mr-sm-2">
|
|
|
|
<div class="input-group-prepend">
|
|
|
|
<div class="input-group-text"><i class="fas fa-tag"></i></div>
|
|
|
|
</div>
|
|
|
|
<input id="tags" name="tags" class="form-control" placeholder="Tags (optional, space separated)" type="text"
|
2019-09-11 15:33:04 +02:00
|
|
|
value="{% for tag in tracker_metadata['tags'] %}{{tag}} {% endfor %}">
|
2019-08-14 09:44:49 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<button class="btn btn-info">
|
|
|
|
<i class="fas fa-pencil-alt"></i> Edit Tags
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="div_edit_mails">
|
2019-09-11 15:33:04 +02:00
|
|
|
<form action="{{ url_for('hunter.update_tracker_mails') }}" method='post'>
|
|
|
|
<input name="uuid" type="text" value="{{tracker_metadata['uuid']}}" hidden>
|
2019-08-14 09:44:49 +02:00
|
|
|
<div>All E-Mails to Notify for this tracker, space separated: </div>
|
|
|
|
<div class="input-group mb-2 mr-sm-2">
|
|
|
|
<div class="input-group-prepend">
|
|
|
|
<div class="input-group-text"><i class="fas fa-at"></i></div>
|
|
|
|
</div>
|
|
|
|
<input id="mails" name="mails" class="form-control" placeholder="E-Mails Notification (optional, space separated)" type="text"
|
2019-09-11 15:33:04 +02:00
|
|
|
value="{% for mail in tracker_metadata['mails'] %}{{mail}} {% endfor %}">
|
2019-08-14 09:44:49 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<button class="btn btn-info">
|
|
|
|
<i class="fas fa-pencil-alt"></i> Edit Email Notification
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2019-09-11 15:33:04 +02:00
|
|
|
<a href="{{ url_for('hunter.delete_tracker') }}?uuid={{tracker_metadata['uuid']}}" class="float-right" style="font-size: 15px">
|
2019-08-14 09:44:49 +02:00
|
|
|
<button class='btn btn-danger'><i class="fas fa-trash-alt"></i>
|
|
|
|
</button>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-09-11 15:33:04 +02:00
|
|
|
<div id="graphline" class="text-center"></div>
|
2019-08-14 09:44:49 +02:00
|
|
|
|
2019-09-11 15:33:04 +02:00
|
|
|
<div class="card mb-5 mt-1">
|
2019-08-14 09:44:49 +02:00
|
|
|
<div class="card-body">
|
|
|
|
|
|
|
|
<div class="row mb-3">
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="input-group" id="date-range-from">
|
|
|
|
<div class="input-group-prepend"><span class="input-group-text"><i class="far fa-calendar-alt" aria-hidden="true"></i></span></div>
|
2019-09-11 15:33:04 +02:00
|
|
|
<input class="form-control" id="date-range-from-input" placeholder="yyyy-mm-dd" value="{{ tracker_metadata['date_from'] }}" name="date_from" autocomplete="off">
|
2019-08-14 09:44:49 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="input-group" id="date-range-to">
|
|
|
|
<div class="input-group-prepend"><span class="input-group-text"><i class="far fa-calendar-alt" aria-hidden="true"></i></span></div>
|
2019-09-11 15:33:04 +02:00
|
|
|
<input class="form-control" id="date-range-to-input" placeholder="yyyy-mm-dd" value="{{ tracker_metadata['date_to'] }}" name="date_to" autocomplete="off">
|
2019-08-14 09:44:49 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<button class="btn btn-info" type="button" id="button-search-tags" onclick="getItems();">
|
|
|
|
<i class="fas fa-search"></i> Search Tracked Items
|
|
|
|
</button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-09-11 15:33:04 +02:00
|
|
|
{%if tracker_metadata['items']%}
|
|
|
|
<div class="mt-4">
|
|
|
|
<table class="table table-bordered table-hover" id="myTable_">
|
|
|
|
<thead class="thead-dark">
|
2019-08-14 09:44:49 +02:00
|
|
|
<tr>
|
2019-09-11 15:33:04 +02:00
|
|
|
<th>Date</th>
|
|
|
|
<th>Item Id</th>
|
2019-08-14 09:44:49 +02:00
|
|
|
</tr>
|
2019-09-11 15:33:04 +02:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
{% for item in tracker_metadata['items'] %}
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
{{item['date'][0:4]}}/{{item['date'][4:6]}}/{{item['date'][6:8]}}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a class="text-secondary" target="_blank" href="{{ url_for('showsavedpastes.showsavedpaste') }}?paste={{item['id']}}">
|
|
|
|
<div style="line-height:0.9;">{{ item['id'] }}</div>
|
|
|
|
</a>
|
|
|
|
<div class="mb-2">
|
|
|
|
{% for tag in item['tags'] %}
|
2020-01-20 15:13:03 +01:00
|
|
|
<a href="{{ url_for('tags_ui.get_obj_by_tags') }}?object_type=item<ags={{ tag }}">
|
2019-09-11 15:33:04 +02:00
|
|
|
<span class="badge badge-{{ bootstrap_label[loop.index0 % 5] }} pull-left">{{ tag }}</span>
|
|
|
|
</a>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2019-08-14 09:44:49 +02:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
$(document).ready(function(){
|
|
|
|
$('#div_edit_mails').hide();
|
2019-09-13 16:33:34 +02:00
|
|
|
$('#div_edit_tags').hide();edit_description
|
|
|
|
$('#div_edit_description').hide();
|
2019-08-14 09:44:49 +02:00
|
|
|
$("#page-Decoded").addClass("active");
|
|
|
|
|
|
|
|
$('#date-range-from').dateRangePicker({
|
|
|
|
separator : ' to ',
|
|
|
|
getValue: function(){
|
|
|
|
if ($('#date-range-from-input').val() && $('#date-range-to-input').val() )
|
|
|
|
return $('#date-range-from-input').val() + ' to ' + $('#date-range-to-input').val();
|
|
|
|
else
|
|
|
|
return '';
|
|
|
|
},
|
|
|
|
setValue: function(s,s1,s2){
|
|
|
|
$('#date-range-from-input').val(s1);
|
|
|
|
$('#date-range-to-input').val(s2);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$('#date-range-to').dateRangePicker({
|
|
|
|
separator : ' to ',
|
|
|
|
getValue: function(){
|
|
|
|
if ($('#date-range-from-input').val() && $('#date-range-to-input').val() )
|
|
|
|
return $('#date-range-from-input').val() + ' to ' + $('#date-range-to-input').val();
|
|
|
|
else
|
|
|
|
return '';
|
|
|
|
},
|
|
|
|
setValue: function(s,s1,s2){
|
|
|
|
$('#date-range-from-input').val(s1);
|
|
|
|
$('#date-range-to-input').val(s2);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2019-09-11 15:33:04 +02:00
|
|
|
$('#myTable_').DataTable({
|
|
|
|
"aLengthMenu": [[5, 10, 15, -1], [5, 10, 15, "All"]],
|
|
|
|
"iDisplayLength": 10,
|
2019-09-13 11:06:41 +02:00
|
|
|
"order": [[ 0, "asc" ]]
|
2019-09-11 15:33:04 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
sparkline("sparkline", {{ tracker_metadata['sparkline'] }}, {});
|
|
|
|
let div_width = $("#graphline").width();
|
|
|
|
$.getJSON( "{{ url_for('hunter.get_json_tracker_stats') }}?uuid={{ tracker_metadata['uuid'] }}{%if tracker_metadata['date_from']%}&date_from={{ tracker_metadata['date_from'] }}{%endif%}{%if tracker_metadata['date_to']%}&date_to={{ tracker_metadata['date_to'] }}{%endif%}",
|
|
|
|
function( data ) {multilines_group("graphline", data, {"width": div_width});}
|
|
|
|
);
|
|
|
|
|
2019-08-14 09:44:49 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
function toggle_sidebar(){
|
|
|
|
if($('#nav_menu').is(':visible')){
|
|
|
|
$('#nav_menu').hide();
|
|
|
|
$('#side_menu').removeClass('border-right')
|
|
|
|
$('#side_menu').removeClass('col-lg-2')
|
|
|
|
$('#core_content').removeClass('col-lg-10')
|
|
|
|
}else{
|
|
|
|
$('#nav_menu').show();
|
|
|
|
$('#side_menu').addClass('border-right')
|
|
|
|
$('#side_menu').addClass('col-lg-2')
|
|
|
|
$('#core_content').addClass('col-lg-10')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function edit_tags(){
|
|
|
|
$('#div_edit_mails').hide();
|
2019-09-13 16:33:34 +02:00
|
|
|
$('#div_edit_description').hide();
|
2019-08-14 09:44:49 +02:00
|
|
|
$('#div_edit_tags').show();
|
|
|
|
}
|
|
|
|
|
|
|
|
function edit_mails(){
|
|
|
|
$('#div_edit_tags').hide();
|
2019-09-13 16:33:34 +02:00
|
|
|
$('#div_edit_description').hide();
|
2019-08-14 09:44:49 +02:00
|
|
|
$('#div_edit_mails').show();
|
|
|
|
}
|
|
|
|
|
2019-09-13 16:33:34 +02:00
|
|
|
function edit_description(){
|
|
|
|
$('#div_edit_tags').hide();
|
|
|
|
$('#div_edit_mails').hide();
|
|
|
|
$('#div_edit_description').show();
|
|
|
|
}
|
|
|
|
|
2019-08-14 09:44:49 +02:00
|
|
|
function getItems() {
|
|
|
|
var date_from = $('#date-range-from-input').val();
|
|
|
|
var date_to =$('#date-range-to-input').val();
|
2019-09-11 15:33:04 +02:00
|
|
|
window.location.replace("{{ url_for('hunter.show_tracker') }}?uuid={{ tracker_metadata['uuid'] }}&date_from="+date_from+"&date_to="+date_to);
|
2019-08-14 09:44:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|