Skip to content

Commit 0e3b749

Browse files
FlorianBracqswachchhanda000nasbench
authored
Merge PR #5898 from @FlorianBracq - Set groups in regular expressions as non capturing
update: Dynamic .NET Compilation Via Csc.EXE - Update regex to use a non-capturing group update: Csc.EXE Execution Form Potentially Suspicious Parent - Update regex to use a non-capturing group update: Invoke-Obfuscation Obfuscated IEX Invocation - Update regex to use a non-capturing group update: Invoke-Obfuscation Via Stdin - Update regex to use a non-capturing group update: Invoke-Obfuscation Via Use Clip - Update regex to use a non-capturing group update: Powershell Token Obfuscation - Process Creation - Update regex to use a non-capturing group update: Potential Rundll32 Execution With DLL Stored In ADS - Update regex to use a non-capturing group update: Suspicious Copy From or To System Directory - Update regex to use a non-capturing group update: Obfuscated IP Download Activity - Update regex to use a non-capturing group update: Obfuscated IP Via CLI - Update regex to use a non-capturing group update: Uncommon Svchost Command Line Parameter - Update regex to use a non-capturing group --------- Co-authored-by: Swachchhanda Shrawan Poudel <87493836+swachchhanda000@users.noreply.github.com> Co-authored-by: Nasreddine Bencherchali <monsteroffire2@gmail.com>
1 parent ad80b4d commit 0e3b749

11 files changed

Lines changed: 25 additions & 24 deletions

rules/windows/process_creation/proc_creation_win_csc_susp_dynamic_compilation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ references:
1010
- https://github.com/redcanaryco/atomic-red-team/blob/b27a3cb25025161d49ac861cb216db68c46a3537/atomics/T1027.004/T1027.004.md#atomic-test-1---compile-after-delivery-using-cscexe
1111
author: Florian Roth (Nextron Systems), X__Junior (Nextron Systems)
1212
date: 2019-08-24
13-
modified: 2024-05-27
13+
modified: 2026-03-23
1414
tags:
1515
- attack.defense-evasion
1616
- attack.t1027.004
@@ -41,7 +41,7 @@ detection:
4141
- ':\Users\'
4242
- '\Pictures\'
4343
selection_susp_location_3:
44-
CommandLine|re: '([Pp]rogram[Dd]ata|%([Ll]ocal)?[Aa]pp[Dd]ata%|\\[Aa]pp[Dd]ata\\([Ll]ocal([Ll]ow)?|[Rr]oaming))\\[^\\]{1,256}$'
44+
CommandLine|re: '(?:[Pp]rogram[Dd]ata|%(?:[Ll]ocal)?[Aa]pp[Dd]ata%|\\[Aa]pp[Dd]ata\\(?:[Ll]ocal(?:[Ll]ow)?|[Rr]oaming))\\[^\\]{1,256}$'
4545
filter_main_programfiles:
4646
# Note: this is a generic filter. You could baseline execution in your env for a more robust rule
4747
ParentImage|startswith:

rules/windows/process_creation/proc_creation_win_csc_susp_parent.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ references:
88
- https://www.pwc.com/gx/en/issues/cybersecurity/cyber-threat-intelligence/yellow-liderc-ships-its-scripts-delivers-imaploader-malware.html
99
author: Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems), X__Junior (Nextron Systems)
1010
date: 2019-02-11
11-
modified: 2024-05-27
11+
modified: 2026-03-23
1212
tags:
1313
- attack.execution
1414
- attack.t1059.005
@@ -41,7 +41,7 @@ detection:
4141
- '-Encoded '
4242
- 'FromBase64String'
4343
selection_parent_susp_location:
44-
- ParentCommandLine|re: '([Pp]rogram[Dd]ata|%([Ll]ocal)?[Aa]pp[Dd]ata%|\\[Aa]pp[Dd]ata\\([Ll]ocal([Ll]ow)?|[Rr]oaming))\\[^\\]{1,256}$'
44+
- ParentCommandLine|re: '(?:[Pp]rogram[Dd]ata|%(?:[Ll]ocal)?[Aa]pp[Dd]ata%|\\[Aa]pp[Dd]ata\\(?:[Ll]ocal(?:[Ll]ow)?|[Rr]oaming))\\[^\\]{1,256}$'
4545
- ParentCommandLine|contains:
4646
- ':\PerfLogs\'
4747
- ':\Users\Public\'

