From d2dda4519fde7390624c71abd18a246d20cd6857 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 5 Jul 2021 13:54:04 -0400 Subject: [PATCH] Island: Allow Windows ransomware target paths to be UNC paths --- .../configuration-components/ValidationFormats.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js index 414d6071a..d7c0a371c 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js @@ -12,8 +12,8 @@ const windowsAbsolutePathRegex = /^([A-Za-z]:(\\|\/))/ // path starts like `C:\` const windowsEnvVarNonNumeric = '[A-Za-z#\\$\'\\(\\)\\*\\+,-\\.\\?@\\[\\]_`\\{\\}~+ ]' const windowsPathStartsWithEnvVariableRegex = new RegExp( `^%(${windowsEnvVarNonNumeric}+(${windowsEnvVarNonNumeric}|\\d)*)%` -);// path starts like `$` OR `%abc%` - +) // path starts like `$` OR `%abc%` +const windowsUncPathRegex = /^\\{2}/ // Path starts like `\\` const emptyRegex = /^$/ @@ -55,6 +55,7 @@ function buildValidRansomwarePathWindowsRegex() { return new RegExp([ emptyRegex.source, windowsAbsolutePathRegex.source, - windowsPathStartsWithEnvVariableRegex.source + windowsPathStartsWithEnvVariableRegex.source, + windowsUncPathRegex.source ].join('|')) }