Skip to content

[New Rule] Domain Trust Enumeration via Nltest #2010

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

Merged
merged 14 commits into from
Jul 5, 2022

Conversation

terrancedejesus
Copy link
Contributor

@terrancedejesus terrancedejesus commented Jun 1, 2022

Issues

Summary

This rule detects the use of command-line utility nltest.exe as a child process of cmd.exe where arguments provided suggest domain trust enumeration. This technique has been observed in a Ryuk ransomware investigation as referenced below.

Screen Shot 2022-06-01 at 10 24 37 AM

domain_trusts argument

{
  "_index": ".ds-logs-endpoint.events.process-default-2022.06.01-000001",
  "_id": "VgF6H4EB-snQZBCYzPHi",
  "_score": 1,
  "_source": {
    "agent": {
      "id": "0a828983-141f-4be6-8c23-fb1bd6a7e6f3",
      "type": "endpoint",
      "version": "8.2.2"
    },
    "process": {
      "Ext": {
        "ancestry": [
          "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTM3MDAtMTMyOTg1NjM3NDcuMjc4ODQ5NzAw",
          "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTg0NDQtMTMyOTg1MDcyNDMuODYwMDU2NjAw"
        ],
        "code_signature": [
          {
            "trusted": true,
            "subject_name": "Microsoft Windows",
            "exists": true,
            "status": "trusted"
          }
        ]
      },
      "parent": {
        "args": [
          "C:\\Windows\\system32\\cmd.exe"
        ],
        "name": "cmd.exe",
        "pid": 3700,
        "args_count": 1,
        "entity_id": "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTM3MDAtMTMyOTg1NjM3NDcuMjc4ODQ5NzAw",
        "command_line": "\"C:\\Windows\\system32\\cmd.exe\" ",
        "executable": "C:\\Windows\\System32\\cmd.exe"
      },
      "pid": 11108,
      "entity_id": "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTExMTA4LTEzMjk4NTY0MTQ0Ljc4OTYxNjQwMA==",
      "executable": "C:\\Windows\\System32\\nltest.exe",
      "args": [
        "nltest.exe",
        "/domain_trusts"
      ],
      "code_signature": {
        "trusted": true,
        "subject_name": "Microsoft Windows",
        "exists": true,
        "status": "trusted"
      },
      "pe": {
        "original_file_name": "nltestrk.exe"
      },
      "exit_code": 1,
      "name": "nltest.exe",
      "args_count": 2,
      "command_line": "nltest.exe  /domain_trusts",
      "hash": {
        "sha1": "d568f62430417bdfa888949a0fb725eae0870ea6",
        "sha256": "553bbf90f51033e76b1f721ed60ef583766d22f2cef4baae473d6876902de0b3",
        "md5": "9be98cfde66da15f7c94c7f332dc8ef3"
      }
    },
    "message": "Endpoint process event",
    "@timestamp": "2022-06-01T13:35:45.0140443Z",
    "ecs": {
      "version": "1.11.0"
    },
    "data_stream": {
      "namespace": "default",
      "type": "logs",
      "dataset": "endpoint.events.process"
    },
    "elastic": {
      "agent": {
        "id": "0a828983-141f-4be6-8c23-fb1bd6a7e6f3"
      }
    },
    "host": {
      "hostname": "winserver-tdejesus",
      "os": {
        "Ext": {
          "variant": "Windows Server 2022 Datacenter"
        },
        "kernel": "21H2 (10.0.20348.707)",
        "name": "Windows",
        "family": "windows",
        "type": "windows",
        "version": "21H2 (10.0.20348.707)",
        "platform": "windows",
        "full": "Windows Server 2022 Datacenter 21H2 (10.0.20348.707)"
      },
      "ip": [
        "10.142.15.199",
        "fe80::d9c3:7a18:96d6:35c",
        "127.0.0.1",
        "::1"
      ],
      "name": "winserver-tdejesus",
      "id": "04d7c4e9-48f6-4bc8-8914-d87ec67eedd3",
      "mac": [
        "42:01:0a:8e:0f:c7"
      ],
      "architecture": "x86_64"
    },
    "event": {
      "agent_id_status": "verified",
      "sequence": 918,
      "ingested": "2022-06-01T13:35:50Z",
      "created": "2022-06-01T13:35:45.0140443Z",
      "kind": "event",
      "module": "endpoint",
      "action": "end",
      "id": "MdRedBvE5OU4cHRf++++++RX",
      "category": [
        "process"
      ],
      "type": [
        "end"
      ],
      "dataset": "endpoint.events.process"
    },
    "user": {
      "domain": "WINSERVER-TDEJE",
      "name": "terrance_dejesus",
      "id": "S-1-5-21-3883428562-1491877956-3560675551-1000"
    }
  },
  "fields": {
    "process.hash.md5": [
      "9be98cfde66da15f7c94c7f332dc8ef3"
    ],
    "host.os.full.text": [
      "Windows Server 2022 Datacenter 21H2 (10.0.20348.707)"
    ],
    "process.command_line.caseless": [
      "nltest.exe  /domain_trusts"
    ],
    "event.category": [
      "process"
    ],
    "process.name.text": [
      "nltest.exe"
    ],
    "host.os.name.text": [
      "Windows"
    ],
    "host.os.full": [
      "Windows Server 2022 Datacenter 21H2 (10.0.20348.707)"
    ],
    "process.parent.command_line": [
      "\"C:\\Windows\\system32\\cmd.exe\" "
    ],
    "process.parent.name": [
      "cmd.exe"
    ],
    "process.parent.pid": [
      3700
    ],
    "process.hash.sha256": [
      "553bbf90f51033e76b1f721ed60ef583766d22f2cef4baae473d6876902de0b3"
    ],
    "host.hostname": [
      "winserver-tdejesus"
    ],
    "process.pid": [
      11108
    ],
    "process.code_signature.exists": [
      true
    ],
    "host.mac": [
      "42:01:0a:8e:0f:c7"
    ],
    "elastic.agent.id": [
      "0a828983-141f-4be6-8c23-fb1bd6a7e6f3"
    ],
    "process.code_signature.subject_name": [
      "Microsoft Windows"
    ],
    "process.parent.entity_id": [
      "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTM3MDAtMTMyOTg1NjM3NDcuMjc4ODQ5NzAw"
    ],
    "host.os.version": [
      "21H2 (10.0.20348.707)"
    ],
    "host.os.name": [
      "Windows"
    ],
    "host.name": [
      "winserver-tdejesus"
    ],
    "event.agent_id_status": [
      "verified"
    ],
    "event.kind": [
      "event"
    ],
    "process.code_signature.trusted": [
      true
    ],
    "user.id": [
      "S-1-5-21-3883428562-1491877956-3560675551-1000"
    ],
    "host.os.type": [
      "windows"
    ],
    "process.Ext.ancestry": [
      "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTM3MDAtMTMyOTg1NjM3NDcuMjc4ODQ5NzAw",
      "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTg0NDQtMTMyOTg1MDcyNDMuODYwMDU2NjAw"
    ],
    "data_stream.type": [
      "logs"
    ],
    "process.parent.args_count": [
      1
    ],
    "host.architecture": [
      "x86_64"
    ],
    "process.name": [
      "nltest.exe"
    ],
    "agent.id": [
      "0a828983-141f-4be6-8c23-fb1bd6a7e6f3"
    ],
    "process.parent.executable.text": [
      "C:\\Windows\\System32\\cmd.exe"
    ],
    "ecs.version": [
      "1.11.0"
    ],
    "event.created": [
      "2022-06-01T13:35:45.014Z"
    ],
    "agent.version": [
      "8.2.2"
    ],
    "host.os.family": [
      "windows"
    ],
    "process.command_line.text": [
      "nltest.exe  /domain_trusts"
    ],
    "user.name": [
      "terrance_dejesus"
    ],
    "process.entity_id": [
      "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTExMTA4LTEzMjk4NTY0MTQ0Ljc4OTYxNjQwMA=="
    ],
    "process.parent.name.text": [
      "cmd.exe"
    ],
    "host.ip": [
      "10.142.15.199",
      "fe80::d9c3:7a18:96d6:35c",
      "127.0.0.1",
      "::1"
    ],
    "event.sequence": [
      918
    ],
    "process.executable.caseless": [
      "c:\\windows\\system32\\nltest.exe"
    ],
    "agent.type": [
      "endpoint"
    ],
    "process.pe.original_file_name": [
      "nltestrk.exe"
    ],
    "process.executable.text": [
      "C:\\Windows\\System32\\nltest.exe"
    ],
    "event.module": [
      "endpoint"
    ],
    "host.os.kernel": [
      "21H2 (10.0.20348.707)"
    ],
    "host.os.full.caseless": [
      "windows server 2022 datacenter 21h2 (10.0.20348.707)"
    ],
    "user.domain": [
      "WINSERVER-TDEJE"
    ],
    "process.name.caseless": [
      "nltest.exe"
    ],
    "host.id": [
      "04d7c4e9-48f6-4bc8-8914-d87ec67eedd3"
    ],
    "process.exit_code": [
      1
    ],
    "process.executable": [
      "C:\\Windows\\System32\\nltest.exe"
    ],
    "process.parent.name.caseless": [
      "cmd.exe"
    ],
    "process.parent.executable.caseless": [
      "c:\\windows\\system32\\cmd.exe"
    ],
    "process.parent.executable": [
      "C:\\Windows\\System32\\cmd.exe"
    ],
    "process.parent.command_line.text": [
      "\"C:\\Windows\\system32\\cmd.exe\" "
    ],
    "process.args_count": [
      2
    ],
    "data_stream.namespace": [
      "default"
    ],
    "process.args": [
      "nltest.exe",
      "/domain_trusts"
    ],
    "process.code_signature.status": [
      "trusted"
    ],
    "message": [
      "Endpoint process event"
    ],
    "host.os.Ext.variant": [
      "Windows Server 2022 Datacenter"
    ],
    "process.parent.args": [
      "C:\\Windows\\system32\\cmd.exe"
    ],
    "event.ingested": [
      "2022-06-01T13:35:50Z"
    ],
    "event.action": [
      "end"
    ],
    "@timestamp": [
      "2022-06-01T13:35:45.014Z"
    ],
    "host.os.platform": [
      "windows"
    ],
    "process.parent.command_line.caseless": [
      "\"c:\\windows\\system32\\cmd.exe\" "
    ],
    "data_stream.dataset": [
      "endpoint.events.process"
    ],
    "event.type": [
      "end"
    ],
    "process.Ext.code_signature": [
      {
        "subject_name": [
          "Microsoft Windows"
        ],
        "exists": [
          true
        ],
        "trusted": [
          true
        ],
        "status": [
          "trusted"
        ]
      }
    ],
    "process.command_line": [
      "nltest.exe  /domain_trusts"
    ],
    "process.hash.sha1": [
      "d568f62430417bdfa888949a0fb725eae0870ea6"
    ],
    "event.id": [
      "MdRedBvE5OU4cHRf++++++RX"
    ],
    "host.os.name.caseless": [
      "windows"
    ],
    "event.dataset": [
      "endpoint.events.process"
    ],
    "user.name.text": [
      "terrance_dejesus"
    ]
  }
}

