mirror of https://github.com/CIRCL/AIL-framework
fix: [screenshot canevas + domain link] fix item domain link + screenshot canevas: chg colors and icons for unsafe tags
parent
0ec56cf1ed
commit
2d02251456
|
@ -20,8 +20,6 @@ import ssdeep
|
||||||
import Paste
|
import Paste
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from pyfaup.faup import Faup
|
|
||||||
|
|
||||||
sys.path.append(os.path.join(os.environ['AIL_BIN'], 'packages/'))
|
sys.path.append(os.path.join(os.environ['AIL_BIN'], 'packages/'))
|
||||||
import Tag
|
import Tag
|
||||||
|
|
||||||
|
@ -48,8 +46,6 @@ vt_enabled = Flask_config.vt_enabled
|
||||||
PASTES_FOLDER = Flask_config.PASTES_FOLDER
|
PASTES_FOLDER = Flask_config.PASTES_FOLDER
|
||||||
SCREENSHOT_FOLDER = Flask_config.SCREENSHOT_FOLDER
|
SCREENSHOT_FOLDER = Flask_config.SCREENSHOT_FOLDER
|
||||||
|
|
||||||
faup = Faup()
|
|
||||||
|
|
||||||
showsavedpastes = Blueprint('showsavedpastes', __name__, template_folder='templates')
|
showsavedpastes = Blueprint('showsavedpastes', __name__, template_folder='templates')
|
||||||
|
|
||||||
# ============ FUNCTIONS ============
|
# ============ FUNCTIONS ============
|
||||||
|
@ -94,7 +90,6 @@ def showpaste(content_range, requested_path):
|
||||||
p_date_list = []
|
p_date_list = []
|
||||||
p_hashtype_list = []
|
p_hashtype_list = []
|
||||||
|
|
||||||
|
|
||||||
for dup_list in p_duplicate_str_full_list:
|
for dup_list in p_duplicate_str_full_list:
|
||||||
dup_list = dup_list[1:-1].replace('\'', '').replace(' ', '').split(',')
|
dup_list = dup_list[1:-1].replace('\'', '').replace(' ', '').split(',')
|
||||||
if dup_list[0] == "tlsh":
|
if dup_list[0] == "tlsh":
|
||||||
|
@ -221,9 +216,7 @@ def showpaste(content_range, requested_path):
|
||||||
if 'infoleak:submission="crawler"' in l_tags:
|
if 'infoleak:submission="crawler"' in l_tags:
|
||||||
crawler_metadata['get_metadata'] = True
|
crawler_metadata['get_metadata'] = True
|
||||||
crawler_metadata['domain'] = r_serv_metadata.hget('paste_metadata:'+requested_path, 'domain')
|
crawler_metadata['domain'] = r_serv_metadata.hget('paste_metadata:'+requested_path, 'domain')
|
||||||
faup.decode(crawler_metadata['domain'])
|
crawler_metadata['domain'] = crawler_metadata['domain'].rsplit(':', 1)[0]
|
||||||
domain_unpack = faup.get()
|
|
||||||
crawler_metadata['domain'] = domain_unpack['domain']
|
|
||||||
if tags_safe:
|
if tags_safe:
|
||||||
tags_safe = Tag.is_tags_safe(Domain.get_domain_tags(crawler_metadata['domain']))
|
tags_safe = Tag.is_tags_safe(Domain.get_domain_tags(crawler_metadata['domain']))
|
||||||
crawler_metadata['paste_father'] = r_serv_metadata.hget('paste_metadata:'+requested_path, 'father')
|
crawler_metadata['paste_father'] = r_serv_metadata.hget('paste_metadata:'+requested_path, 'father')
|
||||||
|
@ -371,6 +364,7 @@ def show_item_min(requested_path , content_range=0):
|
||||||
crawler_metadata['paste_father'] = r_serv_metadata.hget('paste_metadata:'+relative_path, 'father')
|
crawler_metadata['paste_father'] = r_serv_metadata.hget('paste_metadata:'+relative_path, 'father')
|
||||||
crawler_metadata['real_link'] = r_serv_metadata.hget('paste_metadata:'+relative_path,'real_link')
|
crawler_metadata['real_link'] = r_serv_metadata.hget('paste_metadata:'+relative_path,'real_link')
|
||||||
crawler_metadata['screenshot'] = get_item_screenshot_path(relative_path)
|
crawler_metadata['screenshot'] = get_item_screenshot_path(relative_path)
|
||||||
|
crawler_metadata['har_file'] = Item.get_item_har(relative_path)
|
||||||
else:
|
else:
|
||||||
crawler_metadata['get_metadata'] = False
|
crawler_metadata['get_metadata'] = False
|
||||||
|
|
||||||
|
@ -466,6 +460,13 @@ def showDiff():
|
||||||
def screenshot(filename):
|
def screenshot(filename):
|
||||||
return send_from_directory(SCREENSHOT_FOLDER, filename+'.png', as_attachment=True)
|
return send_from_directory(SCREENSHOT_FOLDER, filename+'.png', as_attachment=True)
|
||||||
|
|
||||||
|
# @showsavedpastes.route('/har/paste/<path:filename>')
|
||||||
|
# @login_required
|
||||||
|
# @login_read_only
|
||||||
|
# def har(filename):
|
||||||
|
# har_file = Item.get_item_har(filename)
|
||||||
|
# return jsonify(har_file)
|
||||||
|
|
||||||
@showsavedpastes.route('/send_file_to_vt/', methods=['POST'])
|
@showsavedpastes.route('/send_file_to_vt/', methods=['POST'])
|
||||||
@login_required
|
@login_required
|
||||||
@login_analyst
|
@login_analyst
|
||||||
|
|
|
@ -452,6 +452,10 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
{% if crawler_metadata['har_file'] %}
|
||||||
|
button
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -464,7 +468,7 @@
|
||||||
<input class="center" id="blocks" type="range" min="1" max="50" value="{%if tags_safe%}13{%else%}0{%endif%}">
|
<input class="center" id="blocks" type="range" min="1" max="50" value="{%if tags_safe%}13{%else%}0{%endif%}">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<button class="btn btn-primary btn-tags" onclick="blocks.value=50;pixelate();">
|
<button class="btn {%if tags_safe%}btn-primary{%else%}btn-danger{%endif%} btn-tags" onclick="blocks.value=50;pixelate();">
|
||||||
<span class="glyphicon glyphicon-zoom-in"></span>
|
<span class="glyphicon glyphicon-zoom-in"></span>
|
||||||
<span class="label-icon">Full resolution</span>
|
<span class="label-icon">Full resolution</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -370,7 +370,7 @@
|
||||||
<div class="card-body py-2">
|
<div class="card-body py-2">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3 text-center">
|
<div class="col-md-3 text-center">
|
||||||
<button class="btn btn-primary" onclick="blocks.value=0;pixelate();">
|
<button class="btn {%if dict_domain['tags_safe']%}btn-primary{%else%}btn-danger{%endif%}" onclick="blocks.value=0;pixelate();">
|
||||||
<i class="fas fa-eye-slash"></i>
|
<i class="fas fa-eye-slash"></i>
|
||||||
<span class="label-icon">Hide</span>
|
<span class="label-icon">Hide</span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -379,8 +379,12 @@
|
||||||
<input class="custom-range mt-2" id="blocks" type="range" min="1" max="50" value="{%if dict_domain['tags_safe']%}13{%else%}0{%endif%}">
|
<input class="custom-range mt-2" id="blocks" type="range" min="1" max="50" value="{%if dict_domain['tags_safe']%}13{%else%}0{%endif%}">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3 text-center">
|
<div class="col-md-3 text-center">
|
||||||
<button class="btn btn-primary" onclick="blocks.value=50;pixelate();">
|
<button class="btn {%if dict_domain['tags_safe']%}btn-primary{%else%}btn-danger{%endif%}" onclick="blocks.value=50;pixelate();">
|
||||||
<i class="fas fa-search-"></i>
|
{%if dict_domain['tags_safe']%}
|
||||||
|
<i class="fas fa-plus-square"></i>
|
||||||
|
{%else%}
|
||||||
|
<i class="fas fa-exclamation-triangle"></i>
|
||||||
|
{%endif%}
|
||||||
<span class="label-icon">Full resolution</span>
|
<span class="label-icon">Full resolution</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue