forked from mandiant/gocrack-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDisplayFileInfo.vue
More file actions
92 lines (83 loc) · 2.61 KB
/
DisplayFileInfo.vue
File metadata and controls
92 lines (83 loc) · 2.61 KB
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
<template>
<b-tabs ref="file-info-tabs">
<b-tab :title="$t('file_info.task_file')" active>
<table class="table">
<tbody>
<tr v-for="(value, key) in data.password_file">
<td>{{ key | rename }}</td>
<td>{{ value }}</td>
</tr>
</tbody>
</table>
<DownloadButton :fileid="data.password_file.file_id" :isTaskFile="true" styleclass="btn-small" />
</b-tab>
<template v-if="data.engine === 'Hashcat'">
<b-tab :title="$t('file_info.dictionary_file')" v-if="data.engine_options.dictionary_file !== undefined">
<table class="table">
<tbody>
<tr v-for="(value, key) in data.engine_options.dictionary_file">
<td>{{ key | rename }}</td>
<td>{{ value }}</td>
</tr>
</tbody>
</table>
<DownloadButton :fileid="data.engine_options.dictionary_file.file_id" :isTaskFile="false" styleclass="btn-small" />
</b-tab>
<b-tab :title="$t('hashcat.mangling_rules')" v-if="data.engine_options.mangling_file !== undefined">
<table class="table">
<tbody>
<tr v-for="(value, key) in data.engine_options.mangling_file">
<td>{{ key | rename }}</td>
<td>{{ value }}</td>
</tr>
</tbody>
</table>
<DownloadButton :fileid="data.engine_options.mangling_file.file_id" :isTaskFile="false" styleclass="btn-small" />
</b-tab>
<b-tab :title="$t('hashcat.bruteforce_masks')" v-if="data.engine_options.masks !== undefined">
<table class="table">
<tbody>
<tr v-for="(value, key) in data.engine_options.masks">
<td>{{ key | rename }}</td>
<td>{{ value }}</td>
</tr>
</tbody>
</table>
<DownloadButton :fileid="data.engine_options.masks.file_id" :isTaskFile="false" styleclass="btn-small" />
</b-tab>
</template>
</b-tabs>
</template>
<script>
import DownloadButton from '@/components/DownloadButton'
const RENAME_ME = {
'Sha1': 'SHA1',
'File Id': 'File ID',
'Filename': 'File Name',
'File Sz': 'File Size',
'Num Entries': 'Number of Entries'
}
export default {
components: {
DownloadButton
},
props: {
data: {
type: Object,
required: true
}
},
filters: {
rename: (val) => {
val = val && val[0].toUpperCase() + val.slice(1)
val = val.replace(/(_\w)/g, (m) => {
return ' ' + m[1].toUpperCase()
})
if (RENAME_ME.hasOwnProperty(val)) {
return RENAME_ME[val]
}
return val
}
}
}
</script>