parentdomain argument

{
  "_index": ".ds-logs-endpoint.events.process-default-2022.06.01-000001",
  "_id": "BpOOH4EB_FHuRo8UE71K",
  "_score": 1,
  "_source": {
    "agent": {
      "id": "0a828983-141f-4be6-8c23-fb1bd6a7e6f3",
      "type": "endpoint",
      "version": "8.2.2"
    },
    "process": {
      "Ext": {
        "ancestry": [
          "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTM3MDAtMTMyOTg1NjM3NDcuMjc4ODQ5NzAw",
          "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTg0NDQtMTMyOTg1MDcyNDMuODYwMDU2NjAw"
        ],
        "code_signature": [
          {
            "trusted": true,
            "subject_name": "Microsoft Windows",
            "exists": true,
            "status": "trusted"
          }
        ],
        "authentication_id": "0x1d0f41",
        "token": {
          "integrity_level_name": "high",
          "security_attributes": [
            "TSA://ProcUnique"
          ],
          "elevation_level": "full"
        }
      },
      "args": [
        "nltest.exe",
        "/parentdomain"
      ],
      "parent": {
        "args": [
          "C:\\Windows\\system32\\cmd.exe"
        ],
        "name": "cmd.exe",
        "pid": 3700,
        "args_count": 1,
        "entity_id": "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTM3MDAtMTMyOTg1NjM3NDcuMjc4ODQ5NzAw",
        "command_line": "\"C:\\Windows\\system32\\cmd.exe\" ",
        "executable": "C:\\Windows\\System32\\cmd.exe"
      },
      "code_signature": {
        "trusted": true,
        "subject_name": "Microsoft Windows",
        "exists": true,
        "status": "trusted"
      },
      "pe": {
        "original_file_name": "nltestrk.exe"
      },
      "name": "nltest.exe",
      "pid": 8492,
      "args_count": 2,
      "entity_id": "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTg0OTItMTMyOTg1NjUzODEuOTA3MTM4ODAw",
      "command_line": "nltest.exe  /parentdomain",
      "executable": "C:\\Windows\\System32\\nltest.exe",
      "hash": {
        "sha1": "d568f62430417bdfa888949a0fb725eae0870ea6",
        "sha256": "553bbf90f51033e76b1f721ed60ef583766d22f2cef4baae473d6876902de0b3",
        "md5": "9be98cfde66da15f7c94c7f332dc8ef3"
      }
    },
    "message": "Endpoint process event",
    "@timestamp": "2022-06-01T13:56:21.9071388Z",
    "ecs": {
      "version": "1.11.0"
    },
    "data_stream": {
      "namespace": "default",
      "type": "logs",
      "dataset": "endpoint.events.process"
    },
    "elastic": {
      "agent": {
        "id": "0a828983-141f-4be6-8c23-fb1bd6a7e6f3"
      }
    },
    "host": {
      "hostname": "winserver-tdejesus",
      "os": {
        "Ext": {
          "variant": "Windows Server 2022 Datacenter"
        },
        "kernel": "21H2 (10.0.20348.707)",
        "name": "Windows",
        "family": "windows",
        "type": "windows",
        "version": "21H2 (10.0.20348.707)",
        "platform": "windows",
        "full": "Windows Server 2022 Datacenter 21H2 (10.0.20348.707)"
      },
      "ip": [
        "10.142.15.199",
        "fe80::d9c3:7a18:96d6:35c",
        "127.0.0.1",
        "::1"
      ],
      "name": "winserver-tdejesus",
      "id": "04d7c4e9-48f6-4bc8-8914-d87ec67eedd3",
      "mac": [
        "42:01:0a:8e:0f:c7"
      ],
      "architecture": "x86_64"
    },
    "event": {
      "agent_id_status": "verified",
      "sequence": 6273,
      "ingested": "2022-06-01T13:56:53Z",
      "created": "2022-06-01T13:56:21.9071388Z",
      "kind": "event",
      "module": "endpoint",
      "action": "start",
      "id": "MdRedBvE5OU4cHRf+++++5Ga",
      "category": [
        "process"
      ],
      "type": [
        "start"
      ],
      "dataset": "endpoint.events.process"
    },
    "user": {
      "domain": "WINSERVER-TDEJE",
      "name": "terrance_dejesus",
      "id": "S-1-5-21-3883428562-1491877956-3560675551-1000"
    }
  },
  "fields": {
    "process.hash.md5": [
      "9be98cfde66da15f7c94c7f332dc8ef3"
    ],
    "host.os.full.text": [
      "Windows Server 2022 Datacenter 21H2 (10.0.20348.707)"
    ],
    "process.command_line.caseless": [
      "nltest.exe  /parentdomain"
    ],
    "event.category": [
      "process"
    ],
    "host.os.name.text": [
      "Windows"
    ],
    "process.parent.command_line": [
      "\"C:\\Windows\\system32\\cmd.exe\" "
    ],
    "process.parent.name": [
      "cmd.exe"
    ],
    "process.parent.pid": [
      3700
    ],
    "process.hash.sha256": [
      "553bbf90f51033e76b1f721ed60ef583766d22f2cef4baae473d6876902de0b3"
    ],
    "host.hostname": [
      "winserver-tdejesus"
    ],
    "process.code_signature.exists": [
      true
    ],
    "host.mac": [
      "42:01:0a:8e:0f:c7"
    ],
    "elastic.agent.id": [
      "0a828983-141f-4be6-8c23-fb1bd6a7e6f3"
    ],
    "host.os.version": [
      "21H2 (10.0.20348.707)"
    ],
    "event.agent_id_status": [
      "verified"
    ],
    "user.id": [
      "S-1-5-21-3883428562-1491877956-3560675551-1000"
    ],
    "host.os.type": [
      "windows"
    ],
    "process.Ext.ancestry": [
      "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTM3MDAtMTMyOTg1NjM3NDcuMjc4ODQ5NzAw",
      "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTg0NDQtMTMyOTg1MDcyNDMuODYwMDU2NjAw"
    ],
    "host.architecture": [
      "x86_64"
    ],
    "agent.id": [
      "0a828983-141f-4be6-8c23-fb1bd6a7e6f3"
    ],
    "process.command_line.text": [
      "nltest.exe  /parentdomain"
    ],
    "user.name": [
      "terrance_dejesus"
    ],
    "process.entity_id": [
      "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTg0OTItMTMyOTg1NjUzODEuOTA3MTM4ODAw"
    ],
    "host.ip": [
      "10.142.15.199",
      "fe80::d9c3:7a18:96d6:35c",
      "127.0.0.1",
      "::1"
    ],
    "process.executable.caseless": [
      "c:\\windows\\system32\\nltest.exe"
    ],
    "agent.type": [
      "endpoint"
    ],
    "process.pe.original_file_name": [
      "nltestrk.exe"
    ],
    "process.executable.text": [
      "C:\\Windows\\System32\\nltest.exe"
    ],
    "user.domain": [
      "WINSERVER-TDEJE"
    ],
    "process.name.caseless": [
      "nltest.exe"
    ],
    "host.id": [
      "04d7c4e9-48f6-4bc8-8914-d87ec67eedd3"
    ],
    "process.Ext.token.integrity_level_name": [
      "high"
    ],
    "process.parent.name.caseless": [
      "cmd.exe"
    ],
    "process.code_signature.status": [
      "trusted"
    ],
    "host.os.Ext.variant": [
      "Windows Server 2022 Datacenter"
    ],
    "event.ingested": [
      "2022-06-01T13:56:53Z"
    ],
    "event.action": [
      "start"
    ],
    "@timestamp": [
      "2022-06-01T13:56:21.907Z"
    ],
    "host.os.platform": [
      "windows"
    ],
    "process.parent.command_line.caseless": [
      "\"c:\\windows\\system32\\cmd.exe\" "
    ],
    "data_stream.dataset": [
      "endpoint.events.process"
    ],
    "process.Ext.code_signature": [
      {
        "subject_name": [
          "Microsoft Windows"
        ],
        "exists": [
          true
        ],
        "trusted": [
          true
        ],
        "status": [
          "trusted"
        ]
      }
    ],
    "process.hash.sha1": [
      "d568f62430417bdfa888949a0fb725eae0870ea6"
    ],
    "event.id": [
      "MdRedBvE5OU4cHRf+++++5Ga"
    ],
    "host.os.name.caseless": [
      "windows"
    ],
    "user.name.text": [
      "terrance_dejesus"
    ],
    "process.name.text": [
      "nltest.exe"
    ],
    "host.os.full": [
      "Windows Server 2022 Datacenter 21H2 (10.0.20348.707)"
    ],
    "process.pid": [
      8492
    ],
    "process.code_signature.subject_name": [
      "Microsoft Windows"
    ],
    "process.parent.entity_id": [
      "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTM3MDAtMTMyOTg1NjM3NDcuMjc4ODQ5NzAw"
    ],
    "host.os.name": [
      "Windows"
    ],
    "host.name": [
      "winserver-tdejesus"
    ],
    "event.kind": [
      "event"
    ],
    "process.code_signature.trusted": [
      true
    ],
    "data_stream.type": [
      "logs"
    ],
    "process.parent.args_count": [
      1
    ],
    "process.name": [
      "nltest.exe"
    ],
    "process.Ext.token.security_attributes": [
      "TSA://ProcUnique"
    ],
    "process.parent.executable.text": [
      "C:\\Windows\\System32\\cmd.exe"
    ],
    "ecs.version": [
      "1.11.0"
    ],
    "event.created": [
      "2022-06-01T13:56:21.907Z"
    ],
    "agent.version": [
      "8.2.2"
    ],
    "host.os.family": [
      "windows"
    ],
    "process.parent.name.text": [
      "cmd.exe"
    ],
    "event.sequence": [
      6273
    ],
    "event.module": [
      "endpoint"
    ],
    "host.os.kernel": [
      "21H2 (10.0.20348.707)"
    ],
    "host.os.full.caseless": [
      "windows server 2022 datacenter 21h2 (10.0.20348.707)"
    ],
    "process.executable": [
      "C:\\Windows\\System32\\nltest.exe"
    ],
    "process.parent.executable.caseless": [
      "c:\\windows\\system32\\cmd.exe"
    ],
    "process.parent.executable": [
      "C:\\Windows\\System32\\cmd.exe"
    ],
    "process.parent.command_line.text": [
      "\"C:\\Windows\\system32\\cmd.exe\" "
    ],
    "process.args_count": [
      2
    ],
    "data_stream.namespace": [
      "default"
    ],
    "process.args": [
      "nltest.exe",
      "/parentdomain"
    ],
    "message": [
      "Endpoint process event"
    ],
    "process.Ext.authentication_id": [
      "0x1d0f41"
    ],
    "process.Ext.token.elevation_level": [
      "full"
    ],
    "process.parent.args": [
      "C:\\Windows\\system32\\cmd.exe"
    ],
    "event.type": [
      "start"
    ],
    "process.command_line": [
      "nltest.exe  /parentdomain"
    ],
    "event.dataset": [
      "endpoint.events.process"
    ]
  }
}

