Giter Club home page Giter Club logo

whisker's Introduction

Whisker

Whisker is a C# tool for taking over Active Directory user and computer accounts by manipulating their msDS-KeyCredentialLink attribute, effectively adding "Shadow Credentials" to the target account.

This tool is based on code from DSInternals by Michael Grafnetter (@MGrafnetter).

For this attack to succeed, the environment must have a Domain Controller running at least Windows Server 2016, and the Domain Controller must have a server authentication certificate to allow for PKINIT Kerberos authentication.

More details are available at the post Shadow Credentials: Abusing Key Trust Account Mapping for Takeover.

Usage

Add a new value to the msDS-KeyCredentialLink attribute of a target object:

  • /target:<samAccountName>: Required. Set the target name. Computer objects should end with a '$' sign.

  • /domain:<FQDN>: Optional. Set the target Fully Qualified Domain Name (FQDN). If not provided, will try to resolve the FQDN of the current user.

  • /dc:<IP/HOSTNAME>: Optional. Set the target Domain Controller (DC). If not provided, will try to target the Primary Domain Controller (PDC).

  • /path:<PATH>: Optional. Set the path to store the generated self-signed certificate for authentication. If not provided, the certificate will be printed as a Base64 blob.

  • /password:<PASWORD>: Optional. Set the password for the stored self-signed certificate. If not provided, a random password will be generated.

Example: Whisker.exe add /target:computername$ /domain:constoso.local /dc:dc1.contoso.local /path:C:\path\to\file.pfx /password:P@ssword1

Remove a value from the msDS-KeyCredentialLink attribute of a target object:

  • /target:<samAccountName>: Required. Set the target name. Computer objects should end with a '$' sign.

  • /deviceID:<GUID>: Required. Set the DeviceID of the value to remove from the attribute msDS-KeyCredentialLink of the target object. Must be a valid GUID.

  • /domain:<FQDN>: Optional. Set the target Fully Qualified Domain Name (FQDN). If not provided, will try to resolve the FQDN of the current user.

  • /dc:<IP/HOSTNAME>: Optional. Set the target Domain Controller (DC). If not provided, will try to target the Primary Domain Controller (PDC).

Example: Whisker.exe remove /target:computername$ /domain:constoso.local /dc:dc1.contoso.local /deviceid:2de4643a-2e0b-438f-a99d-5cb058b3254b

Clear all the values of the the msDS-KeyCredentialLink attribute of a target object:

  • /target:<samAccountName>: Required. Set the target name. Computer objects should end with a '$' sign.

  • /domain:<FQDN>: Optional. Set the target Fully Qualified Domain Name (FQDN). If not provided, will try to resolve the FQDN of the current user.

  • /dc:<IP/HOSTNAME>: Optional. Set the target Domain Controller (DC). If not provided, will try to target the Primary Domain Controller (PDC).

Example: Whisker.exe clear /target:computername$ /domain:constoso.local /dc:dc1.contoso.local

โš ๏ธ Warning: Clearing the msDS-KeyCredentialLink attribute of accounts configured for passwordless authentication will cause disruptions.

List all the values of the the msDS-KeyCredentialLink attribute of a target object:

  • /target:<samAccountName>: Required. Set the target name. Computer objects should end with a '$' sign.

  • /domain:<FQDN>: Optional. Set the target Fully Qualified Domain Name (FQDN). If not provided, will try to resolve the FQDN of the current user.

  • /dc:<IP/HOSTNAME>: Optional. Set the target Domain Controller (DC). If not provided, will try to target the Primary Domain Controller (PDC).

Example: Whisker.exe list /target:computername$ /domain:constoso.local /dc:dc1.contoso.local

References

whisker's People

Contributors

dliv3 avatar eladshamir avatar infamoussyn avatar p0dalirius avatar qazeer avatar slashsec1 avatar subat0mik avatar t94j0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whisker's Issues

Add license

Hi!

The license for this repository is currently missing.
Would you be able to add a license (e.g. MIT license)?

Domain Searcher - Operations Error

When trying to use add, I'm receiving an operations error:

Commands Used:
Whisker-dude.exe add /target:zph-svrmgmt1$ /domain:zsm.local /dc:ZPH-SVRDC01.zsm.local

Error:
"[X] Error executing the domain searcher: An operations error occurred."

Full output:
C:\Users\marcus\AppData\Local\Temp>Whisker-dude.exe add /target:zph-svrmgmt1$ /domain:zsm.local /dc:ZPH-SVRDC01.zsm.local
Whisker-dude.exe add /target:zph-svrmgmt1$ /domain:zsm.local /dc:ZPH-SVRDC01.zsm.local
[] No path was provided. The certificate will be printed as a Base64 blob
[
] No pass was provided. The certificate will be stored with the password 1NX63Tzvnz9LVFpC
[*] Searching for the target account

[X] Error executing the domain searcher: An operations error occurred.

Can this be used for interactive login?

This might sound like a dumb question but hear me out. IT guys spend a lot of time troubleshooting things on behalf of end users. Recently Microsoft announced Temporary Access Passwords that allow technicians to login as users for a predetermined amount of time to configure things that can only be configured easily in user space.

So lets say you re setting up a computer for an end user. In order for this to work you'd have to enable the web sign-in auth package in Windows, which is only available on AzureAD joined machines and doens't work in domain-joined/hybrid joined environments. I'm looking for something that works in traditional domain/hybrid environments.

It appears to me that the technique in Whisker could be used to legitimately add shadow PINs for Windows Hello for Business, and potentially time limit them via certificate expiration. In this scenario, we have a Windows Service running on both the domain controller and the target machine that allows for arbitrary code execution, meaning if WHfB isn't enabled on the device, I can likely register it.

I suppose the only trick here would be knowing the device id of the machine so that Whisker can add the credential to the appropriate device, allowing for interactive logon for the target user.

Am I on the right track?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.