Convert Figma logo to code with AI

huntergregal logomimipenguin

A tool to dump the login password from the current linux user

3,787
631
3,787
5

Top Related Projects

19,244

A little tool to play with Windows security

9,431

Credentials recovery project

Internal Monologue Attack: Retrieving NTLM Hashes without Touching LSASS

Mimikatz implementation in pure Python

2,019

Extract credentials from lsass remotely

Quick Overview

MimiPenguin is a tool designed to dump credentials from the current Linux user. It's similar to the Windows tool Mimikatz but specifically tailored for Linux systems. MimiPenguin extracts clear-text passwords from memory for various Linux desktop environments and display managers.

Pros

  • Effective at extracting clear-text passwords from memory
  • Supports multiple Linux distributions and desktop environments
  • Regularly updated to improve detection and evasion techniques
  • Available in both bash and Python versions for flexibility

Cons

  • Can be detected by some antivirus software as malicious
  • Requires root privileges to run, limiting its use in some scenarios
  • May not work on all Linux systems or configurations
  • Potential for misuse in unauthorized access attempts

Getting Started

To use MimiPenguin, follow these steps:

  1. Clone the repository:

    git clone https://github.com/huntergregal/mimipenguin.git
    
  2. Change to the MimiPenguin directory:

    cd mimipenguin
    
  3. Run the bash version (requires root privileges):

    sudo ./mimipenguin.sh
    

    Or run the Python version:

    sudo python3 mimipenguin.py
    

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

Competitor Comparisons

19,244

A little tool to play with Windows security

Pros of Mimikatz

  • More comprehensive functionality, supporting various credential extraction techniques
  • Cross-platform support (Windows, Linux, macOS)
  • Actively maintained with frequent updates

Cons of Mimikatz

  • Larger codebase, potentially more complex to use
  • Higher likelihood of being flagged by antivirus software
  • Requires administrative privileges on Windows systems

Code Comparison

Mimipenguin (Python):

def dump_target(target):
    if target == "gnome-keyring":
        # Gnome Keyring dump logic
    elif target == "kde-wallet":
        # KDE Wallet dump logic
    # ... other targets

Mimikatz (C):

NTSTATUS kuhl_m_sekurlsa_genericCredsOutput(PKIWI_GENERIC_PRIMARY_CREDENTIAL mesCreds, PLUID luid, PWSTR sid)
{
    // Complex credential extraction and output logic
}

Mimipenguin focuses on Linux-specific credential extraction, with a simpler Python codebase. Mimikatz offers a more comprehensive set of features for Windows systems, implemented in C with a more complex structure. While Mimipenguin is easier to use and less likely to trigger antivirus alerts, Mimikatz provides broader functionality and cross-platform support at the cost of increased complexity and potential detection.

9,431

Credentials recovery project

Pros of LaZagne

  • Multi-platform support (Windows, Linux, macOS)
  • Retrieves passwords from a wide range of applications and browsers
  • Actively maintained with regular updates

Cons of LaZagne

  • Larger codebase, potentially more complex to use
  • May trigger antivirus software due to its comprehensive nature

Code Comparison

LaZagne:

def run_lazagne(category_selected="all", subcategories={}, password=None):
    for category in category_selected:
        for r in runModule(category):
            yield r

mimipenguin:

if [[ $(id -u) -ne 0 ]]; then
    echo "Got root?"
    exit 1
fi

Key Differences

  • LaZagne is a more comprehensive tool, targeting multiple platforms and applications
  • mimipenguin focuses specifically on extracting Linux user credentials from memory
  • LaZagne is written in Python, while mimipenguin is primarily a Bash script
  • mimipenguin is more lightweight and focused on a single task
  • LaZagne offers more flexibility in terms of password retrieval options

Both tools serve different purposes and can be valuable in their respective domains. LaZagne is better suited for broader password recovery tasks across multiple platforms, while mimipenguin excels at quickly extracting Linux credentials from memory.

