cyberchef 9.37.3 → 9.38.2
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/CHANGELOG.md +7 -2
- package/Gruntfile.js +2 -1
- package/package.json +4 -2
- package/src/core/config/Categories.json +1 -0
- package/src/core/config/OperationConfig.json +30 -2
- package/src/core/config/modules/Default.mjs +2 -0
- package/src/core/config/scripts/newMinorVersion.mjs +144 -0
- package/src/core/lib/Binary.mjs +9 -5
- package/src/core/lib/FileSignatures.mjs +12 -12
- package/src/core/lib/Protocol.mjs +47 -0
- package/src/core/lib/Stream.mjs +22 -12
- package/src/core/operations/ParseTCP.mjs +245 -0
- package/src/core/operations/ParseUDP.mjs +29 -24
- package/src/core/operations/Substitute.mjs +5 -5
- package/src/core/operations/ToBase45.mjs +4 -0
- package/src/core/operations/ToHex.mjs +2 -2
- package/src/core/operations/index.mjs +2 -0
- package/src/node/index.mjs +5 -0
- package/src/web/App.mjs +10 -5
- package/src/web/html/index.html +12 -10
- package/src/web/stylesheets/components/_pane.css +11 -4
- package/src/web/stylesheets/layout/_controls.css +4 -0
- package/src/web/stylesheets/layout/_io.css +1 -2
- package/src/web/stylesheets/layout/_structure.css +2 -2
- package/src/web/waiters/OperationsWaiter.mjs +5 -1
- package/src/web/waiters/OutputWaiter.mjs +2 -0
- package/src/web/waiters/WindowWaiter.mjs +2 -2
- package/tests/operations/index.mjs +1 -0
- package/tests/operations/tests/ParseTCP.mjs +44 -0
- package/tests/operations/tests/ParseUDP.mjs +5 -18
- package/webpack.config.js +11 -0
|
@@ -96,6 +96,7 @@ import "./tests/Protobuf.mjs";
|
|
|
96
96
|
import "./tests/ParseSSHHostKey.mjs";
|
|
97
97
|
import "./tests/DefangIP.mjs";
|
|
98
98
|
import "./tests/ParseUDP.mjs";
|
|
99
|
+
import "./tests/ParseTCP.mjs";
|
|
99
100
|
import "./tests/AvroToJSON.mjs";
|
|
100
101
|
import "./tests/Lorenz.mjs";
|
|
101
102
|
import "./tests/LuhnChecksum.mjs";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse TCP tests.
|
|
3
|
+
*
|
|
4
|
+
* @author n1474335
|
|
5
|
+
* @copyright Crown Copyright 2022
|
|
6
|
+
* @license Apache-2.0
|
|
7
|
+
*/
|
|
8
|
+
import TestRegister from "../../lib/TestRegister.mjs";
|
|
9
|
+
|
|
10
|
+
TestRegister.addTests([
|
|
11
|
+
{
|
|
12
|
+
name: "Parse TCP: No options",
|
|
13
|
+
input: "c2eb0050a138132e70dc9fb9501804025ea70000",
|
|
14
|
+
expectedMatch: /1026 \(Scaled: 1026\)/,
|
|
15
|
+
recipeConfig: [
|
|
16
|
+
{
|
|
17
|
+
op: "Parse TCP",
|
|
18
|
+
args: ["Hex"],
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "Parse TCP: Options",
|
|
24
|
+
input: "c2eb0050a1380c1f000000008002faf080950000020405b40103030801010402",
|
|
25
|
+
expectedMatch: /1460/,
|
|
26
|
+
recipeConfig: [
|
|
27
|
+
{
|
|
28
|
+
op: "Parse TCP",
|
|
29
|
+
args: ["Hex"],
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "Parse TCP: Timestamps",
|
|
35
|
+
input: "9e90e11574d57b2c00000000a002ffffe5740000020405b40402080aa4e8c8f50000000001030308",
|
|
36
|
+
expectedMatch: /2766719221/,
|
|
37
|
+
recipeConfig: [
|
|
38
|
+
{
|
|
39
|
+
op: "Parse TCP",
|
|
40
|
+
args: ["Hex"],
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
}
|
|
44
|
+
]);
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Parse UDP tests.
|
|
3
3
|
*
|
|
4
4
|
* @author h345983745
|
|
5
|
-
*
|
|
6
5
|
* @copyright Crown Copyright 2019
|
|
7
6
|
* @license Apache-2.0
|
|
8
7
|
*/
|
|
@@ -12,15 +11,11 @@ TestRegister.addTests([
|
|
|
12
11
|
{
|
|
13
12
|
name: "Parse UDP: No Data - JSON",
|
|
14
13
|
input: "04 89 00 35 00 2c 01 01",
|
|
15
|
-
expectedOutput: "{\"Source port\":1161,\"Destination port\":53,\"Length\":44,\"Checksum\":\"
|
|
14
|
+
expectedOutput: "{\"Source port\":1161,\"Destination port\":53,\"Length\":44,\"Checksum\":\"0x0101\"}",
|
|
16
15
|
recipeConfig: [
|
|
17
|
-
{
|
|
18
|
-
op: "From Hex",
|
|
19
|
-
args: ["Auto"],
|
|
20
|
-
},
|
|
21
16
|
{
|
|
22
17
|
op: "Parse UDP",
|
|
23
|
-
args: [],
|
|
18
|
+
args: ["Hex"],
|
|
24
19
|
},
|
|
25
20
|
{
|
|
26
21
|
op: "JSON Minify",
|
|
@@ -30,15 +25,11 @@ TestRegister.addTests([
|
|
|
30
25
|
}, {
|
|
31
26
|
name: "Parse UDP: With Data - JSON",
|
|
32
27
|
input: "04 89 00 35 00 2c 01 01 02 02",
|
|
33
|
-
expectedOutput: "{\"Source port\":1161,\"Destination port\":53,\"Length\":44,\"Checksum\":\"
|
|
28
|
+
expectedOutput: "{\"Source port\":1161,\"Destination port\":53,\"Length\":44,\"Checksum\":\"0x0101\",\"Data\":\"0x0202\"}",
|
|
34
29
|
recipeConfig: [
|
|
35
|
-
{
|
|
36
|
-
op: "From Hex",
|
|
37
|
-
args: ["Auto"],
|
|
38
|
-
},
|
|
39
30
|
{
|
|
40
31
|
op: "Parse UDP",
|
|
41
|
-
args: [],
|
|
32
|
+
args: ["Hex"],
|
|
42
33
|
},
|
|
43
34
|
{
|
|
44
35
|
op: "JSON Minify",
|
|
@@ -51,13 +42,9 @@ TestRegister.addTests([
|
|
|
51
42
|
input: "04 89 00",
|
|
52
43
|
expectedOutput: "Need 8 bytes for a UDP Header",
|
|
53
44
|
recipeConfig: [
|
|
54
|
-
{
|
|
55
|
-
op: "From Hex",
|
|
56
|
-
args: ["Auto"],
|
|
57
|
-
},
|
|
58
45
|
{
|
|
59
46
|
op: "Parse UDP",
|
|
60
|
-
args: [],
|
|
47
|
+
args: ["Hex"],
|
|
61
48
|
},
|
|
62
49
|
{
|
|
63
50
|
op: "JSON Minify",
|
package/webpack.config.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const webpack = require("webpack");
|
|
2
2
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
3
3
|
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
|
4
|
+
const { ModifySourcePlugin } = require("modify-source-webpack-plugin");
|
|
4
5
|
const path = require("path");
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -82,6 +83,16 @@ module.exports = {
|
|
|
82
83
|
to: "assets/forge/"
|
|
83
84
|
}
|
|
84
85
|
]
|
|
86
|
+
}),
|
|
87
|
+
new ModifySourcePlugin({
|
|
88
|
+
rules: [
|
|
89
|
+
{
|
|
90
|
+
// Fix toSpare(0) bug in Split.js by avoiding gutter accomodation
|
|
91
|
+
test: /split\.es\.js$/,
|
|
92
|
+
modify: (src, path) =>
|
|
93
|
+
src.replace("if (pixelSize < elementMinSize)", "if (false)")
|
|
94
|
+
}
|
|
95
|
+
]
|
|
85
96
|
})
|
|
86
97
|
],
|
|
87
98
|
resolve: {
|