PywerView supports Kerberos authentication so you can leverage existing TGTs or TGSs stored in a ccache file rather than passing plaintext passwords or NTLM hashes. This is particularly useful in engagements where you have captured a ticket with tools like Impacket’sDocumentation 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.
getTGT.py or Rubeus and want to reuse it from a Linux host. Kerberos support is partial and relies on a mixed architecture: LDAP commands use ldap3 with gssapi, while SMB/RPC commands use impacket — each with subtly different SPN requirements that you must account for.
How It Works
PywerView reads Kerberos credentials from the file pointed to by theKRB5CCNAME environment variable. If the ccache file contains a TGS for the target service, that ticket is presented directly. If it contains only a TGT, gssapi (for LDAP commands) or impacket (for SMB/RPC commands) will request a TGS automatically.
Setup and Usage
Obtain a Kerberos ticket
Acquire a TGT or TGS for your target using your preferred method — e.g.,
Example output:
getTGT.py from Impacket, kinit, or export from a Windows machine.
Verify the ticket contents with klist:Export KRB5CCNAME
Point the environment variable at your ccache file. You can export it for
the shell session or prefix it inline on each command:
SPN Compatibility
PywerView’s mixedldap3 + impacket architecture creates different SPN requirements depending on the command type.
- LDAP commands (e.g.,
get-netuser,get-netcomputer) useldap3withgssapi. Thegssapilibrary requires the full hostname in the SPN — it cannot resolve tickets that use a short hostname. - SMB/RPC commands (e.g.,
get-localdisks,get-netsession) useimpacketand are more lenient: tickets with an incomplete hostname SPN work, as long as--computernamematches the short name in the SPN.
| SPN in the ticket | LDAP commands | SMB/RPC commands |
|---|---|---|
ldap/srv-ad.contoso.com@CONTOSO.COM | ✔️ | ✔️ |
cifs/srv-ad.contoso.com@CONTOSO.COM | ✔️ | ✔️ |
ldap/srv-ad@CONTOSO.COM | ❌ | ✔️ |
--computername to the short name in the SPN:
SPN patching is not yet implemented. PywerView cannot rewrite SPNs on the
fly. If your ccache contains a ticket with a short hostname SPN and you need
to run an LDAP command, you must obtain a new ticket with the full FQDN in the
SPN (e.g.,
ldap/srv-ad.contoso.com@CONTOSO.COM). The same limitation
applies to TGTs: krbtgt/srv-ad.contoso.com@CONTOSO.COM will work, but
krbtgt/srv-ad@CONTOSO.COM will not for LDAP functions.