1
0
mirror of synced 2025-02-22 12:50:36 +01:00

Merge branch 'master' into master

This commit is contained in:
Adam Hassan 2025-01-13 12:24:45 -05:00 committed by GitHub
commit 54e559c5a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 25 additions and 18 deletions

22
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "cyberchef", "name": "cyberchef",
"version": "10.19.0", "version": "10.19.4",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "cyberchef", "name": "cyberchef",
"version": "10.19.0", "version": "10.19.4",
"hasInstallScript": true, "hasInstallScript": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
@ -115,7 +115,7 @@
"babel-plugin-dynamic-import-node": "^2.3.3", "babel-plugin-dynamic-import-node": "^2.3.3",
"babel-plugin-transform-builtin-extend": "1.1.2", "babel-plugin-transform-builtin-extend": "1.1.2",
"base64-loader": "^1.0.0", "base64-loader": "^1.0.0",
"chromedriver": "^125.0.3", "chromedriver": "^130.0.0",
"cli-progress": "^3.12.0", "cli-progress": "^3.12.0",
"colors": "^1.4.0", "colors": "^1.4.0",
"copy-webpack-plugin": "^12.0.2", "copy-webpack-plugin": "^12.0.2",
@ -3982,12 +3982,12 @@
} }
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "1.6.7", "version": "1.7.7",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz",
"integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"follow-redirects": "^1.15.4", "follow-redirects": "^1.15.6",
"form-data": "^4.0.0", "form-data": "^4.0.0",
"proxy-from-env": "^1.1.0" "proxy-from-env": "^1.1.0"
} }
@ -5093,14 +5093,14 @@
} }
}, },
"node_modules/chromedriver": { "node_modules/chromedriver": {
"version": "125.0.3", "version": "130.0.0",
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-125.0.3.tgz", "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-130.0.0.tgz",
"integrity": "sha512-Qzuk5Wian2o3EVGjtbz6V/jv+pT/AV9246HbG6kUljZXXjsKZLZxqJC+kHR3qEh/wdv4EJD0YwAOWV72v9hogw==", "integrity": "sha512-1g1eMoKF22Uh6l8DTFOPvWLovINPrkAMw7yDHlF6Rx+4W4JI9aGdCZ2Cx7c181hUgALU1oSKGH3uKNryYM5DaQ==",
"dev": true, "dev": true,
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@testim/chrome-version": "^1.1.4", "@testim/chrome-version": "^1.1.4",
"axios": "^1.6.7", "axios": "^1.7.4",
"compare-versions": "^6.1.0", "compare-versions": "^6.1.0",
"extract-zip": "^2.0.1", "extract-zip": "^2.0.1",
"proxy-agent": "^6.4.0", "proxy-agent": "^6.4.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "cyberchef", "name": "cyberchef",
"version": "10.19.0", "version": "10.19.4",
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.", "description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
"author": "n1474335 <n1474335@gmail.com>", "author": "n1474335 <n1474335@gmail.com>",
"homepage": "https://gchq.github.io/CyberChef", "homepage": "https://gchq.github.io/CyberChef",
@ -55,7 +55,7 @@
"babel-plugin-dynamic-import-node": "^2.3.3", "babel-plugin-dynamic-import-node": "^2.3.3",
"babel-plugin-transform-builtin-extend": "1.1.2", "babel-plugin-transform-builtin-extend": "1.1.2",
"base64-loader": "^1.0.0", "base64-loader": "^1.0.0",
"chromedriver": "^125.0.3", "chromedriver": "^130.0.0",
"cli-progress": "^3.12.0", "cli-progress": "^3.12.0",
"colors": "^1.4.0", "colors": "^1.4.0",
"copy-webpack-plugin": "^12.0.2", "copy-webpack-plugin": "^12.0.2",

View File

@ -44,7 +44,7 @@ export function toJA4(bytes) {
the TLS version is the value of the Protocol Version. Handshake version (located at the top of the packet) the TLS version is the value of the Protocol Version. Handshake version (located at the top of the packet)
should be ignored. should be ignored.
*/ */
let version = tlsr.version.value; let version = tlsr.handshake.value.helloVersion.value;
for (const ext of tlsr.handshake.value.extensions.value) { for (const ext of tlsr.handshake.value.extensions.value) {
if (ext.type.value === "supported_versions") { if (ext.type.value === "supported_versions") {
version = parseHighestSupportedVersion(ext.value.data); version = parseHighestSupportedVersion(ext.value.data);
@ -189,7 +189,7 @@ export function toJA4S(bytes) {
the TLS version is the value of the Protocol Version. Handshake version (located at the top of the packet) the TLS version is the value of the Protocol Version. Handshake version (located at the top of the packet)
should be ignored. should be ignored.
*/ */
let version = tlsr.version.value; let version = tlsr.handshake.value.helloVersion.value;
for (const ext of tlsr.handshake.value.extensions.value) { for (const ext of tlsr.handshake.value.extensions.value) {
if (ext.type.value === "supported_versions") { if (ext.type.value === "supported_versions") {
version = parseHighestSupportedVersion(ext.value.data); version = parseHighestSupportedVersion(ext.value.data);

View File

@ -60,7 +60,7 @@ class RSASign extends Operation {
const privateKey = forge.pki.decryptRsaPrivateKey(key, password); const privateKey = forge.pki.decryptRsaPrivateKey(key, password);
// Generate message hash // Generate message hash
const md = MD_ALGORITHMS[mdAlgo].create(); const md = MD_ALGORITHMS[mdAlgo].create();
md.update(input, "utf8"); md.update(input, "raw");
// Sign message hash // Sign message hash
const sig = privateKey.sign(md); const sig = privateKey.sign(md);
return sig; return sig;

View File

@ -8,6 +8,7 @@ import Operation from "../Operation.mjs";
import OperationError from "../errors/OperationError.mjs"; import OperationError from "../errors/OperationError.mjs";
import forge from "node-forge"; import forge from "node-forge";
import { MD_ALGORITHMS } from "../lib/RSA.mjs"; import { MD_ALGORITHMS } from "../lib/RSA.mjs";
import Utils from "../Utils.mjs";
/** /**
* RSA Verify operation * RSA Verify operation
@ -37,6 +38,11 @@ class RSAVerify extends Operation {
type: "text", type: "text",
value: "" value: ""
}, },
{
name: "Message format",
type: "option",
value: ["Raw", "Hex", "Base64"]
},
{ {
name: "Message Digest Algorithm", name: "Message Digest Algorithm",
type: "option", type: "option",
@ -51,7 +57,7 @@ class RSAVerify extends Operation {
* @returns {string} * @returns {string}
*/ */
run(input, args) { run(input, args) {
const [pemKey, message, mdAlgo] = args; const [pemKey, message, format, mdAlgo] = args;
if (pemKey.replace("-----BEGIN RSA PUBLIC KEY-----", "").length === 0) { if (pemKey.replace("-----BEGIN RSA PUBLIC KEY-----", "").length === 0) {
throw new OperationError("Please enter a public key."); throw new OperationError("Please enter a public key.");
} }
@ -60,7 +66,8 @@ class RSAVerify extends Operation {
const pubKey = forge.pki.publicKeyFromPem(pemKey); const pubKey = forge.pki.publicKeyFromPem(pemKey);
// Generate message digest // Generate message digest
const md = MD_ALGORITHMS[mdAlgo].create(); const md = MD_ALGORITHMS[mdAlgo].create();
md.update(message, "utf8"); const messageStr = Utils.convertToByteString(message, format);
md.update(messageStr, "raw");
// Compare signed message digest and generated message digest // Compare signed message digest and generated message digest
const result = pubKey.verify(md.digest().bytes(), input); const result = pubKey.verify(md.digest().bytes(), input);
return result ? "Verified OK" : "Verification Failure"; return result ? "Verified OK" : "Verification Failure";