mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-26 15:57:16 +00:00
Merge branch 'master' into user_management
This commit is contained in:
commit
34786d54db
8 changed files with 457 additions and 569 deletions
|
@ -101,6 +101,13 @@ To upgrade from an existing AIL installation, you have to launch [python3_upgrad
|
|||
Docker Quick Start (Ubuntu 16.04 LTS)
|
||||
------------
|
||||
|
||||
:warning:
|
||||
Not maintained at the moment.
|
||||
If you are interested to get this running, please:
|
||||
|
||||
Fork -> Branch -> PR
|
||||
|
||||
|
||||
1. Install Docker
|
||||
```bash
|
||||
sudo su
|
||||
|
|
76
bin/helper/dump_crawler_history.py
Executable file
76
bin/helper/dump_crawler_history.py
Executable file
|
@ -0,0 +1,76 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*-coding:UTF-8 -*
|
||||
|
||||
import os
|
||||
import sys
|
||||
import gzip
|
||||
import datetime
|
||||
import redis
|
||||
import json
|
||||
import time
|
||||
|
||||
import shutil
|
||||
|
||||
sys.path.append(os.environ['AIL_BIN'])
|
||||
sys.path.append(os.path.join(os.environ['AIL_BIN'], 'packages'))
|
||||
from HiddenServices import HiddenServices
|
||||
from Helper import Process
|
||||
|
||||
def substract_date(date_from, date_to):
|
||||
date_from = datetime.date(int(date_from[0:4]), int(date_from[4:6]), int(date_from[6:8]))
|
||||
date_to = datetime.date(int(date_to[0:4]), int(date_to[4:6]), int(date_to[6:8]))
|
||||
delta = date_to - date_from # timedelta
|
||||
l_date = []
|
||||
for i in range(delta.days + 1):
|
||||
date = date_from + datetime.timedelta(i)
|
||||
l_date.append( date.strftime('%Y%m%d') )
|
||||
return l_date
|
||||
|
||||
config_section = 'Keys'
|
||||
p = Process(config_section)
|
||||
|
||||
r_serv_onion = redis.StrictRedis(
|
||||
host=p.config.get("ARDB_Onion", "host"),
|
||||
port=p.config.getint("ARDB_Onion", "port"),
|
||||
db=p.config.getint("ARDB_Onion", "db"),
|
||||
decode_responses=True)
|
||||
|
||||
date_from = '20190614'
|
||||
date_to = '20190615'
|
||||
service_type = 'onion'
|
||||
date_range = substract_date(date_from, date_to)
|
||||
|
||||
dir_path = os.path.join(os.environ['AIL_HOME'], 'temp')
|
||||
|
||||
domain_skipped = []
|
||||
|
||||
for date in date_range:
|
||||
domains_up = list(r_serv_onion.smembers('{}_up:{}'.format(service_type, date)))
|
||||
if domains_up:
|
||||
save_path = os.path.join(dir_path, date[0:4], date[4:6], date[6:8])
|
||||
try:
|
||||
os.makedirs(save_path)
|
||||
except FileExistsError:
|
||||
pass
|
||||
for domain in domains_up:
|
||||
print(domain)
|
||||
h = HiddenServices(domain, 'onion')
|
||||
item_core = h.get_domain_crawled_core_item()
|
||||
if 'root_item' in item_core:
|
||||
l_pastes = h.get_last_crawled_pastes(item_root=item_core['root_item'])
|
||||
try:
|
||||
res = h.create_domain_basic_archive(l_pastes)
|
||||
filename = os.path.join(save_path, '{}'.format(domain))
|
||||
with open(filename, 'wb') as f:
|
||||
shutil.copyfileobj(res, f)
|
||||
print('done')
|
||||
except Exception as e:
|
||||
print('skipped')
|
||||
domain_skipped.append(domain)
|
||||
pass
|
||||
|
||||
print()
|
||||
print()
|
||||
print('DOMAINS SKIPPED: ')
|
||||
for domain in domain_skipped:
|
||||
print(domain)
|
|
@ -214,7 +214,7 @@ def misp_create_event(distribution, threat_level_id, analysis, info, l_tags, pub
|
|||
leak_obj.add_attribute('duplicate_number', value=p_duplicate_number, type='counter')
|
||||
|
||||
try:
|
||||
templateID = [x['ObjectTemplate']['id'] for x in pymisp.get_object_templates_list() if x['ObjectTemplate']['name'] == obj_name][0]
|
||||
templateID = [x['ObjectTemplate']['id'] for x in pymisp.get_object_templates_list()['response'] if x['ObjectTemplate']['name'] == obj_name][0]
|
||||
except IndexError:
|
||||
valid_types = ", ".join([x['ObjectTemplate']['name'] for x in pymisp.get_object_templates_list()])
|
||||
print ("Template for type {} not found! Valid types are: {%s}".format(obj_name, valid_types))
|
||||
|
@ -285,7 +285,7 @@ def PasteSubmit_page():
|
|||
#active galaxies
|
||||
active_galaxies = r_serv_tags.smembers('active_galaxies')
|
||||
|
||||
return render_template("PasteSubmit.html",
|
||||
return render_template("submit_items.html",
|
||||
active_taxonomies = active_taxonomies,
|
||||
active_galaxies = active_galaxies)
|
||||
|
||||
|
@ -360,7 +360,7 @@ def submit():
|
|||
|
||||
launch_submit(ltags, ltagsgalaxies, paste_content, UUID, password ,True)
|
||||
|
||||
return render_template("submiting.html",
|
||||
return render_template("submit_items.html",
|
||||
active_taxonomies = active_taxonomies,
|
||||
active_galaxies = active_galaxies,
|
||||
UUID = UUID)
|
||||
|
@ -383,7 +383,7 @@ def submit():
|
|||
|
||||
launch_submit(ltags, ltagsgalaxies, paste_content, UUID, password)
|
||||
|
||||
return render_template("submiting.html",
|
||||
return render_template("submit_items.html",
|
||||
active_taxonomies = active_taxonomies,
|
||||
active_galaxies = active_galaxies,
|
||||
UUID = UUID)
|
||||
|
|
|
@ -1,203 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Submit Paste - AIL</title>
|
||||
<link rel="icon" href="{{ url_for('static', filename='image/ail-icon.png') }}">
|
||||
|
||||
<!-- Core CSS -->
|
||||
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
|
||||
<link href="{{ url_for('static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet">
|
||||
<link href="{{ url_for('static', filename='css/sb-admin-2.css') }}" rel="stylesheet">
|
||||
<link href="{{ url_for('static', filename='css/dygraph_gallery.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ url_for('static', filename='css/tags.css') }}" rel="stylesheet" type="text/css" />
|
||||
<!-- JS -->
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='js/dygraph-combined.js') }}"></script>
|
||||
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js')}}"></script>
|
||||
<script src="{{ url_for('static', filename='js/jquery.flot.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/jquery.flot.pie.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/jquery.flot.time.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/tags.js') }}"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{% include 'navbar.html' %}
|
||||
|
||||
<div id="page-wrapper">
|
||||
<div class="row">
|
||||
<!-- /.col-lg-12 -->
|
||||
|
||||
|
||||
|
||||
<form action="{{ url_for('PasteSubmit.submit') }}" id="pasteSubmitForm" method="post" enctype=multipart/form-data onsubmit="submitPaste()">
|
||||
|
||||
<input type="hidden" id="tags_taxonomies" name="tags_taxonomies" value="test">
|
||||
<input type="hidden" id="tags_galaxies" name="tags_galaxies" value="test">
|
||||
|
||||
<div class="panel panel-primary pull-left" style="width: 40%;">
|
||||
<div class="panel-heading">Files submission
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="file">Submit a file </label>
|
||||
<input type="file" class="form-control-file" id="file" name="file">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="paste_name">Archive Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" placeholder="Optionnal">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-info pull-right" style="width: auto;">
|
||||
<div class="panel-heading"> Tags :
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
|
||||
<div class="form-group input-group" >
|
||||
<input id="ltags" style="width:450%;" type="text">
|
||||
</div>
|
||||
|
||||
<div class="btn-group btn-block">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle btn-block" data-toggle="dropdown">Taxonomie Selection
|
||||
<i class="fa fa-chevron-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu scrollable-menu" role="menu">
|
||||
<li><a href="#" id="all-tags-taxonomies">All Tags <i class="fa fa-tags"></i></a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
{% for taxo in active_taxonomies %}
|
||||
<li><a href="#" id="{{ taxo }}-id{{ loop.index0 }}">{{ taxo }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
|
||||
<div class="form-group input-group" >
|
||||
<input id="ltagsgalaxies" style="width:450%;" type="text">
|
||||
</div>
|
||||
|
||||
<div class="btn-group btn-block">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle btn-block" data-toggle="dropdown">Galaxy Selection
|
||||
<i class="fa fa-chevron-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu scrollable-menu" role="menu">
|
||||
<li><a href="#" id="all-tags-galaxies">All Tags <i class="fa fa-tags"></i></a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
{% for galaxy in active_galaxies %}
|
||||
<li><a href="#" id="{{ galaxy }}-idgalax{{ loop.index0 }}">{{ galaxy }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="paste_content" name="paste_content" rows="25"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button class="btn btn-primary " name="submit" type="submit">Submit this paste</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<!-- /.row -->
|
||||
|
||||
</div>
|
||||
<!-- /#page-wrapper -->
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
<script>
|
||||
var ltags
|
||||
var ltagsgalaxies
|
||||
$(document).ready(function(){
|
||||
|
||||
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
|
||||
function(data) {
|
||||
|
||||
ltags = $('#ltags').tagSuggest({
|
||||
data: data,
|
||||
maxDropHeight: 200,
|
||||
name: 'ltags'
|
||||
});
|
||||
});
|
||||
|
||||
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
|
||||
function(data) {
|
||||
|
||||
ltagsgalaxies = $('#ltagsgalaxies').tagSuggest({
|
||||
data: data,
|
||||
maxDropHeight: 200,
|
||||
name: 'ltagsgalaxies'
|
||||
});
|
||||
});
|
||||
|
||||
activePage = "page-PasteSubmit"
|
||||
$("#"+activePage).addClass("active");
|
||||
|
||||
$('#modalsubmit').modal({backdrop: 'static'})
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function submitPaste(){
|
||||
document.getElementById("tags_taxonomies").value = ltags.getValue();
|
||||
document.getElementById("tags_galaxies").value = ltagsgalaxies.getValue();
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
jQuery("#all-tags-taxonomies").click(function(e){
|
||||
//change input tags list
|
||||
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
|
||||
function(data) {
|
||||
ltags.setData(data)
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<script>
|
||||
jQuery("#all-tags-galaxies").click(function(e){
|
||||
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
|
||||
function(data) {
|
||||
ltagsgalaxies.setData(data)
|
||||
});
|
||||
});
|
||||
|
||||
{% for taxo in active_taxonomies %}
|
||||
jQuery("#{{ taxo }}-id{{ loop.index0 }}").click(function(e){
|
||||
$.getJSON("{{ url_for('Tags.get_tags_taxonomie') }}?taxonomie={{ taxo }}",
|
||||
function(data) {
|
||||
ltags.setData(data)
|
||||
});
|
||||
});
|
||||
{% endfor %}
|
||||
</script>
|
||||
<script>
|
||||
{% for galaxy in active_galaxies %}
|
||||
jQuery("#{{ galaxy }}-idgalax{{ loop.index0 }}").click(function(e){
|
||||
$.getJSON("{{ url_for('Tags.get_tags_galaxy') }}?galaxy={{ galaxy }}",
|
||||
function(data) {
|
||||
ltagsgalaxies.setData(data)
|
||||
});
|
||||
});
|
||||
{% endfor %}
|
||||
</script>
|
||||
|
||||
</html>
|
356
var/www/modules/PasteSubmit/templates/submit_items.html
Normal file
356
var/www/modules/PasteSubmit/templates/submit_items.html
Normal file
|
@ -0,0 +1,356 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>AIL-Framework</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/tags.css') }}" rel="stylesheet" type="text/css" />
|
||||
|
||||
<!-- 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>
|
||||
<script src="{{ url_for('static', filename='js/tags.js') }}"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{% if UUID %}
|
||||
<div id="modalsubmit" class="modal fade" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
|
||||
<div id="mymodalcontent" class="modal-content">
|
||||
<div class="modal-header" style="border-bottom: 4px solid #cccccc; background-color: #cccccc; color: #ffffff;">
|
||||
<p class="heading"><h1>Submitting Items ...</h1></p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="progress mt-1" id="pr" hidden>
|
||||
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar"
|
||||
aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%" id="progress-bar">
|
||||
0%
|
||||
</div>
|
||||
</div>
|
||||
<span class="btn btn-info mt-2" id="files_submitted_btn" hidden>
|
||||
Files Submitted <span class="badge badge-light" id="files_submitted">1 / 1</span>
|
||||
</span>
|
||||
|
||||
<button class="btn btn-lg btn-warning" style="margin: auto;" id="loading_button">
|
||||
<i class="fas fa-sync-alt fa-spin"></i>
|
||||
Loading . . .
|
||||
</button>
|
||||
|
||||
<br></br>
|
||||
|
||||
<div class="card border-danger" id="panel_error" hidden>
|
||||
<div class="card-header bg-danger text-white">ERROR</div>
|
||||
<div class="card-body">
|
||||
<p id="error_message">error</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list-group" id="submit_pastes" hidden>
|
||||
<li class="list-group-item bg-dark text-white">Submitted Items</li>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-light text-secondary" href="{{ url_for('Tags.Tags_page') }}?ltags=infoleak:submission="manual"" target="_blank" id="submit_result" hidden>
|
||||
<i class="fas fa-paper-plane fa-2x"></i>
|
||||
<span class="label-icon">Submitted Items </span>
|
||||
</a>
|
||||
<button class="btn btn-success btn-tags ml-auto" data-dismiss="modal" id="success_submit_button" hidden>
|
||||
<span class="label-icon">Success </span>
|
||||
<i class="fas fa-check"></i>
|
||||
</button>
|
||||
<button class="btn btn-danger btn-tags ml-auto" data-dismiss="modal" id="error_submit_button" hidden>
|
||||
<span class="label-icon">ERROR </span>
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% include 'nav_bar.html' %}
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
|
||||
{% include 'item_submit/menu_sidebar.html' %}
|
||||
|
||||
<div class="col-12 col-lg-10" id="core_content">
|
||||
|
||||
<form action="{{ url_for('PasteSubmit.submit') }}" id="pasteSubmitForm" method="post" enctype=multipart/form-data onsubmit="submitPaste()">
|
||||
|
||||
<input type="hidden" id="tags_taxonomies" name="tags_taxonomies" value="test">
|
||||
<input type="hidden" id="tags_galaxies" name="tags_galaxies" value="test">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-5">
|
||||
|
||||
<div class="card mt-2">
|
||||
<div class="card-header text-white" style="background-color: #337ab7;">
|
||||
Files submission
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="file">Submit a file</label>
|
||||
<input type="file" class="form-control-file" id="file" name="file">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="paste_name">Archive Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" placeholder="Optionnal">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-xl-7">
|
||||
|
||||
<div class="card mt-2">
|
||||
<div class="card-header text-white" style="background-color: #337ab7;">
|
||||
Tags :
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="input-group" >
|
||||
<input id="ltags" type="text" class="form-control" autocomplete="off">
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-info dropdown-toggle mt-1 mb-3" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Taxonomie Selected
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-right"> <!-- TODO: make dropdown-scrollable -->
|
||||
<h6 class="dropdown-header">Taxonomie Tags</h6>
|
||||
<button class="dropdown-item" type="button" id="all-tags-taxonomies">All Tags <i class="fas fa-tags"></i></button>
|
||||
<div class="dropdown-divider"></div>
|
||||
{% for taxo in active_taxonomies %}
|
||||
<button class="dropdown-item" type="button" id="{{ taxo }}-id{{ loop.index0 }}">{{ taxo }}</button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="ltagsgalaxies" type="text" class="form-control" autocomplete="off">
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-info dropdown-toggle mt-1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Galaxy Selected
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-right"> <!-- TODO: make dropdown-scrollable -->
|
||||
<h6 class="dropdown-header">Galaxy Tags</h6>
|
||||
<button class="dropdown-item" type="button" id="all-tags-galaxies">All Tags <i class="fas fa-tags"></i></button>
|
||||
<div class="dropdown-divider"></div>
|
||||
{% for galaxy in active_galaxies %}
|
||||
<button class="dropdown-item" type="button" id="{{ galaxy }}-idgalax{{ loop.index0 }}">{{ galaxy }}</button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-3">
|
||||
<textarea class="form-control" id="paste_content" name="paste_content" rows="25"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button class="btn btn-primary " name="submit" type="submit">Submit Item</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
<script>
|
||||
var ltags
|
||||
var ltagsgalaxies
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#page-items-submit").addClass("active");
|
||||
|
||||
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
|
||||
function(data) {
|
||||
|
||||
ltags = $('#ltags').tagSuggest({
|
||||
data: data,
|
||||
maxDropHeight: 200,
|
||||
name: 'ltags'
|
||||
});
|
||||
});
|
||||
|
||||
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
|
||||
function(data) {
|
||||
|
||||
ltagsgalaxies = $('#ltagsgalaxies').tagSuggest({
|
||||
data: data,
|
||||
maxDropHeight: 200,
|
||||
name: 'ltagsgalaxies'
|
||||
});
|
||||
});
|
||||
|
||||
$('#modalsubmit').modal({backdrop: 'static'})
|
||||
});
|
||||
|
||||
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')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function submitPaste(){
|
||||
document.getElementById("tags_taxonomies").value = ltags.getValue();
|
||||
document.getElementById("tags_galaxies").value = ltagsgalaxies.getValue();
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
jQuery("#all-tags-taxonomies").click(function(e){
|
||||
//change input tags list
|
||||
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
|
||||
function(data) {
|
||||
ltags.setData(data)
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<script>
|
||||
jQuery("#all-tags-galaxies").click(function(e){
|
||||
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
|
||||
function(data) {
|
||||
ltagsgalaxies.setData(data)
|
||||
});
|
||||
});
|
||||
|
||||
{% for taxo in active_taxonomies %}
|
||||
jQuery("#{{ taxo }}-id{{ loop.index0 }}").click(function(e){
|
||||
$.getJSON("{{ url_for('Tags.get_tags_taxonomie') }}?taxonomie={{ taxo }}",
|
||||
function(data) {
|
||||
ltags.setData(data)
|
||||
});
|
||||
});
|
||||
{% endfor %}
|
||||
</script>
|
||||
<script>
|
||||
{% for galaxy in active_galaxies %}
|
||||
jQuery("#{{ galaxy }}-idgalax{{ loop.index0 }}").click(function(e){
|
||||
$.getJSON("{{ url_for('Tags.get_tags_galaxy') }}?galaxy={{ galaxy }}",
|
||||
function(data) {
|
||||
ltagsgalaxies.setData(data)
|
||||
});
|
||||
});
|
||||
{% endfor %}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var i = 0;
|
||||
var err = 0;
|
||||
$(".progress-bar").css("width", i + "%").text(i + " %");
|
||||
function makeProgress(){
|
||||
|
||||
$.getJSON("{{ url_for('PasteSubmit.submit_status') }}?UUID={{ UUID }}",
|
||||
function(data) {
|
||||
|
||||
var end = data.end;
|
||||
var prog = data.prog;
|
||||
var in_progress = data.in_progress;
|
||||
var processing = data.processing;
|
||||
var isError = data.isError;
|
||||
var error = data.error;
|
||||
|
||||
if(processing){
|
||||
$("#loading_button").hide();
|
||||
$("#pr").removeAttr('hidden');
|
||||
$("#files_submitted_btn").removeAttr('hidden');
|
||||
}
|
||||
|
||||
if(i < 100){
|
||||
$(".progress-bar").css("width", prog + "%").text(prog + " %");
|
||||
}
|
||||
|
||||
if(!end){
|
||||
|
||||
document.getElementById('files_submitted').innerHTML = in_progress;
|
||||
|
||||
//error handler
|
||||
if(isError){
|
||||
document.getElementById('error_message').innerHTML = error;
|
||||
$("#panel_error").removeAttr('hidden');
|
||||
$("#error_submit_button").removeAttr('hidden');
|
||||
err = err + 1;
|
||||
}
|
||||
|
||||
// Wait for sometime before running this script again
|
||||
if(err < 100){
|
||||
setTimeout("makeProgress()", 100);
|
||||
}
|
||||
} else {
|
||||
document.getElementById('files_submitted').innerHTML = in_progress;
|
||||
$("#progress-bar").removeClass('progress-bar-animated');
|
||||
$("#submit_result").removeAttr('hidden');
|
||||
|
||||
if(isError){
|
||||
document.getElementById('error_message').innerHTML = error;
|
||||
$("#panel_error").removeAttr('hidden');
|
||||
$("#error_submit_button").removeAttr('hidden');
|
||||
|
||||
} else {
|
||||
$("#success_submit_button").removeAttr('hidden');
|
||||
}
|
||||
|
||||
if(in_progress == '0 / '){
|
||||
document.getElementById('files_submitted').innerHTML = '0 / 0'
|
||||
$(".progress-bar").css("width", "100%").text("100 %");
|
||||
$("#progress-bar").addClass('bg-danger')
|
||||
} else {
|
||||
var link = data.link;
|
||||
$("#submit_pastes").append(link);
|
||||
$("#submit_pastes").removeAttr('hidden');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
makeProgress();
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</html>
|
|
@ -1,361 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Submit Paste - AIL</title>
|
||||
<link rel="icon" href="{{ url_for('static', filename='image/ail-icon.png') }}">
|
||||
|
||||
<!-- Core CSS -->
|
||||
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
|
||||
<link href="{{ url_for('static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet">
|
||||
<link href="{{ url_for('static', filename='css/sb-admin-2.css') }}" rel="stylesheet">
|
||||
<link href="{{ url_for('static', filename='css/dygraph_gallery.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ url_for('static', filename='css/tags.css') }}" rel="stylesheet" type="text/css" />
|
||||
<!-- JS -->
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='js/dygraph-combined.js') }}"></script>
|
||||
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js')}}"></script>
|
||||
<script src="{{ url_for('static', filename='js/jquery.flot.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/jquery.flot.pie.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/jquery.flot.time.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/tags.js') }}"></script>
|
||||
|
||||
<style>
|
||||
.glyphicon-refresh-animate {
|
||||
-animation: spin .7s infinite linear;
|
||||
-webkit-animation: spin2 .7s infinite linear;
|
||||
}
|
||||
|
||||
@-webkit-keyframes spin2 {
|
||||
from { -webkit-transform: rotate(0deg);}
|
||||
to { -webkit-transform: rotate(360deg);}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
from { transform: scale(1) rotate(0deg);}
|
||||
to { transform: scale(1) rotate(360deg);}
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{% include 'navbar.html' %}
|
||||
|
||||
<div id="page-wrapper">
|
||||
<div class="row">
|
||||
<!-- /.col-lg-12 -->
|
||||
|
||||
<form action="{{ url_for('PasteSubmit.submit') }}" id="pasteSubmitForm" method="post" enctype=multipart/form-data onsubmit="submitPaste()">
|
||||
|
||||
<input type="hidden" id="tags_taxonomies" name="tags_taxonomies" value="test">
|
||||
<input type="hidden" id="tags_galaxies" name="tags_galaxies" value="test">
|
||||
|
||||
<div class="panel panel-primary pull-left" style="width: 40%;">
|
||||
<div class="panel-heading">Files submission
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="file">Submit a file</label>
|
||||
<input type="file" class="form-control-file" id="file" name="file">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="paste_name">Archive Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" placeholder="Optionnal">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-info pull-right" style="width: auto;">
|
||||
<div class="panel-heading"> Tags :
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
|
||||
<div class="form-group input-group" >
|
||||
<input id="ltags" style="width:450%;" type="text">
|
||||
</div>
|
||||
|
||||
<div class="btn-group btn-block">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle btn-block" data-toggle="dropdown">Taxonomie Selection
|
||||
<i class="fa fa-chevron-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu scrollable-menu" role="menu">
|
||||
<li><a href="#" id="all-tags-taxonomies">All Tags <i class="fa fa-tags"></i></a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
{% for taxo in active_taxonomies %}
|
||||
<li><a href="#" id="{{ taxo }}-id{{ loop.index0 }}">{{ taxo }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
|
||||
<div class="form-group input-group" >
|
||||
<input id="ltagsgalaxies" style="width:450%;" type="text">
|
||||
</div>
|
||||
|
||||
<div class="btn-group btn-block">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle btn-block" data-toggle="dropdown">Galaxy Selection
|
||||
<i class="fa fa-chevron-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu scrollable-menu" role="menu">
|
||||
<li><a href="#" id="all-tags-galaxies">All Tags <i class="fa fa-tags"></i></a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
{% for galaxy in active_galaxies %}
|
||||
<li><a href="#" id="{{ galaxy }}-idgalax{{ loop.index0 }}">{{ galaxy }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="paste_content" name="paste_content" rows="25"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button class="btn btn-primary " name="submit" type="submit">Submit this paste</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<!-- /.row -->
|
||||
|
||||
</div>
|
||||
<!-- /#page-wrapper -->
|
||||
</div>
|
||||
|
||||
<div id="modalsubmit" class="modal fade" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
|
||||
<!-- Modal content-->
|
||||
<div id="mymodalcontent" class="modal-content">
|
||||
<div class="modal-header" style="border-bottom: 4px solid #cccccc; background-color: #cccccc; color: #ffffff;">
|
||||
<p class="heading"><h1>Submitting Pastes ...</h1></p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<br></br>
|
||||
|
||||
<div class="progress hidden" id="pr">
|
||||
<div class="progress-bar progress-bar-striped active" role="progressbar"
|
||||
aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%" id="progress-bar">
|
||||
0%
|
||||
</div>
|
||||
</div>
|
||||
<span class="btn btn-info hidden" id="files_submitted_btn">
|
||||
Files Submitted <span class="badge badge-light" id="files_submitted">1 / 1</span>
|
||||
</span>
|
||||
|
||||
<button class="btn btn-lg btn-warning" style="margin: auto;" id="loading_button">
|
||||
<span class="glyphicon glyphicon-refresh glyphicon-refresh-animate">
|
||||
</span> Loading . . .
|
||||
</button>
|
||||
|
||||
<br></br>
|
||||
|
||||
<div class="panel panel-danger hidden" id="panel_error">
|
||||
<div class="panel-heading">ERROR</div>
|
||||
<div class="panel-body">
|
||||
<p id="error_message">error</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list-group hidden" id="submit_pastes">
|
||||
<li class="list-group-item active">Submitted pastes</li>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-success btn-tags hidden " data-dismiss="modal" id="success_submit_button">
|
||||
<span class="label-icon">Success </span>
|
||||
<i class="fa fa-check"></i>
|
||||
</button>
|
||||
<button class="btn btn-danger btn-tags hidden" data-dismiss="modal" id="error_submit_button">
|
||||
<span class="label-icon">ERROR </span>
|
||||
<i class="fa fa-times"></i>
|
||||
</button>
|
||||
<a class="btn btn-tags pull-left hidden" href="{{ url_for('Tags.Tags_page') }}?ltags=infoleak:submission="manual"" target="_blank" id="submit_result">
|
||||
<span class="label-icon">Submitted Pastes </span>
|
||||
<i class="fa fa-paper-plane fa-2x"></i>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
<script>
|
||||
var ltags
|
||||
var ltagsgalaxies
|
||||
$(document).ready(function(){
|
||||
|
||||
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
|
||||
function(data) {
|
||||
|
||||
ltags = $('#ltags').tagSuggest({
|
||||
data: data,
|
||||
maxDropHeight: 200,
|
||||
name: 'ltags'
|
||||
});
|
||||
});
|
||||
|
||||
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
|
||||
function(data) {
|
||||
|
||||
ltagsgalaxies = $('#ltagsgalaxies').tagSuggest({
|
||||
data: data,
|
||||
maxDropHeight: 200,
|
||||
name: 'ltagsgalaxies'
|
||||
});
|
||||
});
|
||||
|
||||
activePage = "page-PasteSubmit"
|
||||
$("#"+activePage).addClass("active");
|
||||
|
||||
$('#modalsubmit').modal({backdrop: 'static'})
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function submitPaste(){
|
||||
document.getElementById("tags_taxonomies").value = ltags.getValue();
|
||||
document.getElementById("tags_galaxies").value = ltagsgalaxies.getValue();
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
jQuery("#all-tags-taxonomies").click(function(e){
|
||||
//change input tags list
|
||||
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
|
||||
function(data) {
|
||||
ltags.setData(data)
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<script>
|
||||
jQuery("#all-tags-galaxies").click(function(e){
|
||||
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
|
||||
function(data) {
|
||||
ltagsgalaxies.setData(data)
|
||||
});
|
||||
});
|
||||
|
||||
{% for taxo in active_taxonomies %}
|
||||
jQuery("#{{ taxo }}-id{{ loop.index0 }}").click(function(e){
|
||||
$.getJSON("{{ url_for('Tags.get_tags_taxonomie') }}?taxonomie={{ taxo }}",
|
||||
function(data) {
|
||||
ltags.setData(data)
|
||||
});
|
||||
});
|
||||
{% endfor %}
|
||||
</script>
|
||||
<script>
|
||||
{% for galaxy in active_galaxies %}
|
||||
jQuery("#{{ galaxy }}-idgalax{{ loop.index0 }}").click(function(e){
|
||||
$.getJSON("{{ url_for('Tags.get_tags_galaxy') }}?galaxy={{ galaxy }}",
|
||||
function(data) {
|
||||
ltagsgalaxies.setData(data)
|
||||
});
|
||||
});
|
||||
{% endfor %}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var i = 0;
|
||||
var err = 0;
|
||||
$(".progress-bar").css("width", i + "%").text(i + " %");
|
||||
function makeProgress(){
|
||||
|
||||
$.getJSON("{{ url_for('PasteSubmit.submit_status') }}?UUID={{ UUID }}",
|
||||
function(data) {
|
||||
|
||||
var end = data.end;
|
||||
var prog = data.prog;
|
||||
var in_progress = data.in_progress;
|
||||
var processing = data.processing;
|
||||
var isError = data.isError;
|
||||
var error = data.error;
|
||||
|
||||
if(processing){
|
||||
$("#loading_button").addClass('hidden');
|
||||
$("#pr").removeClass('hidden');
|
||||
$("#files_submitted_btn").removeClass('hidden');
|
||||
}
|
||||
|
||||
if(i < 100){
|
||||
$(".progress-bar").css("width", prog + "%").text(prog + " %");
|
||||
}
|
||||
|
||||
if(!end){
|
||||
|
||||
document.getElementById('files_submitted').innerHTML = in_progress;
|
||||
|
||||
//error handler
|
||||
if(isError){
|
||||
document.getElementById('error_message').innerHTML = error;
|
||||
$("#panel_error").removeClass('hidden');
|
||||
$("#error_submit_button").removeClass('hidden');
|
||||
err = err + 1;
|
||||
}
|
||||
|
||||
// Wait for sometime before running this script again
|
||||
if(err < 100){
|
||||
setTimeout("makeProgress()", 100);
|
||||
}
|
||||
} else {
|
||||
document.getElementById('files_submitted').innerHTML = in_progress;
|
||||
$("#progress-bar").removeClass('active');
|
||||
$("#submit_result").removeClass('hidden');
|
||||
|
||||
if(isError){
|
||||
document.getElementById('error_message').innerHTML = error;
|
||||
$("#panel_error").removeClass('hidden');
|
||||
$("#error_submit_button").removeClass('hidden');
|
||||
|
||||
} else {
|
||||
$("#success_submit_button").removeClass('hidden');
|
||||
}
|
||||
|
||||
if(in_progress == '0 / '){
|
||||
document.getElementById('files_submitted').innerHTML = '0 / 0'
|
||||
$(".progress-bar").css("width", "100%").text("100 %");
|
||||
$("#progress-bar").addClass('progress-bar-danger')
|
||||
} else {
|
||||
var link = data.link;
|
||||
$("#submit_pastes").append(link);
|
||||
$("#submit_pastes").removeClass('hidden');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
makeProgress();
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</html>
|
13
var/www/templates/item_submit/menu_sidebar.html
Normal file
13
var/www/templates/item_submit/menu_sidebar.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<div class="col-12 col-lg-2 p-0 bg-light border-right" id="side_menu">
|
||||
|
||||
<button type="button" class="btn btn-outline-secondary mt-1 ml-3" onclick="toggle_sidebar()">
|
||||
<i class="fas fa-align-left"></i>
|
||||
<span>Toggle Sidebar</span>
|
||||
</button>
|
||||
|
||||
<nav class="navbar navbar-expand navbar-light bg-light flex-md-column flex-row align-items-start py-2" id="nav_menu">
|
||||
<h5 class="d-flex w-100">
|
||||
<span>Submit Items </span>
|
||||
</h5>
|
||||
</nav>
|
||||
</div>
|
|
@ -13,7 +13,7 @@
|
|||
<a class="nav-link mr-3" id="page-Dashboard" href="{{ url_for('dashboard.index') }}">Home</a>
|
||||
</li>
|
||||
<li class="nav-item mr-3">
|
||||
<a class="nav-link" href="{{ url_for('PasteSubmit.PasteSubmit_page') }}" aria-disabled="true"><i class="fas fa-external-link-alt"></i> Submit</a>
|
||||
<a class="nav-link" id="page-items-submit" href="{{ url_for('PasteSubmit.PasteSubmit_page') }}" aria-disabled="true"><i class="fas fa-external-link-alt"></i> Submit</a>
|
||||
</li>
|
||||
<li class="nav-item mr-3">
|
||||
<a class="nav-link" id="page-Browse-Items" href="{{ url_for('Tags.Tags_page') }}" aria-disabled="true"><i class="fas fa-tag"></i> Browse Items</a>
|
||||
|
|
Loading…
Reference in a new issue