LOLBAS. GitHub
LIVING OFF THE LAND / OS BINARIES

Query.exe

View source

Remote Desktop Services MultiUser Query Utility

01COMMAND EXAMPLES
01ATT&CK TECHNIQUES
00DETECTION RESOURCES
01CAPABILITIES
01 / TRADECRAFT

Command reference

1 examples

Execute1

EXAMPLE 01T1218

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.

COMMAND
query.exe user
USE CASE
Execute an arbitrary executable via trusted system executable.
PRIVILEGES
User
OPERATING SYSTEM
Windows 10, Windows 11
Execute · EXERequires · Rename
02 / ON DISK

Known paths

c:\windows\system32\query.exe
c:\windows\syswow64\query.exe
03 / DEFENSIVE INTELLIGENCE

Detection & indicators

0 resources

Indicators & detection notes

  • IOC

    query.exe being executed and executes a child process outside of its normal path of c:\windows\system32\ or c:\windows\syswow64\

COMMUNITY RESEARCH

Acknowledgements

Idan Lerman@IdanLerman