Skip to content
KitploitKITPLOIT
HerramientasBlog
Log in
Enviar
HerramientasBlog
Enviar

¡Herramientas de Hacking, PenTest y Ciberseguridad para tu Arsenal de Seguridad!

Kitploit es un directorio de herramientas de hacking, ciberseguridad y pentesting. Descubre las últimas actualizaciones de proyectos para encontrar vulnerabilidades, analizar sistemas, automatizar pruebas y fortalecer tu seguridad.

FeedsContactoPrivacidad© 2026 Kitploit

Directorio de Herramientas

Categorías

Ver todas las categorías
Loading categories
pywhisker — Versión en Python de la herramienta C# para ataques de "Shadow Credentials" | Kitploit
Herramientas/GitHubGitHub/shutdownrepo/pywhisker
Escalada de PrivilegiosExplotaciónPruebas de PenetraciónAutenticación
GitHubshutdownrepo/pywhisker

pywhisker

Versión en Python de la herramienta C# para ataques de "Shadow Credentials"

Ver Repositorio
92210712hace 3 mesesRevisado por Kitploit

Más Populares

Ver todos →

Descubre las herramientas más usadas por nuestra comunidad.

Explora todas las herramientas

Explora nuestra colección de herramientas

Ver todas las herramientas →
Compartir

pyWhisker

pyWhisker es un equivalente en Python del Whisker original creado por Elad Shamir y escrito en C#. Esta herramienta permite a los usuarios manipular el atributo msDS-KeyCredentialLink de un usuario/equipo objetivo para obtener control total sobre ese objeto. Se basa en Impacket y en un equivalente en Python de DSInternals de Michael Grafnetter, llamado PyDSInternals creado por podalirius. Esta herramienta, junto con PKINITtools de Dirk-jan, permiten una explotación primitiva completa en sistemas basados en UNIX.

Requisitos previos para este ataque son los siguientes:

  1. El nivel funcional del dominio objetivo debe ser Windows Server 2016 o superior.
  2. El dominio objetivo debe tener al menos un Controlador de Dominio que ejecute Windows Server 2016 o superior.
  3. El Controlador de Dominio a utilizar durante el ataque debe tener su propio certificado y claves (esto significa que la organización debe tener AD CS, o una PKI, una CA o algo similar).
  4. El atacante debe tener control sobre una cuenta capaz de escribir el atributo msDs-KeyCredentialLink de la cuenta de usuario o equipo objetivo.

¿Por qué algunos prerequisitos?

  • Prerequisitos 1 y 2 porque las características de PKINIT se introdujeron con Windows Server 2016.
  • Prerequisito 3 porque el DC necesita su propio certificado y claves para el intercambio de claves de sesión durante la transacción AS_REQ <-> AS_REP.

Se generará un KRB-ERROR (16) : KDC_ERR_PADATA_TYPE_NOSUPP si no se cumple el prerequisito 3.

Más información sobre esta primitiva de "Shadow Credentials":

  • Shadow Credentials: Abusing Key Trust Account Mapping for Takeover
  • The Hacker Recipes - ACEs and DACL abuse
  • The Hacker Recipes - Shadow Credentials

Uso

pyWhisker se puede utilizar para realizar varias acciones sobre el atributo msDs-KeyCredentialLink de un objetivo:

  • list: listar todos los ID de KeyCredentials actuales y la hora de creación
  • add: añadir un nuevo KeyCredential a msDs-KeyCredentialLink
  • spray: rociar añadiendo un nuevo KeyCredential a msDs-KeyCredentialLink
  • remove: eliminar un KeyCredential de msDs-KeyCredentialLink
  • clear: eliminar todos los KeyCredentials de msDs-KeyCredentialLink
  • info: imprimir toda la información contenida en una estructura KeyCredential
  • export: exportar todos los KeyCredentials de msDs-KeyCredentialLink en JSON
  • import: sobrescribir msDs-KeyCredentialLink con KeyCredentials de un archivo JSON

