Skip to content

Commit e873392

Browse files
X-Juniornasbenchphantinuss
authored
Merge PR #4522 from @X-Junior - updating multiple rules
update: Obfuscated IP Via CLI - increase coverage for more types of obfuscation and fix logic update: Obfuscated IP Download Activity - increase coverage for more types of obfuscation and fix logic update: Csc.EXE Execution Form Potentially Suspicious Parent - add more MS Office tools, suspicious locations and filter known FPs update: Dynamic .NET Compilation Via Csc.EXE - add more suspicious locations update: Malware User Agent - add new user agents --------- Co-authored-by: nasbench <8741929+nasbench@users.noreply.github.com> Co-authored-by: phantinuss <79651203+phantinuss@users.noreply.github.com>
1 parent 2a64bc1 commit e873392

File tree

5 files changed

+103
-31
lines changed

5 files changed

+103
-31
lines changed

rules/web/proxy_generic/proxy_ua_malware.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ logsource:
2222
detection:
2323
selection:
2424
c-useragent:
25-
# RATs
25+
# RATs
2626
- 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Chrome /53.0' # DragonOK
2727
- 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1)' # Used by PlugX - base-lining recommended - https://community.rsa.com/thread/185439
2828
- 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)' # Used by PlugX - base-lining recommended - https://community.rsa.com/thread/185439
@@ -31,9 +31,9 @@ detection:
3131
- '*<|>*' # Houdini / Iniduoh / njRAT
3232
- 'nsis_inetc (mozilla)' # ZeroAccess
3333
- 'Wget/1.9+cvs-stable (Red Hat modified)' # Dyre / Upatre
34-
# Ghost419 https://goo.gl/rW1yvZ
34+
# Ghost419 https://goo.gl/rW1yvZ
3535
- 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; .NET CLR 1.1.4322)'
36-
# Malware
36+
# Malware
3737
- '*zeroup*' # W32/Renos.Downloader
3838
- 'Mozilla/5.0 (Windows NT 5.1 ; v.*' # Kazy
3939
- '* adlib/*' # https://goo.gl/gcAHoh
@@ -59,20 +59,20 @@ detection:
5959
- 'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT)' # https://goo.gl/g43qjs
6060
- 'Mozilla/4.0(compatible; MSIE 6.0; Windows NT 5.1)' # MacControl malware https://goo.gl/sqY3Ja https://www.symantec.com/connect/blogs/osxmacontrol-back-it-again
6161
- 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)' # used by Zebrocy malware https://app.any.run/tasks/7d7fa4a0-6970-4428-828b-29572abf9ceb/
62-
# Ursnif
62+
# Ursnif
6363
- 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 10.0; Win64; x64)'
6464
- 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64)'
65-
# Emotet
65+
# Emotet
6666
- 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; InfoPath.3)' # https://twitter.com/webbthewombat/status/1225827092132179968
67-
# Lockbit (https://twitter.com/kladblokje_88/status/1614673320124743681?s=12&t=joEpeVa5d58aHYNGA_To7Q)
67+
# Lockbit (https://twitter.com/kladblokje_88/status/1614673320124743681?s=12&t=joEpeVa5d58aHYNGA_To7Q)
6868
- 'Mozilla/5.0 (Windows NT 6.1)'
6969
- 'AppleWebkit/587.38 (KHTML, like Gecko)'
7070
- 'Chrome/91.0.4472.77'
7171
- 'Safari/537.36'
7272
- 'Edge/91.0.864.37'
7373
- 'Firefox/89.0'
7474
- 'Gecko/20100101'
75-
# Others
75+
# Others
7676
- '* pxyscand*'
7777
- '* asd'
7878
- '* mdms'
@@ -120,13 +120,21 @@ detection:
120120
- 'OK' # Nymaim - https://twitter.com/suyog41/status/1558051450797690880
121121
- 'Project1sqlite' # DarkCloud - https://twitter.com/suyog41/status/1558051450797690880
122122
- 'Project1' # DarkCloud - https://twitter.com/suyog41/status/1558051450797690880
123+
- 'DuckTales' # Racoon Stealer
124+
- 'Zadanie' # Racoon Stealer
125+
- 'GunnaWunnaBlueTips' # Racoon Stealer
126+
- 'Xlmst' # Racoon Stealer
127+
- 'GeekingToTheMoon' # Racoon Stealer
128+
- 'SunShineMoonLight' # Racoon Stealer
129+
- 'BunnyRequester' # BunnyStealer
130+
- 'BunnyTasks' # BunnyStealer
131+
- 'BunnyStealer' # BunnyStealer
132+
- 'BunnyLoader_Dropper' # BunnyStealer
133+
- 'BunnyLoader' # BunnyStealer
134+
- 'BunnyShell' # BunnyStealer
123135
- 'SPARK-COMMIT' # SparkRAT - https://arcticwolf.com/resources/blog/tellmethetruth-exploitation-of-cve-2023-46604-leading-to-ransomware/
124136
- '4B4DB4B3' # B4B3RAT - https://twitter.com/naumovax/status/1718956514491130301
125137
condition: selection
126-
fields:
127-
- ClientIP
128-
- c-uri
129-
- c-useragent
130138
falsepositives:
131139
- Unknown
132140
level: high

