Python library to remotely extract credentials on a set of hosts.

Overview

lsassy

PyPI version Twitter

Example

Python library to remotely extract credentials on a set of hosts. This blog post explains how it works.

This library uses impacket project to remotely read necessary bytes in lsass dump and pypykatz to extract credentials.

Chapters Description
Requirements Requirements to install lsassy from source
Warning Before using this tool, read this
Documentation Lsassy documentation
CrackMapExec Module Link to CrackMapExec module included in this repository
Issues Read this before creating an issue
Acknowledgments Kudos to these people and tools
Official Discord Official Discord channel

Requirement

  • Python >= 3.6

Warning

Although I have made every effort to make the tool stable, traces may be left if errors occur.

This tool can either leave some lsass dumps if it failed to delete it (eventhough it tries hard to do so) or leave a scheduled task running if it fails to delete it. This shouldn't happen, but it might. Now, you know, use it with caution.

Documentation

The tool is fully documented in the project's wiki

Installation

Standalone

Library

CrackMapExec module

Changelog

v2.1.0
------
* Kerberos authentication support (Thank you laxa for PR)
* Add CME module for python3
* Update bloodhound queries for BloodHound3
* Bug fixes

v2.0.0
------
* Multiprocessing support to dump credentials on multiple hosts at a time
* Add new dumping method using "dumpert"
* Can be used as a library in other python projects
* Syntax changed to be more flexible
* Complete code refactoring, way more organized and easy to maintain/extend
* Better error handling
* Complete wiki

v1.1.0
------
* Better execution process : --method flag has been added and described in help text
* Uses random dump name
* Chose between cmd, powershell, dll and/or procdump methods
* CME module is now using light lsassy WMIExec et TASKExec implementation
* Bug fixes

v1.0.0
------
* Built-in lsass dump
** Lsass dump using built-in Windows
** Lsass dump using procdump (using -p parameter)
* Add --dumppath to ask for remote parsing only
* Code refactoring
* Add --quiet to quiet output

v0.2.0
------
* Add BloodHound option to CME module (-o BLOODHOUND=True)
    - Set compromised targets as "owned" in BloodHound
    - Check if compromised users have at least one path to domain admin
* Custom parsing (json, grep, pretty [default])
* New --hashes option to lsassy
* Include CME module in repository
* Add credentials to CME database


v0.1.0
------
First release

Acknowledgments

image

Official Discord Channel

Porchetta Industries

