@@ -186,6 +186,38 @@ public static String randomRule() {
186
186
"level: high" ;
187
187
}
188
188
189
+
190
+
191
+ public static String randomNullRule () {
192
+ return "title: null field\n " +
193
+ "id: 5f92fff9-82e2-48eb-8fc1-8b133556a551\n " +
194
+ "description: Detects remote RPC calls to possibly abuse remote encryption service via MS-EFSR\n " +
195
+ "references:\n " +
196
+ " - https://attack.mitre.org/tactics/TA0008/\n " +
197
+ " - https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-36942\n " +
198
+ " - https://github.com/jsecurity101/MSRPC-to-ATTACK/blob/main/documents/MS-EFSR.md\n " +
199
+ " - https://github.com/zeronetworks/rpcfirewall\n " +
200
+ " - https://zeronetworks.com/blog/stopping_lateral_movement_via_the_rpc_firewall/\n " +
201
+ "tags:\n " +
202
+ " - attack.defense_evasion\n " +
203
+ "status: experimental\n " +
204
+ "author: Sagie Dulce, Dekel Paz\n " +
205
+ "date: 2022/01/01\n " +
206
+ "modified: 2022/01/01\n " +
207
+ "logsource:\n " +
208
+ " product: rpc_firewall\n " +
209
+ " category: application\n " +
210
+ " definition: 'Requirements: install and apply the RPC Firew all to all processes with \" audit:true action:block uuid:df1941c5-fe89-4e79-bf10-463657acf44d or c681d488-d850-11d0-8c52-00c04fd90f7e'\n " +
211
+ "detection:\n " +
212
+ " selection:\n " +
213
+ " EventID: 22\n " +
214
+ " RecordNumber: null\n " +
215
+ " condition: selection\n " +
216
+ "falsepositives:\n " +
217
+ " - Legitimate usage of remote file encryption\n " +
218
+ "level: high" ;
219
+ }
220
+
189
221
public static String randomRuleForMappingView (String field ) {
190
222
return "title: Remote Encrypting File System Abuse\n " +
191
223
"id: 5f92fff9-82e2-48eb-8fc1-8b133556a551\n " +
@@ -1460,6 +1492,84 @@ public static String randomDocOnlyNumericAndText(int severity, int version, Stri
1460
1492
return String .format (Locale .ROOT , doc , severity , version , opCode );
1461
1493
}
1462
1494
1495
+ //Add IPs in HostName field.
1496
+ public static String randomDocWithIpIoc (int severity , int version , String ioc ) {
1497
+ String doc = "{\n " +
1498
+ "\" EventTime\" :\" 2020-02-04T14:59:39.343541+00:00\" ,\n " +
1499
+ "\" HostName\" :\" %s\" ,\n " +
1500
+ "\" Keywords\" :\" 9223372036854775808\" ,\n " +
1501
+ "\" SeverityValue\" :%s,\n " +
1502
+ "\" Severity\" :\" INFO\" ,\n " +
1503
+ "\" EventID\" :22,\n " +
1504
+ "\" SourceName\" :\" Microsoft-Windows-Sysmon\" ,\n " +
1505
+ "\" ProviderGuid\" :\" {5770385F-C22A-43E0-BF4C-06F5698FFBD9}\" ,\n " +
1506
+ "\" Version\" :%s,\n " +
1507
+ "\" TaskValue\" :22,\n " +
1508
+ "\" OpcodeValue\" :0,\n " +
1509
+ "\" RecordNumber\" :9532,\n " +
1510
+ "\" ExecutionProcessID\" :1996,\n " +
1511
+ "\" ExecutionThreadID\" :2616,\n " +
1512
+ "\" Channel\" :\" Microsoft-Windows-Sysmon/Operational\" ,\n " +
1513
+ "\" Domain\" :\" NT AUTHORITY\" ,\n " +
1514
+ "\" AccountName\" :\" SYSTEM\" ,\n " +
1515
+ "\" UserID\" :\" S-1-5-18\" ,\n " +
1516
+ "\" AccountType\" :\" User\" ,\n " +
1517
+ "\" Message\" :\" Dns query:\\ r\\ nRuleName: \\ r\\ nUtcTime: 2020-02-04 14:59:38.349\\ r\\ nProcessGuid: {b3c285a4-3cda-5dc0-0000-001077270b00}\\ r\\ nProcessId: 1904\\ r\\ nQueryName: EC2AMAZ-EPO7HKA\\ r\\ nQueryStatus: 0\\ r\\ nQueryResults: 172.31.46.38;\\ r\\ nImage: C:\\ \\ Program Files\\ \\ nxlog\\ \\ nxlog.exe\" ,\n " +
1518
+ "\" Category\" :\" Dns query (rule: DnsQuery)\" ,\n " +
1519
+ "\" Opcode\" :\" blahblah\" ,\n " +
1520
+ "\" UtcTime\" :\" 2020-02-04 14:59:38.349\" ,\n " +
1521
+ "\" ProcessGuid\" :\" {b3c285a4-3cda-5dc0-0000-001077270b00}\" ,\n " +
1522
+ "\" ProcessId\" :\" 1904\" ,\" QueryName\" :\" EC2AMAZ-EPO7HKA\" ,\" QueryStatus\" :\" 0\" ,\n " +
1523
+ "\" QueryResults\" :\" 172.31.46.38;\" ,\n " +
1524
+ "\" Image\" :\" C:\\ \\ Program Files\\ \\ nxlog\\ \\ regsvr32.exe\" ,\n " +
1525
+ "\" EventReceivedTime\" :\" 2020-02-04T14:59:40.780905+00:00\" ,\n " +
1526
+ "\" SourceModuleName\" :\" in\" ,\n " +
1527
+ "\" SourceModuleType\" :\" im_msvistalog\" ,\n " +
1528
+ "\" CommandLine\" : \" eachtest\" ,\n " +
1529
+ "\" Initiated\" : \" true\" \n " +
1530
+ "}" ;
1531
+ return String .format (Locale .ROOT , doc , ioc , severity , version );
1532
+
1533
+ }
1534
+
1535
+ public static String randomDocWithNullField () {
1536
+ return "{\n " +
1537
+ "\" @timestamp\" :\" 2020-02-04T14:59:39.343541+00:00\" ,\n " +
1538
+ "\" EventTime\" :\" 2020-02-04T14:59:39.343541+00:00\" ,\n " +
1539
+ "\" HostName\" :\" EC2AMAZ-EPO7HKA\" ,\n " +
1540
+ "\" Keywords\" :\" 9223372036854775808\" ,\n " +
1541
+ "\" SeverityValue\" :2,\n " +
1542
+ "\" Severity\" :\" INFO\" ,\n " +
1543
+ "\" EventID\" :22,\n " +
1544
+ "\" SourceName\" :\" Microsoft-Windows-Sysmon\" ,\n " +
1545
+ "\" ProviderGuid\" :\" {5770385F-C22A-43E0-BF4C-06F5698FFBD9}\" ,\n " +
1546
+ "\" Version\" :5,\n " +
1547
+ "\" TaskValue\" :22,\n " +
1548
+ "\" OpcodeValue\" :0,\n " +
1549
+ "\" RecordNumber\" :null,\n " +
1550
+ "\" ExecutionProcessID\" :1996,\n " +
1551
+ "\" ExecutionThreadID\" :2616,\n " +
1552
+ "\" Channel\" :\" Microsoft-Windows-Sysmon/Operational\" ,\n " +
1553
+ "\" Domain\" :\" NTAUTHORITY\" ,\n " +
1554
+ "\" AccountName\" :\" SYSTEM\" ,\n " +
1555
+ "\" UserID\" :\" S-1-5-18\" ,\n " +
1556
+ "\" AccountType\" :\" User\" ,\n " +
1557
+ "\" Message\" :\" Dns query:\\ r\\ nRuleName: \\ r\\ nUtcTime: 2020-02-04 14:59:38.349\\ r\\ nProcessGuid: {b3c285a4-3cda-5dc0-0000-001077270b00}\\ r\\ nProcessId: 1904\\ r\\ nQueryName: EC2AMAZ-EPO7HKA\\ r\\ nQueryStatus: 0\\ r\\ nQueryResults: 172.31.46.38;\\ r\\ nImage: C:\\ \\ Program Files\\ \\ nxlog\\ \\ nxlog.exe\" ,\n " +
1558
+ "\" Category\" :\" Dns query (rule: DnsQuery)\" ,\n " +
1559
+ "\" Opcode\" :\" Info\" ,\n " +
1560
+ "\" UtcTime\" :\" 2020-02-04 14:59:38.349\" ,\n " +
1561
+ "\" ProcessGuid\" :\" {b3c285a4-3cda-5dc0-0000-001077270b00}\" ,\n " +
1562
+ "\" ProcessId\" :\" 1904\" ,\" QueryName\" :\" EC2AMAZ-EPO7HKA\" ,\" QueryStatus\" :\" 0\" ,\n " +
1563
+ "\" QueryResults\" :\" 172.31.46.38;\" ,\n " +
1564
+ "\" Image\" :\" C:\\ \\ Program Files\\ \\ nxlog\\ \\ regsvr32.exe\" ,\n " +
1565
+ "\" EventReceivedTime\" :\" 2020-02-04T14:59:40.780905+00:00\" ,\n " +
1566
+ "\" SourceModuleName\" :\" in\" ,\n " +
1567
+ "\" SourceModuleType\" :\" im_msvistalog\" ,\n " +
1568
+ "\" CommandLine\" : \" eachtest\" ,\n " +
1569
+ "\" Initiated\" : \" true\" \n " +
1570
+ "}" ;
1571
+ }
1572
+
1463
1573
public static String randomDoc () {
1464
1574
return "{\n " +
1465
1575
"\" @timestamp\" :\" 2020-02-04T14:59:39.343541+00:00\" ,\n " +
0 commit comments