rules/windows/process_creation/proc_creation_win_hktl_invoke_obfuscation_obfuscated_iex_commandline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ references:
66
- https://github.com/danielbohannon/Invoke-Obfuscation/blob/f20e7f843edd0a3a7716736e9eddfa423395dd26/Out-ObfuscatedStringCommand.ps1#L873-L888
77
author: 'Daniel Bohannon (@Mandiant/@FireEye), oscd.community'
88
date: 2019-11-08
9-
modified: 2022-12-31
9+
modified: 2026-03-16
1010
tags:
1111
- attack.defense-evasion
1212
- attack.t1027
@@ -20,7 +20,7 @@ detection:
2020
- CommandLine|re: '\$PSHome\[\s*\d{1,3}\s*\]\s*\+\s*\$PSHome\['
2121
- CommandLine|re: '\$ShellId\[\s*\d{1,3}\s*\]\s*\+\s*\$ShellId\['
2222
- CommandLine|re: '\$env:Public\[\s*\d{1,3}\s*\]\s*\+\s*\$env:Public\['
23-
- CommandLine|re: '\$env:ComSpec\[(\s*\d{1,3}\s*,){2}'
23+
- CommandLine|re: '\$env:ComSpec\[(?:\s*\d{1,3}\s*,){2}'
2424
- CommandLine|re: '\*mdr\*\W\s*\)\.Name'
2525
- CommandLine|re: '\$VerbosePreference\.ToString\('
2626
- CommandLine|re: '\[String\]\s*\$VerbosePreference'

rules/windows/process_creation/proc_creation_win_hktl_invoke_obfuscation_via_stdin.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ references:
66
- https://github.com/SigmaHQ/sigma/issues/1009 # (Task28)
77
author: Nikita Nazarov, oscd.community
88
date: 2020-10-12
9-
modified: 2024-04-16
9+
modified: 2026-03-16
1010
tags:
1111
- attack.defense-evasion
1212
- attack.t1027
@@ -17,7 +17,7 @@ logsource:
1717
product: windows
1818
detection:
1919
selection:
20-
CommandLine|re: '(?i)(set).*&&\s?set.*(environment|invoke|\$\{?input).*&&.*"'
20+
CommandLine|re: '(?i)(?:set).*&&\s?set.*(?:environment|invoke|\$\{?input).*&&.*"'
2121
condition: selection
2222
falsepositives:
2323
- Unknown

rules/windows/process_creation/proc_creation_win_hktl_invoke_obfuscation_via_use_clip.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ references:
66
- https://github.com/SigmaHQ/sigma/issues/1009 # (Task29)
77
author: Nikita Nazarov, oscd.community
88
date: 2020-10-09
9-
modified: 2024-04-15
9+
modified: 2026-03-16
1010
tags:
1111
- attack.defense-evasion
1212
- attack.t1027
@@ -19,7 +19,7 @@ detection:
1919
selection:
2020
# Example 1: C:\WINdoWS\sySteM32\CMd /c " ECho\Invoke-Expression (New-Object Net.WebClient).DownloadString|Clip.Exe&&C:\WINdoWS\sySteM32\CMd /c pOWerSheLl -STa . ( \"{2}{0}{1}\"-f'dd-',(\"{0}{1}\" -f 'T','ype' ),'A' ) -Assembly ( \"{4}{1}{3}{0}{2}\"-f (\"{0}{1}\" -f 'nd','ow'),( \"{1}{0}\"-f'.W','stem' ),( \"{2}{1}{0}\" -f 'rms','Fo','s.'),'i','Sy') ; ${exeCUtIOnCONTeXT}.\"INV`oKECOM`m`ANd\".\"INV`ok`ESCriPT\"( ( [sYSteM.wiNDoWS.forMs.ClIPboaRD]::( \"{2}{0}{1}\" -f'Ex','t',(\"{0}{1}\" -f'Get','t' ) ).\"iNvo`Ke\"( )) ) ; [System.Windows.Forms.Clipboard]::(\"{1}{0}\" -f 'ar','Cle' ).\"in`V`oKE\"( )"
2121
# Example 2: C:\WINDowS\sYsTEM32\CmD.eXE /C" echo\Invoke-Expression (New-Object Net.WebClient).DownloadString| C:\WIndOWs\SYSteM32\CLip &&C:\WINDowS\sYsTEM32\CmD.eXE /C POWERSHeLL -sT -noL [Void][System.Reflection.Assembly]::( \"{0}{3}{4}{1}{2}\" -f( \"{0}{1}\"-f'Lo','adW' ),( \"{0}{1}\"-f 'Par','t'),( \"{0}{1}{2}\"-f 'ial','N','ame'),'it','h' ).\"in`VO`KE\"( ( \"{3}{1}{4}{5}{2}{0}\"-f'rms','ystem.Windo','Fo','S','w','s.' )) ; ( [wIndows.fOrms.cLIPBOArD]::( \"{1}{0}\"-f'T',( \"{1}{0}\" -f'tEX','gET' )).\"i`Nvoke\"( ) ) ^^^| ^^^& ( ( ^^^& ( \"{2}{1}{0}\"-f 'e',( \"{2}{1}{0}\"-f'IABl','aR','v' ),( \"{0}{1}\"-f'Get','-' ) ) ( \"{1}{0}\"-f'*','*MDr' )).\"n`Ame\"[3,11,2]-jOin'') ; [Windows.Forms.Clipboard]::( \"{0}{1}\" -f (\"{1}{0}\"-f'tT','Se' ),'ext').\"in`VoKe\"(' ' )"
22-
CommandLine|re: '(?i)echo.*clip.*&&.*(Clipboard|i`?n`?v`?o`?k`?e`?)'
22+
CommandLine|re: '(?i)echo.*clip.*&&.*(?:Clipboard|i`?n`?v`?o`?k`?e`?)'
2323
condition: selection
2424
falsepositives:
2525
- Unknown

