qwinsta.exe

  • File Path: C:\Windows\system32\qwinsta.exe
  • Description: Query Session Utility

Hashes

Type Hash
MD5 9322C72AB11E725B098552A5FAE0F655
SHA1 C47948B8701E1197AC582C50F5E1D1A74607285F
SHA256 E1AE2EC83FEC0C8CF01B9E4C3DA910BE61ABF3071E56EDA834590C405E8E4E69
SHA384 70006E1A37A607F00F63B1222671653C4FF5BDAD6B98DD81DBDE1F88DD7AE585F71509FFCBDE1958CF23197371E428D1
SHA512 C11682E2229B4A2E7EC2FD1FE2FA4A988109D4743373C5530D7BC45EDB75B78541993B948DA08A63FEF894AC3D8AAA37575F2CF485191AE66BFE235C0DDF5EBD
SSDEEP 768:xLqMld2QHrlnu6X5rJZc1l3SCAKK8rPXugLxVay:0dsBNX5rjGP6y
IMP 45B4A06EB57D86287767753D3ED73862
PESHA1 CC77569004C78AC0FC628B1AC7ED6987BABDCAEE
PE256 EC16345A41095FB4A8A3E7B2C26F06B6A149788D23B73B15D44AEEA30853F759

Runtime Data

Usage (stdout):

Display information about Remote Desktop Services sessions.

QUERY SESSION [sessionname | username | sessionid]
              [/SERVER:servername] [/MODE] [/FLOW] [/CONNECT] [/COUNTER] [/VM]

  sessionname         Identifies the session named sessionname.
  username            Identifies the session with user username.
  sessionid           Identifies the session with ID sessionid.
  /SERVER:servername  The server to be queried (default is current).
  /MODE               Display current line settings.
  /FLOW               Display current flow control settings.
  /CONNECT            Display current connect settings.
  /COUNTER            Display current Remote Desktop Services counters information.
  /VM                 Display information about sessions within virtual machines.


Usage (stderr):

Invalid parameter(s)
Display information about Remote Desktop Services sessions.

QUERY SESSION [sessionname | username | sessionid]
              [/SERVER:servername] [/MODE] [/FLOW] [/CONNECT] [/COUNTER] [/VM]

  sessionname         Identifies the session named sessionname.
  username            Identifies the session with user username.
  sessionid           Identifies the session with ID sessionid.
  /SERVER:servername  The server to be queried (default is current).
  /MODE               Display current line settings.
  /FLOW               Display current flow control settings.
  /CONNECT            Display current connect settings.
  /COUNTER            Display current Remote Desktop Services counters information.
  /VM                 Display information about sessions within virtual machines.


Signature

  • Status: Signature verified.
  • Serial: 33000001C422B2F79B793DACB20000000001C4
  • Thumbprint: AE9C1AE54763822EEC42474983D8B635116C8452
  • Issuer: CN=Microsoft Windows Production PCA 2011, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
  • Subject: CN=Microsoft Windows, O=Microsoft Corporation, L=Redmond, S=Washington, C=US

File Metadata

  • Original Filename: qwinsta.exe.mui
  • Product Name: Microsoft Windows Operating System
  • Company Name: Microsoft Corporation
  • File Version: 10.0.17763.1 (WinBuild.160101.0800)
  • Product Version: 10.0.17763.1
  • Language: English (United States)
  • Legal Copyright: Microsoft Corporation. All rights reserved.
  • Machine Type: 64-bit

File Scan

  • VirusTotal Detections: 0/72
  • VirusTotal Link: https://www.virustotal.com/gui/file/e1ae2ec83fec0c8cf01b9e4c3da910be61abf3071e56eda834590c405e8e4e69/detection/

File Similarity (ssdeep match)

File Score
C:\WINDOWS\system32\qwinsta.exe 74

Possible Misuse

The following table contains possible examples of qwinsta.exe being misused. While qwinsta.exe is not inherently malicious, its legitimate functionality can be abused for malicious purposes.

Source Source File Example License
sigma apt_silence_downloader_v3.yml - '\qwinsta.exe' DRL 1.0
sigma proc_creation_win_local_system_owner_account_discovery.yml - '\qwinsta.exe' DRL 1.0
sigma proc_creation_win_multiple_suspicious_cli.yml - qwinsta.exe DRL 1.0
atomic-red-team T1033.md qwinsta.exe /server:#{computer_name} MIT License. © 2018 Red Canary
atomic-red-team T1033.md qwinsta.exe MIT License. © 2018 Red Canary
atomic-red-team T1033.md for /F “tokens=1,2” %i in (‘qwinsta /server:#{computer_name} ^| findstr “Active Disc”’) do @echo %i | find /v “#” | find /v “console” || echo %j > computers.txt MIT License. © 2018 Red Canary
atomic-red-team T1033.md @FOR /F %n in (computers.txt) DO @FOR /F “tokens=1,2” %i in (‘qwinsta /server:%n ^| findstr “Active Disc”’) do @echo %i | find /v “#” | find /v “console” || echo %j > usernames.txt MIT License. © 2018 Red Canary

Additional Info*

*The information below is copied from MicrosoftDocs, which is maintained by Microsoft. Available under CC BY 4.0 license.


qwinsta

Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

Displays information about sessions on a Remote Desktop Session Host server. The list includes information not only about active sessions but also about other sessions that the server runs.

[!NOTE] This command is the same as the query session command. To find out what’s new in the latest version, see What’s New in Remote Desktop Services in Windows Server.

Syntax

qwinsta [<sessionname> | <username> | <sessionID>] [/server:<servername>] [/mode] [/flow] [/connect] [/counter]

Parameters

Parameter Description
<sessionname> Specifies the name of the session that you want to query.
<username> Specifies the name of the user whose sessions you want to query.
<sessionID> Specifies the ID of the session that you want to query.
/server:<servername> Identifies the rd Session Host server to query. The default is the current server.
/mode Displays current line settings.
/flow Displays current flow-control settings.
/connect Displays current connect settings.
/counter Displays current counters information, including the total number of sessions created, disconnected, and reconnected.
/? Displays help at the command prompt.
Remarks
  • A user can always query the session to which the user is currently logged on. To query other sessions, the user must have special access permission.

  • If you don’t specify a session using the <username>, <sessionname>, or sessionID parameters, this query will display information about all active sessions in the system.

  • When qwinsta returns information, a greater than (>) symbol is displayed before the current session. For example:

      C:\>qwinsta
          SESSIONNAME     USERNAME        ID STATE    TYPE    DEVICE
          console         Administrator1  0 active    wdcon
          >rdp-tcp#1      User1           1 active    wdtshare
          rdp-tcp                         2 listen    wdtshare
                                          4 idle
                                          5 idle
    

    Where:

    • SESSIONNAME specifies the name assigned to the session.
    • USERNAME indicates the user name of the user connected to the session.
    • STATE provides information about the current state of the session.
    • TYPE indicates the session type.
    • DEVICE, which isn’t present for the console or network-connected sessions, is the device name assigned to the session.
    • Any sessions in which the initial state is configured as DISABLED won’t show up in the qwinsta list until they’re enabled.

Examples

To display information about all active sessions on server Server2, type:

qwinsta /server:Server2

To display information about active session modeM02, type:

qwinsta modeM02

Additional References


MIT License. Copyright (c) 2020-2021 Strontic.