rules/windows/process_creation/proc_creation_win_csc_susp_dynamic_compilation.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,40 @@ references:
88
- https://app.any.run/tasks/c6993447-d1d8-414e-b856-675325e5aa09/
99
- https://twitter.com/gN3mes1s/status/1206874118282448897
1010
- https://github.com/redcanaryco/atomic-red-team/blob/b27a3cb25025161d49ac861cb216db68c46a3537/atomics/T1027.004/T1027.004.md#atomic-test-1---compile-after-delivery-using-cscexe
11-
author: Florian Roth (Nextron Systems)
11+
author: Florian Roth (Nextron Systems), X__Junior (Nextron Systems)
1212
date: 2019/08/24
13-
modified: 2023/08/02
13+
modified: 2023/10/27
1414
tags:
1515
- attack.defense_evasion
1616
- attack.t1027.004
1717
logsource:
1818
category: process_creation
1919
product: windows
2020
detection:
21-
selection:
21+
selection_img:
2222
Image|endswith: '\csc.exe'
23+
selection_susp_location_1:
2324
CommandLine|contains:
25+
- ':\Perflogs\'
26+
- ':\Users\Public\'
2427
- '\AppData\Local\Temp\' # User execution
28+
- '\Temporary Internet'
2529
- '\Windows\Temp\' # Admin execution
30+
selection_susp_location_2:
31+
- CommandLine|contains|all:
32+
- ':\Users\'
33+
- '\Favorites\'
34+
- CommandLine|contains|all:
35+
- ':\Users\'
36+
- '\Favourites\'
37+
- CommandLine|contains|all:
38+
- ':\Users\'
39+
- '\Contacts\'
40+
- CommandLine|contains|all:
41+
- ':\Users\'
42+
- '\Pictures\'
43+
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}$'
2645
filter_main_programfiles:
2746
# Note: this is a generic filter. You could baseline execution in your env for a more robust rule
2847
ParentImage|startswith:
@@ -44,7 +63,7 @@ detection:
4463
- 'JwB7ACIAZgBhAGkAbABlAGQAIgA6AHQAcgB1AGUALAAiAG0AcwBnACIAOgAiAEEAbgBzAGkAYgBsAGUAIAByAGUAcQB1AGkAcgBlAHMAIABQAG8AdwBlAHIAUwBoAGUAbABsACAAdgAzAC4AMAAgAG8AcgAgAG4AZQB3AGUAcgAiAH0AJw'
4564
- 'cAewAiAGYAYQBpAGwAZQBkACIAOgB0AHIAdQBlACwAIgBtAHMAZwAiADoAIgBBAG4AcwBpAGIAbABlACAAcgBlAHEAdQBpAHIAZQBzACAAUABvAHcAZQByAFMAaABlAGwAbAAgAHYAMwAuADAAIABvAHIAIABuAGUAdwBlAHIAIgB9ACcA'
4665
- 'nAHsAIgBmAGEAaQBsAGUAZAAiADoAdAByAHUAZQAsACIAbQBzAGcAIgA6ACIAQQBuAHMAaQBiAGwAZQAgAHIAZQBxAHUAaQByAGUAcwAgAFAAbwB3AGUAcgBTAGgAZQBsAGwAIAB2ADMALgAwACAAbwByACAAbgBlAHcAZQByACIAfQAnA'
47-
condition: selection and not 1 of filter_main_* and not 1 of filter_optional_*
66+
condition: selection_img and 1 of selection_susp_location_* and not 1 of filter_main_* and not 1 of filter_optional_*
4867
falsepositives:
4968
- Legitimate software from program files - https://twitter.com/gN3mes1s/status/1206874118282448897
5069
- Legitimate Microsoft software - https://twitter.com/gabriele_pippi/status/1206907900268072962

