Skip to content

Commit

Permalink
The corresponding prefix has been added to all rules for Mac OS (#434)
Browse files Browse the repository at this point in the history
* The corresponding prefix has been added to all rules for Mac OS

* small fix
  • Loading branch information
DmitryOffsec authored Nov 8, 2024
1 parent 1080888 commit 8d044b6
Show file tree
Hide file tree
Showing 49 changed files with 68 additions and 65 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Description: 'The application {subject.process.name } launched with a potentially malicious file {object.fullpath}'
EventDescriptions:
- LocalizationId: 'corrname_DirtyNIB'
- LocalizationId: 'corrname_MacOS_DirtyNIB'
EventDescription: 'correlation_name = "DirtyNIB"'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Description: 'Приложение {subject.process.name} запущено с потенциально вредоносным файлом {object.fullpath}'
EventDescriptions:
- LocalizationId: 'corrname_DirtyNIB'
- LocalizationId: 'corrname_MacOS_DirtyNIB'
EventDescription: 'correlation_name = "DirtyNIB"'
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ContentAutoName: DirtyNIB
ContentAutoName: MacOS_DirtyNIB
ExpertContext:
Created: 24.06.2024
Updated: 25.06.2024
Updated: 30.07.2024
KnowledgeHolders:
- d3f0x0 (Vadim Varganov)
Usecases: []
Expand All @@ -22,5 +22,5 @@ ContentRelations:
defense-evasion:
- T1574
EventDescriptions:
- Criteria: correlation_name = "DirtyNIB"
LocalizationId: corrname_DirtyNIB
- Criteria: correlation_name = "MacOS_DirtyNIB"
LocalizationId: corrname_MacOS_DirtyNIB
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ event Create_dirty_nib:
key:
event_src.host, datafield1
filter {
correlation_name == "Subrule_DirtyNIB"
correlation_name == "MacOS_Subrule_DirtyNIB"
}

event Execute_vuln_app:
Expand All @@ -13,7 +13,7 @@ event Execute_vuln_app:
and id == "PT_Positive_Technologies_XDR_es_logger_process_execution"
}

rule DirtyNIB: (Create_dirty_nib -> Execute_vuln_app) timer 5m
rule MacOS_DirtyNIB: (Create_dirty_nib -> Execute_vuln_app) timer 5m