Comments
  • Protected lsass?

    Protected lsass?

    Probably not a bug and more likely a mis-usage of my part but I could not find much info.

    I am executing the following command:

    lsassy -d SomeDomain -u SomeAdminUser -p SomePassword 10.0.2.4

    But I am getting the following error: [X] [10.0.2.4] Either lsass is protected or target might be slow or procdump/dumpert wasn't provided

    Also, tried adding -m with 0-5 and providing prodump and dumpert but still getting the same error.

    If I log into machine 10.0.2.4, I can dump lsass using prodump or taskmgr.

    opened by EasiestOdin5 9
  • Automatically generate Linux & Windows builds

    Automatically generate Linux & Windows builds

    I can't find a good way to automatically generate builds when I release a new version. If someone knows how to do this, help would be really appreciated 🤗

    enhancement help wanted 
    opened by Hackndo 7
  • Add MirrorDump dump method

    Add MirrorDump dump method

    Hi @Hackndo!

    In this PR I'd like to bring the mirrordump dump method based on the MirrorDump awesome tool by @CCob. For quite a long time it has been my personal tool of choice for offensive engagements, and I think it should definitely be a part of your great toolkit.

    Before compiling MirrorDump a tiny modification should be made to the source code (Program.cs file) for lsassy to successfully parse the output. By default MirrorDump creates a zip file containing the dump, so the modification changes the output to raw dump bytes:

    static void SaveDump(string fileName, DumpContext dc)
    {
        using (var fileStream = new FileStream(fileName, FileMode.Create, FileAccess.ReadWrite))
        {
            fileStream.Write(dc.Data, 0, (int)dc.Size);
        }
    }
    
    ...
    
    //SaveZip(fileName, MiniDumpToMem.GetDumpContextFromHandle(MagicHandle));
    SaveDump(fileName, MiniDumpToMem.GetDumpContextFromHandle(MagicHandle));
    

    I've also made an attempt to create a module with embedded assembly of MirrorDump.exe, but I've faced the following issue: due to a relatevily big size of the assembly (Boo compiler is inside) ImpacketFile.create_file does not transfer the whole file and stops at length of 1,024 Kbytes. I suppose it has something to do with the MAX_FILE_WRITE constant (not sure).

    If you have any idea of how to corretly resolve the issue, I'll be happy to update the PR!

    Usage example:

    ~$ lsassy -vv -u administrator -p 'Passw0rd!' 10.10.13.37 -m mirrordump -O mirrordump_path=./MirrorDump.exe
    

    example

    P. S. I'm sure you will compile the project by yourself for the security purposes, but I shall attach the modified assembly in this PR as well for testing - MirrorDump.zip.

    opened by snovvcrash 6
  • Bypass antivirus

    Bypass antivirus

    Under certain circumstances (e.g. Microsoft Defender active), no dump can be performed with lsassy. This is due to the fact that the dump of the lsass.exe process is considered.

    However, the following works:

    $ psexec.py host.example.com 'tasklist /fi "imagename eq lsass.exe"'
    [CUT]
    Image Name                     PID Session Name        Session#    Mem Usage
    ========================= ======== ================ =========== ============
    lsass.exe                     1337 Services                   0     49,680 K
    [CUT]
    $ psexec.py -c procdump64.exe host.example.com '-accepteula -ma 1337 c:\lsass.dmp'
    [CUT]
    [01:23:45] Dump 1 initiated: c:\lsass.dmp
    [CUT]
    

    I don't know whether it would make sense for you to include this bypass in lsassy?

    Thanks for your awesome work! :)

    opened by viaccoz 6
  • Obfuscation-(not a bug)

    Obfuscation-(not a bug)

    First of all Great tool

    I got detected by windows defender is there any method that you guys use to bypass it?

    i give the tool a try but got flagged by windows defender latest version full patched

    opened by maibold1 5
  • pipenv shell

    pipenv shell

    Not sure if running in pipenv shell is the issue, but getting the error after a successful dump of lsass.exe:

    Detailed error : /bin/sh: 1: lsassy: not found

    Thoughts?

    wontfix 
    opened by bucky67gto 5
  • [Feature] Optionally use UNC path with `dumpertdll` module to run dumpert DLL from SMB share

    [Feature] Optionally use UNC path with `dumpertdll` module to run dumpert DLL from SMB share

    Hello! First I would like to say congratulations on the 3.0.0 release, the new improvements look awesome! I had an idea while reading some of the new dumping methods, specifically dumpertdll.

    rundll32 can run DLLs from SMB shares, they don't have to be on the disk. My idea was to run an SMB share (like with Samba or impacket-smbshare, not lsassy) and then place the dumpert DLL file in that share. You could then provide the UNC path to the dumpert DLL in the "dumpertdll_path" option, and lsassy would tell rundll32 to call the dumpert DLL from the SMB share, instead of having to upload it.

    I've had lots of luck with this method when trying to spawn sliver agents using a DLL loaded from an SMB share, and it would also prevent the OPSEC hit of having to upload the file to disk. Finally, if something goes wrong during the dump (like AV gets wind of what your doing) there is no risk of the dumpert DLL persisting after aborted execution because it couldn't be deleted.

    enhancement 
    opened by davidmckennirey 4
  • Release the DCOM Connection if WMI failed

    Release the DCOM Connection if WMI failed

    This would cause python to hang when the WMI exec method failed during the program execution (lsassy in CLI or any python code using Lsassy as a lib). That was a funny debugging afternoon 😄

    Cheers

    opened by themaks 4
  • Using lsassy on Ubuntu WSL

    Using lsassy on Ubuntu WSL

    Describe the bug Maybe not so much a bug as a desire to see if it would run in WSL. Thinking Windows store apps can be accessed by non-admin users and then install Ubuntu along with lsassy. Should this be a pull request? A little new to the game here but testing my limits.

    Expected behavior Here are my steps: Install WSL on Win10 device Install Ubuntu from Windows store Check if Python3 is installed python3 --version Install Python 3 (if needed) sudo apt install python3 Update apt-get sudo apt-get update Install netaddr sudo apt-get install -y python-netaddr Pip3 install netaddr Install pip3 sudo apt-get install python3-pip Install pypykatz pip3 install pypykatz Clone Impacket sudo git clone https://github.com/SecureAuthCorp/impacket.git cd impacket/ sudo python3 setup.py install Install lsassy sudo python3.6 -m pip install lsassy

    Screenshots

    Additional context The command and results [email protected]:/$ lsassy domain/%username%:%Password%@%FQDN_deviceName Traceback (most recent call last): File "/usr/local/bin/lsassy", line 11, in sys.exit(run()) File "/usr/local/lib/python3.6/dist-packages/lsassy/core.py", line 208, in run targets = get_targets(get_args().target) File "/usr/local/lib/python3.6/dist-packages/lsassy/utils/utils.py", line 134, in get_targets ret_targets += parse_targets(target) File "/usr/local/lib/python3.6/dist-packages/lsassy/utils/utils.py", line 101, in parse_targets t = IPRange(ip_range[0], ip_range[1]) File "/usr/local/lib/python3.6/dist-packages/netaddr/ip/init.py", line 1357, in init self._start = IPAddress(start, flags=flags) File "/usr/local/lib/python3.6/dist-packages/netaddr/ip/init.py", line 280, in init % self.class.name) ValueError: IPAddress() does not support netmasks or subnet prefixes! See documentation for details.

    opened by NtHawk101 4
  • Wait when file is not written yet

    Wait when file is not written yet

    • A task is launched to dump lsass.exe. As long as it is not finished, the dump file is non-existent or empty. This can generate STATUS_OBJECT_NAME_NOT_FOUND errors. Because of this, we have to wait until the task and the write are finished.
    • Delete dump file
    • More precise logging
    opened by viaccoz 4
  • Add collection of masterkeys

    Add collection of masterkeys

    Like the -K for kerberos tickets, the new -M stores dumped masterkeys to a file in format {GUID}:SHA1. This format of masterkeys can be use in many tools like SharpDPAPI.

    opened by zblurx 3