rules/windows/process_creation/proc_creation_win_csc_susp_parent.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ description: Detects a potentially suspicious parent of "csc.exe", which could b
55
references:
66
- https://www.uptycs.com/blog/warzonerat-can-now-evade-with-process-hollowing
77
- https://reaqta.com/2017/11/short-journey-darkvnc/
8-
author: Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
8+
- https://www.pwc.com/gx/en/issues/cybersecurity/cyber-threat-intelligence/yellow-liderc-ships-its-scripts-delivers-imaploader-malware.html
9+
author: Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems), X__Junior (Nextron Systems)
910
date: 2019/02/11
10-
modified: 2023/08/02
11+
modified: 2023/10/27
1112
tags:
1213
- attack.execution
1314
- attack.t1059.005
@@ -25,7 +26,11 @@ detection:
2526
selection_parent_generic:
2627
ParentImage|endswith:
2728
- '\cscript.exe'
29+
- '\excel.exe'
2830
- '\mshta.exe'
31+
- '\onenote.exe'
32+
- '\outlook.exe'
33+
- '\powerpnt.exe'
2934
- '\winword.exe'
3035
- '\wscript.exe'
3136
selection_parent_powershell:
@@ -38,8 +43,9 @@ detection:
3843
selection_parent_susp_location:
3944
- ParentCommandLine|re: '([Pp]rogram[Dd]ata|%([Ll]ocal)?[Aa]pp[Dd]ata%|\\[Aa]pp[Dd]ata\\([Ll]ocal(Ll]ow)?|[Rr]oaming))\\[^\\]{1,256}$'
4045
- ParentCommandLine|contains:
41-
- ':\Users\Public\'
4246
- ':\PerfLogs\'
47+
- ':\Users\Public\'
48+
- ':\Windows\Temp\'
4349
- '\Temporary Internet'
4450
- ParentCommandLine|contains|all:
4551
- ':\Users\'
@@ -53,6 +59,19 @@ detection:
5359
- ParentCommandLine|contains|all:
5460
- ':\Users\'
5561
- '\Pictures\'
62+
filter_main_programfiles:
63+
# Note: this is a generic filter. You could baseline execution in your env for a more robust rule
64+
ParentImage|startswith:
65+
- 'C:\Program Files (x86)\' # https://twitter.com/gN3mes1s/status/1206874118282448897
66+
- 'C:\Program Files\' # https://twitter.com/gN3mes1s/status/1206874118282448897
67+
filter_main_sdiagnhost:
68+
ParentImage: 'C:\Windows\System32\sdiagnhost.exe' # https://twitter.com/gN3mes1s/status/1206874118282448897
69+
filter_main_w3p:
70+
ParentImage: 'C:\Windows\System32\inetsrv\w3wp.exe' # https://twitter.com/gabriele_pippi/status/1206907900268072962
71+
filter_optional_chocolatey:
72+
ParentImage: 'C:\ProgramData\chocolatey\choco.exe' # Chocolatey https://chocolatey.org/
73+
filter_optional_defender:
74+
ParentCommandLine|contains: '\ProgramData\Microsoft\Windows Defender Advanced Threat Protection'
5675
filter_optional_ansible:
5776
# Note: As ansible is widely used we exclude it with this generic filter.
5877
# A better option would be to filter based on script content basis or other marker while hunting
@@ -61,7 +80,7 @@ detection:
6180
- 'JwB7ACIAZgBhAGkAbABlAGQAIgA6AHQAcgB1AGUALAAiAG0AcwBnACIAOgAiAEEAbgBzAGkAYgBsAGUAIAByAGUAcQB1AGkAcgBlAHMAIABQAG8AdwBlAHIAUwBoAGUAbABsACAAdgAzAC4AMAAgAG8AcgAgAG4AZQB3AGUAcgAiAH0AJw'
6281
- 'cAewAiAGYAYQBpAGwAZQBkACIAOgB0AHIAdQBlACwAIgBtAHMAZwAiADoAIgBBAG4AcwBpAGIAbABlACAAcgBlAHEAdQBpAHIAZQBzACAAUABvAHcAZQByAFMAaABlAGwAbAAgAHYAMwAuADAAIABvAHIAIABuAGUAdwBlAHIAIgB9ACcA'
6382
- 'nAHsAIgBmAGEAaQBsAGUAZAAiADoAdAByAHUAZQAsACIAbQBzAGcAIgA6ACIAQQBuAHMAaQBiAGwAZQAgAHIAZQBxAHUAaQByAGUAcwAgAFAAbwB3AGUAcgBTAGgAZQBsAGwAIAB2ADMALgAwACAAbwByACAAbgBlAHcAZQByACIAfQAnA'
64-
condition: selection_img and 1 of selection_parent_* and not 1 of filter_optional_*
83+
condition: selection_img and 1 of selection_parent_* and not 1 of filter_main_* and not 1 of filter_optional_*
6584
falsepositives:
6685
- Unknown
6786
level: high

