Ceplin Command Identifier

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

Opens the identifier with your command. It is read in your browser and sent nowhere.

How query.exe is abused

documented by LOLBAS

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

from LOLBAS, each read by the identifier

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 user
Identify

The 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

Sigma process creation rules
mediumQuery Usage To Exfil DataNasreddine Bencherchali (Nextron Systems)
highExploited CVE-2020-10189 Zoho ManageEngineFlorian Roth (Nextron Systems)
highSuspicious Shells Spawn by Java Utility KeytoolAndreas Hunkeler (@Karneades)
highSuspicious Processes Spawned by Java.EXEAndreas Hunkeler (@Karneades), Florian Roth
highSuspicious Spool Service Child ProcessJustin C. (@endisphotic), @dreadphones (detection), Thomas Patzke (Sigma rule)
highSuspicious Process By Web Server ProcessThomas Patzke, Florian Roth (Nextron Systems), Zach Stanford @svch0st, Tim Shelton, Nasreddine Bencherchali (Nextron Systems)
T1218System Binary Proxy Execution

Is it the real query.exe?

file version info and known copies
Installed inC:\Windows\system32\
C:\Windows\SysWOW64\
Signed byMicrosoft Windows
ProductMicrosoft Windows Operating System, Microsoft Corporation
DescriptionMultiUser Query Utility

9 known copies

10.0.22000.1 (WinBuild.160101.0800) · C:\WINDOWS\system32\query.exe · signed by Microsoft Windows

c02f3831375bda955f13909985faf5987b14968ae5a19f6128e407649aa3dd66

10.0.19041.1 (WinBuild.160101.0800) · C:\Windows\system32\query.exe · signed by Microsoft Windows

58d1132b636c6d33c2b8b3659f310f6de370a00f837226129657b2b82184a307

10.0.18362.1 (WinBuild.160101.0800) · C:\WINDOWS\system32\query.exe · signed by Microsoft Windows

e0655b492ca255745d122caa2a1147ae01554ca5ae2f53454863d6706d667910

10.0.17763.1 (WinBuild.160101.0800) · C:\Windows\system32\query.exe · signed by Microsoft Windows

3369e8fea09c3c226d636b13108da357093d0d98214236417839a94f56d3ba02

10.0.17763.1 (WinBuild.160101.0800) · C:\Windows\SysWOW64\query.exe · signed by Microsoft Windows

856ea448ce7e099496a0c9d7783fffd2a28e9f1f931d2146714ab7640c39bada

10.0.14393.0 (rs1_release.160715-1616) · C:\Windows\system32\query.exe · signed by Microsoft Windows

0141b31c3583fc37d82b2506d0806e2060d34b89cd507a329a69162f435a8ce0

10.0.14393.0 (rs1_release.160715-1616) · C:\Windows\SysWOW64\query.exe · signed by Microsoft Windows

d934e8742dbd682e7ba5abbecca7c31e7ed064ac7106fda11e1cfbad49fbe71b

6.3.9600.16384 (winblue_rtm.130821-1623) · C:\windows\system32\query.exe · not signed

92ed947190266c70211d216fe8ac642f43e4113a9dd31745f0a670530172fbab

6.3.9600.16384 (winblue_rtm.130821-1623) · C:\windows\SysWOW64\query.exe · not signed

dff9bb9e1792c24432db6d3b3272e8f480432711955cea3385d8943ac1cd558f

From 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

from tldr-pages, CC BY 4.0

Display all user sessions

query sessionIdentify

Display the current user sessions on a remote computer

query session /server:hostnameIdentify
/serverIdentifies the rd Session Host server to query. Windows commands reference

Display logged in users

query userIdentify

Matches LOLBAS abuse: Execute (T1218)

Of the 3 examples the identifier reads, 1 matches LOLBAS abuse or trips a Sigma process-creation rule.