rules/windows/process_creation/proc_creation_win_powershell_token_obfuscation.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ references:
99
- https://github.com/danielbohannon/Invoke-Obfuscation
1010
author: frack113
1111
date: 2022-12-27
12-
modified: 2024-08-11
12+
modified: 2026-03-16
1313
tags:
1414
- attack.defense-evasion
1515
- attack.t1027.009
@@ -22,9 +22,9 @@ detection:
2222
# IN`V`o`Ke-eXp`ResSIOn (Ne`W-ob`ject Net.WebClient).DownloadString
2323
# &('In'+'voke-Expressi'+'o'+'n') (.('New-Ob'+'jec'+'t') Net.WebClient).DownloadString
2424
# &("{2}{3}{0}{4}{1}"-f 'e','Expression','I','nvok','-') (&("{0}{1}{2}"-f'N','ew-O','bject') Net.WebClient).DownloadString
25-
- CommandLine|re: '\w+`(\w+|-|.)`[\w+|\s]'
25+
- CommandLine|re: '\w+`(?:\w+|-|.)`[\w+|\s]'
2626
# - CommandLine|re: '\((\'(\w|-|\.)+\'\+)+\'(\w|-|\.)+\'\)' TODO: fixme
27-
- CommandLine|re: '"(\{\d\})+"\s*-f'
27+
- CommandLine|re: '"(?:\{\d\})+"\s*-f'
2828
# ${e`Nv:pATh}
2929
- CommandLine|re: '(?i)\$\{`?e`?n`?v`?:`?p`?a`?t`?h`?\}'
3030
filter_main_envpath:

rules/windows/process_creation/proc_creation_win_rundll32_ads_stored_dll_execution.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ references:
66
- https://lolbas-project.github.io/lolbas/Binaries/Rundll32
77
author: Harjot Singh, '@cyb3rjy0t'
88
date: 2023-01-21
9-
modified: 2023-02-08
9+
modified: 2026-03-16
1010
tags:
1111
- attack.defense-evasion
1212
- attack.t1564.004
@@ -21,7 +21,7 @@ detection:
2121
# Example:
2222
# rundll32 "C:\ads\file.txt:ADSDLL.dll",DllMain
2323
# Note: This doesn't cover the use case where a full path for the DLL isn't used. As it requires a more expensive regex
24-
CommandLine|re: '[Rr][Uu][Nn][Dd][Ll][Ll]32(\.[Ee][Xx][Ee])? \S+?\w:\S+?:'
24+
CommandLine|re: '[Rr][Uu][Nn][Dd][Ll][Ll]32(?:\.[Ee][Xx][Ee])? \S+?\w:\S+?:'
2525
condition: all of selection_*
2626
falsepositives:
2727
- Unknown

