fix submit paste

pull/237/head
Terrtia 2018-06-29 15:29:02 +02:00
parent 98d0235fc3
commit a0a639276c
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
2 changed files with 100 additions and 61 deletions

View File

@ -34,7 +34,7 @@ def create_paste(uuid, paste_content, ltags, ltagsgalaxies, name):
gzip64encoded = base64.standard_b64encode(gzipencoded).decode() gzip64encoded = base64.standard_b64encode(gzipencoded).decode()
except: except:
abord_file_submission(uuid, "file error") abord_file_submission(uuid, "file error")
continue return 1
# send paste to Global module # send paste to Global module
relay_message = "{0} {1}".format(save_path, gzip64encoded) relay_message = "{0} {1}".format(save_path, gzip64encoded)

View File

@ -12,6 +12,7 @@
<link href="{{ url_for('static', filename='font-awesome/css/font-awesome.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/sb-admin-2.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.css') }}" rel="stylesheet" type="text/css" /> <link href="{{ url_for('static', filename='css/dataTables.bootstrap.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ url_for('static', filename='css/daterangepicker.min.css') }}" rel="stylesheet" type="text/css" />
<!-- JS --> <!-- JS -->
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js')}}"></script> <script language="javascript" src="{{ url_for('static', filename='js/jquery.js')}}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script> <script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
@ -20,6 +21,8 @@
<script src="{{ url_for('static', filename='js/jquery.flot.js') }}"></script> <script src="{{ url_for('static', filename='js/jquery.flot.js') }}"></script>
<script src="{{ url_for('static', filename='js/jquery.flot.time.js') }}"></script> <script src="{{ url_for('static', filename='js/jquery.flot.time.js') }}"></script>
<script src="{{ url_for('static', filename='js/jquery.flot.stack.js') }}"></script> <script src="{{ url_for('static', filename='js/jquery.flot.stack.js') }}"></script>
<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>
<script language="javascript" src="{{ url_for('static', filename='js/d3.js') }}"></script> <script language="javascript" src="{{ url_for('static', filename='js/d3.js') }}"></script>
<style> <style>
.red_table thead{ .red_table thead{
@ -53,68 +56,74 @@
</div> </div>
<!-- /.col-lg-12 --> <!-- /.col-lg-12 -->
{% if type %} <div class="col-md-6">
<div id="barchart_type"> {% if type %}
</div> <div id="barchart_type">
{% endif %} </div>
{% if daily_type_chart %} {% endif %}
<div id="barchart_type"> {% if daily_type_chart %}
</div> <div id="barchart_type">
{% endif %} </div>
{% endif %}
<!-- /#page-wrapper --> <!-- /#page-wrapper -->
{% if l_64|length != 0 %} {% if l_64|length != 0 %}
<h3> Today Base64 files: </h3> <h3> Today Base64 files: </h3>
<table id="tableb64" class="red_table table table-striped table-bordered"> <table id="tableb64" class="red_table table table-striped table-bordered">
<thead> <thead>
<tr> <tr>
<th>estimated type</th> <th>estimated type</th>
<th>hash</th> <th>hash</th>
<th>first seen</th> <th>first seen</th>
<th>last seen</th> <th>last seen</th>
<th>nb paste</th> <th>nb paste</th>
<th>size</th> <th>size</th>
<th>Virus Total</th> <th>Virus Total</th>
<th>Test</th> <th>Test</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for b64 in l_64 %} {% for b64 in l_64 %}
<tr> <tr>
<td><i class="fa {{ b64[0] }}"></i>&nbsp;&nbsp;{{ b64[1] }}</td> <td><i class="fa {{ b64[0] }}"></i>&nbsp;&nbsp;{{ b64[1] }}</td>
<td>{{ b64[2] }}</td> <td>{{ b64[2] }}</td>
<td>{{ b64[5] }}</td> <td>{{ b64[5] }}</td>
<td>{{ b64[6] }}</td> <td>{{ b64[6] }}</td>
<td>{{ b64[3] }}</td> <td>{{ b64[3] }}</td>
<td>{{ b64[4] }}</td> <td>{{ b64[4] }}</td>
<td style="text-align:center;max-width:150px;"> <td style="text-align:center;max-width:150px;">
{% if vt_enabled %} {% if vt_enabled %}
{% if not b64[7] %} {% if not b64[7] %}
<form action="/base64Decoded/send_file_to_vt" id="vt_submit" method='post'> <form action="/base64Decoded/send_file_to_vt" id="vt_submit" method='post'>
<input type="hidden" id="hash" name="hash" value="b64[2]"> <input type="hidden" id="hash" name="hash" value="b64[2]">
<button class="btn btn-primary"> <button class="btn btn-primary">
<i class="fa fa-paper-plane"></i> Send this file to VT <i class="fa fa-paper-plane"></i> Send this file to VT
</button> </button>
</form> </form>
{% else %}
<a class="btn btn-default" target="_blank" href="{{ b64[8] }}"><i class="fa fa-link"> VT scan reports</i></a>
{% endif %}
<button class="btn btn-default" onclick="updateVTReport('{{ b64[2] }}')">
<div id="report_vt_{{ b64[2] }}"><span class="glyphicon glyphicon-refresh"></span>&nbsp;{{ b64[8] }}</div>
</button>
{% else %} {% else %}
<a class="btn btn-default" target="_blank" href="{{ b64[8] }}"><i class="fa fa-link"> VT scan reports</i></a> Virus Total submission is disabled
{% endif %} {% endif %}
<button class="btn btn-default" onclick="updateVTReport('{{ b64[2] }}')"> </td>
<div id="report_vt_{{ b64[2] }}"><span class="glyphicon glyphicon-refresh"></span>&nbsp;{{ b64[8] }}</div> <td id="sparklines_{{ b64[2] }}" style="text-align:center;">
</button> </td>
{% else %} </tr>
Virus Total submission is disabled {% endfor %}
{% endif %} </tbody>
</td> </table>
<td id="sparklines_{{ b64[2] }}" style="text-align:center;"> {% else %}
</td> <h3>{{daily_date[0:4]}}/{{daily_date[4:6]}}/{{daily_date[6:8]}}, No base64</h3>
</tr> {% endif %}
{% endfor %} </div>
</tbody> <div class="col-md-6">
</table> <input id="date-range-from" size="40" value="">
{% else %} <input id="date-range-to" size="40" value="">
<h3>{{daily_date[0:4]}}/{{daily_date[4:6]}}/{{daily_date[6:8]}}, No base64</h3> </div>
{% endif %}
</div> </div>
<!-- /.row --> <!-- /.row -->
@ -124,6 +133,37 @@
activePage = "page-base64Decoded" activePage = "page-base64Decoded"
$("#"+activePage).addClass("active"); $("#"+activePage).addClass("active");
$('#date-range-from').dateRangePicker({
separator : ' to ',
getValue: function()
{
if ($('#date-range-from').val() && $('#date-range-to').val() )
return $('#date-range-from').val() + ' to ' + $('#date-range-to').val();
else
return '';
},
setValue: function(s,s1,s2)
{
$('#date-range-from').val(s1);
$('#date-range-to').val(s2);
}
});
$('#date-range-to').dateRangePicker({
separator : ' to ',
getValue: function()
{
if ($('#date-range-from').val() && $('#date-range-to').val() )
return $('#date-range-from').val() + ' to ' + $('#date-range-to').val();
else
return '';
},
setValue: function(s,s1,s2)
{
$('#date-range-from').val(s1);
$('#date-range-to').val(s2);
}
});
$('#tableb64').DataTable({ $('#tableb64').DataTable({
"aLengthMenu": [[5, 10, 15, -1], [5, 10, 15, "All"]], "aLengthMenu": [[5, 10, 15, -1], [5, 10, 15, "All"]],
"iDisplayLength": 10, "iDisplayLength": 10,
@ -135,7 +175,6 @@
{% endif %} {% endif %}
{% if daily_type_chart %} {% if daily_type_chart %}
barchart_type('/base64Decoded/daily_type_json?date={{daily_date}}', '#barchart_type'); barchart_type('/base64Decoded/daily_type_json?date={{daily_date}}', '#barchart_type');
console.log('cool')
{% endif %} {% endif %}
}); });