cyberchef 9.46.1 → 9.46.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nvmrc +1 -1
- package/package.json +3 -5
- package/src/core/config/OperationConfig.json +5 -0
- package/src/core/lib/Protobuf.mjs +1 -1
- package/src/core/operations/JPathExpression.mjs +21 -12
- package/src/web/stylesheets/index.js +1 -1
- package/tests/operations/tests/Code.mjs +25 -10
- package/tests/operations/tests/Protobuf.mjs +6 -6
- package/webpack.config.js +0 -13
- package/src/web/stylesheets/vendors/bootstrap.scss +0 -23
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
18
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cyberchef",
|
|
3
|
-
"version": "9.46.
|
|
3
|
+
"version": "9.46.4",
|
|
4
4
|
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
|
|
5
5
|
"author": "n1474335 <n1474335@gmail.com>",
|
|
6
6
|
"homepage": "https://gchq.github.io/CyberChef",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"babel-loader": "^8.2.5",
|
|
50
50
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
51
51
|
"babel-plugin-transform-builtin-extend": "1.1.2",
|
|
52
|
-
"chromedriver": "^
|
|
52
|
+
"chromedriver": "^103.0.0",
|
|
53
53
|
"cli-progress": "^3.11.1",
|
|
54
54
|
"colors": "^1.4.0",
|
|
55
55
|
"copy-webpack-plugin": "^11.0.0",
|
|
@@ -77,7 +77,6 @@
|
|
|
77
77
|
"postcss-import": "^14.1.0",
|
|
78
78
|
"postcss-loader": "^7.0.0",
|
|
79
79
|
"prompt": "^1.3.0",
|
|
80
|
-
"sass-loader": "^13.0.0",
|
|
81
80
|
"sitemap": "^7.1.1",
|
|
82
81
|
"terser": "^5.14.0",
|
|
83
82
|
"webpack": "^5.73.0",
|
|
@@ -123,7 +122,7 @@
|
|
|
123
122
|
"js-sha3": "^0.8.0",
|
|
124
123
|
"jsesc": "^3.0.2",
|
|
125
124
|
"json5": "^2.2.1",
|
|
126
|
-
"jsonpath": "^
|
|
125
|
+
"jsonpath-plus": "^7.2.0",
|
|
127
126
|
"jsonwebtoken": "^8.5.1",
|
|
128
127
|
"jsqr": "^1.4.0",
|
|
129
128
|
"jsrsasign": "^10.5.23",
|
|
@@ -140,7 +139,6 @@
|
|
|
140
139
|
"ngeohash": "^0.6.3",
|
|
141
140
|
"node-forge": "^1.3.1",
|
|
142
141
|
"node-md6": "^0.1.0",
|
|
143
|
-
"node-sass": "^7.0.1",
|
|
144
142
|
"nodom": "^2.4.0",
|
|
145
143
|
"notepack.io": "^3.0.1",
|
|
146
144
|
"nwmatcher": "^1.4.4",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @license Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import {JSONPath} from "jsonpath-plus";
|
|
8
8
|
import Operation from "../Operation.mjs";
|
|
9
9
|
import OperationError from "../errors/OperationError.mjs";
|
|
10
10
|
|
|
@@ -27,14 +27,20 @@ class JPathExpression extends Operation {
|
|
|
27
27
|
this.outputType = "string";
|
|
28
28
|
this.args = [
|
|
29
29
|
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
name: "Query",
|
|
31
|
+
type: "string",
|
|
32
|
+
value: ""
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
name: "Result delimiter",
|
|
36
|
+
type: "binaryShortString",
|
|
37
|
+
value: "\\n"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "Prevent eval",
|
|
41
|
+
type: "boolean",
|
|
42
|
+
value: true,
|
|
43
|
+
description: "Evaluated expressions are disabled by default for security reasons"
|
|
38
44
|
}
|
|
39
45
|
];
|
|
40
46
|
}
|
|
@@ -45,18 +51,21 @@ class JPathExpression extends Operation {
|
|
|
45
51
|
* @returns {string}
|
|
46
52
|
*/
|
|
47
53
|
run(input, args) {
|
|
48
|
-
const [query, delimiter] = args;
|
|
49
|
-
let results,
|
|
50
|
-
obj;
|
|
54
|
+
const [query, delimiter, preventEval] = args;
|
|
55
|
+
let results, jsonObj;
|
|
51
56
|
|
|
52
57
|
try {
|
|
53
|
-
|
|
58
|
+
jsonObj = JSON.parse(input);
|
|
54
59
|
} catch (err) {
|
|
55
60
|
throw new OperationError(`Invalid input JSON: ${err.message}`);
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
try {
|
|
59
|
-
results =
|
|
64
|
+
results = JSONPath({
|
|
65
|
+
path: query,
|
|
66
|
+
json: jsonObj,
|
|
67
|
+
preventEval: preventEval
|
|
68
|
+
});
|
|
60
69
|
} catch (err) {
|
|
61
70
|
throw new OperationError(`Invalid JPath expression: ${err.message}`);
|
|
62
71
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import "highlight.js/styles/vs.css";
|
|
11
11
|
|
|
12
12
|
/* Frameworks */
|
|
13
|
-
import "
|
|
13
|
+
import "bootstrap-material-design/dist/css/bootstrap-material-design.css";
|
|
14
14
|
import "bootstrap-colorpicker/dist/css/bootstrap-colorpicker.css";
|
|
15
15
|
|
|
16
16
|
/* CyberChef styles */
|
|
@@ -185,11 +185,11 @@ TestRegister.addTests([
|
|
|
185
185
|
{
|
|
186
186
|
name: "JPath Expression: Empty expression",
|
|
187
187
|
input: JSON.stringify(JSON_TEST_DATA),
|
|
188
|
-
expectedOutput: "
|
|
188
|
+
expectedOutput: "",
|
|
189
189
|
recipeConfig: [
|
|
190
190
|
{
|
|
191
191
|
"op": "JPath expression",
|
|
192
|
-
"args": ["", "\n"]
|
|
192
|
+
"args": ["", "\n", true]
|
|
193
193
|
}
|
|
194
194
|
],
|
|
195
195
|
},
|
|
@@ -205,7 +205,7 @@ TestRegister.addTests([
|
|
|
205
205
|
recipeConfig: [
|
|
206
206
|
{
|
|
207
207
|
"op": "JPath expression",
|
|
208
|
-
"args": ["$.store.book[*].author", "\n"]
|
|
208
|
+
"args": ["$.store.book[*].author", "\n", true]
|
|
209
209
|
}
|
|
210
210
|
],
|
|
211
211
|
},
|
|
@@ -223,7 +223,7 @@ TestRegister.addTests([
|
|
|
223
223
|
recipeConfig: [
|
|
224
224
|
{
|
|
225
225
|
"op": "JPath expression",
|
|
226
|
-
"args": ["$..title", "\n"]
|
|
226
|
+
"args": ["$..title", "\n", true]
|
|
227
227
|
}
|
|
228
228
|
],
|
|
229
229
|
},
|
|
@@ -238,7 +238,7 @@ TestRegister.addTests([
|
|
|
238
238
|
recipeConfig: [
|
|
239
239
|
{
|
|
240
240
|
"op": "JPath expression",
|
|
241
|
-
"args": ["$.store.*", "\n"]
|
|
241
|
+
"args": ["$.store.*", "\n", true]
|
|
242
242
|
}
|
|
243
243
|
],
|
|
244
244
|
},
|
|
@@ -249,7 +249,7 @@ TestRegister.addTests([
|
|
|
249
249
|
recipeConfig: [
|
|
250
250
|
{
|
|
251
251
|
"op": "JPath expression",
|
|
252
|
-
"args": ["$..book[-1:]", "\n"]
|
|
252
|
+
"args": ["$..book[-1:]", "\n", true]
|
|
253
253
|
}
|
|
254
254
|
],
|
|
255
255
|
},
|
|
@@ -263,7 +263,7 @@ TestRegister.addTests([
|
|
|
263
263
|
recipeConfig: [
|
|
264
264
|
{
|
|
265
265
|
"op": "JPath expression",
|
|
266
|
-
"args": ["$..book[:2]", "\n"]
|
|
266
|
+
"args": ["$..book[:2]", "\n", true]
|
|
267
267
|
}
|
|
268
268
|
],
|
|
269
269
|
},
|
|
@@ -277,7 +277,7 @@ TestRegister.addTests([
|
|
|
277
277
|
recipeConfig: [
|
|
278
278
|
{
|
|
279
279
|
"op": "JPath expression",
|
|
280
|
-
"args": ["$..book[?(@.isbn)]", "\n"]
|
|
280
|
+
"args": ["$..book[?(@.isbn)]", "\n", false]
|
|
281
281
|
}
|
|
282
282
|
],
|
|
283
283
|
},
|
|
@@ -292,7 +292,7 @@ TestRegister.addTests([
|
|
|
292
292
|
recipeConfig: [
|
|
293
293
|
{
|
|
294
294
|
"op": "JPath expression",
|
|
295
|
-
"args": ["$..book[?(@.price<30 && @.category==\"fiction\")]", "\n"]
|
|
295
|
+
"args": ["$..book[?(@.price<30 && @.category==\"fiction\")]", "\n", false]
|
|
296
296
|
}
|
|
297
297
|
],
|
|
298
298
|
},
|
|
@@ -306,9 +306,24 @@ TestRegister.addTests([
|
|
|
306
306
|
recipeConfig: [
|
|
307
307
|
{
|
|
308
308
|
"op": "JPath expression",
|
|
309
|
-
"args": ["$..book[?(@.price<10)]", "\n"]
|
|
309
|
+
"args": ["$..book[?(@.price<10)]", "\n", false]
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: "JPath Expression: Script-based expression",
|
|
315
|
+
input: "[{}]",
|
|
316
|
+
recipeConfig: [
|
|
317
|
+
{
|
|
318
|
+
"op": "JPath expression",
|
|
319
|
+
"args": [
|
|
320
|
+
"$..[?(({__proto__:[].constructor}).constructor(\"self.postMessage({action:'bakeComplete',data:{bakeId:1,dish:{type:1,value:''},duration:1,error:false,id:undefined,inputNum:2,progress:1,result:'<iframe/onload=debugger>',type: 'html'}});\")();)]",
|
|
321
|
+
"\n",
|
|
322
|
+
true
|
|
323
|
+
]
|
|
310
324
|
}
|
|
311
325
|
],
|
|
326
|
+
expectedOutput: "Invalid JPath expression: Eval [?(expr)] prevented in JSONPath expression."
|
|
312
327
|
},
|
|
313
328
|
{
|
|
314
329
|
name: "CSS selector",
|
|
@@ -40,10 +40,10 @@ TestRegister.addTests([
|
|
|
40
40
|
"Apple": [
|
|
41
41
|
28
|
|
42
42
|
],
|
|
43
|
-
"Banana": "You",
|
|
44
43
|
"Carrot": [
|
|
45
44
|
"Me"
|
|
46
|
-
]
|
|
45
|
+
],
|
|
46
|
+
"Banana": "You"
|
|
47
47
|
}, null, 4),
|
|
48
48
|
recipeConfig: [
|
|
49
49
|
{
|
|
@@ -72,10 +72,10 @@ TestRegister.addTests([
|
|
|
72
72
|
"Apple": [
|
|
73
73
|
28
|
|
74
74
|
],
|
|
75
|
-
"Banana": "You",
|
|
76
75
|
"Carrot": [
|
|
77
76
|
"Me"
|
|
78
|
-
]
|
|
77
|
+
],
|
|
78
|
+
"Banana": "You"
|
|
79
79
|
},
|
|
80
80
|
"Unknown Fields": {
|
|
81
81
|
"4": 43,
|
|
@@ -111,10 +111,10 @@ TestRegister.addTests([
|
|
|
111
111
|
"Apple": [
|
|
112
112
|
28
|
|
113
113
|
],
|
|
114
|
-
"Banana": "You",
|
|
115
114
|
"Carrot": [
|
|
116
115
|
"Me"
|
|
117
116
|
],
|
|
117
|
+
"Banana": "You",
|
|
118
118
|
"Date": 43,
|
|
119
119
|
"Elderberry": {
|
|
120
120
|
"Fig": "abc123",
|
|
@@ -154,10 +154,10 @@ TestRegister.addTests([
|
|
|
154
154
|
input: "0d1c0000001203596f751a024d65202b2a0a0a06616263313233120031ba32a96cc10200003801",
|
|
155
155
|
expectedOutput: JSON.stringify({
|
|
156
156
|
"Test": {
|
|
157
|
-
"Banana (string)": "You",
|
|
158
157
|
"Carrot (string)": [
|
|
159
158
|
"Me"
|
|
160
159
|
],
|
|
160
|
+
"Banana (string)": "You",
|
|
161
161
|
"Date (int32)": 43,
|
|
162
162
|
"Imbe (Options)": "Option1"
|
|
163
163
|
},
|
package/webpack.config.js
CHANGED
|
@@ -164,19 +164,6 @@ module.exports = {
|
|
|
164
164
|
"postcss-loader",
|
|
165
165
|
]
|
|
166
166
|
},
|
|
167
|
-
{
|
|
168
|
-
test: /\.scss$/,
|
|
169
|
-
use: [
|
|
170
|
-
{
|
|
171
|
-
loader: MiniCssExtractPlugin.loader,
|
|
172
|
-
options: {
|
|
173
|
-
publicPath: "../"
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
"css-loader",
|
|
177
|
-
"sass-loader",
|
|
178
|
-
]
|
|
179
|
-
},
|
|
180
167
|
{
|
|
181
168
|
test: /\.(ico|eot|ttf|woff|woff2)$/,
|
|
182
169
|
type: "asset/resource",
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bootstrap Material Design with overrides
|
|
3
|
-
*
|
|
4
|
-
* @author n1474335 [n1474335@gmail.com]
|
|
5
|
-
* @copyright Crown Copyright 2018
|
|
6
|
-
* @license Apache-2.0
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
@import "~bootstrap-material-design/scss/variables/colors";
|
|
10
|
-
|
|
11
|
-
$theme-colors: (
|
|
12
|
-
primary: $blue-700,
|
|
13
|
-
success: $green,
|
|
14
|
-
info: $light-blue,
|
|
15
|
-
warning: $deep-orange,
|
|
16
|
-
danger: $red,
|
|
17
|
-
light: $grey-100,
|
|
18
|
-
dark: $grey-800
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
$bmd-form-line-height: 1.25;
|
|
22
|
-
|
|
23
|
-
@import "~bootstrap-material-design/scss/core";
|