From 43472394c79025bb5cc96c1ea3873bb87ffd7577 Mon Sep 17 00:00:00 2001 From: n1474335 Date: Tue, 13 Aug 2019 14:23:41 +0100 Subject: [PATCH] Tidied up 'Defang IP Addresses' operation --- src/core/config/Categories.json | 2 +- .../{DefangIP.mjs => DefangIPAddresses.mjs} | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) rename src/core/operations/{DefangIP.mjs => DefangIPAddresses.mjs} (80%) diff --git a/src/core/config/Categories.json b/src/core/config/Categories.json index 44ec9b78..f1a7b815 100755 --- a/src/core/config/Categories.json +++ b/src/core/config/Categories.json @@ -180,7 +180,7 @@ "Encode NetBIOS Name", "Decode NetBIOS Name", "Defang URL", - "Defang IP" + "Defang IP Addresses" ] }, { diff --git a/src/core/operations/DefangIP.mjs b/src/core/operations/DefangIPAddresses.mjs similarity index 80% rename from src/core/operations/DefangIP.mjs rename to src/core/operations/DefangIPAddresses.mjs index 03bfc6da..74e03500 100644 --- a/src/core/operations/DefangIP.mjs +++ b/src/core/operations/DefangIPAddresses.mjs @@ -8,19 +8,19 @@ import Operation from "../Operation"; /** - * Defang IP operation + * Defang IP Addresses operation */ -class DefangIP extends Operation { +class DefangIPAddresses extends Operation { /** - * DefangIP constructor + * DefangIPAddresses constructor */ constructor() { super(); - this.name = "Defang IP"; + this.name = "Defang IP Addresses"; this.module = "Default"; - this.description = "Takes a IPV4 or IPV6 address and 'Defangs' it; meaning the IP becomes invalid, removing the risk of accidentally utilising it as an IP address."; + this.description = "Takes a IPv4 or IPv6 address and 'Defangs' it, meaning the IP becomes invalid, removing the risk of accidentally utilising it as an IP address."; this.infoURL = "https://isc.sans.edu/forums/diary/Defang+all+the+things/22744/"; this.inputType = "string"; this.outputType = "string"; @@ -34,13 +34,10 @@ class DefangIP extends Operation { * @returns {string} */ run(input, args) { - - input = input.replace(IPV4_REGEX, x => { return x.replace(/\./g, "[.]"); }); - input = input.replace(IPV6_REGEX, x => { return x.replace(/:/g, "[:]"); }); @@ -49,7 +46,7 @@ class DefangIP extends Operation { } } -export default DefangIP; +export default DefangIPAddresses; /**