Detecting PowerShell-Based Ingress Tool Transfers
Detection of attackers using PowerShell to download executable, script, or library files from untrusted remote domains as part of command and control activity.
Attackers frequently leverage PowerShell to perform ingress tool transfers, moving malware or post-exploitation tooling from external systems into a compromised environment. By utilizing native system administration utilities, actors attempt to blend in with legitimate automation and maintenance tasks. This threat activity involves PowerShell processes making network connections for DNS resolution to identify remote resources, followed by the creation of potentially malicious files on the local filesystem.
Defenders should prioritize monitoring for PowerShell execution that culminates in file creation events, specifically when the domain resolution does not align with known trusted services (e.g., Microsoft update endpoints, standard package managers, or internal infrastructure). Given the prevalence of PowerShell in administrative routines, effective detection requires correlation between network events (DNS lookups) and file system events, combined with contextual filtering to suppress benign administrative activity.
Attack Chain
- Attacker establishes initial access or presence on a target Windows host.
- Attacker launches PowerShell or PowerShell ISE to facilitate file retrieval.
- PowerShell performs a DNS query to resolve a remote, untrusted, or attacker-controlled domain.
- The network connection is successfully established to the resolved IP address.
- The PowerShell process invokes download commands (e.g., Invoke-WebRequest, IEX) to fetch the payload.
- PowerShell writes the retrieved content to the disk (e.g., an .exe, .dll, or .ps1 file).
- The file creation event is logged by the system, identifying the PowerShell process as the actor.
- Attacker subsequently executes the downloaded file to advance their objective, such as persistence or lateral movement.
Impact
Successful ingress tool transfer allows attackers to introduce secondary malware, backdoors, or credential harvesting tools into a network. This facilitates long-term persistence, lateral movement, and data exfiltration. If left undetected, this activity provides the attacker with a platform to expand their footprint across the organization's infrastructure.
Recommendation
- Deploy the provided Sigma detection rule to monitor for PowerShell-initiated downloads.
- Baseline your environment's PowerShell usage to identify legitimate update or automation domains that should be added to the exclusion list.
- Enable Sysmon or Elastic Defend to capture both network (DNS) and file creation events, ensuring process-level lineage is available for investigation.
- Use the provided investigation guide to analyze the parent process tree, examine digital signatures, and assess the reputation of external domains identified in the DNS logs.
Immediate actions
Deploy PowerShell download detection rule
Threat Hunt
Search for PowerShell processes with high volume of external network connections
Data: DNS and socket connection logs
Mitigations
Implement strict PowerShell execution policy and constrained language mode
T1059.001
Detection coverage 1
Detect Remote File Download via PowerShell
mediumIdentifies PowerShell being used to download an executable file, DLL, or script from an untrusted remote destination.
Detection queries are available on the platform. Get full rules →