pyWhisker soporta las siguientes autenticaciones:

  • (NTLM) Contraseña en texto claro
  • (NTLM) Pass-the-hash
  • (Kerberos) Contraseña en texto claro
  • (Kerberos) Pass-the-key / Overpass-the-hash
  • (Kerberos) Pass-the-cache (tipo de Pass-the-ticket)
  • (LDAP sobre Schannel) Pass-the-cert

Entre otras cosas, pyWhisker soporta verbosidad multinivel, solo hay que añadir -v, -vv, ... al comando :)

pyWhisker también puede trabajar entre dominios, ver el argumento -td/--target-domain.

usage: pywhisker [-h] (-t TARGET_SAMNAME | -tl TARGET_SAMNAME_LIST) [-a [{list,add,spray,remove,clear,info,export,import}]] [--use-ldaps] [--use-schannel] [-v] [-q]
                 [--dc-ip ip address] [-d DOMAIN] [-u USER] [-crt CERTFILE] [-key KEYFILE] [-td TARGET_DOMAIN] [--no-pass | -p PASSWORD | -H [LMHASH:]NTHASH | --aes-key hex key]
                 [-k] [-P PFX_PASSWORD] [-f FILENAME] [-e {PEM,PFX}] [-D DEVICE_ID]

Python (re)setter for property msDS-KeyCredentialLink for Shadow Credentials attacks.

optional arguments:
  -h, --help            show this help message and exit
  -t TARGET_SAMNAME, --target TARGET_SAMNAME
                        Target account
  -tl TARGET_SAMNAME_LIST, --target-list TARGET_SAMNAME_LIST
                        Path to a file with target accounts names (one per line)
  -a [{list,add,spray,remove,clear,info,export,import}], --action [{list,add,spray,remove,clear,info,export,import}]
                        Action to operate on msDS-KeyCredentialLink
  --use-ldaps           Use LDAPS instead of LDAP
  --use-schannel        Use LDAP Schannel (TLS) for certificate-based authentication
  -v, --verbose         verbosity level (-v for verbose, -vv for debug)
  -q, --quiet           show no information at all

authentication & connection:
  --dc-ip ip address    IP Address of the domain controller or KDC (Key Distribution Center) for Kerberos. If omitted it will use the domain part (FQDN) specified in the identity parameter
  -d DOMAIN, --domain DOMAIN
                        (FQDN) domain to authenticate to
  -u USER, --user USER  user to authenticate with
  -crt, --certfile CERTFILE
                        Path to the user certificate (PEM format) for Schannel authentication
  -key, --keyfile KEYFILE
                        Path to the user private key (PEM format) for Schannel authentication
  -td TARGET_DOMAIN, --target-domain TARGET_DOMAIN
                        Target domain (if different than the domain of the authenticating user)

  --no-pass             don't ask for password (useful for -k)
  -p PASSWORD, --password PASSWORD
                        password to authenticate with
  -H [LMHASH:]NTHASH, --hashes [LMHASH:]NTHASH
                        NT/LM hashes, format is LMhash:NThash
  --aes-key hex key     AES key to use for Kerberos Authentication (128 or 256 bits)
  -k, --kerberos        Use Kerberos authentication. Grabs credentials from .ccache file (KRB5CCNAME) based on target parameters. If valid credentials cannot be found, it will use the ones
                        specified in the command line

arguments when setting -action to add:
  -P PFX_PASSWORD, --pfx-password PFX_PASSWORD
                        password for the PFX stored self-signed certificate (will be random if not set, not needed when exporting to PEM)
  -f FILENAME, --filename FILENAME
                        filename to store the generated self-signed PEM or PFX certificate and key, or filename for the "import"/"export" actions
  -e {PEM,PFX}, --export {PEM,PFX}
                        choose to export cert+private key in PEM or PFX (i.e. #PKCS12) (default: PFX))

arguments when setting -action to remove:
  -D DEVICE_ID, --device-id DEVICE_ID
                        device ID of the KeyCredentialLink to remove when setting -action to remove

A continuación se muestran ejemplos y capturas de pantalla de lo que pyWhisker puede hacer.

Listar y obtener información

Descargar herramienta