Two of the most widely used free Windows utilities from the long-running SoftwareOK catalog — Q-Dir, a popular alternative file manager, and DesktopOK, a desktop icon layout manager — have had their official distribution channels compromised. Threat actors replaced legitimate installers with trojanized builds that drop and execute a Python-based remote access trojan (RAT) on victim machines. Because these tools are downloaded directly from the official site and trusted implicitly by users, help desks, and even IT administrators, this is a textbook supply-chain attack with a high success probability and a wide, unquantifiable blast radius.
This is not a vulnerability you can patch your way out of — it is a trust-chain failure. Any host that downloaded or updated Q-Dir or DesktopOK during the compromise window should be treated as presumptively compromised until proven otherwise. Defenders should prioritize hunting for Python interpreter activity on endpoints where these utilities were installed, auditing persistence mechanisms, and validating every copy of these tools in the environment.
Technical Analysis
Affected products and platforms
| Product | Function | Affected component | Platform |
|---|---|---|---|
| Q-Dir | Alternative file manager (single-EXE, portable) | Official download/installer from SoftwareOK | Windows (7–11, Server editions) |
| DesktopOK | Desktop icon position save/restore utility | Official download/installer from SoftwareOK | Windows (7–11, Server editions) |
Both tools are distributed primarily as small, portable executables downloaded directly from the SoftwareOK website rather than through a store or signed enterprise channel. That distribution model is exactly what makes them attractive targets: there is no package manager, no hash-pinning workflow, and no vendor-enforced update integrity check standing between a poisoned download and the endpoint.
Attack chain
From a defender's perspective, the intrusion chain is straightforward, which is precisely why it works:
- Compromise of the distribution channel. Attackers gain control of (or modify content served by) the official download path for Q-Dir and DesktopOK.
- Trojanized installer execution. A victim downloads and runs what they believe is the legitimate utility. Because these tools are portable, "installation" is simply running the executable — often with the user's trust and, on admin machines, elevated privileges.
- Python RAT staging. The trojanized build drops a Python interpreter/runtime plus a malicious Python payload, typically into a user-writable location such as
%APPDATA%,%LOCALAPPDATA%, or%TEMP%, and executes it — frequently viapython.exeorpythonw.exewith a script path argument. - Persistence and C2. The RAT establishes persistence (a Run key, scheduled task, or startup folder entry) and opens outbound command-and-control over HTTP/HTTPS, giving the operator remote shell access, file theft, and staging capability for follow-on payloads.
The choice of a Python-based RAT is tactically significant. Python payloads are trivial to modify (defeating hash-based reputation), run on a legitimate signed interpreter (defeating naive application-control rules), and their traffic blends with legitimate developer and automation tooling. On endpoints with no legitimate Python use, however, this is a gift for defenders — the signal is loud.
Exploitation status
- Confirmed active distribution in the wild. This is not a theoretical or PoC condition — trojanized installers were served through the official channel to real users.
- No CVE applies. Supply-chain compromise of a download channel is not a CVE-trackable vulnerability; do not waste time looking for an identifier. The remediation is removal and verification, not patching.
- Attribution: Not yet publicly attributed to a named actor group at the time of writing. Treat C2 infrastructure and staging paths as the pivot points, not actor folklore.
Detection & Response
Sigma Rules
---
title: Trojanized Q-Dir or DesktopOK Installer Spawning Scripting Interpreter
id: 3f8c2a71-6d4e-4b9a-9c21-8e7f5a2b1d34
status: experimental
description: Detects Q-Dir or DesktopOK executables spawning Python or other scripting interpreters, consistent with trojanized installers staging a Python RAT.
references:
- https://www.bleepingcomputer.com/news/security/q-dir-and-desktopok-windows-utilities-compromised-to-push-python-rat/
- https://attack.mitre.org/techniques/T1059/
author: Security Arsenal
date: 2026/04/10
tags:
- attack.execution
- attack.t1059.006
logsource:
category: process_creation
product: windows
detection:
selection_parent:
ParentImage|endswith:
- '\Q-Dir.exe'
- '\Q-Dir_x64.exe'
- '\DesktopOK.exe'
selection_child:
Image|endswith:
- '\python.exe'
- '\pythonw.exe'
- '\powershell.exe'
- '\cmd.exe'
- '\wscript.exe'
- '\cscript.exe'
- '\mshta.exe'
condition: selection_parent and selection_child
falsepositives:
- None expected; these utilities have no legitimate reason to spawn scripting interpreters
level: high
---
title: Python Interpreter Executing from User-Writable Directory
id: 9a1b4e65-2c7d-4f83-b6a0-5d9c3e7f8210
status: experimental
description: Detects python.exe or pythonw.exe running from user-writable paths such as AppData, Temp, or Downloads, a common staging pattern for Python-based RATs dropped by trojanized installers.
references:
- https://www.bleepingcomputer.com/news/security/q-dir-and-desktopok-windows-utilities-compromised-to-push-python-rat/
- https://attack.mitre.org/techniques/T1059/006/
author: Security Arsenal
date: 2026/04/10
tags:
- attack.execution
- attack.t1059.006
logsource:
category: process_creation
product: windows
detection:
selection_img:
Image|endswith:
- '\python.exe'
- '\pythonw.exe'
selection_path:
Image|contains:
- '\AppData\'
- '\Temp\'
- '\Downloads\'
- '\Public\'
- '\ProgramData\'
filter_legit:
Image|contains:
- '\AppData\Local\Programs\Python\'
- '\AppData\Local\Microsoft\WindowsApps\'
condition: selection_img and selection_path and not filter_legit
falsepositives:
- Portable Python distributions or developer tooling run from user directories
- Legitimate bundled Python in third-party applications under ProgramData
level: high
---
title: Persistence Created for Python Payload in User Context
id: c4d7e2f1-8a3b-4c96-a1d5-7f2b9e603418
status: experimental
description: Detects registry Run key or startup persistence pointing to a Python interpreter or Python script in a user-writable location, consistent with Python RAT persistence.
references:
- https://www.bleepingcomputer.com/news/security/q-dir-and-desktopok-windows-utilities-compromised-to-push-python-rat/
- https://attack.mitre.org/techniques/T1547/001/
author: Security Arsenal
date: 2026/04/10
tags:
- attack.persistence
- attack.t1547.001
logsource:
category: registry_set
product: windows
detection:
selection_key:
TargetObject|contains:
- '\CurrentVersion\Run\'
- '\CurrentVersion\RunOnce\'
selection_value:
Details|contains:
- 'python.exe'
- 'pythonw.exe'
- '.pyw'
- '.py'
condition: selection_key and selection_value
falsepositives:
- Rare; legitimate software does not typically persist Python scripts via Run keys
level: critical
KQL (Microsoft Sentinel / Defender)
// Hunt for trojanized Q-Dir/DesktopOK activity staging a Python RAT
// Part 1: Utility binaries spawning scripting interpreters
DeviceProcessEvents
| where TimeGenerated > ago(14d)
| where InitiatingProcessFileName has_any ("Q-Dir.exe", "Q-Dir_x64.exe", "DesktopOK.exe")
or FileName has_any ("Q-Dir.exe", "Q-Dir_x64.exe", "DesktopOK.exe")
| where FileName has_any ("python.exe", "pythonw.exe", "powershell.exe", "cmd.exe", "mshta.exe", "wscript.exe", "cscript.exe")
or InitiatingProcessFileName has_any ("python.exe", "pythonw.exe", "powershell.exe", "cmd.exe", "mshta.exe", "wscript.exe", "cscript.exe")
| project TimeGenerated, DeviceName, AccountName, InitiatingProcessFileName, InitiatingProcessCommandLine,
FileName, ProcessCommandLine, FolderPath, SHA256
| order by TimeGenerated desc;
// Part 2: Python interpreters executing from user-writable directories
DeviceProcessEvents
| where TimeGenerated > ago(14d)
| where FileName in~ ("python.exe", "pythonw.exe")
| where FolderPath has_any ("\\AppData\\", "\\Temp\\", "\\Downloads\\", "\\Public\\", "\\ProgramData\\")
| where FolderPath !has "\\AppData\\Local\\Programs\\Python\\"
| project TimeGenerated, DeviceName, AccountName, FileName, ProcessCommandLine, FolderPath, InitiatingProcessFileName, SHA256;
// Part 3: Outbound network connections from Python on endpoints running these utilities
DeviceNetworkEvents
| where TimeGenerated > ago(14d)
| where InitiatingProcessFileName in~ ("python.exe", "pythonw.exe")
| where RemoteUrl !has_any ("pypi.org", "python.org", "microsoft.com", "azure.com")
| summarize ConnectionCount = count(),
DistinctDestinations = dcount(RemoteIP),
FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
by DeviceName, AccountName, InitiatingProcessFolderPath, RemoteIP, RemoteUrl, RemotePort
| order by FirstSeen asc
Velociraptor VQL
-- Hunt for Python RAT staging and persistence on endpoints with Q-Dir or DesktopOK
-- Part 1: Suspicious Python processes and their parentage
SELECT Pid, Name, CommandLine, Exe, Username, CreateTime,
_processes.ParentPid as ParentPid
FROM pslist()
WHERE (Name =~ 'python(w)?\.exe' OR Exe =~ '(?i)python(w)?\.exe')
AND Exe =~ '(?i)(AppData|Temp|Downloads|Public|ProgramData)'
AND Exe !~ '(?i)AppData\\Local\\Programs\\Python'
-- Part 2: Persistence artifacts referencing Python payloads
SELECT Name, FullPath, Mtime, Size, Data.value AS PersistenceValue
FROM glob(glob='C:/Users/*/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/*')
WHERE PersistenceValue =~ '(?i)python' OR FullPath =~ '(?i)\.(py|pyw)$'
-- Part 3: Network connections from Python interpreters in non-standard paths
SELECT Pid, Name, Path, State, LocalAddr, LocalPort, RemoteAddr, RemotePort
FROM netstat()
WHERE Name =~ '(?i)python(w)?\.exe'
AND Path =~ '(?i)(AppData|Temp|Downloads|Public|ProgramData)'
Remediation Script
# Remove-CompromisedUtility.ps1
# Remediation for trojanized Q-Dir / DesktopOK (Python RAT) compromise.
# Run elevated on suspect endpoints. Test in audit mode (-AuditOnly) first.
param([switch]$AuditOnly)
$report = [System.Collections.Generic.List[object]]::new()
# --- 1. Locate Q-Dir and DesktopOK binaries outside expected install paths ---
$utilityPaths = @()
foreach ($root in @("$env:LOCALAPPDATA", "$env:APPDATA", "$env:TEMP", "C:\Users\Public", "$env:USERPROFILE\Downloads")) {
if (Test-Path $root) {
$utilityPaths += Get-ChildItem -Path $root -Recurse -File -ErrorAction SilentlyContinue |
Where-Object { $_.Name -match '^(Q-Dir(_x64)?|DesktopOK)\.exe$' }
}
}
foreach ($f in $utilityPaths) {
$hash = (Get-FileHash -Path $f.FullName -Algorithm SHA256).Hash
$sig = Get-AuthenticodeSignature -FilePath $f.FullName
$report += [pscustomobject]@{ Artifact='UtilityBinary'; Path=$f.FullName; SHA256=$hash; SignatureStatus=$sig.Status }
if (-not $AuditOnly -and $sig.Status -ne 'Valid') {
# Quarantine: rename rather than delete to preserve forensic evidence
Rename-Item -Path $f.FullName -NewName "$($f.Name).quarantined" -Force
}
}
# --- 2. Kill Python processes running from user-writable directories ---
$badPython = Get-Process -Name 'python','pythonw' -ErrorAction SilentlyContinue |
Where-Object { $_.Path -match 'AppData|Temp|Downloads|Public|ProgramData' -and
$_.Path -notmatch 'AppData\\Local\\Programs\\Python' }
foreach ($p in $badPython) {
$report += [pscustomobject]@{ Artifact='SuspiciousPythonProcess'; Path=$p.Path; SHA256=''; SignatureStatus="PID=$($p.Id)" }
if (-not $AuditOnly) { Stop-Process -Id $p.Id -Force }
}
# --- 3. Audit and remove persistence pointing at Python payloads ---
$runKeys = @('HKCU:\Software\Microsoft\Windows\CurrentVersion\Run',
'HKCU:\Software\Microsoft\Windows\CurrentVersion\RunOnce',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Run',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\RunOnce')
foreach ($key in $runKeys) {
if (Test-Path $key) {
$props = Get-ItemProperty -Path $key
foreach ($name in ($props.PSObject.Properties.Name | Where-Object { $_ -notmatch '^PS' })) {
if ($props.$name -match '(?i)python|\.pyw?\b') {
$report += [pscustomobject]@{ Artifact='Persistence'; Path="$key\$name"; SHA256=''; SignatureStatus=$props.$name }
if (-not $AuditOnly) { Remove-ItemProperty -Path $key -Name $name -Force }
}
}
}
}
# --- 4. Audit scheduled tasks invoking Python ---
Get-ScheduledTask | ForEach-Object {
$actions = $_.Actions | Where-Object { $_.Execute -match '(?i)python(w)?\.exe' }
if ($actions) {
$report += [pscustomobject]@{ Artifact='ScheduledTask'; Path=$_.TaskName; SHA256=''; SignatureStatus=$actions.Execute }
if (-not $AuditOnly) { Unregister-ScheduledTask -TaskName $_.TaskName -Confirm:$false }
}
}
# --- 5. Report ---
if ($report.Count -gt 0) {
$report | Format-Table -AutoSize
$report | Export-Csv -Path "$env:TEMP\QDirDesktopOK_Remediation_$((Get-Date).ToString('yyyyMMdd_HHmmss')).csv" -NoTypeInformation
Write-Warning "Suspicious artifacts found. Treat host as compromised: collect memory/triage image before rebuilding."
} else {
Write-Output "No Q-Dir/DesktopOK trojanized-installer artifacts detected."
}
Remediation
This incident has no patch and no CVE — remediation is about removing the poisoned software, eradicating the RAT, and restoring trust in your software supply chain.
- Inventory and isolate. Use your EDR/software inventory to enumerate every endpoint with Q-Dir or DesktopOK installed or present (including portable copies in Downloads, Desktop, and USB-synced folders). Isolate any host where the binary was executed during the compromise window pending triage.
- Verify provenance. Do not re-download Q-Dir or DesktopOK until the vendor confirms the distribution channel is clean and you have validated installer hashes or signatures against vendor-published values. Pull all existing copies into quarantine and hash them; submit unknown hashes to your sandbox or VirusTotal.
- Eradicate the RAT. Remove persistence (Run keys, scheduled tasks, Startup folder), kill rogue Python processes, and delete the staged interpreter and payload directories. Given that a RAT implies interactive access, assume credential theft: reset credentials used on the host and review adjacent lateral movement.
- Rebuild when in doubt. Because RATs frequently stage secondary payloads, any host that executed the trojanized installer should be reimaged rather than merely cleaned if your IR timeline cannot conclusively scope the intrusion.
- Harden against the next one. Block portable/unsigned executables from running in user-writable paths via WDAC or AppLocker; restrict Python interpreter execution to approved paths (a WDAC rule limiting
python.exetoC:\Program Files\Python*and sanctioned venvs is high-value and low-friction); and require that freeware utilities enter your environment through a vetted software catalog rather than ad-hoc downloads. - Monitor and alert. Deploy the Sigma rules and KQL hunts above, alert on Python spawning from user-writable directories, and treat the Q-Dir/DesktopOK filenames as watchlist items in your process-creation telemetry until the vendor situation is resolved.
- Track vendor communications. Monitor the vendor's official site and the original reporting (https://www.bleepingcomputer.com/news/security/q-dir-and-desktopok-windows-utilities-compromised-to-push-python-rat/) for confirmed-clean installer hashes, the scope of the compromise window, and any updated IOCs.
Related Resources
Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub
Is your security operations ready?
Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.