Skip to content

Commit

Permalink
Added a specialized form element for regex parameters. (Velocidex#1367)
Browse files Browse the repository at this point in the history
  • Loading branch information
scudette authored Nov 4, 2021
1 parent 1bcec18 commit 641aff0
Show file tree
Hide file tree
Showing 94 changed files with 851 additions and 374 deletions.
1 change: 1 addition & 0 deletions artifacts/definitions/Admin/Client/Uninstall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ required_permissions:

parameters:
- name: DisplayNameRegex
type: regex
default: Velociraptor
description: A regex that will match the package to uninstall.

Expand Down
3 changes: 2 additions & 1 deletion artifacts/definitions/Admin/System/CompressUploads.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ type: SERVER_EVENT

parameters:
- name: blacklistCompressionFilename
type: regex
description: Filenames which match this regex will be excluded from compression.
default: '(?i).+ntuser.dat'
default: 'ntuser.dat$'

sources:
- queries:
Expand Down
4 changes: 4 additions & 0 deletions artifacts/definitions/Demo/Plugins/GUI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ parameters:
- Second Choice
- Third Choice

- name: RegularExpression
type: regex
default: "."

- name: Flag
type: bool
default: Y
Expand Down
1 change: 1 addition & 0 deletions artifacts/definitions/Elastic/Flows/Upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type: SERVER_EVENT
parameters:
- name: ArtifactNameRegex
default: .
type: regex
description: Only upload these artifacts to elastic
- name: elasticAddresses
default: http://127.0.0.1:9200/
Expand Down
3 changes: 3 additions & 0 deletions artifacts/definitions/Generic/System/Pstree.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ description: |
parameters:
- name: ProcessNameRegex
default: .
type: regex

- name: PidFilter
description: Filter pids by this regex
default: .
type: regex

- name: CallChainFilter
default: .
type: regex

- name: CallChainSep
default: " <- "
Expand Down
2 changes: 2 additions & 0 deletions artifacts/definitions/Linux/Detection/Yara/Process.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ type: CLIENT
parameters:
- name: ProcessRegex
default: .
type: regex
- name: PidRegex
default: .
type: regex
- name: UploadHits
type: bool
- name: YaraUrl
Expand Down
1 change: 1 addition & 0 deletions artifacts/definitions/Linux/Network/Netstat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type: CLIENT

parameters:
- name: StateRegex
type: regex
default: "Listening|Established"
description: Only show these states

Expand Down
24 changes: 13 additions & 11 deletions artifacts/definitions/Linux/Sys/BashHistory.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
name: Linux.Sys.BashHistory
author: "Matt Green - @mgreen27"
description: |
This artifact enables grep of Bash and alternate shell history files.
It can also be used to target other files located in the user profile such as
*_profile and *rc files.
shell history: /{root,home/*}/.*_history
profile: /{root,home/*}/.*_profile
*rc file: /{root,home/*}/.*rc
This artifact enables grep of Bash and alternate shell history files.
It can also be used to target other files located in the user profile such as
*_profile and *rc files.
shell history: /{root,home/*}/.*_history
profile: /{root,home/*}/.*_profile
*rc file: /{root,home/*}/.*rc
tags: .bash_history .bash_profile .bashrc
parameters:
- name: TargetGlob
default: /{root,home/*}/.*_history
- name: SearchRegex
type: regex
description: "Regex of strings to search in line."
default: '.'
- name: WhitelistRegex
type: regex
description: "Regex of strings to leave out of output."
default:

Expand All @@ -29,7 +31,7 @@ sources:
SELECT * FROM foreach(row=files,
query={
SELECT Line, FullPath FROM parse_lines(filename=FullPath)
WHERE
WHERE
Line =~ SearchRegex
AND NOT if(condition= WhitelistRegex,
then= Line =~ WhitelistRegex,
Expand Down
1 change: 1 addition & 0 deletions artifacts/definitions/Linux/Sys/Maps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ parameters:
- name: processRegex
description: A regex applied to process names.
default: .
type: regex

sources:
- queries:
Expand Down
1 change: 1 addition & 0 deletions artifacts/definitions/Linux/Sys/Pslist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: |
parameters:
- name: processRegex
default: .
type: regex

precondition: SELECT OS From info() where OS = 'linux'

Expand Down
2 changes: 1 addition & 1 deletion artifacts/definitions/Server/Alerts/PsExec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sources:
row={
SELECT * from watch_monitoring(
artifact='Windows.Events.ProcessCreation')
WHERE Name =~ '(?i)psexesvc'
WHERE Name =~ 'psexesvc'
},
query={
SELECT * FROM mail(
Expand Down
1 change: 1 addition & 0 deletions artifacts/definitions/Server/Alerts/TheHive/Case.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ parameters:
default: https://myvelo
- name: ArtifactsToAlertOn
default: .
type: regex
- name: DisableSSLVerify
type: bool
default: true
Expand Down
1 change: 1 addition & 0 deletions artifacts/definitions/Server/Information/Users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ parameters:
- name: StandardUserAccounts
description: Well known SIDs to hide from the output.
default: "(-5..$|S-1-5-18|S-1-5-19|S-1-5-20)"
type: regex

sources:
- query: |
Expand Down
2 changes: 2 additions & 0 deletions artifacts/definitions/Server/Monitoring/ScheduleHunt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ type: SERVER_EVENT
parameters:
- name: ScheduleDayRegex
default: Tuesday
type: regex
- name: ScheduleTimeRegex
default: "01:28:"
type: regex
- name: HuntDescription
default:

Expand Down
2 changes: 2 additions & 0 deletions artifacts/definitions/Server/Utils/BackupS3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ parameters:
- name: ArtifactNameRegex
default: "."
description: A regular expression to select which artifacts to upload
type: regex

- name: Bucket
- name: Region
- name: CredentialsKey
Expand Down
1 change: 1 addition & 0 deletions artifacts/definitions/Splunk/Flows/Upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type: SERVER_EVENT
parameters:
- name: ArtifactNameRegex
default: "."
type: regex
description: Names of artifacts to upload to Splunk
- name: url
default: http://127.0.0.1:8088/services/collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ parameters:
SELECT *,url as url_visited FROM moz_historyvisits, moz_places WHERE moz_historyvisits.place_id=moz_places.id
- name: userRegex
default: .
type: regex

precondition: SELECT OS From info() where OS = 'windows'

Expand Down
8 changes: 5 additions & 3 deletions artifacts/definitions/Windows/Application/IISLogs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Windows.Application.IISLogs
description: |
This artifact enables grep of IISLogs.
This artifact enables grep of IISLogs.
Parameters include SearchRegex and WhitelistRegex as regex terms.
author: "Matt Green - @mgreen27"
Expand All @@ -11,9 +11,11 @@ parameters:
- name: SearchRegex
description: "Regex of strings to search in line."
default: ' POST '
type: regex
- name: WhitelistRegex
description: "Regex of strings to leave out of output."
default:
type: regex

sources:
- precondition: SELECT OS From info() where OS = 'windows'
Expand All @@ -24,9 +26,9 @@ sources:
SELECT * FROM foreach(row=files,
query={
SELECT Line, FullPath FROM parse_lines(filename=FullPath)
WHERE
WHERE
Line =~ SearchRegex
AND NOT if(condition= WhitelistRegex,
then= Line =~ WhitelistRegex,
else= FALSE)
})
})
18 changes: 10 additions & 8 deletions artifacts/definitions/Windows/Application/MegaSync.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Windows.Application.MegaSync
description: |
This artifact will parse MEGASync logs and enables using regex to search for
This artifact will parse MEGASync logs and enables using regex to search for
entries of interest.
With UploadLogs selected a copy of the logs are uploaded to the server.
SearchVSS enables search over VSS and dedup support.
author: "Matt Green - @mgreen27"

reference:
Expand All @@ -19,17 +19,19 @@ parameters:
- name: SearchRegex
description: "Regex of strings to search in line."
default: 'Transfer\s\(UPLOAD\)|upload\squeue|local\sfile\saddition\sdetected|Sync\s-\ssending\sfile|\"user\"'
type: regex
- name: WhitelistRegex
description: "Regex of strings to leave out of output."
default:
type: regex
- name: SearchVSS
description: "Add VSS into query."
type: bool
- name: UploadLogs
description: "Upload MEGASync logs."
type: bool


sources:
- query: |
-- Find target files
Expand Down Expand Up @@ -61,7 +63,7 @@ sources:
})
GROUP BY Line
SELECT
SELECT
Line as RawLine,
FullPath
FROM output
Expand All @@ -70,7 +72,7 @@ sources:
- name: LogFiles
queries:
- |
SELECT
SELECT
FullPath,
if(condition=UploadLogs,
then= upload(file=FullPath,accessor='ntfs')
Expand All @@ -81,4 +83,4 @@ sources:
Ctime,
Size
FROM output
GROUP BY FullPath
GROUP BY FullPath
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ parameters:
FROM cookies
- name: userRegex
default: .
type: regex

precondition: SELECT OS From info() where OS = 'windows'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ parameters:
default: \AppData\Local\Google\Chrome\User Data\*\Extensions\*\*\manifest.json
- name: userRegex
default: .
type: regex

sources:
- precondition: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ parameters:
FROM urls
- name: userRegex
default: .
type: regex

precondition: SELECT OS From info() where OS = 'windows'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ parameters:
- name: URLRegex
default: .
description: Filter URLs by this regex
type: regex
- name: DateAfter
type: timestamp
- name: DateBefore
Expand Down
1 change: 1 addition & 0 deletions artifacts/definitions/Windows/Applications/SBECmd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ precondition: SELECT OS From info() where OS = 'windows'
parameters:
- name: userRegex
default: .
type: regex

- name: UploadFiles
description: "Select to Upload SBECmd Output files."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ parameters:
- name: TeamViewerIDRegex
description: "Regex of TeamViewer ID"
default: .
type: regex
- name: SourceHostRegex
description: "Regex of source host"
default: .
type: regex
- name: UserRegex
description: "Regex of user"
default: .
type: regex
- name: SearchVSS
description: "Add VSS into query."
type: bool
Expand Down
Loading

0 comments on commit 641aff0

Please sign in to comment.