diff --git a/CHANGELOG.md b/CHANGELOG.md index ddff4460..abceeda3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -725,7 +725,7 @@ All major and minor version changes will be documented in this file. Details of [#1667]: https://github.com/gchq/CyberChef/issues/1667 [#1555]: https://github.com/gchq/CyberChef/issues/1555 [#1694]: https://github.com/gchq/CyberChef/issues/1694 -[#1699]: https://github.com/gchq/CyberChef/issues/1694 +[#1699]: https://github.com/gchq/CyberChef/issues/1699 [#1757]: https://github.com/gchq/CyberChef/issues/1757 [#1752]: https://github.com/gchq/CyberChef/issues/1752 [#1753]: https://github.com/gchq/CyberChef/issues/1753 @@ -740,6 +740,7 @@ All major and minor version changes will be documented in this file. Details of [#1765]: https://github.com/gchq/CyberChef/issues/1765 [#1767]: https://github.com/gchq/CyberChef/issues/1767 [#1769]: https://github.com/gchq/CyberChef/issues/1769 +[#1759]: https://github.com/gchq/CyberChef/issues/1759 [#1504]: https://github.com/gchq/CyberChef/issues/1504 [#512]: https://github.com/gchq/CyberChef/issues/512 [#1732]: https://github.com/gchq/CyberChef/issues/1732 diff --git a/Gruntfile.js b/Gruntfile.js index 32ba9007..b040d98d 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -86,10 +86,12 @@ module.exports = function (grunt) { // Project configuration - const compileTime = grunt.template.today("UTC:dd/mm/yyyy HH:MM:ss") + " UTC", + const compileYear = grunt.template.today("UTC:yyyy"), + compileTime = grunt.template.today("UTC:dd/mm/yyyy HH:MM:ss") + " UTC", pkg = grunt.file.readJSON("package.json"), webpackConfig = require("./webpack.config.js"), BUILD_CONSTANTS = { + COMPILE_YEAR: JSON.stringify(compileYear), COMPILE_TIME: JSON.stringify(compileTime), COMPILE_MSG: JSON.stringify(grunt.option("compile-msg") || grunt.option("msg") || ""), PKG_VERSION: JSON.stringify(pkg.version), @@ -125,6 +127,7 @@ module.exports = function (grunt) { filename: "index.html", template: "./src/web/html/index.html", chunks: ["main"], + compileYear: compileYear, compileTime: compileTime, version: pkg.version, minify: { @@ -227,6 +230,7 @@ module.exports = function (grunt) { filename: "index.html", template: "./src/web/html/index.html", chunks: ["main"], + compileYear: compileYear, compileTime: compileTime, version: pkg.version, }) diff --git a/package-lock.json b/package-lock.json index 693e0d42..20935e27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cyberchef", - "version": "10.15.0", + "version": "10.15.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cyberchef", - "version": "10.15.0", + "version": "10.15.1", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index ef61fbab..c623c647 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cyberchef", - "version": "10.15.0", + "version": "10.15.1", "description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.", "author": "n1474335 ", "homepage": "https://gchq.github.io/CyberChef", diff --git a/src/core/Utils.mjs b/src/core/Utils.mjs index 18b0e688..a9c381d7 100755 --- a/src/core/Utils.mjs +++ b/src/core/Utils.mjs @@ -893,7 +893,7 @@ class Utils { /** - * Converts a string to it's title case equivalent. + * Converts a string to its title case equivalent. * * @param {string} str * @returns string diff --git a/src/core/config/Categories.json b/src/core/config/Categories.json index e483c747..8f8a14f9 100644 --- a/src/core/config/Categories.json +++ b/src/core/config/Categories.json @@ -388,7 +388,6 @@ "SHA2", "SHA3", "SM3", - "MurmurHash3", "Keccak", "Shake", "RIPEMD", @@ -413,6 +412,7 @@ "Scrypt", "NT Hash", "LM Hash", + "MurmurHash3", "Fletcher-8 Checksum", "Fletcher-16 Checksum", "Fletcher-32 Checksum", diff --git a/src/core/config/scripts/newOperation.mjs b/src/core/config/scripts/newOperation.mjs index fddeff97..1686f6eb 100644 --- a/src/core/config/scripts/newOperation.mjs +++ b/src/core/config/scripts/newOperation.mjs @@ -147,7 +147,7 @@ class ${moduleName} extends Operation { this.name = "${result.opName}"; this.module = "${result.module}"; this.description = "${(new EscapeString).run(result.description, ["Special chars", "Double"])}"; - this.infoURL = "${result.infoURL}"; + this.infoURL = "${result.infoURL}"; // Usually a Wikipedia link. Remember to remove localisation (i.e. https://wikipedia.org/etc rather than https://en.wikipedia.org/etc) this.inputType = "${result.inputType}"; this.outputType = "${result.outputType}"; this.args = [ diff --git a/src/core/lib/FileSignatures.mjs b/src/core/lib/FileSignatures.mjs index 69157a1b..22132823 100644 --- a/src/core/lib/FileSignatures.mjs +++ b/src/core/lib/FileSignatures.mjs @@ -81,7 +81,7 @@ export const FILE_SIGNATURES = { 0: 0x00, 1: 0x00, 2: 0x00, - // 3 could be 0x24 or 0x18, so skip it + 3: [0x24, 0x18], 4: 0x66, // ftypheic 5: 0x74, 6: 0x79, @@ -2748,7 +2748,7 @@ export function extractGIF(bytes, offset) { stream.moveForwardsBy(11); // Loop until next Graphic Control Extension. - while (stream.getBytes(2) !== [0x21, 0xf9]) { + while (!Array.from(stream.getBytes(2)).equals([0x21, 0xf9])) { stream.moveBackwardsBy(2); stream.moveForwardsBy(stream.readInt(1)); if (!stream.readInt(1)) diff --git a/src/core/operations/ChaCha.mjs b/src/core/operations/ChaCha.mjs index 40ba46dc..2d186d35 100644 --- a/src/core/operations/ChaCha.mjs +++ b/src/core/operations/ChaCha.mjs @@ -100,7 +100,7 @@ class ChaCha extends Operation { super(); this.name = "ChaCha"; - this.module = "Default"; + this.module = "Ciphers"; this.description = "ChaCha is a stream cipher designed by Daniel J. Bernstein. It is a variant of the Salsa stream cipher. Several parameterizations exist; 'ChaCha' may refer to the original construction, or to the variant as described in RFC-8439. ChaCha is often used with Poly1305, in the ChaCha20-Poly1305 AEAD construction.

Key: ChaCha uses a key of 16 or 32 bytes (128 or 256 bits).

Nonce: ChaCha uses a nonce of 8 or 12 bytes (64 or 96 bits).

Counter: ChaCha uses a counter of 4 or 8 bytes (32 or 64 bits); together, the nonce and counter must add up to 16 bytes. The counter starts at zero at the start of the keystream, and is incremented at every 64 bytes."; this.infoURL = "https://wikipedia.org/wiki/Salsa20#ChaCha_variant"; this.inputType = "string"; diff --git a/src/core/operations/DateTimeDelta.mjs b/src/core/operations/DateTimeDelta.mjs index 35090606..7f82cf01 100644 --- a/src/core/operations/DateTimeDelta.mjs +++ b/src/core/operations/DateTimeDelta.mjs @@ -22,7 +22,6 @@ class DateTimeDelta extends Operation { this.name = "DateTime Delta"; this.module = "Default"; this.description = "Calculates a new DateTime value given an input DateTime value and a time difference (delta) from the input DateTime value."; - this.infoURL = ""; this.inputType = "string"; this.outputType = "html"; this.args = [ diff --git a/src/core/operations/ExtractHashes.mjs b/src/core/operations/ExtractHashes.mjs index 386aab0e..fd50089f 100644 --- a/src/core/operations/ExtractHashes.mjs +++ b/src/core/operations/ExtractHashes.mjs @@ -21,7 +21,7 @@ class ExtractHashes extends Operation { this.name = "Extract hashes"; this.module = "Regex"; this.description = "Extracts potential hashes based on hash character length"; - this.infoURL = "https://en.wikipedia.org/wiki/Comparison_of_cryptographic_hash_functions"; + this.infoURL = "https://wikipedia.org/wiki/Comparison_of_cryptographic_hash_functions"; this.inputType = "string"; this.outputType = "string"; this.args = [ diff --git a/src/core/operations/FangURL.mjs b/src/core/operations/FangURL.mjs index 93e01770..ad5bf525 100644 --- a/src/core/operations/FangURL.mjs +++ b/src/core/operations/FangURL.mjs @@ -20,6 +20,7 @@ class FangURL extends Operation { this.name = "Fang URL"; this.module = "Default"; this.description = "Takes a 'Defanged' Universal Resource Locator (URL) and 'Fangs' it. Meaning, it removes the alterations (defanged) that render it useless so that it can be used again."; + this.infoURL = "https://isc.sans.edu/forums/diary/Defang+all+the+things/22744/"; this.inputType = "string"; this.outputType = "string"; this.args = [ diff --git a/src/core/operations/FileTree.mjs b/src/core/operations/FileTree.mjs index 8321f8f5..9484313f 100644 --- a/src/core/operations/FileTree.mjs +++ b/src/core/operations/FileTree.mjs @@ -1,6 +1,6 @@ /** * @author sw5678 - * @copyright Crown Copyright 2016 + * @copyright Crown Copyright 2023 * @license Apache-2.0 */ @@ -21,7 +21,8 @@ class FileTree extends Operation { this.name = "File Tree"; this.module = "Default"; - this.description = "Creates file tree from list of file paths (similar to the tree command in Linux)"; + this.description = "Creates a file tree from a list of file paths (similar to the tree command in Linux)"; + this.infoURL = "https://wikipedia.org/wiki/Tree_(command)"; this.inputType = "string"; this.outputType = "string"; this.args = [ diff --git a/src/core/operations/FromFloat.mjs b/src/core/operations/FromFloat.mjs index 4fe5990e..8bf56d81 100644 --- a/src/core/operations/FromFloat.mjs +++ b/src/core/operations/FromFloat.mjs @@ -22,8 +22,8 @@ class FromFloat extends Operation { this.name = "From Float"; this.module = "Default"; - this.description = "Convert from EEE754 Floating Point Numbers"; - this.infoURL = "https://en.wikipedia.org/wiki/IEEE_754"; + this.description = "Convert from IEEE754 Floating Point Numbers"; + this.infoURL = "https://wikipedia.org/wiki/IEEE_754"; this.inputType = "string"; this.outputType = "byteArray"; this.args = [ diff --git a/src/core/operations/MurmurHash3.mjs b/src/core/operations/MurmurHash3.mjs index f4aea611..7921633f 100644 --- a/src/core/operations/MurmurHash3.mjs +++ b/src/core/operations/MurmurHash3.mjs @@ -22,7 +22,7 @@ class MurmurHash3 extends Operation { super(); this.name = "MurmurHash3"; - this.module = "Default"; + this.module = "Hashing"; this.description = "Generates a MurmurHash v3 for a string input and an optional seed input"; this.infoURL = "https://wikipedia.org/wiki/MurmurHash"; this.inputType = "string"; @@ -115,11 +115,7 @@ class MurmurHash3 extends Operation { * @return {number} 32-bit signed integer */ unsignedToSigned(value) { - if (value & 0x80000000) { - return -0x100000000 + value; - } else { - return value; - } + return value & 0x80000000 ? -0x100000000 + value : value; } /** diff --git a/src/core/operations/ParseCSR.mjs b/src/core/operations/ParseCSR.mjs index ad891902..6ab44cb2 100644 --- a/src/core/operations/ParseCSR.mjs +++ b/src/core/operations/ParseCSR.mjs @@ -22,7 +22,7 @@ class ParseCSR extends Operation { this.name = "Parse CSR"; this.module = "PublicKey"; this.description = "Parse Certificate Signing Request (CSR) for an X.509 certificate"; - this.infoURL = "https://en.wikipedia.org/wiki/Certificate_signing_request"; + this.infoURL = "https://wikipedia.org/wiki/Certificate_signing_request"; this.inputType = "string"; this.outputType = "string"; this.args = [ diff --git a/src/core/operations/RegularExpression.mjs b/src/core/operations/RegularExpression.mjs index 18d3fda9..9ea17e83 100644 --- a/src/core/operations/RegularExpression.mjs +++ b/src/core/operations/RegularExpression.mjs @@ -67,6 +67,10 @@ class RegularExpression extends Operation { name: "MAC address", value: "[A-Fa-f\\d]{2}(?:[:-][A-Fa-f\\d]{2}){5}" }, + { + name: "UUID", + value: "[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}" + }, { name: "Date (yyyy-mm-dd)", value: "((?:19|20)\\d\\d)[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])" @@ -83,10 +87,6 @@ class RegularExpression extends Operation { name: "Strings", value: "[A-Za-z\\d/\\-:.,_$%\\x27\"()<>= !\\[\\]{}@]{4,}" }, - { - name: "UUID (any version)", - value: "[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}" - }, ], "target": 1 }, diff --git a/src/core/operations/RisonDecode.mjs b/src/core/operations/RisonDecode.mjs index 1b9741a8..d4e36f80 100644 --- a/src/core/operations/RisonDecode.mjs +++ b/src/core/operations/RisonDecode.mjs @@ -20,7 +20,7 @@ class RisonDecode extends Operation { super(); this.name = "Rison Decode"; - this.module = "Default"; + this.module = "Encodings"; this.description = "Rison, a data serialization format optimized for compactness in URIs. Rison is a slight variation of JSON that looks vastly superior after URI encoding. Rison still expresses exactly the same set of data structures as JSON, so data can be translated back and forth without loss or guesswork."; this.infoURL = "https://github.com/Nanonid/rison"; this.inputType = "string"; @@ -29,11 +29,7 @@ class RisonDecode extends Operation { { name: "Decode Option", type: "editableOption", - value: [ - { name: "Decode", value: "Decode", }, - { name: "Decode Object", value: "Decode Object", }, - { name: "Decode Array", value: "Decode Array", }, - ] + value: ["Decode", "Decode Object", "Decode Array"] }, ]; } @@ -52,8 +48,9 @@ class RisonDecode extends Operation { return rison.decode_object(input); case "Decode Array": return rison.decode_array(input); + default: + throw new OperationError("Invalid Decode option"); } - throw new OperationError("Invalid Decode option"); } } diff --git a/src/core/operations/RisonEncode.mjs b/src/core/operations/RisonEncode.mjs index 36a61017..12b13b66 100644 --- a/src/core/operations/RisonEncode.mjs +++ b/src/core/operations/RisonEncode.mjs @@ -20,7 +20,7 @@ class RisonEncode extends Operation { super(); this.name = "Rison Encode"; - this.module = "Default"; + this.module = "Encodings"; this.description = "Rison, a data serialization format optimized for compactness in URIs. Rison is a slight variation of JSON that looks vastly superior after URI encoding. Rison still expresses exactly the same set of data structures as JSON, so data can be translated back and forth without loss or guesswork."; this.infoURL = "https://github.com/Nanonid/rison"; this.inputType = "Object"; @@ -28,13 +28,8 @@ class RisonEncode extends Operation { this.args = [ { name: "Encode Option", - type: "editableOption", - value: [ - { name: "Encode", value: "Encode", }, - { name: "Encode Object", value: "Encode Object", }, - { name: "Encode Array", value: "Encode Array", }, - { name: "Encode URI", value: "Encode URI", } - ] + type: "option", + value: ["Encode", "Encode Object", "Encode Array", "Encode URI"] }, ]; } @@ -55,8 +50,9 @@ class RisonEncode extends Operation { return rison.encode_array(input); case "Encode URI": return rison.encode_uri(input); + default: + throw new OperationError("Invalid encode option"); } - throw new OperationError("Invalid encode option"); } } diff --git a/src/core/operations/Salsa20.mjs b/src/core/operations/Salsa20.mjs index a95dd5d3..7a76cf26 100644 --- a/src/core/operations/Salsa20.mjs +++ b/src/core/operations/Salsa20.mjs @@ -22,7 +22,7 @@ class Salsa20 extends Operation { super(); this.name = "Salsa20"; - this.module = "Default"; + this.module = "Ciphers"; this.description = "Salsa20 is a stream cipher designed by Daniel J. Bernstein and submitted to the eSTREAM project; Salsa20/8 and Salsa20/12 are round-reduced variants. It is closely related to the ChaCha stream cipher.

Key: Salsa20 uses a key of 16 or 32 bytes (128 or 256 bits).

Nonce: Salsa20 uses a nonce of 8 bytes (64 bits).

Counter: Salsa uses a counter of 8 bytes (64 bits). The counter starts at zero at the start of the keystream, and is incremented at every 64 bytes."; this.infoURL = "https://wikipedia.org/wiki/Salsa20"; this.inputType = "string"; diff --git a/src/core/operations/ToFloat.mjs b/src/core/operations/ToFloat.mjs index b9aef638..e0c70bc6 100644 --- a/src/core/operations/ToFloat.mjs +++ b/src/core/operations/ToFloat.mjs @@ -23,8 +23,8 @@ class ToFloat extends Operation { this.name = "To Float"; this.module = "Default"; - this.description = "Convert to EEE754 Floating Point Numbers"; - this.infoURL = "https://en.wikipedia.org/wiki/IEEE_754"; + this.description = "Convert to IEEE754 Floating Point Numbers"; + this.infoURL = "https://wikipedia.org/wiki/IEEE_754"; this.inputType = "byteArray"; this.outputType = "string"; this.args = [ diff --git a/src/core/operations/XSalsa20.mjs b/src/core/operations/XSalsa20.mjs index 32e8a0ba..d289585b 100644 --- a/src/core/operations/XSalsa20.mjs +++ b/src/core/operations/XSalsa20.mjs @@ -22,7 +22,7 @@ class XSalsa20 extends Operation { super(); this.name = "XSalsa20"; - this.module = "Default"; + this.module = "Ciphers"; this.description = "XSalsa20 is a variant of the Salsa20 stream cipher designed by Daniel J. Bernstein; XSalsa uses longer nonces.

Key: XSalsa20 uses a key of 16 or 32 bytes (128 or 256 bits).

Nonce: XSalsa20 uses a nonce of 24 bytes (192 bits).

Counter: XSalsa uses a counter of 8 bytes (64 bits). The counter starts at zero at the start of the keystream, and is incremented at every 64 bytes."; this.infoURL = "https://en.wikipedia.org/wiki/Salsa20#XSalsa20_with_192-bit_nonce"; this.inputType = "string"; diff --git a/src/web/html/index.html b/src/web/html/index.html index 64151628..02ad2c8d 100755 --- a/src/web/html/index.html +++ b/src/web/html/index.html @@ -1,10 +1,10 @@