on Create_dirty_nib {
$object = object
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Здесь укажи какие нормализованные события (одно или несколько) ты подаешь на вход правилу корреляции.
# События отделяются друг от друга символом новой строки. Каждое их них должно быть записано в строку.


# Здесь укажи какие нормализованные события (одно или несколько) ты подаешь на вход правилу корреляции.
# События отделяются друг от друга символом новой строки. Каждое их них должно быть записано в строку.
# Тут будет твой тест. В секции expect укажи сколько и каких корреляционных событий ты ожидаешь
expect 1 {"correlation_name":"DirtyNIB"}
expect 1 {"correlation_name":"MacOS_DirtyNIB"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
expect 1 {"category.generic":"Attack","category.high":"Defense Evasion","correlation_name":"MacOS_DirtyNIB","correlation_type":"incident","event_src.host":"127.0.0.1","importance":"medium","incident.aggregation.key":"MacOS_DirtyNIB|127.0.0.1|Freeform","incident.aggregation.timeout":7200,"incident.category":"SoftwareSuspiciousActivity","incident.severity":"medium","object":"file_object","object.fullpath":"/private/tmp/Freeform.app/Contents/Resources/Base.lproj/CRLAboutPanel.nib","object.name":"CRLAboutPanel.nib","object.path":"/private/tmp/Freeform.app/Contents/Resources/Base.lproj/","subject":"process","subject.account.id":"501","subject.account.session_id":"1","subject.process.cmdline":"/private/tmp/Freeform.app/Contents/MacOS/Freeform","subject.process.cwd":"/","subject.process.fullpath":"/private/tmp/Freeform.app/Contents/MacOS/Freeform","subject.process.hash":"B377F3EEBCAB61FFED11F292E6FF2BC8B0180C8A","subject.process.id":"2904","subject.process.name":"Freeform","subject.process.parent.id":"1","subject.process.path":"/private/tmp/Freeform.app/Contents/MacOS/"}
expect 1 {"correlation_name":"Subrule_MacOS_DirtyNIB","correlation_type":"subrule","event_src.host":"127.0.0.1","importance":"low","object":"file_object","object.fullpath":"/private/tmp/Freeform.app/Contents/Resources/Base.lproj/CRLAboutPanel.nib","object.name":"CRLAboutPanel.nib","object.path":"/private/tmp/Freeform.app/Contents/Resources/Base.lproj/","subject":"process","subject.account.id":"501","subject.account.session_id":"450","subject.process.fullpath":"/bin/cp","subject.process.hash":"UNKNOWN:72FAD644EC24C0FB99080CCFBD8C0F5EE8245B04","subject.process.id":"2900","subject.process.name":"cp","subject.process.parent.id":"456","subject.process.path":"/bin/"}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Description: 'The process started from a hidden folder'
EventDescriptions:
- LocalizationId: 'corrname_Hidden_File_or_Folder_Execution'
- LocalizationId: 'corrname_MacOS_Hidden_File_or_Folder_Execution'
EventDescription: 'The {object.process.cmdline} process has been started on the {event_src.host} host. It is possible that there are hidden directories or files in the specified path. This could indicate an attempt to bypass security measures'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Description: 'Запустился процесс из скрытой папки'
EventDescriptions:
- LocalizationId: 'corrname_Hidden_File_or_Folder_Execution'
- LocalizationId: 'corrname_MacOS_Hidden_File_or_Folder_Execution'
EventDescription: 'На узле {event_src.host} запустился процесс {object.process.cmdline}. Предположительно в пути пристуствуют скрытые папки или файлы. Это может свидетельствовать о попытке обхода механозмов защиты'
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ContentAutoName: Hidden_File_or_Folder_Execution
ContentAutoName: MacOS_Hidden_File_or_Folder_Execution
ExpertContext:
Created: 28.06.2024
Updated: 08.07.2024
Updated: 30.07.2024
KnowledgeHolders:
- Protenil
Usecases:
Expand All @@ -18,5 +18,5 @@ ContentRelations:
defense-evasion:
- T1564.001
EventDescriptions:
- Criteria: correlation_name = "Hidden_File_or_Folder_Execution"
LocalizationId: corrname_Hidden_File_or_Folder_Execution
- Criteria: correlation_name = "MacOS_Hidden_File_or_Folder_Execution"
LocalizationId: corrname_MacOS_Hidden_File_or_Folder_Execution
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ event HiddenFolderOrFileExecution:
and regex(object.process.cmdline, "^\/.*?\/\.[^\.\/]", 0) != NULL
}

rule Hidden_File_or_Folder_Execution: HiddenFolderOrFileExecution
rule MacOS_Hidden_File_or_Folder_Execution: HiddenFolderOrFileExecution

on HiddenFolderOrFileExecution {
$subject.account.name = subject.account.name
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
expect 1 {"correlation_name":"MacOS_Hidden_File_or_Folder_Execution"}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Description: 'Added a file with the extension *.nib {object.fullpath}'
EventDescriptions:
- LocalizationId: 'corrname_Subrule_DirtyNIB'
- LocalizationId: 'corrname_MacOS_Subrule_DirtyNIB'
EventDescription: 'correlation_name = "Subrule_DirtyNIB"'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Description: 'Добавлен файл с расширением *.nib {object.fullpath}'
EventDescriptions:
- LocalizationId: 'corrname_Subrule_DirtyNIB'
- LocalizationId: 'corrname_MacOS_Subrule_DirtyNIB'
EventDescription: 'correlation_name = "Subrule_DirtyNIB"'
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ContentAutoName: Subrule_DirtyNIB
ContentAutoName: MacOS_Subrule_DirtyNIB
ExpertContext:
Created: 25.06.2024
Updated: 25.06.2024
Updated: 30.07.2024
KnowledgeHolders:
- d3f0x0 (Vadim Varganov)
Usecases:
Expand All @@ -16,5 +16,5 @@ ExpertContext:
- 33
ObjectId: SEC-CR-537667857
EventDescriptions:
- Criteria: correlation_name = "Subrule_DirtyNIB"
LocalizationId: corrname_Subrule_DirtyNIB
- Criteria: correlation_name = "MacOS_Subrule_DirtyNIB"
LocalizationId: corrname_MacOS_Subrule_DirtyNIB
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ event Writing_nib_to_exctract_app:
and match(object.path,"*/Contents/Resources/*")
}

rule Subrule_DirtyNIB: Writing_nib_to_exctract_app
rule MacOS_Subrule_DirtyNIB: Writing_nib_to_exctract_app

on Writing_nib_to_exctract_app {
$event_src.ip = event_src.ip
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Successfull test
expect 1 {"action":"modify","correlation_name":"MacOS_Subrule_DirtyNIB","correlation_type":"subrule","datafield1":"Freeform","importance":"low","object":"file_object","object.fullpath":"/private/tmp/Freeform.app/Contents/Resources/Base.lproj/CRLAboutPanel.nib","object.name":"CRLAboutPanel.nib","object.path":"/private/tmp/Freeform.app/Contents/Resources/Base.lproj/","status":"success","subject":"process","subject.account.id":"501","subject.account.session_id":"450","subject.process.fullpath":"/bin/cp","subject.process.hash":"UNKNOWN:72FAD644EC24C0FB99080CCFBD8C0F5EE8245B04","subject.process.id":"2900","subject.process.name":"cp","subject.process.parent.id":"456","subject.process.path":"/bin/"}

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 8d044b6

Please sign in to comment.