Identifier / Programs / Windows
query.exe
Displays information about processes, sessions, and Remote Desktop Session Host servers. Windows commands reference
LOLBAS Execute 7 Sigma rules name it 1 ATT&CK technique 1 documented command 9 known copies with hashes
How query.exe is abused
Execute T1218 System Binary Proxy Execution
user
Each abuse is LOLBAS's category and the options and words it uses; the full write-up is on LOLBAS's page for query.exe.
1 documented command
Execute T1218 System Binary Proxy Execution User privileges
Once executed, query.exe will execute quser.exe in the same folder. Thus, if query.exe is copied to a folder and an arbitrary executable is renamed to quser.exe, query.exe will spawn it. Instead of user, it is also possible to use session, termsession or process as command-line option.
query.exe userIdentifyThe command the identifier reads trips no Sigma process-creation rule. These commands and their descriptions are from LOLBAS’s entry for query.exe, by Idan Lerman, at commit 2056cb766250 of 2026-09-26, under the GPL-3.0 and LOLBAS’s notice, with no warranty. Changed: Markdown is shown formatted. The source is in lolbas-gtfobins-commands.json.gz, and the full entry is on LOLBAS’s page for query.exe. The identifier reads it with LOLBAS’s placeholders filled in: a URL as https://example.com/file, a share as \\192.0.2.10\share\file, a path as C:\Data\file and a command as calc.exe.
What detects it
Is it the real query.exe?
C:\Windows\system32\C:\Windows\SysWOW64\9 known copies
10.0.22000.1 (WinBuild.160101.0800) · C:\WINDOWS\system32\query.exe · signed by Microsoft Windows
c02f3831375bda955f13909985faf5987b14968ae5a19f6128e407649aa3dd6610.0.19041.1 (WinBuild.160101.0800) · C:\Windows\system32\query.exe · signed by Microsoft Windows
58d1132b636c6d33c2b8b3659f310f6de370a00f837226129657b2b82184a30710.0.18362.1 (WinBuild.160101.0800) · C:\WINDOWS\system32\query.exe · signed by Microsoft Windows
e0655b492ca255745d122caa2a1147ae01554ca5ae2f53454863d6706d66791010.0.17763.1 (WinBuild.160101.0800) · C:\Windows\system32\query.exe · signed by Microsoft Windows
3369e8fea09c3c226d636b13108da357093d0d98214236417839a94f56d3ba0210.0.17763.1 (WinBuild.160101.0800) · C:\Windows\SysWOW64\query.exe · signed by Microsoft Windows
856ea448ce7e099496a0c9d7783fffd2a28e9f1f931d2146714ab7640c39bada10.0.14393.0 (rs1_release.160715-1616) · C:\Windows\system32\query.exe · signed by Microsoft Windows
0141b31c3583fc37d82b2506d0806e2060d34b89cd507a329a69162f435a8ce010.0.14393.0 (rs1_release.160715-1616) · C:\Windows\SysWOW64\query.exe · signed by Microsoft Windows
d934e8742dbd682e7ba5abbecca7c31e7ed064ac7106fda11e1cfbad49fbe71b6.3.9600.16384 (winblue_rtm.130821-1623) · C:\windows\system32\query.exe · not signed
92ed947190266c70211d216fe8ac642f43e4113a9dd31745f0a670530172fbab6.3.9600.16384 (winblue_rtm.130821-1623) · C:\windows\SysWOW64\query.exe · not signed
dff9bb9e1792c24432db6d3b3272e8f480432711955cea3385d8943ac1cd558fFrom the file’s version info and the copies recorded by xCyclopedia (MIT). A copy in another folder, signed by someone else or with another hash is not necessarily malicious, but it is worth a closer look. In Ceplin, "<sha256>".whatis() says which known copy a hash is.
Everyday use
Display all user sessions
query sessionIdentifyDisplay the current user sessions on a remote computer
query session /server:hostnameIdentify/serverIdentifies the rd Session Host server to query. Windows commands referenceOf the 3 examples the identifier reads, 1 matches LOLBAS abuse or trips a Sigma process-creation rule.