cyberchef 9.37.2 → 9.38.1

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +7 -2
  2. package/Gruntfile.js +2 -1
  3. package/package.json +4 -2
  4. package/src/core/config/Categories.json +1 -0
  5. package/src/core/config/OperationConfig.json +106 -3
  6. package/src/core/config/modules/Default.mjs +2 -0
  7. package/src/core/config/scripts/newMinorVersion.mjs +144 -0
  8. package/src/core/lib/Binary.mjs +9 -5
  9. package/src/core/lib/Extract.mjs +16 -11
  10. package/src/core/lib/FileSignatures.mjs +12 -12
  11. package/src/core/lib/Protocol.mjs +47 -0
  12. package/src/core/lib/Sort.mjs +105 -0
  13. package/src/core/lib/Stream.mjs +22 -12
  14. package/src/core/operations/ExtractDates.mjs +7 -1
  15. package/src/core/operations/ExtractDomains.mjs +29 -5
  16. package/src/core/operations/ExtractEmailAddresses.mjs +29 -5
  17. package/src/core/operations/ExtractFilePaths.mjs +38 -14
  18. package/src/core/operations/ExtractIPAddresses.mjs +44 -27
  19. package/src/core/operations/ExtractMACAddresses.mjs +28 -6
  20. package/src/core/operations/ExtractURLs.mjs +28 -5
  21. package/src/core/operations/ParseTCP.mjs +245 -0
  22. package/src/core/operations/ParseUDP.mjs +29 -24
  23. package/src/core/operations/Sort.mjs +5 -105
  24. package/src/core/operations/Strings.mjs +36 -14
  25. package/src/core/operations/ToBase45.mjs +4 -0
  26. package/src/core/operations/ToHex.mjs +2 -2
  27. package/src/core/operations/Unique.mjs +25 -5
  28. package/src/core/operations/index.mjs +2 -0
  29. package/src/node/index.mjs +5 -0
  30. package/src/web/App.mjs +10 -5
  31. package/src/web/html/index.html +12 -10
  32. package/src/web/stylesheets/components/_pane.css +11 -4
  33. package/src/web/stylesheets/layout/_controls.css +4 -0
  34. package/src/web/stylesheets/layout/_io.css +1 -2
  35. package/src/web/stylesheets/layout/_structure.css +2 -2
  36. package/src/web/waiters/OperationsWaiter.mjs +5 -1
  37. package/src/web/waiters/OutputWaiter.mjs +2 -0
  38. package/src/web/waiters/WindowWaiter.mjs +2 -2
  39. package/tests/node/tests/operations.mjs +3 -4
  40. package/tests/operations/index.mjs +1 -0
  41. package/tests/operations/tests/ExtractEmailAddresses.mjs +4 -4
  42. package/tests/operations/tests/ParseTCP.mjs +44 -0
  43. package/tests/operations/tests/ParseUDP.mjs +5 -18
  44. package/webpack.config.js +11 -0
package/src/web/App.mjs CHANGED
@@ -57,7 +57,7 @@ class App {
57
57
  this.populateOperationsList();
58
58
  this.manager.setup();
59
59
  this.manager.output.saveBombe();
60
- this.resetLayout();
60
+ this.adjustComponentSizes();
61
61
  this.setCompileMessage();
62
62
 
63
63
  log.debug("App loaded");
@@ -295,9 +295,7 @@ class App {
295
295
  gutterSize: 4,
296
296
  expandToMin: true,
297
297
  onDrag: debounce(function() {
298
- this.manager.recipe.adjustWidth();
299
- this.manager.input.calcMaxTabs();
300
- this.manager.output.calcMaxTabs();
298
+ this.adjustComponentSizes();
301
299
  }, 50, "dragSplitter", this, [])
302
300
  });
303
301
 
@@ -307,7 +305,7 @@ class App {
307
305
  minSize: minimise ? [0, 0] : [100, 100]
308
306
  });
309
307
 
310
- this.resetLayout();
308
+ this.adjustComponentSizes();
311
309
  }
312
310
 
313
311
 
