Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/the-useless-one/pywerview/llms.txt

Use this file to discover all available pages before exploring further.

get-netsession queries a target Windows machine via the NetSessionEnum RPC call to retrieve a list of all currently active SMB sessions. The results include the username of each connected client, the client’s IP address or hostname, session time, and idle time. This is particularly useful during lateral movement reconnaissance to discover which users are currently interacting with a specific host, potentially revealing privileged sessions worth targeting. Local credentials can be used in place of domain credentials.

Flags

--computername
string
required
IP address or hostname of the target Windows host to query for active sessions.
-w, --workgroup
string
Name of the domain to authenticate with. Can be omitted when using local credentials.
-u, --user
string
Username for authentication. Accepts both domain and local accounts.
-p, --password
string
Password associated with the specified username.
--hashes
string
NTLM hashes for pass-the-hash authentication. Format: [LMHASH:]NTHASH. The LM portion can be omitted or replaced with the empty LM hash.
-k
boolean
Use Kerberos authentication. Reads credentials from the ccache file pointed to by KRB5CCNAME. Falls back to the provided username and password if no valid ticket is found.
-l, --logging-level
string
Logging verbosity sent to stderr. Choices: CRITICAL (default), WARNING, DEBUG, ULTRA.
--json
boolean
Print results as JSON instead of the default human-readable format.

Examples

# List active sessions on a host using domain credentials
pywerview get-netsession --computername 192.168.1.10 -u alice -p 'P@ssw0rd' -w contoso.com

# Pass-the-hash authentication
pywerview get-netsession --computername 192.168.1.10 -u alice --hashes :aad3b435b51404eeaad3b435b51404ee -w contoso.com

# Using local credentials
pywerview get-netsession --computername 192.168.1.10 -u Administrator -p 'LocalP@ss'

# JSON output
pywerview get-netsession --computername 192.168.1.10 -u alice -p 'P@ssw0rd' -w contoso.com --json

Build docs developers (and LLMs) love