Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull out .NET features #866

Merged
merged 6 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 17 additions & 19 deletions collection/network/get-mac-address-on-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,20 @@ rule:
examples:
- al-khaser_x64.exe_:0x14001A1BC
features:
- or:
- api: System.Net.NetworkInformation.NetworkInterface::GetPhysicalAddress
- and:
- os: windows
- or:
- and:
- api: iphlpapi.GetAdaptersInfo
- or:
- offset: 0x194 = IP_ADAPTER_INFO.Address
- offset: 0x195 = IP_ADAPTER_INFO.Address+1
- offset: 0x196 = IP_ADAPTER_INFO.Address+2
- offset: 0x197 = IP_ADAPTER_INFO.Address+3
- offset: 0x198 = IP_ADAPTER_INFO.Address+4
- offset: 0x199 = IP_ADAPTER_INFO.Address+5
- optional:
- string: "%02X-%02X-%02X-%02X-%02X-%02X"
- and:
- api: iphlpapi.GetAdaptersAddresses
- offset: 0x2C = PhysicalAddress
- and:
- os: windows
- or:
- and:
- api: iphlpapi.GetAdaptersInfo
- or:
- offset: 0x194 = IP_ADAPTER_INFO.Address
- offset: 0x195 = IP_ADAPTER_INFO.Address+1
- offset: 0x196 = IP_ADAPTER_INFO.Address+2
- offset: 0x197 = IP_ADAPTER_INFO.Address+3
- offset: 0x198 = IP_ADAPTER_INFO.Address+4
- offset: 0x199 = IP_ADAPTER_INFO.Address+5
- optional:
- string: "%02X-%02X-%02X-%02X-%02X-%02X"
- and:
- api: iphlpapi.GetAdaptersAddresses
- offset: 0x2C = PhysicalAddress
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,3 @@ rule:
- api: RtlAllocateHeap
- match: contain loop
- characteristic: indirect call
- or:
- api: System.IO.DirectoryInfo::GetFiles
- api: System.IO.DirectoryInfo::EnumerateFiles
- api: System.IO.Directory::GetFiles
- api: System.IO.Directory::EnumerateFiles
- api: System.IO.Directory::EnumerateFileSystemEntries
- api: System.IO.DirectoryInfo::GetDirectories
- api: System.IO.DirectoryInfo::EnumerateDirectories
- api: System.IO.Directory::GetDirectories
- api: System.IO.Directory::EnumerateDirectories
27 changes: 27 additions & 0 deletions nursery/enumerate-files-in-dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
rule:
meta:
name: enumerate files in .NET
namespace: host-interaction/file-system/files/list
authors:
- [email protected]
- [email protected]
scopes:
static: function
dynamic: thread
att&ck:
- Discovery::File and Directory Discovery [T1083]
mbc:
- Discovery::File and Directory Discovery [E1083]
references:
- https://github.com/hfiref0x/TDL/blob/cc4b46ae1c939b14a22a734a727b163f873a41b
features:
- or:
- api: System.IO.DirectoryInfo::GetFiles
- api: System.IO.DirectoryInfo::EnumerateFiles
- api: System.IO.Directory::GetFiles
- api: System.IO.Directory::EnumerateFiles
- api: System.IO.Directory::EnumerateFileSystemEntries
- api: System.IO.DirectoryInfo::GetDirectories
- api: System.IO.DirectoryInfo::EnumerateDirectories
- api: System.IO.Directory::GetDirectories
- api: System.IO.Directory::EnumerateDirectories
16 changes: 16 additions & 0 deletions nursery/get-mac-address-in-dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
rule:
meta:
name: get MAC address in .NET
namespace: collection/network
authors:
- [email protected]
- [email protected]
- [email protected]
scopes:
static: function
dynamic: thread
att&ck:
- Discovery::System Information Discovery [T1082]
features:
- or:
- api: System.Net.NetworkInformation.NetworkInterface::GetPhysicalAddress
Loading