mirror of https://github.com/CIRCL/AIL-framework
chg: [pgpdump] reprocess tagged items + fix pgpdump
parent
49f7429c5f
commit
da5579875d
|
@ -187,6 +187,8 @@ function launching_scripts {
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
screen -S "Script_AIL" -X screen -t "Keys" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./Keys.py; read x"
|
screen -S "Script_AIL" -X screen -t "Keys" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./Keys.py; read x"
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
|
screen -S "Script_AIL" -X screen -t "PgpDump" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./PgpDump.py; read x"
|
||||||
|
sleep 0.1
|
||||||
screen -S "Script_AIL" -X screen -t "Decoder" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./Decoder.py; read x"
|
screen -S "Script_AIL" -X screen -t "Decoder" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./Decoder.py; read x"
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
screen -S "Script_AIL" -X screen -t "Bitcoin" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./Bitcoin.py; read x"
|
screen -S "Script_AIL" -X screen -t "Bitcoin" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./Bitcoin.py; read x"
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import time
|
||||||
import redis
|
import redis
|
||||||
import signal
|
import signal
|
||||||
import datetime
|
import datetime
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*-coding:UTF-8 -*
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import gzip
|
||||||
|
import base64
|
||||||
|
import uuid
|
||||||
|
import datetime
|
||||||
|
import base64
|
||||||
|
import redis
|
||||||
|
import json
|
||||||
|
import time
|
||||||
|
|
||||||
|
sys.path.append(os.environ['AIL_BIN'])
|
||||||
|
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_tags = redis.StrictRedis(
|
||||||
|
host=p.config.get("ARDB_Tags", "host"),
|
||||||
|
port=p.config.getint("ARDB_Tags", "port"),
|
||||||
|
db=p.config.getint("ARDB_Tags", "db"),
|
||||||
|
decode_responses=True)
|
||||||
|
|
||||||
|
tag = 'infoleak:automatic-detection="pgp-message"'
|
||||||
|
|
||||||
|
# get tag first/last seen
|
||||||
|
first_seen = r_tags.hget('tag_metadata:{}'.format(tag), 'first_seen')
|
||||||
|
last_seen = r_tags.hget('tag_metadata:{}'.format(tag), 'last_seen')
|
||||||
|
|
||||||
|
l_dates = substract_date(first_seen, last_seen)
|
||||||
|
|
||||||
|
# get all tagged items
|
||||||
|
for date in l_dates:
|
||||||
|
daily_tagged_items = r_tags.smembers('{}:{}'.format(tag, date))
|
||||||
|
|
||||||
|
for item in daily_tagged_items:
|
||||||
|
p.populate_set_out(item, 'PgpDump')
|
|
@ -102,7 +102,7 @@ def get_file_icon_text(estimated_type):
|
||||||
return file_icon_text
|
return file_icon_text
|
||||||
|
|
||||||
def get_pgp_id_icon_text(type_id):
|
def get_pgp_id_icon_text(type_id):
|
||||||
# set file icon
|
# set type_id icon
|
||||||
if type_id == 'key':
|
if type_id == 'key':
|
||||||
file_icon_text = '\uf084'
|
file_icon_text = '\uf084'
|
||||||
elif type_id == 'name':
|
elif type_id == 'name':
|
||||||
|
@ -113,6 +113,18 @@ def get_pgp_id_icon_text(type_id):
|
||||||
file_icon_text = '\uf249'
|
file_icon_text = '\uf249'
|
||||||
return file_icon_text
|
return file_icon_text
|
||||||
|
|
||||||
|
def get_pgp_icon(type_id):
|
||||||
|
# set type_id icon
|
||||||
|
if type_id == 'key':
|
||||||
|
pgp_icon_text = 'key'
|
||||||
|
elif type_id == 'name':
|
||||||
|
pgp_icon_text = 'user-tag'
|
||||||
|
elif type_id == 'mail':
|
||||||
|
pgp_icon_text = 'at'
|
||||||
|
else:
|
||||||
|
pgp_icon_text = 'times'
|
||||||
|
return pgp_icon_text
|
||||||
|
|
||||||
def verify_pgp_type_id(type_id):
|
def verify_pgp_type_id(type_id):
|
||||||
if type_id in ['key', 'name', 'mail']:
|
if type_id in ['key', 'name', 'mail']:
|
||||||
return True
|
return True
|
||||||
|
@ -846,7 +858,7 @@ def pgpdump_page():
|
||||||
|
|
||||||
if pgp_metadata[dump_id]:
|
if pgp_metadata[dump_id]:
|
||||||
pgp_metadata[dump_id]['type_id'] = typ_id
|
pgp_metadata[dump_id]['type_id'] = typ_id
|
||||||
#file_icon = get_file_icon(estimated_type)
|
pgp_metadata[dump_id]['type_icon'] = get_pgp_icon(typ_id)
|
||||||
|
|
||||||
pgp_metadata[dump_id]['sparklines_data'] = list_sparkline_pgp_values(date_range_sparkline, typ_id, dump_id)
|
pgp_metadata[dump_id]['sparklines_data'] = list_sparkline_pgp_values(date_range_sparkline, typ_id, dump_id)
|
||||||
pgp_metadata[dump_id]['sparklines_id'] = sparkline_id
|
pgp_metadata[dump_id]['sparklines_id'] = sparkline_id
|
||||||
|
|
|
@ -143,7 +143,7 @@
|
||||||
<tbody style="font-size: 15px;">
|
<tbody style="font-size: 15px;">
|
||||||
{% for pgp_dump in l_pgpdump %}
|
{% for pgp_dump in l_pgpdump %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><i class="fas {{ er }}"></i> {{ l_pgpdump[pgp_dump]['type_id'] }}</td>
|
<td><i class="fas fa-{{ l_pgpdump[pgp_dump]['type_icon'] }}"></i> {{ l_pgpdump[pgp_dump]['type_id'] }}</td>
|
||||||
<td><a target="_blank" href="{{ url_for('hashDecoded.show_pgpdump') }}?type_id={{ l_pgpdump[pgp_dump]['type_id'] }}&key_id={{ pgp_dump }}">{{ pgp_dump }}</a></td>
|
<td><a target="_blank" href="{{ url_for('hashDecoded.show_pgpdump') }}?type_id={{ l_pgpdump[pgp_dump]['type_id'] }}&key_id={{ pgp_dump }}">{{ pgp_dump }}</a></td>
|
||||||
<td>{{ l_pgpdump[pgp_dump]['first_seen'] }}</td>
|
<td>{{ l_pgpdump[pgp_dump]['first_seen'] }}</td>
|
||||||
<td>{{ l_pgpdump[pgp_dump]['last_seen'] }}</td>
|
<td>{{ l_pgpdump[pgp_dump]['last_seen'] }}</td>
|
||||||
|
|
Loading…
Reference in New Issue