@@ -581,6 +579,13 @@ class App {
581
579
  resetLayout() {
582
580
  this.columnSplitter.setSizes([20, 30, 50]);
583
581
  this.ioSplitter.setSizes([50, 50]);
582
+ this.adjustComponentSizes();
583
+ }
584
+
585
+ /**
586
+ * Adjust components to fit their containers.
587
+ */
588
+ adjustComponentSizes() {
584
589
  this.manager.recipe.adjustWidth();
585
590
  this.manager.input.calcMaxTabs();
586
591
  this.manager.output.calcMaxTabs();
@@ -176,7 +176,7 @@
176
176
  <div id="recipe" class="split split-horizontal no-select">
177
177
  <div class="title no-select">
178
178
  Recipe
179
- <span class="float-right">
179
+ <span class="pane-controls hide-on-maximised-output">
180
180
  <button type="button" class="btn btn-primary bmd-btn-icon" id="save" data-toggle="tooltip" title="Save recipe">
181
181
  <i class="material-icons">save</i>
182
182
  </button>
@@ -190,7 +190,7 @@
190
190
  </div>
191
191
  <ul id="rec-list" class="list-area no-select"></ul>
192
192
 
193
- <div id="controls" class="no-select">
193
+ <div id="controls" class="no-select hide-on-maximised-output">
194
194
  <div id="controls-content" class="d-flex align-items-center">
195
195
  <button type="button" class="mx-2 btn btn-lg btn-secondary" id="step" data-toggle="tooltip" title="Step through the recipe">
196
196
  Step
@@ -217,7 +217,10 @@
217
217
  <div id="input" class="split no-select">
218
218
  <div class="title no-select">
219
219
  <label for="input-text">Input</label>
220
- <span class="float-right">
220
+ <span class="pane-controls">
221
+ <div class="io-info" id="input-files-info"></div>
222
+ <div class="io-info" id="input-selection-info"></div>
223
+ <div class="io-info" id="input-info"></div>
221
224
  <button type="button" class="btn btn-primary bmd-btn-icon" id="btn-new-tab" data-toggle="tooltip" title="Add a new input tab">
222
225
  <i class="material-icons">add</i>
223
226
  </button>
@@ -236,9 +239,7 @@
236
239
  <i class="material-icons">view_compact</i>
237
240
  </button>
238
241
  </span>
239
- <div class="io-info" id="input-files-info"></div>
240
- <div class="io-info" id="input-info"></div>
241
- <div class="io-info" id="input-selection-info"></div>
242
+
242
243
  </div>
243
244
  <div id="input-tabs-wrapper" style="display: none;" class="no-select">
244
245
  <span id="btn-previous-input-tab" class="input-tab-buttons">
@@ -288,7 +289,10 @@
288
289
  <div id="output" class="split">
289
290
  <div class="title no-select">
290
291
  <label for="output-text">Output</label>
291
- <span class="float-right">
292
+ <span class="pane-controls">
293
+ <div class="io-info" id="bake-info"></div>
294
+ <div class="io-info" id="output-selection-info"></div>
295
+ <div class="io-info" id="output-info"></div>
292
296
  <button type="button" class="btn btn-primary bmd-btn-icon" id="save-all-to-file" data-toggle="tooltip" title="Save all outputs to a zip file" style="display: none">
293
297
  <i class="material-icons">archive</i>
294
298
  </button>
@@ -308,9 +312,7 @@
308
312
  <i class="material-icons">fullscreen</i>
309
313
  </button>
310
314
  </span>
311
- <div class="io-info" id="bake-info"></div>
312
- <div class="io-info" id="output-info"></div>
313
- <div class="io-info" id="output-selection-info"></div>
315
+
314
316
  <button type="button" class="btn btn-primary bmd-btn-icon hidden" id="magic" data-toggle="tooltip" title="Magic!" data-html="true">
315
317
  <svg width="22" height="22" viewBox="0 0 24 24">
316
318
  <path d="M7.5,5.6L5,7L6.4,4.5L5,2L7.5,3.4L10,2L8.6,4.5L10,7L7.5,5.6M19.5,15.4L22,14L20.6,16.5L22,19L19.5,17.6L17,19L18.4,16.5L17,14L19.5,15.4M22,2L20.6,4.5L22,7L19.5,5.6L17,7L18.4,4.5L17,2L19.5,3.4L22,2M13.34,12.78L15.78,10.34L13.66,8.22L11.22,10.66L13.34,12.78M14.37,7.29L16.71,9.63C17.1,10 17.1,10.65 16.71,11.04L5.04,22.71C4.65,23.1 4,23.1 3.63,22.71L1.29,20.37C0.9,20 0.9,19.35 1.29,18.96L12.96,7.29C13.35,6.9 14,6.9 14.37,7.29Z" />
@@ -24,9 +24,16 @@
24
24
  line-height: calc(var(--title-height) - 14px);
25
25
  }
26
26
 
27
- .title>span,
28
- .title>.btn {
29
- margin-top: -4px;
27
+ .pane-controls {
28
+ position: absolute;
29
+ right: 8px;
30
+ top: 8px;
31
+ display: flex;
32
+ flex-direction: row;
33
+ }
34
+
35
+ .pane-controls .btn {
36
+ margin-left: 2px;
30
37
  }
31
38
 
32
39
  .list-area {
@@ -107,4 +114,4 @@
107
114
 
108
115
  #files .card-header .float-right a:hover {
109
116
  text-decoration: none;
110
- }
117
+ }
@@ -58,6 +58,10 @@
58
58
  border-radius: 30px;
59
59
  }
