adding new rules based on private Linux sample(s) (#821)

* adding new rules based on private Linux sample(s)

---------

Co-authored-by: Moritz <mr-tz@users.noreply.github.com>
This commit is contained in:
Mike Hunhoff 2023-10-09 10:27:33 -06:00 committed by GitHub
parent fcfb7ef55f
commit 2a37df98f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 111 additions and 4 deletions

View file

@ -33,3 +33,4 @@ rule:
- api: System.Net.Sockets.Socket::EndReceive
- api: System.Net.Sockets.Socket::EndReceiveFrom
- api: System.Net.Sockets.Socket::EndReceiveMessageFrom
- api: recvmsg

View file

@ -20,6 +20,7 @@ rule:
- api: ZwCreateDirectoryObject
- api: SHCreateDirectory
- api: SHCreateDirectoryEx
- api: mkdir
- api: _mkdir
- api: _wmkdir
- api: System.IO.Directory::CreateDirectory

View file

@ -15,6 +15,7 @@ rule:
- or:
- api: RemoveDirectory
- api: RemoveDirectoryTransacted
- api: rmdir
- api: _rmdir
- api: _wrmdir
- api: System.IO.DirectoryInfo::Delete

View file

@ -27,3 +27,7 @@ rule:
- api: System.IO.File::GetLastWriteTime
- api: System.IO.File::GetLastWriteTimeUtc
- property/read: System.IO.FileSystemInfo::Attributes
- api: stat
- api: fstat
- api: lstat
- api: fstatat

View file

@ -27,3 +27,5 @@ rule:
- api: System.IO.File::SetLastWriteTime
- api: System.IO.File::SetLastWriteTimeUtc
- property/write: System.IO.FileSystemInfo::Attributes
- api: utime
- api: utimes

View file

@ -19,6 +19,8 @@ rule:
- api: System.Diagnostics.Process::WaitForExitAsync
- api: System.Environment::Exit
- api: System.Windows.Forms.Application::Exit
- api: exit
- api: Exit
- and:
- optional:
- match: open process

View file

@ -1,7 +1,7 @@
rule:
meta:
name: get current user on Linux
namespace: collection
namespace: host-interaction/session
authors:
- joakim@intezer.com
scope: function
@ -13,9 +13,8 @@ rule:
- and:
- os: linux
- or:
- and:
- api: geteuid
- api: getpwuid
- api: geteuid
- api: getpwuid
- api: getlogin
- api: getlogin_r
- api: cuserid

View file

@ -17,3 +17,4 @@ rule:
- api: kernel32.TerminateThread
- api: PsTerminateSystemThread
- api: System.Threading.Thread.Abort
- api: pthread_terminate

View file

@ -0,0 +1,13 @@
rule:
meta:
name: communicate with kernel module via Netlink socket on Linux
namespace: host-interaction/kernel
authors:
- michael.hunhoff@mandiant.com
description: Netlink is used to transfer information between the kernel and user-space processes (https://man7.org/linux/man-pages/man7/netlink.7.html)
scope: basic block
features:
- and:
- os: linux
- api: socket
- number: 0x10 = AF_NETLINK

View file

@ -0,0 +1,13 @@
rule:
meta:
name: get current PID on Linux
namespace: host-interaction/process
authors:
- michael.hunhoff@mandiant.com
scope: basic block
features:
- and:
- os: linux
- or:
- api: getpid
- api: getppid

View file

@ -0,0 +1,13 @@
rule:
meta:
name: get file system information on Linux
namespace: host-interaction/file-system
authors:
- michael.hunhoff@mandiant.com
scope: basic block
features:
- and:
- os: linux
- or:
- api: statfs
- api: fstatfs

View file

@ -0,0 +1,15 @@
rule:
meta:
name: get password database entry on Linux
namespace: host-interaction/session
authors:
- michael.hunhoff@mandiant.com
scope: basic block
features:
- and:
- os: linux
- or:
- api: getpwuid
- api: getpwuid_r
- api: getpwnam
- api: getpwnam_r

View file

@ -4,6 +4,7 @@ rule:
namespace: host-interaction/os/info
authors:
- joakim@intezer.com
- michael.hunhoff@mandiant.com
scope: function
att&ck:
- Discovery::System Information Discovery [T1082]
@ -15,3 +16,4 @@ rule:
- and:
- api: system
- string: "lshw"
- api: sysinfo

View file

@ -0,0 +1,11 @@
rule:
meta:
name: mark thread detached on Linux
namespace: host-interaction/thread
authors:
- michael.hunhoff@mandiant.com
scope: basic block
features:
- and:
- os: linux
- api: pthread_detach

View file

@ -0,0 +1,12 @@
rule:
meta:
name: persist via GNOME autostart on Linux
namespace: persistence
authors:
- michael.hunhoff@mandiant.com
scope: function
features:
- and:
- os: linux
- match: host-interaction/file-system/write
- substring: "X-GNOME-Autostart-enabled=true"

View file

@ -9,3 +9,5 @@ rule:
- or:
- api: System.IO.Directory::SetCurrentDirectory
- api: kernel32.SetCurrentDirectory
- api: chdir
- api: fchdir

View file

@ -0,0 +1,15 @@
rule:
meta:
name: set thread name on Linux
namespace: host-interaction/thread
authors:
- michael.hunhoff@mandiant.com
scope: basic block
features:
- and:
- os: linux
- or:
- api: pthread_setname_np
- and:
- api: prctl
- number: 0xF = PR_SET_NAME