dcname:DCNAME argument

{
  "_index": ".ds-logs-endpoint.events.process-default-2022.06.01-000001",
  "_id": "_ZOOH4EB_FHuRo8UhL2Y",
  "_score": 1,
  "_source": {
    "agent": {
      "id": "0a828983-141f-4be6-8c23-fb1bd6a7e6f3",
      "type": "endpoint",
      "version": "8.2.2"
    },
    "process": {
      "Ext": {
        "ancestry": [
          "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTM3MDAtMTMyOTg1NjM3NDcuMjc4ODQ5NzAw",
          "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTg0NDQtMTMyOTg1MDcyNDMuODYwMDU2NjAw"
        ],
        "code_signature": [
          {
            "trusted": true,
            "subject_name": "Microsoft Windows",
            "exists": true,
            "status": "trusted"
          }
        ]
      },
      "parent": {
        "args": [
          "C:\\Windows\\system32\\cmd.exe"
        ],
        "name": "cmd.exe",
        "pid": 3700,
        "args_count": 1,
        "entity_id": "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTM3MDAtMTMyOTg1NjM3NDcuMjc4ODQ5NzAw",
        "command_line": "\"C:\\Windows\\system32\\cmd.exe\" ",
        "executable": "C:\\Windows\\System32\\cmd.exe"
      },
      "pid": 5964,
      "entity_id": "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTU5NjQtMTMyOTg1NjU0MTYuNzMxODYzNjAw",
      "executable": "C:\\Windows\\System32\\nltest.exe",
      "args": [
        "nltest.exe",
        "/dcname:test"
      ],
      "code_signature": {
        "trusted": true,
        "subject_name": "Microsoft Windows",
        "exists": true,
        "status": "trusted"
      },
      "pe": {
        "original_file_name": "nltestrk.exe"
      },
      "exit_code": 1,
      "name": "nltest.exe",
      "args_count": 2,
      "command_line": "nltest.exe  /dcname:test",
      "hash": {
        "sha1": "d568f62430417bdfa888949a0fb725eae0870ea6",
        "sha256": "553bbf90f51033e76b1f721ed60ef583766d22f2cef4baae473d6876902de0b3",
        "md5": "9be98cfde66da15f7c94c7f332dc8ef3"
      }
    },
    "message": "Endpoint process event",
    "@timestamp": "2022-06-01T13:56:59.1234492Z",
    "ecs": {
      "version": "1.11.0"
    },
    "data_stream": {
      "namespace": "default",
      "type": "logs",
      "dataset": "endpoint.events.process"
    },
    "elastic": {
      "agent": {
        "id": "0a828983-141f-4be6-8c23-fb1bd6a7e6f3"
      }
    },
    "host": {
      "hostname": "winserver-tdejesus",
      "os": {
        "Ext": {
          "variant": "Windows Server 2022 Datacenter"
        },
        "kernel": "21H2 (10.0.20348.707)",
        "name": "Windows",
        "family": "windows",
        "type": "windows",
        "version": "21H2 (10.0.20348.707)",
        "platform": "windows",
        "full": "Windows Server 2022 Datacenter 21H2 (10.0.20348.707)"
      },
      "ip": [
        "10.142.15.199",
        "fe80::d9c3:7a18:96d6:35c",
        "127.0.0.1",
        "::1"
      ],
      "name": "winserver-tdejesus",
      "id": "04d7c4e9-48f6-4bc8-8914-d87ec67eedd3",
      "mac": [
        "42:01:0a:8e:0f:c7"
      ],
      "architecture": "x86_64"
    },
    "event": {
      "agent_id_status": "verified",
      "sequence": 6448,
      "ingested": "2022-06-01T13:57:22Z",
      "created": "2022-06-01T13:56:59.1234492Z",
      "kind": "event",
      "module": "endpoint",
      "action": "end",
      "id": "MdRedBvE5OU4cHRf+++++5WA",
      "category": [
        "process"
      ],
      "type": [
        "end"
      ],
      "dataset": "endpoint.events.process"
    },
    "user": {
      "domain": "WINSERVER-TDEJE",
      "name": "terrance_dejesus",
      "id": "S-1-5-21-3883428562-1491877956-3560675551-1000"
    }
  },
  "fields": {
    "process.hash.md5": [
      "9be98cfde66da15f7c94c7f332dc8ef3"
    ],
    "host.os.full.text": [
      "Windows Server 2022 Datacenter 21H2 (10.0.20348.707)"
    ],
    "process.command_line.caseless": [
      "nltest.exe  /dcname:test"
    ],
    "event.category": [
      "process"
    ],
    "process.name.text": [
      "nltest.exe"
    ],
    "host.os.name.text": [
      "Windows"
    ],
    "host.os.full": [
      "Windows Server 2022 Datacenter 21H2 (10.0.20348.707)"
    ],
    "process.parent.command_line": [
      "\"C:\\Windows\\system32\\cmd.exe\" "
    ],
    "process.parent.name": [
      "cmd.exe"
    ],
    "process.parent.pid": [
      3700
    ],
    "process.hash.sha256": [
      "553bbf90f51033e76b1f721ed60ef583766d22f2cef4baae473d6876902de0b3"
    ],
    "host.hostname": [
      "winserver-tdejesus"
    ],
    "process.pid": [
      5964
    ],
    "process.code_signature.exists": [
      true
    ],
    "host.mac": [
      "42:01:0a:8e:0f:c7"
    ],
    "elastic.agent.id": [
      "0a828983-141f-4be6-8c23-fb1bd6a7e6f3"
    ],
    "process.code_signature.subject_name": [
      "Microsoft Windows"
    ],
    "process.parent.entity_id": [
      "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTM3MDAtMTMyOTg1NjM3NDcuMjc4ODQ5NzAw"
    ],
    "host.os.version": [
      "21H2 (10.0.20348.707)"
    ],
    "host.os.name": [
      "Windows"
    ],
    "host.name": [
      "winserver-tdejesus"
    ],
    "event.agent_id_status": [
      "verified"
    ],
    "event.kind": [
      "event"
    ],
    "process.code_signature.trusted": [
      true
    ],
    "user.id": [
      "S-1-5-21-3883428562-1491877956-3560675551-1000"
    ],
    "host.os.type": [
      "windows"
    ],
    "process.Ext.ancestry": [
      "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTM3MDAtMTMyOTg1NjM3NDcuMjc4ODQ5NzAw",
      "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTg0NDQtMTMyOTg1MDcyNDMuODYwMDU2NjAw"
    ],
    "data_stream.type": [
      "logs"
    ],
    "process.parent.args_count": [
      1
    ],
    "host.architecture": [
      "x86_64"
    ],
    "process.name": [
      "nltest.exe"
    ],
    "agent.id": [
      "0a828983-141f-4be6-8c23-fb1bd6a7e6f3"
    ],
    "process.parent.executable.text": [
      "C:\\Windows\\System32\\cmd.exe"
    ],
    "ecs.version": [
      "1.11.0"
    ],
    "event.created": [
      "2022-06-01T13:56:59.123Z"
    ],
    "agent.version": [
      "8.2.2"
    ],
    "host.os.family": [
      "windows"
    ],
    "process.command_line.text": [
      "nltest.exe  /dcname:test"
    ],
    "user.name": [
      "terrance_dejesus"
    ],
    "process.entity_id": [
      "MGE4Mjg5ODMtMTQxZi00YmU2LThjMjMtZmIxYmQ2YTdlNmYzLTU5NjQtMTMyOTg1NjU0MTYuNzMxODYzNjAw"
    ],
    "process.parent.name.text": [
      "cmd.exe"
    ],
    "host.ip": [
      "10.142.15.199",
      "fe80::d9c3:7a18:96d6:35c",
      "127.0.0.1",
      "::1"
    ],
    "event.sequence": [
      6448
    ],
    "process.executable.caseless": [
      "c:\\windows\\system32\\nltest.exe"
    ],
    "agent.type": [
      "endpoint"
    ],
    "process.pe.original_file_name": [
      "nltestrk.exe"
    ],
    "process.executable.text": [
      "C:\\Windows\\System32\\nltest.exe"
    ],
    "event.module": [
      "endpoint"
    ],
    "host.os.kernel": [
      "21H2 (10.0.20348.707)"
    ],
    "host.os.full.caseless": [
      "windows server 2022 datacenter 21h2 (10.0.20348.707)"
    ],
    "user.domain": [
      "WINSERVER-TDEJE"
    ],
    "process.name.caseless": [
      "nltest.exe"
    ],
    "host.id": [
      "04d7c4e9-48f6-4bc8-8914-d87ec67eedd3"
    ],
    "process.exit_code": [
      1
    ],
    "process.executable": [
      "C:\\Windows\\System32\\nltest.exe"
    ],
    "process.parent.name.caseless": [
      "cmd.exe"
    ],
    "process.parent.executable.caseless": [
      "c:\\windows\\system32\\cmd.exe"
    ],
    "process.parent.executable": [
      "C:\\Windows\\System32\\cmd.exe"
    ],
    "process.parent.command_line.text": [
      "\"C:\\Windows\\system32\\cmd.exe\" "
    ],
    "process.args_count": [
      2
    ],
    "data_stream.namespace": [
      "default"
    ],
    "process.args": [
      "nltest.exe",
      "/dcname:test"
    ],
    "process.code_signature.status": [
      "trusted"
    ],
    "message": [
      "Endpoint process event"
    ],
    "host.os.Ext.variant": [
      "Windows Server 2022 Datacenter"
    ],
    "process.parent.args": [
      "C:\\Windows\\system32\\cmd.exe"
    ],
    "event.ingested": [
      "2022-06-01T13:57:22Z"
    ],
    "event.action": [
      "end"
    ],
    "@timestamp": [
      "2022-06-01T13:56:59.123Z"
    ],
    "host.os.platform": [
      "windows"
    ],
    "process.parent.command_line.caseless": [
      "\"c:\\windows\\system32\\cmd.exe\" "
    ],
    "data_stream.dataset": [
      "endpoint.events.process"
    ],
    "event.type": [
      "end"
    ],
    "process.Ext.code_signature": [
      {
        "trusted": [
          true
        ],
        "subject_name": [
          "Microsoft Windows"
        ],
        "exists": [
          true
        ],
        "status": [
          "trusted"
        ]
      }
    ],
    "process.command_line": [
      "nltest.exe  /dcname:test"
    ],
    "process.hash.sha1": [
      "d568f62430417bdfa888949a0fb725eae0870ea6"
    ],
    "event.id": [
      "MdRedBvE5OU4cHRf+++++5WA"
    ],
    "host.os.name.caseless": [
      "windows"
    ],
    "event.dataset": [
      "endpoint.events.process"
    ],
    "user.name.text": [
      "terrance_dejesus"
    ]
  }
}