Releases(v3.1.6)
Owner
Pixis
Security blog author https://hackndo.com
Pixis
Send CVE information to the specified mailbox (from Github)

Send CVE information to the specified mailbox (from Github)

91 Nov 08, 2022
Driver Buddy Reloaded is an IDA Pro Python plugin that helps automate some tedious Windows Kernel Drivers reverse engineering tasks.

Driver Buddy Reloaded Quickstart Table of Contents Installation Usage About Driver Buddy Reloaded Finding DispatchDeviceControl Labelling WDM & WDF St

Paolo 'VoidSec' Stagno 199 Jan 04, 2023
Zero-attacker is an multipurpose hacking tool with over 12 tools

Zero Attacker Zero Attacker is bunch of tools which we made for people.These all tools are for purpose of ethical hacking and discord tools. Who is th

Asjad 300 Dec 28, 2022
A Superfast SMS & Call bomber for Linux And Termux !

A Superfast SMS & Call bomber for Linux And Termux !

Anubhav Kashyap 15 Feb 21, 2022
CVE-2021-21985 VMware vCenter Server远程代码执行漏洞 EXP (更新可回显EXP)

CVE-2021-21985 CVE-2021-21985 EXP 本文以及工具仅限技术分享,严禁用于非法用途,否则产生的一切后果自行承担。 0x01 利用Tomcat RMI RCE 1. VPS启动JNDI监听 1099 端口 rmi需要bypass高版本jdk java -jar JNDIIn

