From aa206d7b37060d36e08137263749abead583f3a4 Mon Sep 17 00:00:00 2001 From: n1073645 Date: Tue, 26 Nov 2019 16:43:54 +0000 Subject: [PATCH] Magic signatures --- src/core/operations/BaconCipherDecode.mjs | 22 +++++++++++++++++++++ src/core/operations/CSVToJSON.mjs | 7 +++++++ src/core/operations/ChangeIPFormat.mjs | 17 ++++++++++++++++ src/core/operations/DechunkHTTPResponse.mjs | 7 +++++++ src/core/operations/DecodeNetBIOSName.mjs | 7 +++++++ src/core/operations/FormatMACAddresses.mjs | 7 +++++++ src/core/operations/FromHexContent.mjs | 7 +++++++ src/core/operations/RemoveLineNumbers.mjs | 7 +++++++ src/core/operations/StripHTTPHeaders.mjs | 7 +++++++ 9 files changed, 88 insertions(+) diff --git a/src/core/operations/BaconCipherDecode.mjs b/src/core/operations/BaconCipherDecode.mjs index 56d0946b..90213d41 100644 --- a/src/core/operations/BaconCipherDecode.mjs +++ b/src/core/operations/BaconCipherDecode.mjs @@ -44,6 +44,28 @@ class BaconCipherDecode extends Operation { "value": false } ]; + this.patterns = [ + { + match: "^([01]{5}\\s?)+$", + flags: "", + args: ["Complete", "0/1", false] + }, + { + match: "^([01]{5}\\s?)+$", + flags: "", + args: ["Complete", "0/1", true] + }, + { + match: "^([AB]{5}\\s?)+$", + flags: "", + args: ["Complete", "A/B", false] + }, + { + match: "^([AB]{5}\\s?)+$", + flags: "", + args: ["Complete", "A/B", true] + } + ]; } /** diff --git a/src/core/operations/CSVToJSON.mjs b/src/core/operations/CSVToJSON.mjs index ca9f1ceb..b729e86e 100644 --- a/src/core/operations/CSVToJSON.mjs +++ b/src/core/operations/CSVToJSON.mjs @@ -42,6 +42,13 @@ class CSVToJSON extends Operation { value: ["Array of dictionaries", "Array of arrays"] } ]; + this.patterns = [ + { + match: "([A-Z\s]*,){5}", + flags: "i", + args: [",", "\r\n", "Array of dictionaries"] + } + ]; } /** diff --git a/src/core/operations/ChangeIPFormat.mjs b/src/core/operations/ChangeIPFormat.mjs index c9adc5d8..ffb00739 100644 --- a/src/core/operations/ChangeIPFormat.mjs +++ b/src/core/operations/ChangeIPFormat.mjs @@ -37,6 +37,23 @@ class ChangeIPFormat extends Operation { "value": ["Dotted Decimal", "Decimal", "Octal", "Hex"] } ]; + this.patterns = [ + { + match: "([0-9]{1,3}\\.){3}[0-9]{1,3}", + flags: "", + args: ["Dotted Decimal","Decimal"] + }, + { + match: "([0-9]{1,3}\\.){3}[0-9]{1,3}", + flags: "", + args: ["Dotted Decimal","Octal"] + }, + { + match: "([0-9]{1,3}\\.){3}[0-9]{1,3}", + flags: "", + args: ["Dotted Decimal","Hex"] + } + ]; } /** diff --git a/src/core/operations/DechunkHTTPResponse.mjs b/src/core/operations/DechunkHTTPResponse.mjs index 6a4c3813..f26deb4b 100644 --- a/src/core/operations/DechunkHTTPResponse.mjs +++ b/src/core/operations/DechunkHTTPResponse.mjs @@ -24,6 +24,13 @@ class DechunkHTTPResponse extends Operation { this.inputType = "string"; this.outputType = "string"; this.args = []; + this.patterns = [ + { + match: "^[0-9A-F]+\r\n", + flags: "i", + args: [] + } + ]; } /** diff --git a/src/core/operations/DecodeNetBIOSName.mjs b/src/core/operations/DecodeNetBIOSName.mjs index f4d89f4a..d7a86c26 100644 --- a/src/core/operations/DecodeNetBIOSName.mjs +++ b/src/core/operations/DecodeNetBIOSName.mjs @@ -30,6 +30,13 @@ class DecodeNetBIOSName extends Operation { "value": 65 } ]; + this.patterns = [ + { + match: "^\\S{16}$", + flags: "", + args: [65] + } + ]; } /** diff --git a/src/core/operations/FormatMACAddresses.mjs b/src/core/operations/FormatMACAddresses.mjs index 41fac594..9a14a96a 100644 --- a/src/core/operations/FormatMACAddresses.mjs +++ b/src/core/operations/FormatMACAddresses.mjs @@ -55,6 +55,13 @@ class FormatMACAddresses extends Operation { "value": false } ]; + this.patterns = [ + { + match: "^([0-9a-f]{2}:){5}[0-9a-f]{2}$", + flags: "i", + args: ["Both", true, true, true, true, true] + } + ]; } /** diff --git a/src/core/operations/FromHexContent.mjs b/src/core/operations/FromHexContent.mjs index deb101bf..11a705e6 100644 --- a/src/core/operations/FromHexContent.mjs +++ b/src/core/operations/FromHexContent.mjs @@ -26,6 +26,13 @@ class FromHexContent extends Operation { this.inputType = "string"; this.outputType = "byteArray"; this.args = []; + this.patterns = [ + { + match: "^.+?\\|[0-9a-f]{2}\\|.+$", + flags: "i", + args: [] + } + ]; } /** diff --git a/src/core/operations/RemoveLineNumbers.mjs b/src/core/operations/RemoveLineNumbers.mjs index 0fbf7115..a931524b 100644 --- a/src/core/operations/RemoveLineNumbers.mjs +++ b/src/core/operations/RemoveLineNumbers.mjs @@ -23,6 +23,13 @@ class RemoveLineNumbers extends Operation { this.inputType = "string"; this.outputType = "string"; this.args = []; + this.patterns = [ + { + match: "^([0-9]+ .*?(\\n))+[0-9] .+$", + flags: "", + args: [] + } + ]; } /** diff --git a/src/core/operations/StripHTTPHeaders.mjs b/src/core/operations/StripHTTPHeaders.mjs index e43360ed..f0ac1fb4 100644 --- a/src/core/operations/StripHTTPHeaders.mjs +++ b/src/core/operations/StripHTTPHeaders.mjs @@ -24,6 +24,13 @@ class StripHTTPHeaders extends Operation { this.inputType = "string"; this.outputType = "string"; this.args = []; + this.patterns = [ + { + match: "^HTTP(.|\\s)+?(\\r?\\n){2}", + flags: "", + args: [] + } + ]; } /**