Internal Monologue Attack: Retrieving NTLM Hashes without Touching LSASS

Pros of Internal-Monologue

  • Focuses on extracting NTLM hashes from memory without touching lsass.exe
  • Works on Windows systems, expanding the range of target environments
  • Utilizes built-in Windows APIs, potentially making it more stealthy

Cons of Internal-Monologue

  • Limited to extracting NTLM hashes, while MimiPenguin can extract various credential types
  • Requires administrative privileges on the target Windows system
  • May be less effective against modern Windows security features

Code Comparison

MimiPenguin (Python):

def dump_process(pid):
    with open("/proc/%d/maps" % pid, "r") as maps:
        for line in maps:
            m = re.search(r"([0-9A-Fa-f]+)-([0-9A-Fa-f]+) ([-r])", line)
            if m:
                start, end, perms = int(m.group(1), 16), int(m.group(2), 16), m.group(3)
                if 'r' in perms:
                    mem = read_memory(pid, start, end - start)

Internal-Monologue (C#):

public static string InvokeNetNTLMFromMemory()
{
    IntPtr hProcess = GetCurrentProcess();
    IntPtr pNtlmCredential = IntPtr.Zero;
    uint cbNtlmCredential = 0;
    LsaEnumerateLogonSessions(out uint luidCount, out IntPtr pLogonSessionList);

Mimikatz implementation in pure Python

Pros of pypykatz

  • Written in Python, offering better cross-platform compatibility
  • Supports multiple credential extraction methods beyond just memory dumping
  • More actively maintained with frequent updates and improvements

Cons of pypykatz

  • Larger codebase, potentially more complex to use and modify
  • May have higher system resource requirements due to Python runtime

Code Comparison

mimipenguin:

#!/bin/bash
# Bash implementation for simple credential extraction
grep -R -i "password" /proc/*/environ 2>/dev/null

pypykatz:

from pypykatz.pypykatz import pypykatz

mimi = pypykatz.go_live()
for luid in mimi.logon_sessions:
    print(mimi.logon_sessions[luid])

Summary

pypykatz offers a more comprehensive and flexible approach to credential extraction, with broader platform support and active development. However, mimipenguin's simplicity and lightweight nature may be preferable in certain scenarios. pypykatz's Python implementation allows for more advanced features and easier integration with other tools, while mimipenguin's bash script is more straightforward for quick, targeted extractions on Linux systems.

2,019

Extract credentials from lsass remotely

Pros of lsassy

  • Written in Python, making it more portable and easier to modify
  • Supports remote dumping of credentials over the network
  • Offers more extensive output options, including JSON and SQLite

Cons of lsassy

  • Requires more dependencies and setup compared to mimipenguin
  • May be slower in execution due to being written in Python rather than C

Code Comparison

mimipenguin (C):

void dump_from_binary(char *binary_path) {
    FILE *fp = fopen(binary_path, "rb");
    if (fp == NULL) {
        printf("Error opening file %s\n", binary_path);
        return;
    }
    // ... (rest of the function)
}

lsassy (Python):

def dump_lsass(self, dump_name=None, method="comsvcs"):
    if dump_name is None:
        dump_name = f"lsass_{random_string()}.dmp"
    dump_path = ntpath.join(self.temp_dir, dump_name)
    # ... (rest of the function)

Both projects aim to extract credentials from memory, but lsassy offers more flexibility and features at the cost of increased complexity. mimipenguin is simpler and potentially faster, but with fewer options for customization and remote capabilities.

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

MimiPenguin 2.0

A tool to dump the login password from the current linux desktop user. Adapted from the idea behind the popular Windows tool mimikatz. This was assigned CVE-2018-20781 (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-20781). Fun fact it's still not fixed after GNOME Keyring 3.27.2 and still works as of 3.28.0.2-1ubuntu1.18.04.1.

alt text

Details

Takes advantage of cleartext credentials in memory by dumping the process and extracting lines that have a high probability of containing cleartext passwords. Will attempt to calculate each word's probability by checking hashes in /etc/shadow, hashes in memory, and regex searches. 2.0 introduces a clean C port that aims to increase the speed of execution and portability

Known Issues

  • The 32bit variant of mimipenguin (C build) may fail in a 64bit userspace as it currently does not adequatley handle searching a 64bit address space

Requires

  • root permissions

Supported/Tested Systems

  • Kali 4.3.0 (rolling) x64 (gdm3)
  • Ubuntu Desktop 12.04 LTS x64 (Gnome Keyring 3.18.3-0ubuntu2)
  • Ubuntu Desktop 14.04.1 LTS x64 (Gnome Keyring 3.10.1-1ubuntu4.3, LightDM 1.10.6-0ubuntu1)
  • Ubuntu Desktop 16.04 LTS x64 (Gnome Keyring 3.18.3-0ubuntu2)
  • Ubuntu Desktop 16.04.4 LTS x64 (Gnome Keyring 3.18.3-0ubuntu2, LightDM 1.18.3-0ubuntu1.1)
  • Ubuntu 18
  • XUbuntu Desktop 16.04 x64 (Gnome Keyring 3.18.3-0ubuntu2)
  • Archlinux x64 Gnome 3 (Gnome Keyring 3.20)
  • OpenSUSE Leap 42.2 x64 (Gnome Keyring 3.20)
  • VSFTPd 3.0.3-8+b1 (Active FTP client connections)
  • Apache2 2.4.25-3 (Active/Old HTTP BASIC AUTH Sessions) [Gcore dependency]
  • openssh-server 1:7.3p1-1 (Active SSH connections - sudo usage)

Building

  • To Build the C variant release simply run make in the root directory of the project
  • To build a debug binary with debug prints run make debug
  • To build a static linked binaries run make static

Notes

  • Password moves in memory - still honing in on 100% effectiveness
  • Plan on expanding support and other credential locations
  • Working on expanding to non-desktop environments
  • Known bug - sometimes gcore hangs the script, this is a problem with gcore
  • Open to pull requests and community research
  • LDAP research (nscld winbind etc) planned for future

Development Roadmap

  • Implement needles in C port (speed up)
  • Add optional arg to target specific users only (speed up)

MimiPenguin is slowly being ported to multiple languages to support all possible post-exploit scenarios. The roadmap below was suggested by KINGSABRI to track the various versions and features. An "X" denotes full support while a "~" denotes a feature with known bugs.

Feature.sh.py
GDM password (Kali Desktop, Debian Desktop)~X
Gnome Keyring (Ubuntu Desktop, ArchLinux Desktop)~X
LightDM (Ubuntu Desktop)XX
VSFTPd (Active FTP Connections)XX
Apache2 (Active HTTP Basic Auth Sessions)~~
OpenSSH (Active SSH Sessions - Sudo Usage)~~

Contact

Licence

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

Special Thanks

  • the-useless-one for remove Gcore as a dependency, cleaning up tabs, adding output option, and a full python3 port
  • gentilkiwi for Mimikatz, the inspiration and the twitter shoutout
  • pugilist for cleaning up PID extraction and testing
  • ianmiell for cleaning up some of my messy code
  • w0rm for identifying printf error when special chars are involved
  • benichmt1 for identifying multiple authenticate users issue
  • ChaitanyaHaritash for identifying special char edge case issues
  • ImAWizardLizard for cleaning up the pattern matches with a for loop
  • coreb1t for python3 checks, arch support, other fixes
  • n1nj4sec for a python2 port and support
  • KINGSABRI for the Roadmap proposal
  • bourgouinadrien for linking https://github.com/koalaman/shellcheck
  • bcoles for adding more needles
  • space-r7 and bcoles for work on the Metasploit MimiPenguin module port