r0cky 355 Aug 03, 2022
CodeTest信息收集和漏洞利用工具

CodeTest信息收集和漏洞利用工具,可在进行渗透测试之时方便利用相关信息收集脚本进行信息的获取和验证工作,漏洞利用模块可选择需要测试的漏洞模块,或者选择所有模块测试,包含CVE-2020-14882, CVE-2020-2555等,可自己收集脚本后按照模板进行修改。

23 Mar 18, 2021
SecurAID securely connects aid organizations directly with individuals in dangerous situations to allow them to discreetly and effectively get the assistance they need.

SecurAID securely connects aid organizations directly with individuals in dangerous situations to allow them to discreetly and effec

Ty K 2 Mar 23, 2022
Script hecho en python para sacar la informacion del numero de telefono, Hecha con el API de numverify

Script hecho en python para sacar la informacion del numero de telefono, Hecha con el API de numverify

DW Dariel 5 Dec 03, 2022
A small Python Script To get all levels of subdomains from a list

getlevels A small Python Script To get all levels of subdomains Easily get 1st level, 2nd level, 3rd level, 4th level .... nth level subdomains Usag

9 Feb 15, 2022
DomainMonitor is a web project that has a RESTful API to get a domain's subdomains and whois data.

DomainMonitor is a web project that has a RESTful API to get a domain's subdomains and whois data.

2 Feb 05, 2022
Web Scraping com Python - Raspando Vagas para Programadores

Web Scraping com Python - Raspando Vagas para Programadores Sobre o Projeto Web

Kayo Libarino 3 Dec 30, 2021
A Python application to predict what is cooking

ez-cuisine-classifier A Python application to predict what is cooking Environment Python 3.9 Windows 10 Install python -m venv venv .\venv\Scripts\act

Zeheng Li 1 Jun 21, 2022
python driver for fingerprint machine (ZKTeco biometrics)

fpmachine python driver for fingerprint machine (ZKTeco biometrics) support until now 2 model supported and tested ZMM100_TFT and ZMM220_TFT install p

Samy Sultan 4 Oct 06, 2022
A small POC plugin for launching dumpulator emulation within IDA, passing it addresses from your IDA view using the context menu.

Dumpulator-IDA Currently proof-of-concept This project is a small POC plugin for launching dumpulator emulation within IDA, passing it addresses from

Michael 9 Sep 21, 2022
Automatic SQL injection and database takeover tool

sqlmap sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of

sqlmapproject 25.7k Jan 08, 2023
GitLab CE/EE Preauth RCE using ExifTool

CVE-2021-22205 GitLab CE/EE Preauth RCE using ExifTool This project is for learning only, if someone's rights have been violated, please contact me to

3ND 164 Dec 10, 2022
A proxy server application written in python for trial purposes

python-proxy-server This is a proxy server ❤️ application written in python ❤️ for trial purposes. The purpose of the application; Connecting to Hacke

Ali Kasimoglu 2 Dec 27, 2021
Repository for a project of the course EP2520 Building Networked Systems Security

EP2520_ACME_Project Repository for a project of the course EP2520 Building Networked Systems Security in Royal Institute of Technology (KTH), Stockhol

1 Dec 11, 2021
RedTeam-Security - In this repo you will get the information of Red Team Security related links

OSINT Passive Discovery Amass - https://github.com/OWASP/Amass (Attack Surface M

Abhinav Pathak 5 May 18, 2022
CVE-2021-26084 Remote Code Execution on Confluence Servers

CVE-2021-26084 CVE-2021-26084 Remote Code Execution on Confluence Servers. Dork Fofa: app="ATLASSIAN-Confluence" Usage Show help information. python P

FQ Hsu 63 Dec 30, 2022