rules/windows/process_creation/proc_creation_win_susp_copy_system_dir.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ references:
1313
- https://thedfirreport.com/2023/08/28/html-smuggling-leads-to-domain-wide-ransomware/
1414
author: Florian Roth (Nextron Systems), Markus Neis, Tim Shelton (HAWK.IO), Nasreddine Bencherchali (Nextron Systems)
1515
date: 2020-07-03
16-
modified: 2025-11-27
16+
modified: 2026-03-16
1717
tags:
1818
- attack.defense-evasion
1919
- attack.t1036.003
@@ -41,7 +41,7 @@ detection:
4141
- 'robocopy.exe'
4242
- 'XCOPY.EXE'
4343
selection_target:
44-
CommandLine|re|i: \s['"]?C:\\Windows\\(System32|SysWOW64|WinSxS)
44+
CommandLine|re|i: \s['"]?C:\\Windows\\(?:System32|SysWOW64|WinSxS)
4545
filter_optional_avira:
4646
Image|endswith: '\cmd.exe'
4747
CommandLine|contains|all:

rules/windows/process_creation/proc_creation_win_susp_obfuscated_ip_download.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ references:
88
- https://twitter.com/fr0s7_/status/1712780207105404948
99
author: Florian Roth (Nextron Systems), X__Junior (Nextron Systems)
1010
date: 2022-08-03
11-
modified: 2025-07-18
11+
modified: 2026-03-16
1212
tags:
1313
- attack.discovery
1414
logsource:
@@ -43,13 +43,13 @@ detection:
4343
# http://1359248394
4444
- CommandLine|re: 'https?://0[0-9]{3,11}'
4545
# http://0121.04.0174.012
46-
- CommandLine|re: 'https?://(0[0-9]{1,11}\.){3}0[0-9]{1,11}'
46+
- CommandLine|re: 'https?://(?:0[0-9]{1,11}\.){3}0[0-9]{1,11}'
4747
# http://012101076012
4848
- CommandLine|re: 'https?://0[0-9]{1,11}'
4949
# For octal format
5050
- CommandLine|re: ' [0-7]{7,13}'
5151
filter_main_valid_ip:
52-
CommandLine|re: 'https?://((25[0-5]|(2[0-4]|1\d|[1-9])?\d)(\.|\b)){4}'
52+
CommandLine|re: 'https?://(?:(?:25[0-5]|(?:2[0-4]|1\d|[1-9])?\d)(?:\.|\b)){4}'
5353
condition: selection_command and 1 of selection_ip_* and not 1 of filter_main_*
5454
falsepositives:
5555
- Unknown

rules/windows/process_creation/proc_creation_win_susp_obfuscated_ip_via_cli.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ references:
77
- https://twitter.com/Yasser_Elsnbary/status/1553804135354564608
88
author: Nasreddine Bencherchali (Nextron Systems), X__Junior (Nextron Systems)
99
date: 2022-08-03
10-
modified: 2023-11-06
10+
modified: 2026-03-16
1111
tags:
1212
- attack.discovery
1313
logsource:
@@ -36,13 +36,13 @@ detection:
3636
# http://1359248394
3737
- CommandLine|re: 'https?://0[0-9]{3,11}'
3838
# http://0121.04.0174.012
39-
- CommandLine|re: 'https?://(0[0-9]{1,11}\.){3}0[0-9]{1,11}'
39+
- CommandLine|re: 'https?://(?:0[0-9]{1,11}\.){3}0[0-9]{1,11}'
4040
# http://012101076012
4141
- CommandLine|re: 'https?://0[0-9]{1,11}'
4242
# For octal format
4343
- CommandLine|re: ' [0-7]{7,13}'
4444
filter_main_valid_ip:
45-
CommandLine|re: 'https?://((25[0-5]|(2[0-4]|1\d|[1-9])?\d)(\.|\b)){4}'
45+
CommandLine|re: 'https?://(?:(?:25[0-5]|(?:2[0-4]|1\d|[1-9])?\d)(?:\.|\b)){4}'
4646
condition: selection_img and 1 of selection_ip_* and not 1 of filter_main_*
4747
falsepositives:
4848
- Unknown

0 commit comments

Comments
 (0)