References

https://redcanary.com/blog/how-one-hospital-thwarted-a-ryuk-ransomware-outbreak/
https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc731935(v=ws.11)

Contributor checklist

@terrancedejesus terrancedejesus added Rule: New Proposal for new rule OS: Windows windows related rules v8.4.0 labels Jun 1, 2022
@terrancedejesus terrancedejesus linked an issue Jun 1, 2022 that may be closed by this pull request
@terrancedejesus terrancedejesus marked this pull request as ready for review June 1, 2022 15:25
Copy link
Contributor

@w0rk3r w0rk3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Mikaayenson Mikaayenson self-requested a review June 24, 2022 21:01
Copy link
Contributor

@Mikaayenson Mikaayenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@terrancedejesus terrancedejesus merged commit 329530c into main Jul 5, 2022
@terrancedejesus terrancedejesus deleted the 437-new-rule-enumerating-domain-trusts-activity branch July 5, 2022 14:48
protectionsmachine pushed a commit that referenced this pull request Jul 5, 2022
* adding detection rule

* removed changes from unrelated rule

* adjusted threat technique

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

Co-authored-by: Jonhnathan <[email protected]>

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

Co-authored-by: Jonhnathan <[email protected]>

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

Co-authored-by: Jonhnathan <[email protected]>
Co-authored-by: Justin Ibarra <[email protected]>

