cyberchef 9.33.0 → 9.34.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.
package/CHANGELOG.md CHANGED
@@ -13,6 +13,9 @@ All major and minor version changes will be documented in this file. Details of
13
13
 
14
14
  ## Details
15
15
 
16
+ ### [9.34.0] - 2022-03-28
17
+ - 'Get All Casings' operation added [@n1073645] | [#1065]
18
+
16
19
  ### [9.33.0] - 2022-03-25
17
20
  - Updated to support Node 17 [@n1474335] [@john19696] [@t-8ch] | [[#1326] [#1313] [#1244]
18
21
  - Improved CJS and ESM module support [@d98762625] | [#1037]
@@ -275,6 +278,7 @@ All major and minor version changes will be documented in this file. Details of
275
278
 
276
279
 
277
280
 
281
+ [9.34.0]: https://github.com/gchq/CyberChef/releases/tag/v9.34.0
278
282
  [9.33.0]: https://github.com/gchq/CyberChef/releases/tag/v9.33.0
279
283
  [9.32.0]: https://github.com/gchq/CyberChef/releases/tag/v9.32.0
280
284
  [9.31.0]: https://github.com/gchq/CyberChef/releases/tag/v9.31.0
@@ -476,6 +480,7 @@ All major and minor version changes will be documented in this file. Details of
476
480
  [#1037]: https://github.com/gchq/CyberChef/pull/1037
477
481
  [#1045]: https://github.com/gchq/CyberChef/pull/1045
478
482
  [#1049]: https://github.com/gchq/CyberChef/pull/1049
483
+ [#1065]: https://github.com/gchq/CyberChef/pull/1065
479
484
  [#1083]: https://github.com/gchq/CyberChef/pull/1083
480
485
  [#1244]: https://github.com/gchq/CyberChef/pull/1244
481
486
  [#1313]: https://github.com/gchq/CyberChef/pull/1313
package/Gruntfile.js CHANGED
@@ -200,50 +200,35 @@ module.exports = function (grunt) {
200
200
  web: webpackProdConf(),
201
201
  },
202
202
  "webpack-dev-server": {
203
- options: {
204
- webpack: webpackConfig,
205
- host: "0.0.0.0",
206
- port: grunt.option("port") || 8080,
207
- disableHostCheck: true,
208
- overlay: true,
209
- inline: false,
210
- clientLogLevel: "error",
211
- stats: {
212
- children: false,
213
- chunks: false,
214
- modules: false,
215
- entrypoints: false,
216
- warningsFilter: [
217
- /source-map/,
218
- /dependency is an expression/,
219
- /export 'default'/,
220
- /Can't resolve 'sodium'/
221
- ],
222
- }
223
- },
203
+ options: webpackConfig,
224
204
  start: {
225
- webpack: {
226
- mode: "development",
227
- target: "web",
228
- entry: Object.assign({
229
- main: "./src/web/index.js"
230
- }, moduleEntryPoints),
231
- resolve: {
232
- alias: {
233
- "./config/modules/OpModules.mjs": "./config/modules/Default.mjs"
234
- }
235
- },
236
- plugins: [
237
- new webpack.DefinePlugin(BUILD_CONSTANTS),
238
- new HtmlWebpackPlugin({
239
- filename: "index.html",
240
- template: "./src/web/html/index.html",
241
- chunks: ["main"],
242
- compileTime: compileTime,
243
- version: pkg.version,
244
- })
245
- ]
246
- }
205
+ mode: "development",
206
+ target: "web",
207
+ entry: Object.assign({
208
+ main: "./src/web/index.js"
209
+ }, moduleEntryPoints),
210
+ resolve: {
211
+ alias: {
212
+ "./config/modules/OpModules.mjs": "./config/modules/Default.mjs"
213
+ }
214
+ },
215
+ devServer: {
216
+ port: grunt.option("port") || 8080,
217
+ client: {
218
+ logging: "error",
219
+ overlay: true
220
+ }
221
+ },
222
+ plugins: [
223
+ new webpack.DefinePlugin(BUILD_CONSTANTS),
224
+ new HtmlWebpackPlugin({
225
+ filename: "index.html",
226
+ template: "./src/web/html/index.html",
227
+ chunks: ["main"],
228
+ compileTime: compileTime,
229
+ version: pkg.version,
230
+ })
231
+ ]
247
232
  }
248
233
  },
249
234
  zip: {
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  #### *The Cyber Swiss Army Knife*
12
12
 
13
- CyberChef is a simple, intuitive web app for carrying out all manner of "cyber" operations within a web browser. These operations include simple encoding like XOR or Base64, more complex encryption like AES, DES and Blowfish, creating binary and hexdumps, compression and decompression of data, calculating hashes and checksums, IPv6 and X.509 parsing, changing character encodings, and much more.
13
+ CyberChef is a simple, intuitive web app for carrying out all manner of "cyber" operations within a web browser. These operations include simple encoding like XOR and Base64, more complex encryption like AES, DES and Blowfish, creating binary and hexdumps, compression and decompression of data, calculating hashes and checksums, IPv6 and X.509 parsing, changing character encodings, and much more.
14
14
 
15
15
  The tool is designed to enable both technical and non-technical analysts to manipulate data in complex ways without having to deal with complex tools or algorithms. It was conceived, designed, built and incrementally improved by an analyst in their 10% innovation time over several years.
16
16
 
@@ -106,7 +106,7 @@ An installation walkthrough, how-to guides for adding new operations and themes,
106
106
 
107
107
  ## Licencing
108
108
 
109
- CyberChef is released under the [Apache 2.0 Licence](https://www.apache.org/licenses/LICENSE-2.0) and is covered by [Crown Copyright](https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/copyright-and-re-use/crown-copyright/).
109
+ CyberChef is released under the [Apache 2.0 Licence](https://www.apache.org/licenses/LICENSE-2.0) and is covered by [Crown Copyright](https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/).
110
110
 
111
111
 
112
112
  [1]: https://gchq.github.io/CyberChef
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyberchef",
3
- "version": "9.33.0",
3
+ "version": "9.34.1",
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",
@@ -45,18 +45,16 @@
45
45
  "@babel/plugin-transform-runtime": "^7.17.0",
46
46
  "@babel/preset-env": "^7.16.11",
47
47
  "@babel/runtime": "^7.17.8",
48
- "autoprefixer": "^10.3.1",
48
+ "autoprefixer": "^10.4.4",
49
49
  "babel-loader": "^8.2.4",
50
50
  "babel-plugin-dynamic-import-node": "^2.3.3",
51
51
  "chromedriver": "^99.0.0",
52
- "cli-progress": "^3.9.0",
52
+ "cli-progress": "^3.10.0",
53
53
  "colors": "^1.4.0",
54
- "copy-webpack-plugin": "^9.0.1",
54
+ "copy-webpack-plugin": "^10.2.4",
55
55
  "core-js": "^3.21.1",
56
- "css-loader": "5.2.7",
57
- "eslint": "^8.11.0",
58
- "exports-loader": "^3.0.0",
59
- "file-loader": "^6.2.0",
56
+ "css-loader": "6.7.1",
57
+ "eslint": "^8.12.0",
60
58
  "grunt": "^1.4.1",
61
59
  "grunt-chmod": "~1.1.1",
62
60
  "grunt-concurrent": "^3.0.0",
@@ -66,25 +64,23 @@
66
64
  "grunt-contrib-watch": "^1.1.0",
67
65
  "grunt-eslint": "^24.0.0",
68
66
  "grunt-exec": "~3.0.0",
69
- "grunt-webpack": "^4.0.3",
67
+ "grunt-webpack": "^5.0.0",
70
68
  "grunt-zip": "^0.18.2",
71
- "html-webpack-plugin": "^5.3.2",
72
- "imports-loader": "^3.0.0",
73
- "mini-css-extract-plugin": "1.3.7",
74
- "nightwatch": "^1.7.8",
75
- "postcss": "^8.3.6",
69
+ "html-webpack-plugin": "^5.5.0",
70
+ "imports-loader": "^3.1.1",
71
+ "mini-css-extract-plugin": "2.6.0",
72
+ "nightwatch": "^2.0.10",
73
+ "postcss": "^8.4.12",
76
74
  "postcss-css-variables": "^0.18.0",
77
- "postcss-import": "^14.0.2",
78
- "postcss-loader": "^6.1.1",
79
- "prompt": "^1.1.0",
80
- "sass-loader": "^12.1.0",
81
- "sitemap": "^7.0.0",
82
- "style-loader": "^3.2.1",
83
- "svg-url-loader": "^7.1.1",
84
- "url-loader": "^4.1.1",
75
+ "postcss-import": "^14.1.0",
76
+ "postcss-loader": "^6.2.1",
77
+ "prompt": "^1.2.2",
78
+ "sass-loader": "^12.6.0",
79
+ "sitemap": "^7.1.1",
80
+ "terser": "^5.12.1",
85
81
  "webpack": "^5.70.0",
86
- "webpack-bundle-analyzer": "^4.4.2",
87
- "webpack-dev-server": "3.11.2",
82
+ "webpack-bundle-analyzer": "^4.5.0",
83
+ "webpack-dev-server": "4.7.4",
88
84
  "webpack-node-externals": "^3.0.0",
89
85
  "worker-loader": "^3.0.8"
90
86
  },
@@ -94,22 +90,22 @@
94
90
  "avsc": "^5.7.3",
95
91
  "babel-plugin-transform-builtin-extend": "1.1.2",
96
92
  "bcryptjs": "^2.4.3",
97
- "bignumber.js": "^9.0.1",
98
- "blakejs": "^1.1.1",
99
- "bootstrap": "4.6.0",
93
+ "bignumber.js": "^9.0.2",
94
+ "blakejs": "^1.2.1",
95
+ "bootstrap": "4.6.1",
100
96
  "bootstrap-colorpicker": "^3.4.0",
101
97
  "bootstrap-material-design": "^4.1.3",
102
98
  "browserify-zlib": "^0.2.0",
103
- "bson": "^4.4.1",
99
+ "bson": "^4.6.2",
104
100
  "buffer": "^6.0.3",
105
- "cbor": "5.0.1",
101
+ "cbor": "8.1.0",
106
102
  "chi-squared": "^1.1.0",
107
103
  "codepage": "^1.15.0",
108
104
  "crypto-api": "^0.8.5",
109
105
  "crypto-browserify": "^3.12.0",
110
106
  "crypto-js": "^4.1.1",
111
107
  "ctph.js": "0.0.5",
112
- "d3": "6.5.0",
108
+ "d3": "7.3.0",
113
109
  "d3-hexbin": "^0.2.2",
114
110
  "diff": "^5.0.0",
115
111
  "es6-promisify": "^7.0.0",
@@ -119,7 +115,7 @@
119
115
  "file-saver": "^2.0.5",
120
116
  "flat": "^5.0.2",
121
117
  "geodesy": "1.1.3",
122
- "highlight.js": "^11.2.0",
118
+ "highlight.js": "^11.5.0",
123
119
  "jimp": "^0.16.1",
124
120
  "jquery": "3.6.0",
125
121
  "js-crc": "^0.2.0",
@@ -128,18 +124,18 @@
128
124
  "jsonpath": "^1.1.1",
129
125
  "jsonwebtoken": "^8.5.1",
130
126
  "jsqr": "^1.4.0",
131
- "jsrsasign": "^10.4.0",
127
+ "jsrsasign": "^10.5.14",
132
128
  "kbpgp": "2.1.15",
133
129
  "libbzip2-wasm": "0.0.4",
134
130
  "libyara-wasm": "^1.1.0",
135
131
  "lodash": "^4.17.21",
136
- "loglevel": "^1.7.1",
132
+ "loglevel": "^1.8.0",
137
133
  "loglevel-message-prefix": "^3.0.0",
138
134
  "markdown-it": "^12.3.2",
139
135
  "moment": "^2.29.1",
140
- "moment-timezone": "^0.5.33",
136
+ "moment-timezone": "^0.5.34",
141
137
  "ngeohash": "^0.6.3",
142
- "node-forge": "^0.10.0",
138
+ "node-forge": "^1.3.0",
143
139
  "node-md6": "^0.1.0",
144
140
  "node-sass": "^7.0.1",
145
141
  "nodom": "^2.4.0",
@@ -153,13 +149,12 @@
153
149
  "qr-image": "^3.2.0",
154
150
  "scryptsy": "^2.1.0",
155
151
  "snackbarjs": "^1.1.0",
156
- "sortablejs": "^1.14.0",
157
- "split.js": "^1.6.4",
152
+ "sortablejs": "^1.15.0",
153
+ "split.js": "^1.6.5",
158
154
  "ssdeep.js": "0.0.3",
159
155
  "stream-browserify": "^3.0.0",
160
- "terser": "^5.7.1",
161
156
  "tesseract.js": "2.1.5",
162
- "ua-parser-js": "^0.7.28",
157
+ "ua-parser-js": "^1.0.2",
163
158
  "unorm": "^1.6.0",
164
159
  "utf8": "^3.0.0",
165
160
  "vkbeautify": "^0.99.3",
@@ -173,7 +168,7 @@
173
168
  "build": "npx grunt prod",
174
169
  "repl": "node --experimental-modules --experimental-json-modules --experimental-specifier-resolution=node --no-warnings src/node/repl.mjs",
175
170
  "test": "npx grunt configTests && node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation tests/node/index.mjs && node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation tests/operations/index.mjs",
176
- "test-node-consumer": "npx grunt testnodeconsumer",
171
+ "testnodeconsumer": "npx grunt testnodeconsumer",
177
172
  "testui": "npx grunt testui",
178
173
  "testuidev": "npx nightwatch --env=dev",
179
174
  "lint": "npx grunt lint",
@@ -230,6 +230,7 @@
230
230
  "From Case Insensitive Regex",
231
231
  "Add line numbers",
232
232
  "Remove line numbers",
233
+ "Get All Casings",
233
234
  "To Table",
234
235
  "Reverse",
235
236
  "Sort",
@@ -6787,6 +6787,16 @@
6787
6787
  "manualBake": false,
6788
6788
  "args": []
6789
6789
  },
6790
+ "Get All Casings": {
6791
+ "module": "Default",
6792
+ "description": "Outputs all possible casing variations of a string.",
6793
+ "infoURL": "",
6794
+ "inputType": "string",
6795
+ "outputType": "string",
6796
+ "flowControl": false,
6797
+ "manualBake": false,
6798
+ "args": []
6799
+ },
6790
6800
  "Get Time": {
6791
6801
  "module": "Default",
6792
6802
  "description": "Generates a timestamp showing the amount of time since the UNIX epoch (1970-01-01 00:00:00 UTC). Uses the W3C High Resolution Time API.",
@@ -9241,6 +9251,7 @@
9241
9251
  "Pacific/Guam",
9242
9252
  "Pacific/Honolulu",
9243
9253
  "Pacific/Johnston",
9254
+ "Pacific/Kanton",
9244
9255
  "Pacific/Kiritimati",
9245
9256
  "Pacific/Kosrae",
9246
9257
  "Pacific/Kwajalein",
@@ -11774,6 +11785,7 @@
11774
11785
  "go",
11775
11786
  "golo",
11776
11787
  "gradle",
11788
+ "graphql",
11777
11789
  "groovy",
11778
11790
  "haml",
11779
11791
  "handlebars",
@@ -13300,6 +13312,7 @@
13300
13312
  "Pacific/Guam",
13301
13313
  "Pacific/Honolulu",
13302
13314
  "Pacific/Johnston",
13315
+ "Pacific/Kanton",
13303
13316
  "Pacific/Kiritimati",
13304
13317
  "Pacific/Kosrae",
13305
13318
  "Pacific/Kwajalein",
@@ -13905,6 +13918,7 @@
13905
13918
  "Pacific/Guam",
13906
13919
  "Pacific/Honolulu",
13907
13920
  "Pacific/Johnston",
13921
+ "Pacific/Kanton",
13908
13922
  "Pacific/Kiritimati",
13909
13923
  "Pacific/Kosrae",
13910
13924
  "Pacific/Kwajalein",
@@ -65,6 +65,7 @@ import FuzzyMatch from "../../operations/FuzzyMatch.mjs";
65
65
  import GenerateHOTP from "../../operations/GenerateHOTP.mjs";
66
66
  import GenerateLoremIpsum from "../../operations/GenerateLoremIpsum.mjs";
67
67
  import GenerateTOTP from "../../operations/GenerateTOTP.mjs";
68
+ import GetAllCasings from "../../operations/GetAllCasings.mjs";
68
69
  import GetTime from "../../operations/GetTime.mjs";
69
70
  import GroupIPAddresses from "../../operations/GroupIPAddresses.mjs";
70
71
  import HTMLToText from "../../operations/HTMLToText.mjs";
@@ -228,6 +229,7 @@ OpModules.Default = {
228
229
  "Generate HOTP": GenerateHOTP,
229
230
  "Generate Lorem Ipsum": GenerateLoremIpsum,
230
231
  "Generate TOTP": GenerateTOTP,
232
+ "Get All Casings": GetAllCasings,
231
233
  "Get Time": GetTime,
232
234
  "Group IP addresses": GroupIPAddresses,
233
235
  "HTML To Text": HTMLToText,
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @author n1073645 [n1073645@gmail.com]
3
+ * @copyright Crown Copyright 2020
4
+ * @license Apache-2.0
5
+ */
6
+
7
+ import Operation from "../Operation.mjs";
8
+
9
+ /**
10
+ * Permutate String operation
11
+ */
12
+ class GetAllCasings extends Operation {
13
+
14
+ /**
15
+ * GetAllCasings constructor
16
+ */
17
+ constructor() {
18
+ super();
19
+
20
+ this.name = "Get All Casings";
21
+ this.module = "Default";
22
+ this.description = "Outputs all possible casing variations of a string.";
23
+ this.infoURL = "";
24
+ this.inputType = "string";
25
+ this.outputType = "string";
26
+ this.args = [];
27
+ }
28
+
29
+ /**
30
+ * @param {string} input
31
+ * @param {Object[]} args
32
+ * @returns {string}
33
+ */
34
+ run(input, args) {
35
+ const length = input.length;
36
+ const max = 1 << length;
37
+ input = input.toLowerCase();
38
+ let result = "";
39
+
40
+ for (let i = 0; i < max; i++) {
41
+ const temp = input.split("");
42
+ for (let j = 0; j < length; j++) {
43
+ if (((i >> j) & 1) === 1) {
44
+ temp[j] = temp[j].toUpperCase();
45
+ }
46
+ }
47
+ result += temp.join("") + "\n";
48
+ }
49
+ return result;
50
+ }
51
+ }
52
+
53
+ export default GetAllCasings;
@@ -151,6 +151,7 @@ import GenerateRSAKeyPair from "./GenerateRSAKeyPair.mjs";
151
151
  import GenerateTOTP from "./GenerateTOTP.mjs";
152
152
  import GenerateUUID from "./GenerateUUID.mjs";
153
153
  import GenericCodeBeautify from "./GenericCodeBeautify.mjs";
154
+ import GetAllCasings from "./GetAllCasings.mjs";
154
155
  import GetTime from "./GetTime.mjs";
155
156
  import GroupIPAddresses from "./GroupIPAddresses.mjs";
156
157
  import Gunzip from "./Gunzip.mjs";
@@ -517,6 +518,7 @@ export {
517
518
  GenerateTOTP,
518
519
  GenerateUUID,
519
520
  GenericCodeBeautify,
521
+ GetAllCasings,
520
522
  GetTime,
521
523
  GroupIPAddresses,
522
524
  Gunzip,
@@ -158,6 +158,7 @@ import {
158
158
  GenerateTOTP as core_GenerateTOTP,
159
159
  GenerateUUID as core_GenerateUUID,
160
160
  GenericCodeBeautify as core_GenericCodeBeautify,
161
+ GetAllCasings as core_GetAllCasings,
161
162
  GetTime as core_GetTime,
162
163
  GroupIPAddresses as core_GroupIPAddresses,
163
164
  Gunzip as core_Gunzip,
@@ -524,6 +525,7 @@ function generateChef() {
524
525
  "generateTOTP": _wrap(core_GenerateTOTP),
525
526
  "generateUUID": _wrap(core_GenerateUUID),
526
527
  "genericCodeBeautify": _wrap(core_GenericCodeBeautify),
528
+ "getAllCasings": _wrap(core_GetAllCasings),
527
529
  "getTime": _wrap(core_GetTime),
528
530
  "groupIPAddresses": _wrap(core_GroupIPAddresses),
529
531
  "gunzip": _wrap(core_Gunzip),
@@ -901,6 +903,7 @@ const generateRSAKeyPair = chef.generateRSAKeyPair;
901
903
  const generateTOTP = chef.generateTOTP;
902
904
  const generateUUID = chef.generateUUID;
903
905
  const genericCodeBeautify = chef.genericCodeBeautify;
906
+ const getAllCasings = chef.getAllCasings;
904
907
  const getTime = chef.getTime;
905
908
  const groupIPAddresses = chef.groupIPAddresses;
906
909
  const gunzip = chef.gunzip;
@@ -1269,6 +1272,7 @@ const operations = [
1269
1272
  generateTOTP,
1270
1273
  generateUUID,
1271
1274
  genericCodeBeautify,
1275
+ getAllCasings,
1272
1276
  getTime,
1273
1277
  groupIPAddresses,
1274
1278
  gunzip,
@@ -1641,6 +1645,7 @@ export {
1641
1645
  generateTOTP,
1642
1646
  generateUUID,
1643
1647
  genericCodeBeautify,
1648
+ getAllCasings,
1644
1649
  getTime,
1645
1650
  groupIPAddresses,
1646
1651
  gunzip,
@@ -29,7 +29,7 @@
29
29
  <meta name="description" content="The Cyber Swiss Army Knife - a web app for encryption, encoding, compression and data analysis" />
30
30
  <meta name="keywords" content="base64, hex, decode, encode, encrypt, decrypt, compress, decompress, regex, regular expressions, hash, crypt, hexadecimal, user agent, url, certificate, x.509, parser, JSON, gzip, md5, sha1, aes, des, blowfish, xor" />
31
31
 
32
- <link rel="icon" type="image/ico" href="<%- require('../static/images/favicon.ico').default %>" />
32
+ <link rel="icon" type="image/ico" href="<%- require('../static/images/favicon.ico') %>" />
33
33
 
34
34
  <script type="application/javascript">
35
35
  "use strict";
@@ -197,7 +197,7 @@
197
197
  </button>
198
198
 
199
199
  <button type="button" class="mx-2 btn btn-lg btn-success btn-raised btn-block" id="bake">
200
- <img aria-hidden="true" src="<%- require('../static/images/cook_male-32x32.png').default %>" alt="Chef Icon"/>
200
+ <img aria-hidden="true" src="<%- require('../static/images/cook_male-32x32.png') %>" alt="Chef Icon"/>
201
201
  <span>Bake!</span>
202
202
  </button>
203
203
 
@@ -271,7 +271,7 @@
271
271
  <div class="file-overlay" id="file-overlay"></div>
272
272
  <div style="position: relative; height: 100%;">
273
273
  <div class="io-card card">
274
- <img aria-hidden="true" src="<%- require('../static/images/file-128x128.png').default %>" alt="File icon" id="input-file-thumbnail"/>
274
+ <img aria-hidden="true" src="<%- require('../static/images/file-128x128.png') %>" alt="File icon" id="input-file-thumbnail"/>
275
275
  <div class="card-body">
276
276
  <button type="button" class="close" id="input-file-close">&times;</button>
277
277
  Name: <span id="input-file-name"></span><br>
@@ -346,12 +346,12 @@
346
346
  <div id="output-highlighter" class="no-select"></div>
347
347
  <div id="output-html"></div>
348
348
  <textarea id="output-text" readonly="readonly" spellcheck="false"></textarea>
349
- <img id="show-file-overlay" aria-hidden="true" src="<%- require('../static/images/file-32x32.png').default %>" alt="Show file overlay" title="Show file overlay"/>
349
+ <img id="show-file-overlay" aria-hidden="true" src="<%- require('../static/images/file-32x32.png') %>" alt="Show file overlay" title="Show file overlay"/>
350
350
  <div id="output-file">
351
351
  <div class="file-overlay"></div>
352
352
  <div style="position: relative; height: 100%;">
353
353
  <div class="io-card card">
354
- <img aria-hidden="true" src="<%- require('../static/images/file-128x128.png').default %>" alt="File icon"/>
354
+ <img aria-hidden="true" src="<%- require('../static/images/file-128x128.png') %>" alt="File icon"/>
355
355
  <div class="card-body">
356
356
  Size: <span id="output-file-size"></span><br>
357
357
  <button id="output-file-download" type="button" class="btn btn-primary btn-outline">Download</button>
@@ -626,7 +626,7 @@
626
626
  <h5 class="modal-title">CyberChef - The Cyber Swiss Army Knife</h5>
627
627
  </div>
628
628
  <div class="modal-body">
629
- <img aria-hidden="true" class="about-img-left" src="<%- require('../static/images/cyberchef-128x128.png').default %>" alt="CyberChef Logo"/>
629
+ <img aria-hidden="true" class="about-img-left" src="<%- require('../static/images/cyberchef-128x128.png') %>" alt="CyberChef Logo"/>
630
630
  <p class="subtext">
631
631
  Version <%= htmlWebpackPlugin.options.version %><br>
632
632
  Compile time: <%= htmlWebpackPlugin.options.compileTime %>
@@ -749,7 +749,7 @@
749
749
  <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
750
750
  </div>
751
751
  <a href="https://github.com/gchq/CyberChef">
752
- <img aria-hidden="true" style="position: absolute; top: 0; right: 0; border: 0;" src="<%- require('../static/images/fork_me.png').default %>" alt="Fork me on GitHub">
752
+ <img aria-hidden="true" style="position: absolute; top: 0; right: 0; border: 0;" src="<%- require('../static/images/fork_me.png') %>" alt="Fork me on GitHub">
753
753
  </a>
754
754
  </div>
755
755
  </div>
@@ -303,7 +303,7 @@
303
303
 
304
304
  #stale-indicator {
305
305
  opacity: 1;
306
- visibility: visibile;
306
+ visibility: visible;
307
307
  transition: margin 0s, opacity 0.3s;
308
308
  margin-left: 5px;
309
309
  cursor: help;
@@ -316,7 +316,7 @@
316
316
 
317
317
  #magic {
318
318
  opacity: 1;
319
- visibility: visibile;
319
+ visibility: visible;
320
320
  transition: margin 0s 0.3s, opacity 0.3s 0.3s, visibility 0.3s 0.3s;
321
321
  margin-left: 5px;
322
322
  margin-bottom: 5px;
@@ -71,7 +71,7 @@ module.exports = {
71
71
  .moveToElement(toHex, 10, 10)
72
72
  .useCss()
73
73
  .waitForElementVisible(".popover-body", 1000)
74
- .doubleClick();
74
+ .doubleClick("xpath", toHex);
75
75
 
76
76
  // Confirm that it has been added to the recipe
77
77
  browser
@@ -90,7 +90,7 @@ module.exports = {
90
90
  browser
91
91
  .useCss()
92
92
  .waitForElementNotVisible("#stale-indicator", 1000)
93
- .expect.element("#output-text").to.have.value.that.equals("44 6f 6e 27 74 20 50 61 6e 69 63 2e");
93
+ .expect.element("#output-text").to.have.property("value").that.equals("44 6f 6e 27 74 20 50 61 6e 69 63 2e");
94
94
 
95
95
  // Clear recipe
96
96
  browser
@@ -202,11 +202,11 @@ module.exports = {
202
202
  browser
203
203
  .getLocationInView(genUUID)
204
204
  .moveToElement(genUUID, 10, 10)
205
- .doubleClick()
205
+ .doubleClick("xpath", genUUID)
206
206
  .useCss()
207
207
  .waitForElementVisible(".operation .op-title", 1000)
208
208
  .waitForElementNotVisible("#stale-indicator", 1000)
209
- .expect.element("#output-text").to.have.value.which.matches(/[\da-f-]{36}/);
209
+ .expect.element("#output-text").to.have.property("value").which.matches(/[\da-f-]{36}/);
210
210
 
211
211
  browser.click("#clr-recipe");
212
212
  },
@@ -393,13 +393,13 @@ function testOp(browser, opName, input, output, args=[]) {
393
393
  .click("#clr-recipe")
394
394
  .click("#clr-io")
395
395
  .waitForElementNotPresent("#rec-list li.operation")
396
- .expect.element("#input-text").to.have.value.that.equals("");
396
+ .expect.element("#input-text").to.have.property("value").that.equals("");
397
397
 
398
398
  browser
399
399
  .urlHash("recipe=" + recipeConfig)
400
400
  .setValue("#input-text", input)
401
401
  .waitForElementPresent("#rec-list li.operation")
402
- .expect.element("#input-text").to.have.value.that.equals(input);
402
+ .expect.element("#input-text").to.have.property("value").that.equals(input);
403
403
 
404
404
  browser
405
405
  .waitForElementVisible("#stale-indicator", 5000)
@@ -410,8 +410,8 @@ function testOp(browser, opName, input, output, args=[]) {
410
410
  .waitForElementNotVisible("#output-loader", 5000);
411
411
 
412
412
  if (typeof output === "string") {
413
- browser.expect.element("#output-text").to.have.value.that.equals(output);
413
+ browser.expect.element("#output-text").to.have.property("value").that.equals(output);
414
414
  } else if (output instanceof RegExp) {
415
- browser.expect.element("#output-text").to.have.value.that.matches(output);
415
+ browser.expect.element("#output-text").to.have.property("value").that.matches(output);
416
416
  }
417
417
  }
@@ -685,8 +685,8 @@ Arguments:
685
685
  it("Parse user agent", () => {
686
686
  const result = chef.parseUserAgent("Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0 ");
687
687
  const expected = `Browser
688
- Name: Mozilla
689
- Version: 5.0
688
+ Name: Firefox
689
+ Version: 47.0
690
690
  Device
691
691
  Model: unknown
692
692
  Type: unknown
@@ -107,7 +107,7 @@ import "./tests/CBORDecode.mjs";
107
107
  import "./tests/JA3Fingerprint.mjs";
108
108
  import "./tests/JA3SFingerprint.mjs";
109
109
  import "./tests/HASSH.mjs";
110
-
110
+ import "./tests/GetAllCasings.mjs";
111
111
 
112
112
  // Cannot test operations that use the File type yet
113
113
  // import "./tests/SplitColourChannels.mjs";
@@ -0,0 +1,44 @@
1
+ /**
2
+ * GetAllCasings tests.
3
+ *
4
+ * @author n1073645 [n1073645@gmail.com]
5
+ * @copyright Crown Copyright 2020
6
+ * @license Apache-2.0
7
+ */
8
+ import TestRegister from "../../lib/TestRegister.mjs";
9
+
10
+ TestRegister.addTests([
11
+ {
12
+ name: "All casings of test",
13
+ input: "test",
14
+ expectedOutput: "test\nTest\ntEst\nTEst\nteSt\nTeSt\ntESt\nTESt\ntesT\nTesT\ntEsT\nTEsT\nteST\nTeST\ntEST\nTEST\n",
15
+ recipeConfig: [
16
+ {
17
+ "op": "Get All Casings",
18
+ "args": []
19
+ }
20
+ ]
21
+ },
22
+ {
23
+ name: "All casings of t",
24
+ input: "t",
25
+ expectedOutput: "t\nT\n",
26
+ recipeConfig: [
27
+ {
28
+ "op": "Get All Casings",
29
+ "args": []
30
+ }
31
+ ]
32
+ },
33
+ {
34
+ name: "All casings of null",
35
+ input: "",
36
+ expectedOutput: "\n",
37
+ recipeConfig: [
38
+ {
39
+ "op": "Get All Casings",
40
+ "args": []
41
+ }
42
+ ]
43
+ }
44
+ ]);
package/webpack.config.js CHANGED
@@ -36,7 +36,8 @@ const banner = `/**
36
36
  module.exports = {
37
37
  output: {
38
38
  publicPath: "",
39
- globalObject: "this"
39
+ globalObject: "this",
40
+ assetModuleFilename: "assets/[hash][ext][query]"
40
41
  },
41
42
  plugins: [
42
43
  new webpack.ProvidePlugin({
@@ -122,7 +123,7 @@ module.exports = {
122
123
  },
123
124
  {
124
125
  test: /prime.worker.min.js$/,
125
- use: "raw-loader"
126
+ type: "asset/source"
126
127
  },
127
128
  {
128
129
  test: /bootstrap-material-design/,
@@ -165,53 +166,33 @@ module.exports = {
165
166
  "sass-loader",
166
167
  ]
167
168
  },
168
- /**
169
- * The limit for these files has been increased to 60,000 (60KB)
170
- * to ensure the material icons font is inlined.
171
- *
172
- * See: https://github.com/gchq/CyberChef/issues/612
173
- */
174
169
  {
175
170
  test: /\.(ico|eot|ttf|woff|woff2)$/,
176
- loader: "url-loader",
177
- options: {
178
- limit: 60000,
179
- name: "[hash].[ext]",
180
- outputPath: "assets"
181
- }
171
+ type: "asset/resource",
182
172
  },
183
173
  {
184
174
  test: /\.svg$/,
185
- loader: "svg-url-loader",
186
- options: {
187
- encoding: "base64"
188
- }
175
+ type: "asset/inline",
189
176
  },
190
177
  { // Store font .fnt and .png files in a separate fonts folder
191
178
  test: /(\.fnt$|bmfonts\/.+\.png$)/,
192
- loader: "file-loader",
193
- options: {
194
- name: "[name].[ext]",
195
- outputPath: "assets/fonts"
179
+ type: "asset/resource",
180
+ generator: {
181
+ filename: "assets/fonts/[name][ext]"
196
182
  }
197
183
  },
198
184
  { // First party images are saved as files to be cached
199
185
  test: /\.(png|jpg|gif)$/,
200
186
  exclude: /(node_modules|bmfonts)/,
201
- loader: "file-loader",
202
- options: {
203
- name: "images/[name].[ext]"
187
+ type: "asset/resource",
188
+ generator: {
189
+ filename: "images/[name][ext]"
204
190
  }
205
191
  },
206
192
  { // Third party images are inlined
207
193
  test: /\.(png|jpg|gif)$/,
208
194
  exclude: /web\/static/,
209
- loader: "url-loader",
210
- options: {
211
- limit: 10000,
212
- name: "[hash].[ext]",
213
- outputPath: "assets"
214
- }
195
+ type: "asset/inline",
215
196
  },
216
197
  ]
217
198
  },
@@ -219,14 +200,15 @@ module.exports = {
219
200
  children: false,
220
201
  chunks: false,
221
202
  modules: false,
222
- entrypoints: false,
223
- warningsFilter: [
224
- /source-map/,
225
- /dependency is an expression/,
226
- /export 'default'/,
227
- /Can't resolve 'sodium'/
228
- ],
203
+ entrypoints: false
229
204
  },
205
+ ignoreWarnings: [
206
+ /source-map/,
207
+ /source map/,
208
+ /dependency is an expression/,
209
+ /export 'default'/,
210
+ /Can't resolve 'sodium'/
211
+ ],
230
212
  performance: {
231
213
  hints: false
232
214
  }