From b78533bb02399a9d46ca43295ac39749d14287ed Mon Sep 17 00:00:00 2001
From: a3957273 <89583054+a3957273@users.noreply.github.com>
Date: Sat, 3 Feb 2024 02:02:13 +0000
Subject: [PATCH] Update forensics wiki address
---
src/core/Utils.mjs | 17 +++++++++++++++++
src/core/operations/CTPH.mjs | 2 +-
src/core/operations/CompareCTPHHashes.mjs | 2 +-
src/core/operations/CompareSSDEEPHashes.mjs | 2 +-
src/core/operations/SSDEEP.mjs | 2 +-
src/web/HTMLOperation.mjs | 4 ++--
6 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/src/core/Utils.mjs b/src/core/Utils.mjs
index 787ef270b2..18b0e68830 100755
--- a/src/core/Utils.mjs
+++ b/src/core/Utils.mjs
@@ -892,6 +892,23 @@ class Utils {
}
+ /**
+ * Converts a string to it's title case equivalent.
+ *
+ * @param {string} str
+ * @returns string
+ *
+ * @example
+ * // return "A Tiny String"
+ * Utils.toTitleCase("a tIny String");
+ */
+ static toTitleCase(str) {
+ return str.replace(/\w\S*/g, function(txt) {
+ return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
+ });
+ }
+
+
/**
* Encodes a URI fragment (#) or query (?) using a minimal amount of percent-encoding.
*
diff --git a/src/core/operations/CTPH.mjs b/src/core/operations/CTPH.mjs
index 7394faaae3..6b6a487d81 100644
--- a/src/core/operations/CTPH.mjs
+++ b/src/core/operations/CTPH.mjs
@@ -21,7 +21,7 @@ class CTPH extends Operation {
this.name = "CTPH";
this.module = "Crypto";
this.description = "Context Triggered Piecewise Hashing, also called Fuzzy Hashing, can match inputs that have homologies. Such inputs have sequences of identical bytes in the same order, although bytes in between these sequences may be different in both content and length.
CTPH was originally based on the work of Dr. Andrew Tridgell and a spam email detector called SpamSum. This method was adapted by Jesse Kornblum and published at the DFRWS conference in 2006 in a paper 'Identifying Almost Identical Files Using Context Triggered Piecewise Hashing'.";
- this.infoURL = "https://forensicswiki.xyz/wiki/index.php?title=Context_Triggered_Piecewise_Hashing";
+ this.infoURL = "https://forensics.wiki/context_triggered_piecewise_hashing/";
this.inputType = "string";
this.outputType = "string";
this.args = [];
diff --git a/src/core/operations/CompareCTPHHashes.mjs b/src/core/operations/CompareCTPHHashes.mjs
index 40fec47208..91956220e0 100644
--- a/src/core/operations/CompareCTPHHashes.mjs
+++ b/src/core/operations/CompareCTPHHashes.mjs
@@ -24,7 +24,7 @@ class CompareCTPHHashes extends Operation {
this.name = "Compare CTPH hashes";
this.module = "Crypto";
this.description = "Compares two Context Triggered Piecewise Hashing (CTPH) fuzzy hashes to determine the similarity between them on a scale of 0 to 100.";
- this.infoURL = "https://forensicswiki.xyz/wiki/index.php?title=Context_Triggered_Piecewise_Hashing";
+ this.infoURL = "https://forensics.wiki/context_triggered_piecewise_hashing/";
this.inputType = "string";
this.outputType = "Number";
this.args = [
diff --git a/src/core/operations/CompareSSDEEPHashes.mjs b/src/core/operations/CompareSSDEEPHashes.mjs
index 806b048ef2..9937d7e6d5 100644
--- a/src/core/operations/CompareSSDEEPHashes.mjs
+++ b/src/core/operations/CompareSSDEEPHashes.mjs
@@ -24,7 +24,7 @@ class CompareSSDEEPHashes extends Operation {
this.name = "Compare SSDEEP hashes";
this.module = "Crypto";
this.description = "Compares two SSDEEP fuzzy hashes to determine the similarity between them on a scale of 0 to 100.";
- this.infoURL = "https://forensicswiki.xyz/wiki/index.php?title=Ssdeep";
+ this.infoURL = "https://forensics.wiki/ssdeep/";
this.inputType = "string";
this.outputType = "Number";
this.args = [
diff --git a/src/core/operations/SSDEEP.mjs b/src/core/operations/SSDEEP.mjs
index df1557d51c..6a76a68be6 100644
--- a/src/core/operations/SSDEEP.mjs
+++ b/src/core/operations/SSDEEP.mjs
@@ -21,7 +21,7 @@ class SSDEEP extends Operation {
this.name = "SSDEEP";
this.module = "Crypto";
this.description = "SSDEEP is a program for computing context triggered piecewise hashes (CTPH). Also called fuzzy hashes, CTPH can match inputs that have homologies. Such inputs have sequences of identical bytes in the same order, although bytes in between these sequences may be different in both content and length.
SSDEEP hashes are now widely used for simple identification purposes (e.g. the 'Basic Properties' section in VirusTotal). Although 'better' fuzzy hashes are available, SSDEEP is still one of the primary choices because of its speed and being a de facto standard.
This operation is fundamentally the same as the CTPH operation, however their outputs differ in format.";
- this.infoURL = "https://forensicswiki.xyz/wiki/index.php?title=Ssdeep";
+ this.infoURL = "https://forensics.wiki/ssdeep";
this.inputType = "string";
this.outputType = "string";
this.args = [];
diff --git a/src/web/HTMLOperation.mjs b/src/web/HTMLOperation.mjs
index d0523aa483..ae61b58d43 100755
--- a/src/web/HTMLOperation.mjs
+++ b/src/web/HTMLOperation.mjs
@@ -157,9 +157,9 @@ function titleFromWikiLink(urlStr) {
pageTitle = "";
switch (urlObj.host) {
- case "forensicswiki.xyz":
+ case "forensics.wiki":
wikiName = "Forensics Wiki";
- pageTitle = urlObj.query.substr(6).replace(/_/g, " "); // Chop off 'title='
+ pageTitle = Utils.toTitleCase(urlObj.path.replace(/\//g, "").replace(/_/g, " "));
break;
case "wikipedia.org":
wikiName = "Wikipedia";