Virtual Private Network Connection Attempt

Identifies the execution of macOS built-in commands to connect to an existing Virtual Private Network (VPN). Adversaries may use VPN connections to laterally move and control remote systems on a network.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2020/01/25"
 3integration = ["endpoint"]
 4maturity = "production"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2023/06/22"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Identifies the execution of macOS built-in commands to connect to an existing Virtual Private Network (VPN). Adversaries
13may use VPN connections to laterally move and control remote systems on a network.
14"""
15from = "now-9m"
16index = ["auditbeat-*", "logs-endpoint.events.*"]
17language = "eql"
18license = "Elastic License v2"
19name = "Virtual Private Network Connection Attempt"
20note = """## Setup
21
22If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.
23"""
24references = [
25    "https://github.com/rapid7/metasploit-framework/blob/master/modules/post/osx/manage/vpn.rb",
26    "https://www.unix.com/man-page/osx/8/networksetup/",
27    "https://superuser.com/questions/358513/start-configured-vpn-from-command-line-osx",
28]
29risk_score = 21
30rule_id = "15dacaa0-5b90-466b-acab-63435a59701a"
31severity = "low"
32tags = ["Domain: Endpoint", "OS: macOS", "Use Case: Threat Detection", "Tactic: Lateral Movement", "Data Source: Elastic Defend"]
33timestamp_override = "event.ingested"
34type = "eql"
35
36query = '''
37process where host.os.type == "macos" and event.type in ("start", "process_started") and
38  (
39    (process.name : "networksetup" and process.args : "-connectpppoeservice") or
40    (process.name : "scutil" and process.args : "--nc" and process.args : "start") or
41    (process.name : "osascript" and process.command_line : "osascript*set VPN to service*")
42  )
43'''
44
45
46[[rule.threat]]
47framework = "MITRE ATT&CK"
48[[rule.threat.technique]]
49id = "T1021"
50name = "Remote Services"
51reference = "https://attack.mitre.org/techniques/T1021/"
52
53
54[rule.threat.tactic]
55id = "TA0008"
56name = "Lateral Movement"
57reference = "https://attack.mitre.org/tactics/TA0008/"

Setup

If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define event.ingested and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate event.ingested to @timestamp for this rule to work.

References

Related rules

to-top