rules/windows/process_creation/proc_creation_win_susp_obfuscated_ip_download.yml

Lines changed: 8 additions & 5 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: 2023/10/29
11+
modified: 2023/11/06
1212
tags:
1313
- attack.discovery
1414
logsource:
@@ -25,6 +25,7 @@ detection:
2525
- 'DownloadString'
2626
selection_ip_1:
2727
CommandLine|contains:
28+
- ' 0x'
2829
- '//0x'
2930
- '.0x'
3031
- '.00x'
@@ -34,17 +35,19 @@ detection:
3435
- '%2e'
3536
selection_ip_3:
3637
# http://81.4.31754
37-
- CommandLine|re: 'https?://[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,5}'
38+
- CommandLine|re: 'https?://[0-9]{1,3}\.[0-9]{1,3}\.0[0-9]{3,4}'
3839
# http://81.293898
39-
- CommandLine|re: 'https?://[0-9]{1,3}\.[0-9]{1,8}'
40+
- CommandLine|re: 'https?://[0-9]{1,3}\.0[0-9]{3,7}'
4041
# http://1359248394
41-
- CommandLine|re: 'https?://[0-9]{1,10}'
42+
- CommandLine|re: 'https?://0[0-9]{3,11}'
4243
# http://0121.04.0174.012
4344
- CommandLine|re: 'https?://(0[0-9]{1,11}\.){3}0[0-9]{1,11}'
4445
# http://012101076012
4546
- CommandLine|re: 'https?://0[0-9]{1,11}'
47+
# For octal format
48+
- CommandLine|re: ' [0-7]{7,13}'
4649
filter_main_valid_ip:
47-
CommandLine|re: 'https?://((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}'
50+
CommandLine|re: 'https?://((25[0-5]|(2[0-4]|1\d|[1-9])?\d)(\.|\b)){4}'
4851
condition: selection_command and 1 of selection_ip_* and not 1 of filter_main_*
4952
falsepositives:
5053
- Unknown
Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
title: Obfuscated IP Via CLI
22
id: 56d19cb4-6414-4769-9644-1ed35ffbb148
3-
status: test
4-
description: Detects usage of an encoded/obfuscated version of an IP address (hex, octal...) via commandline
3+
status: experimental
4+
description: Detects usage of an encoded/obfuscated version of an IP address (hex, octal, etc.) via command line
55
references:
66
- https://h.43z.one/ipconverter/
77
- https://twitter.com/Yasser_Elsnbary/status/1553804135354564608
8-
author: Nasreddine Bencherchali (Nextron Systems)
8+
author: Nasreddine Bencherchali (Nextron Systems), X__Junior (Nextron Systems)
99
date: 2022/08/03
10+
modified: 2023/11/06
1011
tags:
1112
- attack.discovery
1213
logsource:
@@ -17,10 +18,32 @@ detection:
1718
Image|endswith:
1819
- '\ping.exe'
1920
- '\arp.exe'
20-
selection_ip:
21-
- CommandLine|contains: ' 0x' # For hex format
22-
- CommandLine|re: ' [0-9]{7,13}' # For octal format
23-
condition: all of selection*
21+
selection_ip_1:
22+
CommandLine|contains:
23+
- ' 0x'
24+
- '//0x'
25+
- '.0x'
26+
- '.00x'
27+
selection_ip_2:
28+
CommandLine|contains|all:
29+
- 'http://%'
30+
- '%2e'
31+
selection_ip_3:
32+
# http://81.4.31754
33+
- CommandLine|re: 'https?://[0-9]{1,3}\.[0-9]{1,3}\.0[0-9]{3,4}'
34+
# http://81.293898
35+
- CommandLine|re: 'https?://[0-9]{1,3}\.0[0-9]{3,7}'
36+
# http://1359248394
37+
- CommandLine|re: 'https?://0[0-9]{3,11}'
38+
# http://0121.04.0174.012
39+
- CommandLine|re: 'https?://(0[0-9]{1,11}\.){3}0[0-9]{1,11}'
40+
# http://012101076012
41+
- CommandLine|re: 'https?://0[0-9]{1,11}'
42+
# For octal format
43+
- CommandLine|re: ' [0-7]{7,13}'
44+
filter_main_valid_ip:
45+
CommandLine|re: 'https?://((25[0-5]|(2[0-4]|1\d|[1-9])?\d)(\.|\b)){4}'
46+
condition: selection_img and 1 of selection_ip_* and not 1 of filter_main_*
2447
falsepositives:
2548
- Unknown
2649
level: medium

0 commit comments

Comments
 (0)