Skip to content

Commit 7a52b6f

Browse files
authored
dotnet: adding new rules based on recent samples (#1082)
* dotnet: adding new rules based on recent samples
1 parent 9e4cc28 commit 7a52b6f

File tree

7 files changed

+72
-8
lines changed

7 files changed

+72
-8
lines changed

communication/http/client/receive-http-response.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ rule:
33
name: receive HTTP response
44
namespace: communication/http/client
55
authors:
6-
- michael.hunhoff@mandiant.com
6+
- mehunhoff@google.com
77
scopes:
88
static: function
99
dynamic: span of calls
@@ -13,9 +13,13 @@ rule:
1313
- 6A352C3E55E8AE5ED39DC1BE7FB964B1:0x10002790
1414
features:
1515
- or:
16-
- api: System.Net.WebRequest::GetResponse
1716
- api: winhttp.WinHttpReceiveResponse
1817
- and:
1918
- api: winhttp.WinHttpReadData
2019
- optional:
2120
- api: winhttp.WinHttpQueryDataAvailable
21+
- and:
22+
- format: dotnet
23+
- or:
24+
- api: System.Net.WebRequest::GetResponse
25+
- class: System.Net.Http.HttpResponseMessage

communication/http/client/send-http-request.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ rule:
44
namespace: communication/http/client
55
authors:
66
7-
- michael.hunhoff@mandiant.com
7+
- mehunhoff@google.com
88
scopes:
99
static: function
1010
dynamic: span of calls
@@ -15,8 +15,6 @@ rule:
1515
- 6A352C3E55E8AE5ED39DC1BE7FB964B1:0x100026E0
1616
features:
1717
- or:
18-
- api: System.Net.WebRequest::GetResponse
19-
- api: System.Net.WebRequest::GetResponseAsync
2018
- and:
2119
- or:
2220
- api: wininet.HttpOpenRequest
@@ -34,3 +32,18 @@ rule:
3432
- and:
3533
- match: send data on socket
3634
- string: /HTTP/i
35+
- and:
36+
- format: dotnet
37+
- or:
38+
- api: System.Net.WebRequest::GetResponse
39+
- api: System.Net.WebRequest::GetResponseAsync
40+
- api: System.Net.Http.HttpClient::PostAsync
41+
- api: System.Net.Http.HttpClient::GetAsync
42+
- api: System.Net.Http.HttpClient::GetByteArrayAsync
43+
- api: System.Net.Http.HttpClient::GetStreamAsync
44+
- api: System.Net.Http.HttpClient::GetStringAsync
45+
- api: System.Net.Http.HttpClient::Send
46+
- api: System.Net.Http.HttpClient::SendAsync
47+
- api: System.Net.Http.HttpClientHandler::Send
48+
- api: System.Net.Http.HttpClientHandler::SendAsync
49+
- class: System.Net.Http.HttpRequestMessage

data-manipulation/hashing/sha256/hash-data-using-sha256.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ rule:
66
77
88
9+
910
scopes:
1011
static: function
1112
dynamic: span of calls
@@ -50,4 +51,5 @@ rule:
5051
- api: System.Security.Cryptography.SHA256CryptoServiceProvider::Initialize
5152
- api: System.Security.Cryptography.SHA256::Create
5253
- api: System.Security.Cryptography.SHA256Managed::ctor
53-
- api: System.Security.Cryptography.HashAlgorithm::ComputeHash
54+
- optional:
55+
- api: System.Security.Cryptography.HashAlgorithm::ComputeHash

data-manipulation/json/use-dotnet-library-newtonsoftjson.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ rule:
44
namespace: data-manipulation/json
55
authors:
66
- "@johnk3r"
7+
78
scopes:
89
static: file
910
dynamic: file
@@ -13,5 +14,5 @@ rule:
1314
- 387f15043f0198fd3a637b0758c2b6dde9ead795c3ed70803426fc355731b173
1415
features:
1516
- and:
16-
- match: compiled to the .NET platform
17-
- string: "Newtonsoft.Json"
17+
- format: dotnet
18+
- namespace: Newtonsoft.Json

nursery/compiled-from-fsharp.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
rule:
2+
meta:
3+
name: compiled from FSharp
4+
namespace: compiler/fsharp
5+
authors:
6+
7+
scopes:
8+
static: file
9+
dynamic: file
10+
features:
11+
- and:
12+
- format: dotnet
13+
- namespace: Microsoft.FSharp.Core
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
rule:
2+
meta:
3+
name: decrypt data using AES via .NET
4+
namespace: data-manipulation/encryption/aes
5+
authors:
6+
7+
scopes:
8+
static: function
9+
dynamic: span of calls
10+
att&ck:
11+
- Defense Evasion::Obfuscated Files or Information [T1027]
12+
mbc:
13+
- Defense Evasion::Obfuscated Files or Information::Encryption-Standard Algorithm [E1027.m05]
14+
features:
15+
- and:
16+
- format: dotnet
17+
- api: System.Security.Cryptography.Aes::Create
18+
- api: System.Security.Cryptography.SymmetricAlgorithm::CreateDecryptor
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
rule:
2+
meta:
3+
name: get .NET assembly entry point
4+
namespace: load-code/dotnet
5+
authors:
6+
7+
scopes:
8+
static: function
9+
dynamic: span of calls
10+
features:
11+
- and:
12+
- format: dotnet
13+
- property/read: System.Reflection.Assembly::EntryPoint

0 commit comments

Comments
 (0)