By default, PywerView connects to the domain controller over plain LDAP on port 389. TheDocumentation 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.
--tls flag overrides this and forces all LDAP traffic through an encrypted LDAPS connection on port 636. This matters for two concrete scenarios: retrieving Group Managed Service Account (gMSA) managed passwords, where the domain controller refuses to return the msds-managedpassword attribute over an unencrypted channel, and certificate-based (SChannel) authentication, where --tls determines whether PywerView uses a direct LDAPS connection or falls back to StartTLS with an EXTERNAL SASL bind.
When to Use --tls
1. Retrieving gMSA Managed Passwords
Theget-netgmsa command can enumerate Group Managed Service Accounts. However, the sensitive msds-managedpassword attribute is only returned when the connection is made over TLS. Without --tls, the field is silently absent from the output.
Without --tls — managed password not returned:
--tls — managed password present:
2. Certificate (SChannel) Authentication
When you pass--cert and --key for SChannel authentication, --tls controls how PywerView establishes the authenticated session:
- Without --tls (StartTLS)
- With --tls (LDAPS)
PywerView connects to LDAP port 389, upgrades the connection with
StartTLS, then performs an
EXTERNAL SASL bind presenting your certificate.
This follows the
Microsoft MS-ADTS specification.
Use this mode if your DC has StartTLS enabled and port 636 is not accessible.LDAP Signing and Channel Binding
If the domain controller enforces LDAP Signing or LDAP Channel
Binding, standard This package is
ldap3 will fall back to simple (unauthenticated-level)
authentication and may be rejected. To work against DCs with these policies
enabled, install the ldap3-bleeding-edge fork:ldap3 2.10.1 plus six pending pull requests that add signing
and channel binding support. PywerView automatically detects and uses it when
present. You can confirm it is active by enabling debug logging with -l DEBUG.
Without it, PywerView silently falls back to simple authentication, which will
be rejected by hardened DCs.