Executable File Download via Wget
Detects executable file downloads via wget to suspicious locations such as /tmp or /Users/Shared. Threat actors commonly use wget to download malicious payloads and additional tools for post-exploitation.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2026/01/30"
3integration = ["endpoint"]
4maturity = "production"
5updated_date = "2026/02/09"
6
7[rule]
8author = ["Elastic"]
9description = """
10Detects executable file downloads via wget to suspicious locations such as /tmp or /Users/Shared. Threat
11actors commonly use wget to download malicious payloads and additional tools for post-exploitation.
12"""
13from = "now-9m"
14index = ["logs-endpoint.events.network-*", "logs-endpoint.events.file-*"]
15language = "eql"
16license = "Elastic License v2"
17name = "Executable File Download via Wget"
18note = """ ## Triage and analysis
19
20> **Disclaimer**:
21> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
22
23### Investigating Executable File Download via Wget
24
25This rule detects wget pulling down a Mach-O executable and writing it into commonly abused transient or shared directories on macOS, which often signals payload staging during ingress tool transfer. Attackers frequently run wget from a shell or scripted installer to fetch a second-stage binary into /tmp or /Users/Shared, then immediately execute it to establish command and control or deploy additional tooling.
26
27### Possible investigation steps
28
29- Pivot from the detected wget process to identify its parent process, user context, and full command line to determine whether it was launched by an interactive shell, script, or installer package.
30- Review the network connection details from the wget execution (remote IP/domain, URL path, TLS certificate/SNI if available) and assess reputation plus whether it aligns with known internal software distribution.
31- Inspect the downloaded Mach-O at the destination path by collecting its hash, signature/notarization status, and basic static traits (strings, embedded URLs, ad-hoc signing) to quickly judge legitimacy.
32- Check for immediate follow-on activity from the same host such as execution of the new file, creation of persistence (LaunchAgents/Daemons, cron, login items), or additional tool downloads within the next few minutes.
33- Scope for reuse by searching across endpoints for the same downloaded hash, filename, URL, or destination directory pattern to determine blast radius and whether this is a recurring delivery mechanism.
34
35### False positive analysis
36
37- An administrator or developer uses wget in a script to fetch an internal build or test Mach-O binary and stages it in /tmp or /Users/Shared for immediate execution during troubleshooting or CI-style workflows.
38- A legitimate installation or update routine invokes wget to download a helper executable to a transient directory (for unpacking or preflight checks) before moving it into an application bundle, causing a short-lived write to /tmp-like paths.
39
40### Response and remediation
41
42- Isolate the affected macOS host from the network and terminate the active `wget` process to stop additional payload transfers or execution.
43- Quarantine the downloaded Mach-O from `/tmp`, `/private/tmp`, `/var/tmp`, or `/Users/Shared` and preserve a copy plus the originating `wget` command/URL for analysis before removal.
44- Hunt on the host for immediate follow-on execution of the downloaded file and remove any persistence artifacts created around the same time, such as new LaunchAgents/LaunchDaemons, login items, or cron entries pointing to the staged path.
45- Block the observed download URL/domain/IP at egress controls and add allowlisting controls for approved internal distribution sources to reduce future misuse of `wget` for tool transfer.
46- Escalate to incident response if the staged Mach-O is executed, unsigned/ad-hoc signed, establishes outbound connections to unapproved infrastructure, or the same hash/URL is found on multiple endpoints.
47- Harden endpoints by restricting `wget` usage where possible, enforcing Gatekeeper/notarization and least-privilege execution, and adding monitoring/controls for executable writes and executions from world-writable directories.
48"""
49references = [
50 "https://attack.mitre.org/techniques/T1105/"
51]
52risk_score = 47
53rule_id = "36755b43-a1f9-4f2c-9b61-6b240dd0e164"
54severity = "medium"
55tags = [
56 "Domain: Endpoint",
57 "OS: macOS",
58 "Use Case: Threat Detection",
59 "Tactic: Command and Control",
60 "Data Source: Elastic Defend",
61 "Resources: Investigation Guide",
62]
63type = "eql"
64query = '''
65sequence by process.entity_id with maxspan=30s
66 [network where host.os.type == "macos" and event.type == "start" and process.name == "wget"]
67 [file where host.os.type == "macos" and event.action == "modification" and
68 process.name == "wget" and
69 file.path like ("/tmp/*", "/private/tmp/*", "/private/var/tmp/*", "/var/tmp/*", "/Users/Shared/*") and
70 file.Ext.header_bytes like~ ("cffaedfe*", "cafebabe*")]
71'''
72
73[[rule.threat]]
74framework = "MITRE ATT&CK"
75
76 [rule.threat.tactic]
77 name = "Command and Control"
78 id = "TA0011"
79 reference = "https://attack.mitre.org/tactics/TA0011/"
80
81 [[rule.threat.technique]]
82 name = "Ingress Tool Transfer"
83 id = "T1105"
84 reference = "https://attack.mitre.org/techniques/T1105/"
85
86[[rule.threat]]
87framework = "MITRE ATT&CK"
88
89 [rule.threat.tactic]
90 name = "Execution"
91 id = "TA0002"
92 reference = "https://attack.mitre.org/tactics/TA0002/"
93
94 [[rule.threat.technique]]
95 name = "User Execution"
96 id = "T1204"
97 reference = "https://attack.mitre.org/techniques/T1204/"
98
99 [[rule.threat.technique.subtechnique]]
100 name = "Malicious File"
101 id = "T1204.002"
102 reference = "https://attack.mitre.org/techniques/T1204/002/"
Triage and analysis
Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
Investigating Executable File Download via Wget
This rule detects wget pulling down a Mach-O executable and writing it into commonly abused transient or shared directories on macOS, which often signals payload staging during ingress tool transfer. Attackers frequently run wget from a shell or scripted installer to fetch a second-stage binary into /tmp or /Users/Shared, then immediately execute it to establish command and control or deploy additional tooling.
Possible investigation steps
- Pivot from the detected wget process to identify its parent process, user context, and full command line to determine whether it was launched by an interactive shell, script, or installer package.
- Review the network connection details from the wget execution (remote IP/domain, URL path, TLS certificate/SNI if available) and assess reputation plus whether it aligns with known internal software distribution.
- Inspect the downloaded Mach-O at the destination path by collecting its hash, signature/notarization status, and basic static traits (strings, embedded URLs, ad-hoc signing) to quickly judge legitimacy.
- Check for immediate follow-on activity from the same host such as execution of the new file, creation of persistence (LaunchAgents/Daemons, cron, login items), or additional tool downloads within the next few minutes.
- Scope for reuse by searching across endpoints for the same downloaded hash, filename, URL, or destination directory pattern to determine blast radius and whether this is a recurring delivery mechanism.
False positive analysis
- An administrator or developer uses wget in a script to fetch an internal build or test Mach-O binary and stages it in /tmp or /Users/Shared for immediate execution during troubleshooting or CI-style workflows.
- A legitimate installation or update routine invokes wget to download a helper executable to a transient directory (for unpacking or preflight checks) before moving it into an application bundle, causing a short-lived write to /tmp-like paths.
Response and remediation
- Isolate the affected macOS host from the network and terminate the active
wgetprocess to stop additional payload transfers or execution. - Quarantine the downloaded Mach-O from
/tmp,/private/tmp,/var/tmp, or/Users/Sharedand preserve a copy plus the originatingwgetcommand/URL for analysis before removal. - Hunt on the host for immediate follow-on execution of the downloaded file and remove any persistence artifacts created around the same time, such as new LaunchAgents/LaunchDaemons, login items, or cron entries pointing to the staged path.
- Block the observed download URL/domain/IP at egress controls and add allowlisting controls for approved internal distribution sources to reduce future misuse of
wgetfor tool transfer. - Escalate to incident response if the staged Mach-O is executed, unsigned/ad-hoc signed, establishes outbound connections to unapproved infrastructure, or the same hash/URL is found on multiple endpoints.
- Harden endpoints by restricting
wgetusage where possible, enforcing Gatekeeper/notarization and least-privilege execution, and adding monitoring/controls for executable writes and executions from world-writable directories.
References
Related rules
- Perl Outbound Network Connection
- Script Interpreter Connection to Non-Standard Port
- Suspicious AWS S3 Connection via Script Interpreter
- Potential Traffic Tunneling using QEMU
- Curl Execution via Shell Profile