2023-08-29 09:10:25 -03:00
|
|
|
[metadata]
|
2024-05-23 00:45:10 +05:30
|
|
|
bypass_bbr_timing = true
|
2023-08-29 09:10:25 -03:00
|
|
|
creation_date = "2023/08/25"
|
|
|
|
|
integration = ["endpoint"]
|
|
|
|
|
maturity = "production"
|
2024-05-23 00:45:10 +05:30
|
|
|
updated_date = "2024/05/21"
|
2023-08-29 09:10:25 -03:00
|
|
|
|
|
|
|
|
[rule]
|
|
|
|
|
author = ["Elastic"]
|
2024-05-23 00:45:10 +05:30
|
|
|
building_block_type = "default"
|
2023-08-29 09:10:25 -03:00
|
|
|
description = """
|
2024-05-23 00:45:10 +05:30
|
|
|
Identifies unusual process executions using MSSQL Service accounts, which can indicate the exploitation/compromise of
|
|
|
|
|
SQL instances. Attackers may exploit exposed MSSQL instances for initial access or lateral movement.
|
2023-08-29 09:10:25 -03:00
|
|
|
"""
|
|
|
|
|
from = "now-9m"
|
2024-04-08 09:47:48 -03:00
|
|
|
index = ["logs-endpoint.events.process-*"]
|
2023-08-29 09:10:25 -03:00
|
|
|
language = "eql"
|
|
|
|
|
license = "Elastic License v2"
|
|
|
|
|
name = "Unusual Process For MSSQL Service Accounts"
|
|
|
|
|
references = [
|
|
|
|
|
"https://www.microsoft.com/en-us/security/blog/2023/08/24/flax-typhoon-using-legitimate-software-to-quietly-access-taiwanese-organizations/",
|
2024-05-23 00:45:10 +05:30
|
|
|
"https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/configure-windows-service-accounts-and-permissions?view=sql-server-ver16",
|
2023-08-29 09:10:25 -03:00
|
|
|
]
|
|
|
|
|
risk_score = 21
|
|
|
|
|
rule_id = "e74d645b-fec6-431e-bf93-ca64a538e0de"
|
|
|
|
|
severity = "low"
|
2024-05-23 00:45:10 +05:30
|
|
|
tags = [
|
|
|
|
|
"Domain: Endpoint",
|
|
|
|
|
"OS: Windows",
|
|
|
|
|
"Use Case: Threat Detection",
|
|
|
|
|
"Tactic: Lateral Movement",
|
|
|
|
|
"Tactic: Persistence",
|
|
|
|
|
"Data Source: Elastic Defend",
|
|
|
|
|
"Rule Type: BBR",
|
|
|
|
|
]
|
2023-08-29 09:10:25 -03:00
|
|
|
timestamp_override = "event.ingested"
|
|
|
|
|
type = "eql"
|
|
|
|
|
|
|
|
|
|
query = '''
|
|
|
|
|
process where event.type == "start" and host.os.type == "windows" and
|
|
|
|
|
user.name : (
|
|
|
|
|
"SQLSERVERAGENT", "SQLAGENT$*",
|
|
|
|
|
"MSSQLSERVER", "MSSQL$*",
|
|
|
|
|
"MSSQLServerOLAPService",
|
|
|
|
|
"ReportServer*", "MsDtsServer150",
|
|
|
|
|
"MSSQLFDLauncher*",
|
|
|
|
|
"SQLServer2005SQLBrowserUser$*",
|
|
|
|
|
"SQLWriter", "winmgmt"
|
|
|
|
|
) and user.domain : "NT SERVICE" and
|
|
|
|
|
not (
|
2024-02-14 12:49:25 -03:00
|
|
|
(
|
|
|
|
|
process.name : (
|
2023-08-29 09:10:25 -03:00
|
|
|
"sqlceip.exe", "sqlservr.exe", "sqlagent.exe",
|
|
|
|
|
"msmdsrv.exe", "ReportingServicesService.exe",
|
2024-02-14 12:49:25 -03:00
|
|
|
"MsDtsSrvr.exe", "sqlbrowser.exe", "DTExec.exe",
|
|
|
|
|
"SQLPS.exe", "fdhost.exe", "fdlauncher.exe",
|
2024-04-08 09:47:48 -03:00
|
|
|
"SqlDumper.exe", "sqlsqm.exe", "DatabaseMail.exe",
|
|
|
|
|
"ISServerExec.exe", "Microsoft.ReportingServices.Portal.WebHost.exe",
|
|
|
|
|
"bcp.exe", "SQLCMD.exe", "DatabaseMail.exe"
|
2024-02-14 12:49:25 -03:00
|
|
|
) or
|
|
|
|
|
process.executable : (
|
|
|
|
|
"?:\\Windows\\System32\\wermgr.exe",
|
|
|
|
|
"?:\\Windows\\System32\\conhost.exe",
|
|
|
|
|
"?:\\Windows\\System32\\WerFault.exe"
|
|
|
|
|
)
|
|
|
|
|
) and
|
|
|
|
|
(
|
|
|
|
|
process.code_signature.subject_name : ("Microsoft Corporation", "Microsoft Windows") and
|
|
|
|
|
process.code_signature.trusted == true
|
|
|
|
|
)
|
|
|
|
|
) and
|
|
|
|
|
not (
|
2024-04-08 09:47:48 -03:00
|
|
|
(process.name : "cmd.exe" and process.parent.name : "sqlservr.exe") or
|
|
|
|
|
(process.name : "cmd.exe" and process.parent.name : "forfiles.exe" and process.command_line : "/c echo *")
|
2023-08-29 09:10:25 -03:00
|
|
|
)
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[[rule.threat]]
|
|
|
|
|
framework = "MITRE ATT&CK"
|
|
|
|
|
[[rule.threat.technique]]
|
2023-10-15 18:12:20 -03:00
|
|
|
id = "T1210"
|
|
|
|
|
name = "Exploitation of Remote Services"
|
|
|
|
|
reference = "https://attack.mitre.org/techniques/T1210/"
|
2023-08-29 09:10:25 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
[rule.threat.tactic]
|
2023-10-15 18:12:20 -03:00
|
|
|
id = "TA0008"
|
|
|
|
|
name = "Lateral Movement"
|
|
|
|
|
reference = "https://attack.mitre.org/tactics/TA0008/"
|
2023-08-29 09:10:25 -03:00
|
|
|
[[rule.threat]]
|
|
|
|
|
framework = "MITRE ATT&CK"
|
|
|
|
|
[[rule.threat.technique]]
|
|
|
|
|
id = "T1505"
|
|
|
|
|
name = "Server Software Component"
|
|
|
|
|
reference = "https://attack.mitre.org/techniques/T1505/"
|
2023-10-15 18:12:20 -03:00
|
|
|
[[rule.threat.technique.subtechnique]]
|
|
|
|
|
id = "T1505.001"
|
|
|
|
|
name = "SQL Stored Procedures"
|
|
|
|
|
reference = "https://attack.mitre.org/techniques/T1505/001/"
|
2023-08-29 09:10:25 -03:00
|
|
|
|
2024-05-23 00:45:10 +05:30
|
|
|
|
|
|
|
|
|
2023-08-29 09:10:25 -03:00
|
|
|
[rule.threat.tactic]
|
|
|
|
|
id = "TA0003"
|
|
|
|
|
name = "Persistence"
|
|
|
|
|
reference = "https://attack.mitre.org/tactics/TA0003/"
|
2024-05-23 00:45:10 +05:30
|
|
|
|