Code Monkey home page Code Monkey logo

ldapfx's Introduction

Ldapfx

Small tool created due to some edge cases when trying to exploit the relay using PetitPotam to AD CS.

When you successfuly retrieve a .pfx certificate if the SAN within the X509 differs from the dnshostname attribute of your target you won't be able to retrieve a TGT and have the following error :

KDC_ERR_CLIENT_NAME_MISMATCH (ERR 75)

Here is an example of this edge case :

  • FQDN according to the domain : wks2.test.local
  • FQDN which is stored within the dnshostname attribute: wks2.modifyme.test.local

This is NOT related to a child domain but just a custom dnshostname value. It has to be noted that a computer account can modify the dnshostname attribute as long as the modification stick to the following value :

  • <computer name>.<domain name>

Once you've modified the dnshostname attribute you'll have to request a new certificate and only then you'll be able to ask for a TGT.

Usage

LDAPfx.exe DC1:636 wks2_cert.pfx "CN=WKS2,CN=Computers,DC=test,DC=local" "wks2.test.local"
[*] Adding certificate to the LDAPConnection
[*] Requesting LDAPS using the certificate
[*] Current LDAP user : u:TEST\WKS2$
[*] Default naming context : DC=test,DC=local
[*] Current dnshostname attribute : wks2.modifyme.test.local
[*] Did modifying the attribute succeed ? : Success
[*] Current dnshostname attribute : wks2.test.local

Author : @Ottersec & @dav1dstr33t

ldapfx's People

Contributors

sneakyottersec avatar

Watchers

 avatar

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.