Git Product home page Git Product logo

sssdkcmextractor's Introduction

SSSDKCMExtractor

This tool will decrypt Kerberos Cache Manager (KCM) databases used by the System Security Services Daemon (SSSD). Although older Red Hat Enterprise Linux distributions stored Kerberos caches in the /tmp directory, newer installations use the SSSD Kerberos Cache Manager instead.

The Kerberos caches are maintained in a TDB database (Samba Trivial Database). By default, the database file is located at the path: /var/lib/sss/secrets/secrets.ldb

The database is parsable with the python-tdb or python3-tdb TDB library.

Kerberos payloads are encrypted with AES_256_CBC. The key used to encrypt values in the database is present at: /var/lib/sss/secrets/.secrets.mkey

(NOTE: Both files require root access to read. The secret key is marked as hidden on the filesystem via the dot prefix).

Requirements

Install the python-tdb or python3-tdb library using your distribution's package manager.

Next, install pycrypto. pip install -r requirements.txt or pip install pycrypto

You must possess both the secrets.ldb TDB database and the master key (.secrets.mkey) to use this tool.

Usage

python3 SSSDKCMExtractor.py --database secrets.ldb --key secrets.mkey

Once the tool finishes parsing and decrypting the relevant database entries, the raw Kerberos JSON payloads from the KCM are displayed.

We leave it as an exercise to the reader to convert these into a usable ticket file for pass-the-cache and pass-the-ticket operations.

sssdkcmextractor's People

Contributors

mikesiko avatar trevorhaskell 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

Watchers

 avatar  avatar  avatar  avatar  avatar

sssdkcmextractor's Issues

ModuleNotFoundError: No module named 'tdb'

As title, can't run the script

python3 SSSDKCMExtractor.py       
Traceback (most recent call last):
  File "/home/kali/Tools/SSSDKCMExtractor/SSSDKCMExtractor.py", line 14, in <module>
    import tdb
ModuleNotFoundError: No module named 'tdb'

python3-tdb is there:

sudo apt install python3-tdb     
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-tdb is already the newest version (1.4.9-2).
The following packages were automatically installed and are no longer required:
  gcc-12-base libarmadillo11 libcanberra-gtk-module libcanberra-gtk0 libcbor0.8 libcodec2-1.1 libcurl3-nss libgcc-12-dev libgumbo1 libgupnp-igd-1.0-4 libjim0.81 libnfs13 libobjc-12-dev libstdc++-12-dev libtexluajit2 libutf8proc2
  linux-image-6.3.0-kali1-amd64 lua-lpeg nss-plugin-pem python3-jdcal python3-pyminifier python3-trufflehogregexes
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 55 not upgraded.

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.