60
60
 
61
+ .output-maximised .hide-on-maximised-output {
62
+ display: none !important;
63
+ }
64
+
61
65
  .spin {
62
66
  animation-name: spin;
63
67
  animation-duration: 3s;
@@ -280,9 +280,8 @@
280
280
  }
281
281
 
282
282
  .io-info {
283
- margin-right: 20px;
283
+ margin-right: 18px;
284
284
  margin-top: 1px;
285
- float: right;
286
285
  height: 30px;
287
286
  text-align: right;
288
287
  line-height: 12px;
@@ -39,8 +39,8 @@ div#output {
39
39
 
40
40
  .split {
41
41
  box-sizing: border-box;
42
- /* overflow: auto;
43
- Removed to enable Background Magic button pulse to overflow.
42
+ /* overflow: auto; */
43
+ /* Removed to enable Background Magic button pulse to overflow.
44
44
  Replace this rule if it seems to be causing problems. */
45
45
  position: relative;
46
46
  }
@@ -109,11 +109,15 @@ class OperationsWaiter {
109
109
  const matchedOps = [];
110
110
  const matchedDescs = [];
111
111
 
112
+ // Create version with no whitespace for the fuzzy match
113
+ // Helps avoid missing matches e.g. query "TCP " would not find "Parse TCP"
114
+ const inStrNWS = inStr.replace(/\s/g, "");
115
+
112
116
  for (const opName in this.app.operations) {
113
117
  const op = this.app.operations[opName];
114
118
 
115
119
  // Match op name using fuzzy match
116
- const [nameMatch, score, idxs] = fuzzyMatch(inStr, opName);
120
+ const [nameMatch, score, idxs] = fuzzyMatch(inStrNWS, opName);
117
121
 
118
122
  // Match description based on exact match
119
123
  const descPos = op.description.toLowerCase().indexOf(inStr.toLowerCase());
@@ -1373,6 +1373,7 @@ class OutputWaiter {
1373
1373
  const el = e.target.id === "maximise-output" ? e.target : e.target.parentNode;
1374
1374
 
1375
1375
  if (el.getAttribute("data-original-title").indexOf("Maximise") === 0) {
1376
+ document.body.classList.add("output-maximised");
1376
1377
  this.app.initialiseSplitter(true);
1377
1378
  this.app.columnSplitter.collapse(0);
1378
1379
  this.app.columnSplitter.collapse(1);
@@ -1381,6 +1382,7 @@ class OutputWaiter {
1381
1382
  $(el).attr("data-original-title", "Restore output pane");
1382
1383
  el.querySelector("i").innerHTML = "fullscreen_exit";
1383
1384
  } else {
1385
+ document.body.classList.remove("output-maximised");
1384
1386
  $(el).attr("data-original-title", "Maximise output pane");
1385
1387
  el.querySelector("i").innerHTML = "fullscreen";
1386
1388
  this.app.initialiseSplitter(false);
@@ -23,11 +23,11 @@ class WindowWaiter {
23
23
 
24
24
  /**
25
25
  * Handler for window resize events.
26
- * Resets the layout of CyberChef's panes after 200ms (so that continuous resizing doesn't cause
26
+ * Resets adjustable component sizes after 200ms (so that continuous resizing doesn't cause
27
27
  * continuous resetting).
28
28
  */
29
29
  windowResize() {
30
- debounce(this.app.resetLayout, 200, "windowResize", this.app, [])();
30
+ debounce(this.app.adjustComponentSizes, 200, "windowResize", this.app, [])();
31
31
  }
32
32
 
33
33
 
@@ -471,7 +471,7 @@ color: white;
471
471
  }),
472
472
 
473
473
  it("Extract dates", () => {
474
- assert.strictEqual(chef.extractDates("Don't Look a Gift Horse In The Mouth 01/02/1992").toString(), "01/02/1992\n");
474
+ assert.strictEqual(chef.extractDates("Don't Look a Gift Horse In The Mouth 01/02/1992").toString(), "01/02/1992");
475
475
  }),
476
476
 
477
477
  it("Filter", () => {
@@ -859,7 +859,7 @@ pCGTErs=
859
859
  }),
860
860
 
861
861
  it("SQL Beautify", () => {
862
- const result = chef.SQLBeautify(`SELECT MONTH, ID, RAIN_I, TEMP_F
862
+ const result = chef.SQLBeautify(`SELECT MONTH, ID, RAIN_I, TEMP_F
863
863
  FROM STATS;`);
864
864
  const expected = `SELECT MONTH,
865
865
  ID,
@@ -879,8 +879,7 @@ FROM STATS;`;
879
879
  const result = chef.strings("smothering ampersand abreast", {displayTotal: true});
880
880
  const expected = `Total found: 1
881
881
 
882
- smothering ampersand abreast
883
- `;
882
+ smothering ampersand abreast`;
884
883
  assert.strictEqual(result.toString(), expected);
885
884
  }),
886
885
 
@@ -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";
@@ -11,7 +11,7 @@ TestRegister.addTests([
11
11
  {
12
12
  name: "Extract email address",
13
13
  input: "email@example.com\nfirstname.lastname@example.com\nemail@subdomain.example.com\nfirstname+lastname@example.com\n1234567890@example.com\nemail@example-one.com\n_______@example.com email@example.name\nemail@example.museum email@example.co.jp firstname-lastname@example.com",
14
- expectedOutput: "email@example.com\nfirstname.lastname@example.com\nemail@subdomain.example.com\nfirstname+lastname@example.com\n1234567890@example.com\nemail@example-one.com\n_______@example.com\nemail@example.name\nemail@example.museum\nemail@example.co.jp\nfirstname-lastname@example.com\n",
14
+ expectedOutput: "email@example.com\nfirstname.lastname@example.com\nemail@subdomain.example.com\nfirstname+lastname@example.com\n1234567890@example.com\nemail@example-one.com\n_______@example.com\nemail@example.name\nemail@example.museum\nemail@example.co.jp\nfirstname-lastname@example.com",
15
15
  recipeConfig: [
16
16
  {
17
17
  "op": "Extract email addresses",
@@ -22,7 +22,7 @@ TestRegister.addTests([
22
22
  {
23
23
  name: "Extract email address - Display total",
24
24
  input: "email@example.com\nfirstname.lastname@example.com\nemail@subdomain.example.com\nfirstname+lastname@example.com\n1234567890@example.com\nemail@example-one.com\n_______@example.com email@example.name\nemail@example.museum email@example.co.jp firstname-lastname@example.com",
25
- expectedOutput: "Total found: 11\n\nemail@example.com\nfirstname.lastname@example.com\nemail@subdomain.example.com\nfirstname+lastname@example.com\n1234567890@example.com\nemail@example-one.com\n_______@example.com\nemail@example.name\nemail@example.museum\nemail@example.co.jp\nfirstname-lastname@example.com\n",
25
+ expectedOutput: "Total found: 11\n\nemail@example.com\nfirstname.lastname@example.com\nemail@subdomain.example.com\nfirstname+lastname@example.com\n1234567890@example.com\nemail@example-one.com\n_______@example.com\nemail@example.name\nemail@example.museum\nemail@example.co.jp\nfirstname-lastname@example.com",
26
26
  recipeConfig: [
27
27
  {
28
28
  "op": "Extract email addresses",
@@ -33,7 +33,7 @@ TestRegister.addTests([
33
33
  {
34
34
  name: "Extract email address (Internationalized)",
35
35
  input: "\u4f0a\u662d\u5091@\u90f5\u4ef6.\u5546\u52d9 \u093e\u092e@\u092e\u094b\u0939\u0928.\u0908\u0928\u094d\u092b\u094b\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c \u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc Jos\u1ec5Silv\u1ec5@googl\u1ec5.com\nJos\u1ec5Silv\u1ec5@google.com and Jos\u1ec5Silva@google.com\nFoO@BaR.CoM, john@192.168.10.100\ng\xf3mez@junk.br and Abc.123@example.com.\nuser+mailbox/department=shipping@example.com\n\u7528\u6237@\u4f8b\u5b50.\u5e7f\u544a\n\u0909\u092a\u092f\u094b\u0917\u0915\u0930\u094d\u0924\u093e@\u0909\u0926\u093e\u0939\u0930\u0923.\u0915\u0949\u092e\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nD\xf6rte@S\xf6rensen.example.com\n\u0430\u0434\u0436\u0430\u0439@\u044d\u043a\u0437\u0430\u043c\u043f\u043b.\u0440\u0443\u0441\ntest@xn--bcher-kva.com",
36
- expectedOutput: "\u4f0a\u662d\u5091@\u90f5\u4ef6.\u5546\u52d9\n\u093e\u092e@\u092e\u094b\u0939\u0928.\u0908\u0928\u094d\u092b\u094b\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nJos\u1ec5Silv\u1ec5@googl\u1ec5.com\nJos\u1ec5Silv\u1ec5@google.com\nJos\u1ec5Silva@google.com\nFoO@BaR.CoM\njohn@192.168.10.100\ng\xf3mez@junk.br\nAbc.123@example.com\nuser+mailbox/department=shipping@example.com\n\u7528\u6237@\u4f8b\u5b50.\u5e7f\u544a\n\u0909\u092a\u092f\u094b\u0917\u0915\u0930\u094d\u0924\u093e@\u0909\u0926\u093e\u0939\u0930\u0923.\u0915\u0949\u092e\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nD\xf6rte@S\xf6rensen.example.com\n\u0430\u0434\u0436\u0430\u0439@\u044d\u043a\u0437\u0430\u043c\u043f\u043b.\u0440\u0443\u0441\ntest@xn--bcher-kva.com\n",
36
+ expectedOutput: "\u4f0a\u662d\u5091@\u90f5\u4ef6.\u5546\u52d9\n\u093e\u092e@\u092e\u094b\u0939\u0928.\u0908\u0928\u094d\u092b\u094b\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nJos\u1ec5Silv\u1ec5@googl\u1ec5.com\nJos\u1ec5Silv\u1ec5@google.com\nJos\u1ec5Silva@google.com\nFoO@BaR.CoM\njohn@192.168.10.100\ng\xf3mez@junk.br\nAbc.123@example.com\nuser+mailbox/department=shipping@example.com\n\u7528\u6237@\u4f8b\u5b50.\u5e7f\u544a\n\u0909\u092a\u092f\u094b\u0917\u0915\u0930\u094d\u0924\u093e@\u0909\u0926\u093e\u0939\u0930\u0923.\u0915\u0949\u092e\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nD\xf6rte@S\xf6rensen.example.com\n\u0430\u0434\u0436\u0430\u0439@\u044d\u043a\u0437\u0430\u043c\u043f\u043b.\u0440\u0443\u0441\ntest@xn--bcher-kva.com",
37
37
  recipeConfig: [
38
38
  {
39
39
  "op": "Extract email addresses",
@@ -44,7 +44,7 @@ TestRegister.addTests([
44
44
  {
45
45
  name: "Extract email address - Display total (Internationalized)",
46
46
  input: "\u4f0a\u662d\u5091@\u90f5\u4ef6.\u5546\u52d9 \u093e\u092e@\u092e\u094b\u0939\u0928.\u0908\u0928\u094d\u092b\u094b\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c \u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc Jos\u1ec5Silv\u1ec5@googl\u1ec5.com\nJos\u1ec5Silv\u1ec5@google.com and Jos\u1ec5Silva@google.com\nFoO@BaR.CoM, john@192.168.10.100\ng\xf3mez@junk.br and Abc.123@example.com.\nuser+mailbox/department=shipping@example.com\n\u7528\u6237@\u4f8b\u5b50.\u5e7f\u544a\n\u0909\u092a\u092f\u094b\u0917\u0915\u0930\u094d\u0924\u093e@\u0909\u0926\u093e\u0939\u0930\u0923.\u0915\u0949\u092e\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nD\xf6rte@S\xf6rensen.example.com\n\u0430\u0434\u0436\u0430\u0439@\u044d\u043a\u0437\u0430\u043c\u043f\u043b.\u0440\u0443\u0441\ntest@xn--bcher-kva.com",
47
- expectedOutput: "Total found: 19\n\n\u4f0a\u662d\u5091@\u90f5\u4ef6.\u5546\u52d9\n\u093e\u092e@\u092e\u094b\u0939\u0928.\u0908\u0928\u094d\u092b\u094b\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nJos\u1ec5Silv\u1ec5@googl\u1ec5.com\nJos\u1ec5Silv\u1ec5@google.com\nJos\u1ec5Silva@google.com\nFoO@BaR.CoM\njohn@192.168.10.100\ng\xf3mez@junk.br\nAbc.123@example.com\nuser+mailbox/department=shipping@example.com\n\u7528\u6237@\u4f8b\u5b50.\u5e7f\u544a\n\u0909\u092a\u092f\u094b\u0917\u0915\u0930\u094d\u0924\u093e@\u0909\u0926\u093e\u0939\u0930\u0923.\u0915\u0949\u092e\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nD\xf6rte@S\xf6rensen.example.com\n\u0430\u0434\u0436\u0430\u0439@\u044d\u043a\u0437\u0430\u043c\u043f\u043b.\u0440\u0443\u0441\ntest@xn--bcher-kva.com\n",
47
+ expectedOutput: "Total found: 19\n\n\u4f0a\u662d\u5091@\u90f5\u4ef6.\u5546\u52d9\n\u093e\u092e@\u092e\u094b\u0939\u0928.\u0908\u0928\u094d\u092b\u094b\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nJos\u1ec5Silv\u1ec5@googl\u1ec5.com\nJos\u1ec5Silv\u1ec5@google.com\nJos\u1ec5Silva@google.com\nFoO@BaR.CoM\njohn@192.168.10.100\ng\xf3mez@junk.br\nAbc.123@example.com\nuser+mailbox/department=shipping@example.com\n\u7528\u6237@\u4f8b\u5b50.\u5e7f\u544a\n\u0909\u092a\u092f\u094b\u0917\u0915\u0930\u094d\u0924\u093e@\u0909\u0926\u093e\u0939\u0930\u0923.\u0915\u0949\u092e\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nD\xf6rte@S\xf6rensen.example.com\n\u0430\u0434\u0436\u0430\u0439@\u044d\u043a\u0437\u0430\u043c\u043f\u043b.\u0440\u0443\u0441\ntest@xn--bcher-kva.com",
48
48
  recipeConfig: [
49
49
  {
50
50
  "op": "Extract email addresses",
@@ -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\":\"0101\"}",
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\":\"0101\",\"Data\":\"0202\"}",
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: {