-
Notifications
You must be signed in to change notification settings - Fork 28
/
index.php
801 lines (770 loc) · 40.3 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<?php
require_once(__DIR__."/src/config.php");
require_once(__DIR__."/src/lib/usercake/init.php");
if (!UCUser::CanUserAccessUrl($_SERVER['PHP_SELF'])){die();}
$user = UCUser::getCurrentUser();
?>
<?php
$filters = array();
if (isset($_GET["tag"])) {
$filters["tag"] = $_GET["tag"];
}
?>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title><?php echo $user_settings->WebsiteName() ?></title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.6 -->
<link rel="stylesheet" href="plugins/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="plugins/font-awesome/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="plugins/ionicons/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="dist/css/AdminLTE.min.css">
<!-- AdminLTE Skins. We have chosen the skin-blue for this starter
page. However, you can choose any other skin. Make sure you
apply the skin class to the body tag so the changes take effect.
-->
<link rel="stylesheet" href="dist/css/skins/skin-blue.min.css">
<!-- Generic page styles -->
<link rel="stylesheet" href="plugins/jQueryUpload/css/style.css">
<!-- blueimp Gallery styles -->
<link rel="stylesheet" href="plugins/jQueryUpload/css/blueimp-gallery.min.css">
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<link rel="stylesheet" href="plugins/jQueryUpload/css/jquery.fileupload.css">
<link rel="stylesheet" href="plugins/jQueryUpload/css/jquery.fileupload-ui.css">
<!-- CSS adjustments for browsers with JavaScript disabled -->
<noscript><link rel="stylesheet" href="plugins/jQueryUpload/css/jquery.fileupload-noscript.css"></noscript>
<noscript><link rel="stylesheet" href="plugins/jQueryUpload/css/jquery.fileupload-ui-noscript.css"></noscript>
<!-- jqPagination styles -->
<link rel="stylesheet" href="plugins/jQueryUpload/css/jqpagination.css" />
<!-- tags -->
<link rel="stylesheet" type="text/css" href="plugins/jQueryUpload/css/tagmanager.css" />
<!-- Pace style -->
<link rel="stylesheet" href="plugins/pace/pace.min.css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style type="text/css">
.table-responsive {
min-height: 400px !important;
}
ul#dropdown-item-actions,
ul#dropdown-item-actions {
z-index: 10000;
}
</style>
</head>
<!--
BODY TAG OPTIONS:
=================
Apply one or more of the following classes to get the
desired effect
|---------------------------------------------------------|
| SKINS | skin-blue |
| | skin-black |
| | skin-purple |
| | skin-yellow |
| | skin-red |
| | skin-green |
|---------------------------------------------------------|
|LAYOUT OPTIONS | fixed |
| | layout-boxed |
| | layout-top-nav |
| | sidebar-collapse |
| | sidebar-mini |
|---------------------------------------------------------|
-->
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<?php include(__DIR__."/top-nav.php"); ?>
<?php include(__DIR__."/left-nav.php"); ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Main content -->
<section class="content">
<!-- Your Page Content Here -->
<div class="panel panel-info">
<div class="panel-heading">Repository Information</div>
<div class="panel-body">
<span style="font-weight: bold; color: black;">MRF v<?php echo $GLOBALS["config"]["version"]?></span>
<br/>
<?php if (IsModuleEnabled("cuckoo")) { ?>
<span>Powered by Cuckoo Sandbox: </span>
<a id="cuckoo-status-href" href="#" title="Cuckoo">
<span id="cuckoo-status" style="font-weight: bold; color: black;"> Not available</span>
</a>
<?php } ?>
<br>
<span>Samples: </span>
<span id="files-count" style="font-weight: bold; color: black;"> Not available</span>
</div>
</div>
<!-- The file upload form used as target for the file upload widget -->
<form id="fileupload" action="api.php?action=uploadfiles" method="POST" enctype="multipart/form-data">
<div id="upload" class="tab-pane fade in active">
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
<div class="row fileupload-buttonbar">
<div class="col-lg-7">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button">
<i class="glyphicon glyphicon-plus"></i>
<span>Add files...</span>
<input type="file" name="files[]" multiple>
</span>
<button type="submit" class="btn btn-primary start">
<i class="glyphicon glyphicon-upload"></i>
<span>Start upload</span>
<span class="badge" id="btn-upload-all-badge"></span>
</button>
<button type="reset" class="btn btn-warning cancel">
<i class="glyphicon glyphicon-ban-circle"></i>
<span>Cancel upload</span>
</button>
<button type="button" class="btn btn-danger delete">
<i class="glyphicon glyphicon-trash"></i>
<span>Delete</span>
</button>
<div class="btn-group">
<button type="button" class="btn btn-default">Download</button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu">
<li>
<a href="#" class="menu-button-download" OnClick="bulk_download(false)">
<i class="glyphicon glyphicon-download"></i>
<span>Download ZIP</span>
</a>
</li>
<!-- Disabled until password protected is implemented -->
<li style="display: none;">
<a href="#" class="menu-button-download-pw" OnClick="bulk_download(true)">
<i class="glyphicon glyphicon-download"></i>
<span>Download ZIP (Pass: malware)</span>
</a>
</li>
</ul>
</div>
<button type="button" class="btn btn-default" OnClick="refreshRepo()">
<i class="glyphicon glyphicon-refresh"></i>
<span>Refresh</span>
</button>
<input type="checkbox" class="toggle">
<!-- The global file processing state -->
<span class="fileupload-process"></span>
</div>
<!-- The global progress state -->
<div class="col-lg-5 fileupload-progress fade">
<!-- The global progress bar -->
<div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar progress-bar-info" style="width:0%;"></div>
</div>
<!-- The extended global progress state -->
<div class="progress-extended"> </div>
</div>
</div>
</div>
<div id="search" class="panel-group">
<div class="panel panel-info">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" href="#collapse_search"><span class="glyphicon glyphicon-search"></span> Search</a>
</h4>
</div>
<div id="collapse_search" class="panel-collapse collapse">
<div class="panel-body">
<div class="row" style="padding-bottom: 10px">
<div class="control-group col col-lg-4">
<span class="btn btn-default fileinput-button" OnClick="clear_search()">
<i class="glyphicon glyphicon-ban-circle"></i>
<span>Clear</span>
</span>
</div>
</div>
<div class="row" style="padding-bottom: 10px">
<div class="control-group col col-lg-4">
<div class="input-group">
<span class="input-group-addon" id="uploader-descr"><span class="glyphicon glyphicon-user"></span> Uploader</span>
<input type="text" id="uploader-descr-input" class="form-control" placeholder="some user" aria-describedby="uploader-descr" onkeyup="delayed_get_files()">
</div>
</div>
<div class="control-group col col-lg-4">
<div class="input-group">
<span class="input-group-addon" id="date-descr"><span class="glyphicon glyphicon-time"></span> Date</span>
<input type="text" id="date-descr-input" class="form-control" placeholder="2015-12-21" aria-describedby="date-descr" onkeyup="delayed_get_files()">
</div>
</div>
</div>
<div class="row" style="padding-bottom: 10px">
<div class="control-group col col-lg-4">
<div class="input-group">
<span class="input-group-addon" id="vendor-descr"><span class="glyphicon glyphicon-glass"></span> Threat Name</span>
<input type="text" id="vendor-descr-input" class="form-control" placeholder="Tr.Zeus" aria-describedby="vendor-descr" onkeyup="delayed_get_files()">
</div>
</div>
<div class="control-group col col-lg-4">
<div class="input-group">
<span class="input-group-addon" id="comment-descr"><span class="glyphicon glyphicon-pencil"></span> Comment</span>
<input type="text" id="comment-descr-input" class="form-control" placeholder="some comment" aria-describedby="comment-descr" onkeyup="delayed_get_files()">
</div>
</div>
</div>
<div class="row" style="padding-bottom: 10px">
<div class="control-group col col-lg-4">
<div class="input-group">
<span class="input-group-addon" id="md5-descr"><span class="glyphicon glyphicon-map-marker"></span> MD5</span>
<input type="text" id="md5-descr-input" class="form-control" placeholder="ba35799770abde5da0315e60694ce42e" aria-describedby="md5-descr" onkeyup="delayed_get_files()">
</div>
</div>
<div class="control-group col col-lg-4">
<div class="input-group">
<span class="input-group-addon" id="name-descr"><span class="glyphicon glyphicon-file"></span> Filename</span>
<input type="text" id="name-descr-input" class="form-control" placeholder="filename.exe" aria-describedby="name-descr" onkeyup="delayed_get_files()">
</div>
</div>
</div>
<div class="row" style="padding-bottom: 10px">
<?php if (IsModuleEnabled("virustotal")) { ?>
<div class="control-group col col-lg-4">
<div class="input-group">
<span class="input-group-addon" id="vt-descr"><span class="glyphicon glyphicon-eye-open"></span> VirusTotal</span>
<input type="text" id="vt-descr-input" class="form-control" placeholder=">10" aria-describedby="vt-descr" onkeyup="delayed_get_files()">
</div>
</div>
<?php } ?>
<?php if (IsModuleEnabled("cuckoo")) { ?>
<div class="control-group col col-lg-4">
<div class="input-group">
<span class="input-group-addon" id="cuckoo-descr"><span class="glyphicon glyphicon-fire"></span> Cuckoo</span>
<select id="cuckoo-descr-input" aria-describedby="cuckoo-descr" class="selectpicker form-control" data-live-search="true" onchange="delayed_get_files()">
<option value="none"> </option>
<option value="no-results">No Results</option>
<option value="results">Results</option>
<option value="scanning">Scanning</option>
</select>
</div>
</div>
<?php } ?>
</div>
<div class="row" style="padding-bottom: 10px">
<div class="control-group col col-lg-4">
<div class="input-group">
<span class="input-group-addon" id="size-descr"><span class="glyphicon glyphicon-signal"></span> Size</span>
<input type="text" id="size-descr-input" class="form-control" placeholder=">1000" aria-describedby="size-descr" onkeyup="delayed_get_files()">
</div>
</div>
<div class="control-group col col-lg-4">
<div class="input-group">
<span class="input-group-addon" id="fav-descr"><span class="glyphicon glyphicon-star"></span> Favorite</span>
<select id="fav-descr-input" aria-describedby="fav-descr" class="selectpicker form-control" data-live-search="true" onchange="delayed_get_files()">
<option value="none"> </option>
<option value="no-fav">No</option>
<option value="fav">Yes</option>
</select>
</div>
</div>
</div>
<div class="row" style="padding-bottom: 10px">
<div class="control-group col col-lg-4">
<div class="input-group">
<span class="input-group-addon" id="tags-descr"><span class="glyphicon glyphicon-tags"></span> Tags</span>
<input type="text" id="tags-descr-input" class="form-control" placeholder="tag" aria-describedby="tags-descr" onkeyup="delayed_get_files()">
</div>
</div>
<div class="control-group col col-lg-4">
<div class="input-group">
<span class="input-group-addon" id="urls-descr"><span class="glyphicon glyphicon-globe"></span> URLs</span>
<input type="text" id="urls-descr-input" class="form-control" placeholder="url" aria-describedby="urls-descr" onkeyup="delayed_get_files()">
</div>
</div>
</div>
<div class="row" style="padding-bottom: 10px">
<div class="control-group col col-lg-4">
<div class="input-group">
<span class="input-group-addon" id="sha256-descr"><span class="glyphicon glyphicon-map-marker"></span> SHA256</span>
<input type="text" id="sha256-descr-input" class="form-control" placeholder="5ed702ca0e6b87ec2f6503cb9e62ef27e94259608ca87d4abfe1aa08cf967fbb" aria-describedby="md5-descr" onkeyup="delayed_get_files()">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id='alert'></div>
<div class="pagination">
<a href="#" class="first" data-action="first">«</a>
<a href="#" class="previous" data-action="previous">‹</a>
<input type="text" readonly="readonly" data-max-page="40" />
<a href="#" class="next" data-action="next">›</a>
<a href="#" class="last" data-action="last">»</a>
</div>
<!-- The table listing the files available for upload/download -->
<div class="table-responsive">
<table role="presentation" class="table table-hover table-striped">
<!--<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th>Date</th>
<th>Threat Name</th>
<th>Hash MD5</th>
<th>Filename</th>
<th>Size</th>
<th></th>
<th></th>
</tr>
</thead>-->
<tbody class="files"></tbody>
</table>
</div>
</form>
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade">
<td colspan="4">
<span class="name">{%=file.name%}</span>
</td>
<td>
<span class="size">Processing...</span>
</td>
<td colspan=4>
<div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" style="min-width: 50px;">
<div class="progress-bar progress-bar-info"></div>
</div>
</td>
<td>
<div class="checkbox">
<?php if (IsModuleEnabled("virustotal")) { ?>
<label class="checkbox-inline">
<input type="checkbox" id="vtsubmit_{%=file.index%}" value="" <?php if ($GLOBALS["config"]["modules"]["virustotal"]["automatic_upload"]) { ?> checked <?php } ?> >
<span class="label label-warning">VirusTotal</span>
</label>
<?php } ?>
<?php if (IsModuleEnabled("cuckoo")) { ?>
<label class="checkbox-inline">
<input type="checkbox" id="cuckoosubmit_{%=file.index%}" value="">
<span class="label label-info">Cuckoo</span>
</label>
<?php } ?>
</div>
</td>
<td>
<input type="text" id="tags_upload_{%=file.index%}" placeholder="add tag..." class="tm-input tm-input-success tm-input-small"/>
</td>
<td colspan="2">
{% if (!i && !o.options.autoUpload) { %}
<button class="btn btn-primary btn-xs start" disabled>
<i class="glyphicon glyphicon-upload"></i>
<span>Start</span>
</button>
{% } %}
{% if (!i) { %}
<button class="btn btn-warning btn-xs cancel">
<i class="glyphicon glyphicon-ban-circle"></i>
<span>Cancel</span>
</button>
{% } %}
</td>
</tr>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
{% if (file.error) { %}
<tr class="template-download fade" id="row_{%=file.md5%}">
<td colspan="4">
<span class="name">{%=file.filename%}</span>
</td>
<td colspan="9">
<div><span class="label label-danger">Error</span> {%=file.error%}</div>
</td>
</tr>
{% continue; } %}
<tr class="template-download fade" id="row_{%=file.md5%}">
{% if (file.deleteUrl) { %}
<td class="visible-md visible-lg visible-xl"><input type="checkbox" id="select_{%=file.md5%}" name="delete" value="1" class="toggle" style="vertical-align: middle;" data-toggle="tooltip" title="Select for action"></td>
{% } %}
<td class="visible-md visible-lg visible-xl">
{% if (file.favorite) { %}
<a href="#fav_{%=file.md5%}" OnClick="favorite('{%=file.md5%}')" data-toggle="tooltip" title="Favorite"><span id="fav_star_{%=file.md5%}" class="glyphicon glyphicon-star" style="font-size: 1.5em; vertical-align: middle;"></span></a>
{% } else { %}
<a href="#fav_{%=file.md5%}" OnClick="favorite('{%=file.md5%}')" data-toggle="tooltip" title="Favorite"><span id="fav_star_{%=file.md5%}" class="glyphicon glyphicon-star-empty" style="font-size: 1.5em; vertical-align: middle;"></span></a>
{% } %}
{% if (file.locked) { %}
<span class="glyphicon glyphicon-lock" style="font-size: 1.0em; vertical-align: middle; color: #f39c12;" data-toggle="tooltip" title="Locked"></span>
{% } %}
</td>
<td>
<a href="<?php echo $GLOBALS["config"]["urls"]["baseUrl"]; ?>sample.php?hash={%=file.md5%}" target="_blank" data-toggle="tooltip" title="Open"><span class="glyphicon glyphicon-open" style="font-size: 1.5em; vertical-align: middle;"></span></a>
</td>
<td class="visible-md visible-lg visible-xl">
{% if (file.user_avatar && file.user_avatar.length > 0) { %}
<img alt="" height="24px" width="24px" class="img-circle" src="data:image/png;base64,{%=file.user_avatar%}" data-toggle="tooltip" title="Uploader: {%=file.user_name%}">
{% } else { %}
<img alt="" height="24px" width="24px" class="img-circle" src="<?php echo $GLOBALS["config"]["urls"]["baseUrl"] ."dist/img/noavatar.jpg"?>" data-toggle="tooltip" title="Uploader: {%=file.user_name%}">
{% } %}
{% if (file.icon && file.icon.length > 0) { %}
<img alt="" height="24px" width="24px" class="img" src="data:image/png;base64,{%=file.icon%}" data-toggle="tooltip" title="Icon">
{% } %}
</td>
<td>
<span class="name" data-toggle="tooltip" title="Upload date">{%=file.date%}</span>
</td>
<td class="visible-md visible-lg visible-xl">
{% if (file.criticity == 1) { %}
<span id="vendor_{%=file.md5%}" data-toggle="tooltip" title="Vendor Name: {%=file.threat%}" class="label label-danger">{%=file.threat%}</span>
{% } else if (file.criticity == 2) { %}
<span id="vendor_{%=file.md5%}" data-toggle="tooltip" title="Vendor Name: {%=file.threat%}" class="label label-warning">{%=file.threat%}</span>
{% } else { %}
<span id="vendor_{%=file.md5%}" data-toggle="tooltip" title="Vendor Name: {%=file.threat%}" class="label label-default">{%=file.threat%}</span>
{% } %}
</td>
<td class="visible-md visible-lg visible-xl">
<div class="col-md-2">
<input type="text" id="tags_{%=file.md5%}" placeholder="add tag..." class="tm-input tm-input-small"/>
</div>
</td>
<td>
<span class="name">
{% if (file.url) { %}
<a href="{%=file.url%}" data-toggle="tooltip" title="MD5: {%=file.md5%}" download="{%=file.md5%}">{%=file.md5%}</a>
{% } else { %}
<span>{%=file.md5%}</span>
{% } %}
</span>
</td>
<td>
{% if (file.filename.length > 25) { %}
<span data-toggle="tooltip" title="File name: {%=file.filename%}" class="name">{%=file.filename.substring(0,25).concat('...')%}</span>
{% } else { %}
<span data-toggle="tooltip" title="File name: {%=file.filename%}" class="name">{%=file.filename%}</span>
{% } %}
</td>
<td class="visible-sm visible-md visible-lg visible-xl">
<span data-toggle="tooltip" title="File size: {%=o.formatFileSize(file.size)%}" class="size">{%=o.formatFileSize(file.size)%}</span>
</td>
<?php if (IsModuleEnabled("virustotal")) { ?>
<td class="visible-sm visible-md visible-lg visible-xl">
{% if (file.virustotal_status == 1) { %}
{% if (file.virustotal_score < 10) { %}
<a href="{%=file.virustotal_link%}" id="vt_score_link_{%=file.md5%}" target="_blank" data-toggle="tooltip" title="VirusTotal score: {%=file.virustotal_score%}" ><span id="vt_score_{%=file.md5%}" class="label label-success">{%=file.virustotal_score%}/55</span></a>
{% } else if (file.virustotal_score >= 10 && file.virustotal_score < 20) { %}
<a href="{%=file.virustotal_link%}" id="vt_score_link_{%=file.md5%}" target="_blank" data-toggle="tooltip" title="VirusTotal score: {%=file.virustotal_score%}" ><span id="vt_score_{%=file.md5%}" class="label label-warning">{%=file.virustotal_score%}/55</span></a>
{% } else { %}
<a href="{%=file.virustotal_link%}" id="vt_score_link_{%=file.md5%}" target="_blank" data-toggle="tooltip" title="VirusTotal score: {%=file.virustotal_score%}" ><span id="vt_score_{%=file.md5%}" class="label label-danger">{%=file.virustotal_score%}/55</span></a>
{% } %}
{% } else if (file.virustotal_status == 0) { %}
<a href="#" id="vt_score_link_{%=file.md5%}" target="_blank" data-toggle="tooltip" title="VirusTotal score: File unknown" ><span id="vt_score_{%=file.md5%}" class="label label-warning">Unknown</span></a>
{% } else if (file.virustotal_status == -6) { %}
<a href="#" id="vt_score_link_{%=file.md5%}" target="_blank" data-toggle="tooltip" title="VirusTotal score: File not checked" ><span id="vt_score_{%=file.md5%}" class="label label-default">Not Checked</span></a>
{% } else if (file.virustotal_status == -5) { %}
<a href="#" id="vt_score_link_{%=file.md5%}" target="_blank" data-toggle="tooltip" title="VirusTotal score: File too big" ><span id="vt_score_{%=file.md5%}" class="label label-primary">Too big</span></a>
{% } else if (file.virustotal_status == -3) { %}
<a href="#" id="vt_score_link_{%=file.md5%}" target="_blank" data-toggle="tooltip" title="VirusTotal score: API limit reached" ><span id="vt_score_{%=file.md5%}" class="label label-primary">API Error</span></a>
{% } else if (file.virustotal_status == -2) { %}
<a href="{%=file.virustotal_link%}" id="vt_score_link{%=file.md5%}" target="_blank" data-toggle="tooltip" title="VirusTotal score: Currently scanning..."><span id="vt_score_{%=file.md5%}" class="label label-primary">Scanning</span></a>
{% } else { %}
<a href="#" id="vt_score_link_{%=file.md5%}" target="_blank" data-toggle="tooltip" title="Error" ><span id="vt_score_{%=file.md5%}" class="label label-primary">Error</span></a>
{% } %}
</td>
<?php } ?>
<?php if (IsModuleEnabled("cuckoo")) { ?>
<td class="visible-sm visible-md visible-lg visible-xl">
{% if (file.cuckoo_status == 0 && file.cuckoo_link ) { %}
<a href="{%=file.cuckoo_link%}" id="ck_link{%=file.md5%}" target="_blank" data-toggle="tooltip" title="Cuckoo results" style="font-weight: bold; color: green;"><span id="ck_{%=file.md5%}" class="label label-success">Results</span></a>
{% } else if (file.cuckoo_status == -1) { %}
<a href="#" id="ck_link{%=file.md5%}" target="_blank" data-toggle="tooltip" title="Cuckoo scanning" style="font-weight: bold; color: green;"><span id="ck_{%=file.md5%}" class="label label-warning">Scanning</span></a>
{% } else { %}
<a href="#" id="ck_link{%=file.md5%}" target="_blank" data-toggle="tooltip" title="Cuckoo nothing" style="font-weight: bold; color: green;"><span id="ck_{%=file.md5%}" class="label label-primary">None</span></a>
{% } %}
</td>
<?php } ?>
<td>
<div class="btn-group">
{% if (i >= o.files.length - 10 && i >= 10) { %}
<div class="dropup">
{% } else { %}
<div class="dropdown">
{% } %}
<button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
<i class="glyphicon glyphicon-chevron-down"></i>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul id="dropdown-item-actions" class="dropdown-menu dropdown-menu-right" role="menu">
<li><a href="<?php echo $GLOBALS["config"]["urls"]["baseUrl"]; ?>sample.php?hash={%=file.md5%}" target="_blank" >
<i id="edit_img_{%=file.md5%}" class="glyphicon glyphicon-open"></i>
<span>Open</span>
</a></li>
<li><a href="#" class="menu-button-edit" id="edit_{%=file.md5%}" data-id="{%=file.md5%}" OnClick="edit_data('{%=file.md5%}');" style="display: none;">
<i id="edit_img_{%=file.md5%}" class="glyphicon glyphicon-edit"></i>
<span id="edit_text_{%=file.md5%}">Quick Edit</span>
</a></li>
{% if (file.deleteUrl) { %}
<li><a href="#" class="menu-button-delete delete" id="delete_{%=file.md5%}" OnClick="delete_sample('{%=file.md5%}','{%=file.deleteUrl%}','{%=file.deleteType%}','{file.deleteWithCredentials}');">
<i class="glyphicon glyphicon-trash"></i>
<span>Delete</span>
</a></li>
{% } %}
<li class="divider"></li>
<li><a href="#" class="menu-button-comment" id="comment_{%=file.md5%}" data-id="{%=file.md5%}" data-comment-value="{%=file.comment%}" data-toggle="modal" data-target="#commentModal">
<i class="glyphicon glyphicon-pencil"></i>
<span>Comment</span>
</a></li>
<li><a href="#" class="menu-button-urls" id="urls_{%=file.md5%}" data-id="{%=file.md5%}" data-urls-value="{%=file.urls%}" data-toggle="modal" data-target="#urlModal">
<i class="glyphicon glyphicon-globe"></i>
<span>Manage URLs</span>
</a></li>
<?php if (IsModuleEnabled("virustotal")) { ?>
<li class="divider"></li>
<li><a href="#" class="menu-button-vt-comment" id="comment_vt_{%=file.md5%}" data-id="{%=file.md5%}" data-toggle="modal" data-target="#commentVTModal">
<i class="glyphicon glyphicon-pencil"></i>
<span>VT Comment</span>
</a></li>
{% if (file.virustotal_status == 1 || file.virustotal_status == 0 || file.virustotal_status == -6) { %}
<li><a href="#" class="menu-button-scan-vt" id="vt_scan_{%=file.md5%}" type="button" OnClick="vt_scan('{%=file.md5%}');">
{% if (file.virustotal_status == 0 || file.virustotal_status == -6) { %}
<i class="glyphicon glyphicon-upload"></i>
<span id="vt_scan_text_{%=file.md5%}">VT Scan</span>
{% } else { %}
<i class="glyphicon glyphicon-repeat"></i>
<span id="vt_scan_text_{%=file.md5%}">VT Rescan</span>
{% } %}
</a></li>
{% } %}
<?php } ?>
<?php if (IsModuleEnabled("cuckoo")) { ?>
{% if (file.cuckoo_status != -1) { %}
<li class="divider"></li>
<li><a href="#" class="menu-button-urls" id="ck_scan_{%=file.md5%}" data-id="{%=file.md5%}" data-toggle="modal" data-target="#submitCuckooModal">
{% if (file.cuckoo_status == 0) { %}
<i class="glyphicon glyphicon-repeat"></i>
<span id="ck_scan_text_{%=file.md5%}">Cuckoo Rescan</span>
{% } else { %}
<i class="glyphicon glyphicon-upload"></i>
<span id="ck_scan_text_{%=file.md5%}">Cuckoo Scan</span>
{% } %}
</a></li>
{% } %}
<?php } ?>
</ul>
</div>
</div>
</td>
</tr>
{% } %}
</script>
<!-- Old code for row expansion -->
<!--<td>
<a href="#more_{%=file.md5%}" data-toggle="collapse"><span class="glyphicon glyphicon-plus" style="font-size: 1em; vertical-align: middle;"></span></a>
</td>-->
<!--<tr id="more_{%=file.md5%}" class="collapse in">
<td colspan="100%">
<div class="panel panel-info">
<div class="panel-body form-group" style="margin-bottom: 0px;">
</div>
</div>
</td>
</tr>-->
<div id="commentModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Comment: (Click to edit)</h4>
</div>
<div class="modal-body" id="body_comment">
<div id="p_comment" style='width: 100%; height: 400px; margin-top: 20px; overflow: scroll;'></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div id="urlModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">URLs:</h4>
</div>
<div class="modal-body" id="body_urls">
<div id="surveyForm" class="form-horizontal">
<div class="form-group" id="url_node_first">
<div class="col-xs-4">
<input type="text" placeholder="Description" id="name_first" class="form-control" value="" />
</div>
<div class="col-xs-7">
<input type="text" placeholder="http://domain.tld" id="url_first" class="form-control" value="" />
</div>
<div class="col-xs-1">
<button type="button" class="btn btn-default" OnClick="modal_add_url_area();">
<i class="glyphicon glyphicon-plus"></i>
</button>
</div>
</div>
<!-- The option field template containing an option field and a Remove button -->
<div class="form-group hide" id="urltemplate">
<div class="col-xs-4">
<input class="form-control" type="text" id="name_next" placeholder="Description" />
</div>
<div class="col-xs-7">
<input class="form-control" type="text" id="url_next" placeholder="http://domain.tld" />
</div>
<div class="col-xs-1">
<button type="button" class="btn btn-default" OnClick="modal_remove_url_area($(this));">
<i class="glyphicon glyphicon-minus"></i>
</button>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success edit" OnClick="modal_send_urls();">
<i class="glyphicon glyphicon-send"></i>
<span>Update</span>
</button>
</div>
</div>
</div>
</div>
<div id="commentVTModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Comment:</h4>
</div>
<div class="modal-body" id="body_vt_comment">
<textarea id="t_commentvt" style="width: 100%; height: 100px"></textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success edit" OnClick="vt_comment();">
<i class="glyphicon glyphicon-send"></i>
<span>Send</span>
</button>
</div>
</div>
</div>
</div>
<div id="submitCuckooModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Cuckoo Submit:</h4>
</div>
<div class="modal-body" id="body_cuckoo_submit">
<div class="form-group">
<label for="select_cuckoo_machine">Select machine:</label>
<select class="form-control" id="select_cuckoo_machine">
</select>
</div>
<div id="select_cuckoo_options">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success edit" OnClick="cuckoo_scan_modal();">
<i class="glyphicon glyphicon-send"></i>
<span>Submit</span>
</button>
</div>
</div>
</div>
</div>
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php include(__DIR__."/footer.php"); ?>
<?php include(__DIR__."/right-nav.php"); ?>
</div>
<!-- ./wrapper -->
<!-- REQUIRED JS SCRIPTS -->
<!-- jQuery 2.2.3 -->
<script src="plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/app.min.js"></script>
<!-- TinyMCE -->
<script src="plugins/tinymce/js/tinymce/tinymce.min.js"></script>
<!-- MRF -->
<!--<script src="plugins/jQueryUpload/js/vendor/jquery.min.js"></script>-->
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<!--<script src="plugins/jQueryUpload/js/vendor/jquery.ui.widget.js"></script>-->
<script src="plugins/jQueryUI/jquery-ui.min.js"></script>
<!-- The Templates plugin is included to render the upload/download listings -->
<script src="plugins/jQueryUpload/js/tmpl.min.js"></script>
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src="plugins/jQueryUpload/js/load-image.all.min.js"></script>
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
<script src="plugins/jQueryUpload/js/canvas-to-blob.min.js"></script>
<!-- Bootstrap JS is not required, but included for the responsive demo navigation -->
<!--<script src="plugins/jQueryUpload/js/bootstrap.min.js"></script>-->
<!-- blueimp Gallery script -->
<script src="plugins/jQueryUpload/js/jquery.blueimp-gallery.min.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="plugins/jQueryUpload/js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="plugins/jQueryUpload/js/jquery.fileupload.js"></script>
<!-- The File Upload processing plugin -->
<script src="plugins/jQueryUpload/js/jquery.fileupload-process.js"></script>
<!-- The File Upload image preview & resize plugin -->
<script src="plugins/jQueryUpload/js/jquery.fileupload-image.js"></script>
<!-- The File Upload audio preview plugin -->
<script src="plugins/jQueryUpload/js/jquery.fileupload-audio.js"></script>
<!-- The File Upload video preview plugin -->
<script src="plugins/jQueryUpload/js/jquery.fileupload-video.js"></script>
<!-- The File Upload validation plugin -->
<script src="plugins/jQueryUpload/js/jquery.fileupload-validate.js"></script>
<!-- The File Upload user interface plugin -->
<script src="plugins/jQueryUpload/js/jquery.fileupload-ui.js"></script>
<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE 8 and IE 9 -->
<!--[if (gte IE 8)&(lt IE 10)]>
<script src="js/cors/jquery.xdr-transport.js"></script>
<![endif]-->
<!-- Bootstrap 3.3.6 -->
<!-- Bootstrap needs to be placed AFTER jquery-ui because of tootltip conflicts -->
<script src="plugins/bootstrap/js/bootstrap.min.js"></script>
<!-- jqPagination scripts -->
<script src="plugins/jQueryUpload/js/jquery.jqpagination.js"></script>
<!-- tags -->
<script type="text/javascript" src="plugins/jQueryUpload/js/tagmanager.js"></script>
<!-- PACE -->
<script data-pace-options='{"ajax":false,"document":false,"eventLag":false,"startOnPageLoad":false}' src="plugins/pace/pace.min.js"></script>
<!-- The main application script -->
<script src="dist/js/main.js"></script>
<script>
$(function() {
var filters = <?php echo json_encode($filters) ?>;
initRepo(filters);
//Uncomment this for auto-refresh, though this isn't recommended.
//setInterval(refreshRepo, 5000);
});
</script>
<!-- Optionally, you can add Slimscroll and FastClick plugins.
Both of these plugins are recommended to enhance the
user experience. Slimscroll is required when using the
fixed layout. -->
</body>
</html>