Merge branch 'master' into fix-expectOutput

This commit is contained in:
zb3 2024-04-06 13:35:28 +02:00 committed by GitHub
commit a23e47d8f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 48 additions and 54 deletions

View File

@ -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

View File

@ -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,
})

4
package-lock.json generated
View File

@ -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": {

View File

@ -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 <n1474335@gmail.com>",
"homepage": "https://gchq.github.io/CyberChef",

View File

@ -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

View File

@ -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",

View File

@ -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 = [

View File

@ -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))

View File

@ -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.<br><br><b>Key:</b> ChaCha uses a key of 16 or 32 bytes (128 or 256 bits).<br><br><b>Nonce:</b> ChaCha uses a nonce of 8 or 12 bytes (64 or 96 bits).<br><br><b>Counter:</b> 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";

View File

@ -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 = [

View File

@ -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 = [

View File

@ -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 = [

View File

@ -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 = [

View File

@ -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 = [

View File

@ -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;
}
/**

View File

@ -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 = [

View File

@ -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
},

View File

@ -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");
}
}

View File

@ -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");
}
}

View File

@ -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.<br><br><b>Key:</b> Salsa20 uses a key of 16 or 32 bytes (128 or 256 bits).<br><br><b>Nonce:</b> Salsa20 uses a nonce of 8 bytes (64 bits).<br><br><b>Counter:</b> 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";

View File

@ -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 = [

View File

@ -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.<br><br><b>Key:</b> XSalsa20 uses a key of 16 or 32 bytes (128 or 256 bits).<br><br><b>Nonce:</b> XSalsa20 uses a nonce of 24 bytes (192 bits).<br><br><b>Counter:</b> 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";

View File

@ -1,10 +1,10 @@
<!-- htmlmin:ignore --><!--
CyberChef - The Cyber Swiss Army Knife
@copyright Crown Copyright 2016
@copyright Crown Copyright 2016-<%= htmlWebpackPlugin.options.compileYear %>
@license Apache-2.0
Copyright 2016 Crown Copyright
Copyright 2016-<%= htmlWebpackPlugin.options.compileYear %> Crown Copyright
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -25,7 +25,7 @@
<meta charset="UTF-8">
<title>CyberChef</title>
<meta name="copyright" content="Crown Copyright 2016" />
<meta name="copyright" content="Crown Copyright 2016-<%= htmlWebpackPlugin.options.compileYear %>" />
<meta name="description" content="The Cyber Swiss Army Knife - a web app for encryption, encoding, compression and data analysis" />
<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" />
@ -562,10 +562,10 @@
<div class="modal-body">
<img aria-hidden="true" class="about-img-left" src="<%- require('../static/images/cyberchef-128x128.png') %>" alt="CyberChef Logo"/>
<p class="subtext">
Version <%= htmlWebpackPlugin.options.version %><br>
Version <%= htmlWebpackPlugin.options.version %><br>
Compile time: <%= htmlWebpackPlugin.options.compileTime %>
</p>
<p>&copy; Crown Copyright 2016.</p>
<p>&copy; Crown Copyright 2016-<%= htmlWebpackPlugin.options.compileYear %>.</p>
<p>Released under the Apache Licence, Version 2.0.</p>
<p><a href="https://gitter.im/gchq/CyberChef">
<img src="<%- require('../static/images/gitter-badge.svg') %>">
@ -861,7 +861,7 @@
<ul>
<li>Build time: <%= htmlWebpackPlugin.options.compileTime %></li>
<li>The changelog for this version can be viewed <a href="https://github.com/gchq/CyberChef/blob/master/CHANGELOG.md">here</a></li>
<li>&copy; Crown Copyright 2016</li>
<li>&copy; Crown Copyright 2016-<%= htmlWebpackPlugin.options.compileYear %></li>
<li>Released under the Apache Licence, Version 2.0</li>
<li>SHA256 hash: DOWNLOAD_HASH_PLACEHOLDER</li>
</ul>