(cherry picked from commit 329530c)
protectionsmachine pushed a commit that referenced this pull request Jul 5, 2022
* adding detection rule

* removed changes from unrelated rule

* adjusted threat technique

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

Co-authored-by: Jonhnathan <[email protected]>

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

Co-authored-by: Jonhnathan <[email protected]>

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

Co-authored-by: Jonhnathan <[email protected]>
Co-authored-by: Justin Ibarra <[email protected]>

(cherry picked from commit 329530c)
protectionsmachine pushed a commit that referenced this pull request Jul 5, 2022
* adding detection rule

* removed changes from unrelated rule

* adjusted threat technique

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

Co-authored-by: Jonhnathan <[email protected]>

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

Co-authored-by: Jonhnathan <[email protected]>

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

Co-authored-by: Jonhnathan <[email protected]>
Co-authored-by: Justin Ibarra <[email protected]>

(cherry picked from commit 329530c)
protectionsmachine pushed a commit that referenced this pull request Jul 5, 2022
* adding detection rule

* removed changes from unrelated rule

* adjusted threat technique

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

Co-authored-by: Jonhnathan <[email protected]>

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

Co-authored-by: Jonhnathan <[email protected]>

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

Co-authored-by: Jonhnathan <[email protected]>
Co-authored-by: Justin Ibarra <[email protected]>

(cherry picked from commit 329530c)
protectionsmachine pushed a commit that referenced this pull request Jul 5, 2022
* adding detection rule

* removed changes from unrelated rule

* adjusted threat technique

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

Co-authored-by: Jonhnathan <[email protected]>

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

Co-authored-by: Jonhnathan <[email protected]>

* Update rules/windows/discovery_enumerating_domain_trusts_via_nltest.toml

Co-authored-by: Jonhnathan <[email protected]>
Co-authored-by: Justin Ibarra <[email protected]>

(cherry picked from commit 329530c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Rule] Enumerating domain trusts activity
5 participants