forked from p15670423/monkey
cc: Add validation format (starts wih `~`) for ransomware linux target directory
This commit is contained in:
parent
3496c717a9
commit
dc305d8e16
|
@ -4,6 +4,7 @@ const hostnameRegex = '^([A-Za-z0-9]*[A-Za-z]+[A-Za-z0-9]*.?)*([A-Za-z0-9]*[A-Za
|
||||||
|
|
||||||
const linuxAbsolutePathRegex = '^/' // path starts with `/`
|
const linuxAbsolutePathRegex = '^/' // path starts with `/`
|
||||||
const linuxPathStartsWithEnvVariableRegex = '^\\$' // path starts with `$`
|
const linuxPathStartsWithEnvVariableRegex = '^\\$' // path starts with `$`
|
||||||
|
const linuxPathStartsWithTilde = '^~' // path starts with `~`
|
||||||
|
|
||||||
const windowsAbsolutePathRegex = '^([A-Za-z]:(\\\\|\\/))' // path starts like `C:\` OR `C:/`
|
const windowsAbsolutePathRegex = '^([A-Za-z]:(\\\\|\\/))' // path starts like `C:\` OR `C:/`
|
||||||
const windowsPathStartsWithEnvVariableRegex = '^\\$|^(%\\w*\\d*\\s*%)' // path starts like `$` OR `%abc%`
|
const windowsPathStartsWithEnvVariableRegex = '^\\$|^(%\\w*\\d*\\s*%)' // path starts like `$` OR `%abc%`
|
||||||
|
@ -40,7 +41,8 @@ function buildValidRansomwarePathLinuxRegex() {
|
||||||
return new RegExp([
|
return new RegExp([
|
||||||
whitespacesOnlyRegex,
|
whitespacesOnlyRegex,
|
||||||
linuxAbsolutePathRegex,
|
linuxAbsolutePathRegex,
|
||||||
linuxPathStartsWithEnvVariableRegex
|
linuxPathStartsWithEnvVariableRegex,
|
||||||
|
linuxPathStartsWithTilde
|
||||||
].join('|'))
|
].join('|'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue