-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
index.html
281 lines (258 loc) · 12.2 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hunting Keywords</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable@latest/dist/handsontable.full.min.css">
<script src="https://cdn.jsdelivr.net/npm/handsontable@latest/dist/handsontable.full.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/papaparse@latest"></script>
<style>
/* GitHub logo style */
.github-logo {
position: absolute;
top: 10px;
right: 10px;
width: 32px;
height: 32px;
background-color: white; /* Add background color */
border-radius: 50%; /* Make it circular */
padding: 4px; /* Add padding to create a border effect */
}
.handsontable .htCore .ht_master .wtHolder {
overflow-y: hidden !important;
}
.handsontable td {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
height: 23px !important;
line-height: 23px !important;
border-color: #2f4f4f !important; /* Darker color for cell borders */
}
.handsontable th {
border-color: #2f4f4f !important; /* Darker color for header cell borders */
}
/* Dark theme overrides for Handsontable */
html, body {
height: 100%; /* Full height */
margin: 0;
padding: 0;
background-color: #0d1b2a; /* Dark background for the page */
}
/* Ensure the container also has a dark background and full height */
#example {
background-color: #0d1b2a; /* Dark background for the container */
height: 100%; /* Full height */
}
.handsontable, .wtHolder {
color: #53A757; /* Green text */
background-color: #201F1F !important; /* Dark background for the table */
}
/* Specific overrides for table cells */
.handsontable .htCore td, .handsontable .htCore th {
background-color: #04151f !important; /* Dark background for cells */
color: #a7c957 !important; /* Green text */
}
/* Header cells */
.handsontable .htCore th {
background-color: #1b263b !important; /* Slightly lighter background for header cells */
color: #a7c957;
}
/* Override for current row & column highlight */
.ht__highlight {
background-color: #0d1b2a !important; /* Darker background for highlight */
}
/* Adjusting selection colors to fit the dark theme */
.ht_master .htBorders .current {
border-color: #4f772d !important; /* Green border for current selection */
}
.ht_master .htBorders .area {
border-color: #90a955 !important; /* Green border for selected area */
}
/* Customizing scrollbar for dark theme */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: #003049;
}
::-webkit-scrollbar-thumb {
background: #555;
}
::-webkit-scrollbar-thumb:hover {
background: #444;
}
.ascii-art-container {
white-space: nowrap; /* Prevents the content from wrapping */
text-align: center; /* Center the content horizontally */
width: 100%; /* Ensure the container spans the full width */
max-width: 100%; /* Ensures the container does not exceed the viewport width */
overflow: auto; /* In case the ASCII art is wider than the screen */
overflow-x: auto; /* Enables horizontal scrolling */
}
pre {
display: inline-block; /* Allows the <pre> block to be centered by text-align */
white-space: pre-wrap; /* Ensures that the ASCII art does not overflow the container */
word-wrap: break-word; /* Breaks the text to prevent overflow */
}
.ascii-art-container pre {
white-space: pre; /* Maintains spacing and formatting of the ASCII art */
overflow-x: auto; /* Allows horizontal scrolling if needed */
color: #32CD32; /* Light green color */
display: inline-block; /* Treats the pre element as a block while keeping it inline */
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Responsive design adjustments */
@media (max-width: 768px) {
.github-logo {
width: 24px;
height: 24px;
}
.handsontable td {
font-size: 12px;
height: 20px !important;
line-height: 20px !important;
}
.handsontable th {
font-size: 12px;
}
#example {
overflow-x: auto;
}
}
</style>
</head>
<body>
<a href="https://github.com/mthcht/ThreatHunting-Keywords" target="_blank">
<img src="https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg" alt="GitHub" class="github-logo">
</a>
<div class="ascii-art-container">
<pre>
▐▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▌
▐░▀█▀░█░█░█▀▄░█▀▀░█▀█░▀█▀░░░█░█░█░█░█▀█░▀█▀░▀█▀░█▀█░█▀▀░░░█░█░█▀▀░█░█░█░█░█▀█░█▀▄░█▀▄░█▀▀ ▌
▐░░█░░█▀█░█▀▄░█▀▀░█▀█░░█░░░░█▀█░█░█░█░█░░█░░░█░░█░█░█░█░░░█▀▄░█▀▀░░█░░█▄█░█░█░█▀▄░█░█░▀▀█ ▌
▐░░▀░░▀░▀░▀░▀░▀▀▀░▀░▀░░▀░░░░▀░▀░▀▀▀░▀░▀░░▀░░▀▀▀░▀░▀░▀▀▀░░░▀░▀░▀▀▀░░▀░░▀░▀░▀▀▀░▀░▀░▀▀░░▀▀▀ ▌
▐▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▌
</pre>
</div>
<div id="loadingIndicator" style="display:none; text-align:center; color: #0D5C2D;">
<div class="spinner" style="display:inline-block; margin-left:10px; border: 4px solid rgba(50,205,50,.3); border-radius: 50%; border-top-color: #fff; width: 24px; height: 24px; animation: spin 1s ease-in-out infinite;"></div>
</div>
<div id="example"></div>
<script>
document.addEventListener('DOMContentLoaded', function() {
loadCSV('threathunting-keywords.csv');
});
function loadCSV(filePath) {
// Show loading indicator
document.getElementById('loadingIndicator').style.display = 'block';
fetch(filePath)
.then(response => response.text())
.then(csvText => {
Papa.parse(csvText, {
header: true,
dynamicTyping: true,
skipEmptyLines: true,
complete: function(results) {
var data = results.data;
if (data.length === 0 || (data.length === 1 && !data[0])) {
return;
}
// Original column headers from the data
var originalColHeaders = Object.keys(data[0]);
// Adjusted column headers for display
var colHeaders = originalColHeaders.map(header =>
header.startsWith('metadata_') ? header.substring(9) : header
);
// Map original data fields to adjusted column headers for Handsontable
var columns = originalColHeaders.map(header => ({
data: header,
type: 'text',
title: header.startsWith('metadata_') ? header.substring(9) : header
}));
createHandsontable(data, colHeaders, columns);
// Hide loading indicator once loading is complete
document.getElementById('loadingIndicator').style.display = 'none';
}
});
})
.catch(error => {
console.error('Error loading the CSV file:', error);
// Hide loading indicator in case of error
document.getElementById('loadingIndicator').style.display = 'none';
});
}
function createHandsontable(data, colHeaders, columns) {
var container = document.getElementById('example');
if (window.hot) {
window.hot.destroy(); // Destroy existing Handsontable instance if exists
}
window.hot = new Handsontable(container, {
data: data,
colHeaders: colHeaders,
rowHeaders: true,
columns: columns.map(column => {
// Check if the column is the one that needs custom width
if (column.data === 'keyword') {
return { ...column, width: 200 }; // Custom width for this specific column
}
if (column.data === 'metadata_keyword_regex') {
return { ...column, width: 110 }; // Custom width for this specific column
}
if (column.data === 'metadata_keyword_type') {
return { ...column, width: 150 }; // Custom width for this specific column
}
if (column.data === 'metadata_description') {
return { ...column, width: 200 }; // Custom width for this specific column
}
if (column.data === 'metadata_malwares_name') {
return { ...column, width: 50 }; // Custom width for this specific column
}
if (column.data === 'metadata_tool_techniques') {
return { ...column, width: 120 }; // Custom width for this specific column
}
if (column.data === 'metadata_tool_tactics') {
return { ...column, width: 120 }; // Custom width for this specific column
}
if (column.data === 'metadata_groups_name') {
return { ...column, width: 50 }; // Custom width for this specific column
}
if (column.data === 'metadata_category') {
return { ...column, width: 150 }; // Custom width for this specific column
}
if (column.data === 'metadata_link') {
return { ...column, width: 150 }; // Custom width for this specific column
}
if (column.data === 'metadata_tool') {
return { ...column, width: 170 }; // Custom width for this specific column
}
if (column.data === 'metadata_comment') {
return { ...column, width: 100 }; // Custom width for this specific column
}
if (column.data === 'metadata_severity_score') {
return { ...column, width: 130 }; // Custom width for this specific column
}
if (column.data === 'metadata_popularity_score') {
return { ...column, width: 130 }; // Custom width for this specific column
}
return column; // Return other columns as is
}),
licenseKey: 'non-commercial-and-evaluation', // Specify the license key here
colWidths: 100, // Set fixed width for all columns
rowHeights: 23, // Set initial height for all rows
manualColumnResize: true, // Allow manual resizing of columns
manualRowResize: true, // Allow manual resizing of rows
filters: true,
dropdownMenu: true,
// enable sorting for all columns
columnSorting: true
});
}
</script>
</body>
</html>