Dumping revelant information on compromised targets without AV detection

Overview

DonPAPI

Dumping revelant information on compromised targets without AV detection

DPAPI dumping

Lots of credentials are protected by DPAPI (link ) We aim at locating those "secured" credentials, and retreive them using :

  • user password
  • domaine DPAPI BackupKey
  • Local machine DPAPI Key (that protect TaskScheduled Blob)

Curently gathered info:

  • Windows credentials (Taskscheduled credentials & a lot more)
  • Windows Vaults
  • Windows RDP credentials
  • AdConnect (still require a manual operation)
  • Wifi key
  • Intenet explorer Creentials
  • Chrome cookies & credentials
  • Firefox cookies & credentials
  • VNC passwords
  • mRemoteNG password (with default config)

Check for a bit of compliance

  • smb signing enabled
  • OS/Domain/Hostname/Ip of the audited scope

Operational use

with local admin account on a machine, we can :

  • gather Machine protected DPAPI secrets, like ScheduledTask, that will contains cleartext login/password of the account that should run the task (Also Wifi passwords)
  • extract Masterkey's hash value for every users profiles (masterkeys beeing protected by the user's password, let's try to crack them with Hashcat)
  • Identify who is connected from where, in order to identify Admin's personal machines.
  • extract other non-dpapi protected secrets (VNC/Firefox/mRemoteNG)

With a user password, or the domain PVK we can unprotect it's DPAPI Secrets. you can pass a full list of credentials that will be tested on the machine.

  • gather protected secrets from IE, Chrome, Firefox and start reaching the Azure tenant.

Exemples

dump all secrets of our target machine with an admin account :

python DonPAPI.py Domain/user:[email protected]

connect with PTH

python DonPAPI.py -Hashes XXXXXXXXXX Domain/[email protected]

can do kerberos (-k), and local auth (-local_auth)

connect with an account that have LAPS rights:

python DonPAPI.py -laps Domain/user:[email protected]

you have a few users passwords ? just give them to DonPAPI and it will try to use them to decipher masterkeys of these users. (the file have to contain user:pass, one per line)

python DonPAPI.py -credz credz_file Domain/user:[email protected]

you got domain admin access and dumped the domain backup key ? (impacket dpapi.py backupkey --export). them dump all secrets of all users of the domain !

python DonPAPI.py -pvk domain_backupkey.pvk -credz file_with_Login:pass Domain/user:[email protected]_network_list

target can be an IP, IP range, CIDR, file containing list of the above targets (one per line)

Opsec consideration

The RemoteOps part can be spoted by some EDR. has it's only real use is to get DPAPI Machine key, it could be deactivated (--no_remoteops). but no more taskscheduled credentials in that case.

INSTALL

git clone https://github.com/login-securite/DonPAPI.git
pip install -r requirements.txt
python3 DonPAPI.py

Credits

All the credits goes to these great guys for doing the hard research & coding :

  • Benjamin Delpy (@gentilkiwi) for most of the DPAPI research (always greatly commented - <3 your code)
  • Alberto Solino (@agsolino) for the tremendous work of Impacket (https://github.com/SecureAuthCorp/impacket). Almost everything we do here comes from impacket.
  • Alesandro Z (@) & everyone who worked on Lazagne (https://github.com/AlessandroZ/LaZagne/wiki) for the VNC & Firefox modules, and most likely for a lots of other ones in the futur.
  • dirkjanm @dirkjanm for the base code of adconnect dump (https://github.com/fox-it/adconnectdump) & every research he ever did. i learned so much on so many subjects thanks to you. <3
  • @Byt3bl3d33r for CME (lots of inspiration and code comes from CME : https://github.com/byt3bl33d3r/CrackMapExec )
  • All the Team of @LoginSecurite for their help in debugging my shity code (special thanks to @layno & @HackAndDo for that)

TODO

  • finish ADSync/ADConnect password extraction
  • CREDHISTORY full extraction
  • extract windows Certificates
  • further analyse ADAL/msteams
  • implement Chrome
  • find a way to implement Lazagne's great modules
Comments
  • Cookie filtering

    Cookie filtering

    At the moment, depending on the network a lot of expired cookies can be returned. It would be nice if the tool could filter out those (at least by default). In the same idea, a lot of cookies can be empty so 99.9% of the time useless, this could also be filtered out.

    opened by tigre-bleu 3
  • Python SyntaxError

    Python SyntaxError

    Hi, When running the DonPAPI.py script I get the following python error:

    File "./DonPAPI.py", line 157
        logging.info(f"Loaded {len(credz)} user credentials")
                                                           ^
    SyntaxError: invalid syntax
    

    Steps to reproduce:

    git clone https://github.com/login-securite/DonPAPI.git
    pip3 install -r requirements.txt
    ./DonPAPI.py
    

    This looks like a great tool, looking forward to using it!

    opened by israsec 2
  • VNC plugin error on reading and parsing registry key

    VNC plugin error on reading and parsing registry key

    The VNC plugin in software/sysadmin/vnc.py does not handle properly the read of a registry key.

    There is two issues:

    • After getting the key from registry, the variable is bytes, but on line 107, you triy to rstrip() some string, causing an error.
    • On the reverse_vncpassword method, you try to unhex/hex the same variable, but as it's bytes and not a string hex representation, it fails.
    opened by Th3l5D 2
  • Short question: cme module

    Short question: cme module

    On the bottom of the readme you write that a lot of code comes from cme. I would love to see the project as a cme module. Is that currently on focus? Maybe you can write your thoughts about this and maybe some hints how to start with this project on my own.

    Cheers.

    opened by blacklist-arcc 2
  • ModuleNotFoundError

    ModuleNotFoundError

    Bonjour à tous, ça fait un p'tit moment que j'utilise DonPAPI et depuis une fresh install de Kali j'ai une erreur que je n'arrive pas debbugger si quelqu'un a une idée je suis preneur:

    python3 DonPAPI.py

    Traceback (most recent call last): File "DonPAPI.py", line 27, in from myseatbelt import MySeatBelt File "myseatbelt.py", line 12, in from lib.secretsdump import LSASecrets as MyLSASecrets ModuleNotFoundError: No module named 'lib.secretsdump'

    Alors que la lib est bien dispo dasn e dossier d'installation dans lib/secretsdump Pour être sûr de moi j'avais ajouté le chemin d'exécution dans la variable $PATH, mais rien n'y fait.

    Je n'ai aucune idée de comment debbugger ceci.

    D'avance merci de l'attention porté à mon problème !

    opened by no0neismrji 1
  • Allow working in local mode

    Allow working in local mode

    Currently this tool allows reading files via SMB only.

    I would like to run it locally, using Kali Live, with Windows drive(s) mounted in eg. /mnt/c, /mnt/d etc.

    opened by tomaszklim 1
  • Add option to retrieve cookies as well as saved logins

    Add option to retrieve cookies as well as saved logins

    DonPAPI does a fantastic job of retrieving saved login credentials, however the option to retrieve cookies would be beneficial to be able to steal existing sessions and bypass 2FA protection. Currently it seems an attempt was made at adding this feature but it may have been abandoned (https://github.com/login-securite/DonPAPI/blob/main/myseatbelt.py#L460). I might try and have a go at this in a few weeks but not sure if I'll be able to pull it off.

    opened by br-sn 1
  • Error when using --GetHashes

    Error when using --GetHashes

    When running DonPAPI with "--GetHashes" I get the following error.

    Traceback (most recent call last):
      File "/<mytoolspath>/DonPAPI/DonPAPI.py", line 273, in <module>
        main()
      File "/<mytoolspath>/DonPAPI/DonPAPI.py", line 185, in main
        my_report.export_hashes()
    AttributeError: 'reporting' object has no attribute 'export_hashes'
    

    DonPAPI is running on KALI 2021.4 with Impacket v0.9.24.dev1+20210720.100427.cd4fe47c. The target is Windows 10 1803

    opened by corsch 1
  • Wrong description for --no_recent and --no_sysadmins

    Wrong description for --no_recent and --no_sysadmins

    The "--no_recent" and "--no_sysamins" options have the wrong description:

    attacks:
      --no_browser          do not hunt for browser passwords
      --no_dpapi            do not hunt for DPAPI secrets
      --no_vnc              do not hunt for VNC passwords
      --no_remoteops        do not hunt for SAM and LSA with remoteops
      --GetHashes           Get all users Masterkey's hash & DCC2 hash
      --no_recent           Get recent files
      --no_sysadmins        Get sysadmins stuff (mRemoteNG, vnc, keepass, lastpass ...)
    

    The Word "Get" should be replaced by "do not hunt for" for --no_recent and --no_sysamins

    opened by corsch 1
  • Poetry build fix + better readme

    Poetry build fix + better readme

    • [x] pyproject.toml: proper pyproject.toml
    • [x] readme: markdown compliant with https://commonmark.org/
    • [x] readme: add alternative poetry install steps

    Before pyproject.toml update

    $ poetry build
    Creating virtualenv donpapi-dfVQVXBX-py3.10 in /home/noraj/.cache/pypoetry/virtualenvs
    Building donpapi (1.0.0)
    
    $ python -m build --wheel
    * Creating virtualenv isolated environment...
    * Installing packages in isolated environment... (poetry-core>=1.0.0)
    * Getting dependencies for wheel...
    * Building wheel...
    Traceback (most recent call last):
      File "/usr/lib/python3.10/site-packages/pep517/in_process/_in_process.py", line 351, in <module>
        main()
      File "/usr/lib/python3.10/site-packages/pep517/in_process/_in_process.py", line 333, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/usr/lib/python3.10/site-packages/pep517/in_process/_in_process.py", line 249, in build_wheel
        return _build_backend().build_wheel(wheel_directory, config_settings,
      File "/tmp/build-env-lekq9y_k/lib/python3.10/site-packages/poetry/core/masonry/api.py", line 67, in build_wheel
        return WheelBuilder.make_in(poetry, Path(wheel_directory))
      File "/tmp/build-env-lekq9y_k/lib/python3.10/site-packages/poetry/core/masonry/builders/wheel.py", line 74, in make_in
        wb = WheelBuilder(
      File "/tmp/build-env-lekq9y_k/lib/python3.10/site-packages/poetry/core/masonry/builders/wheel.py", line 57, in __init__
        super().__init__(poetry, executable=executable)
      File "/tmp/build-env-lekq9y_k/lib/python3.10/site-packages/poetry/core/masonry/builders/builder.py", line 83, in __init__
        self._module = Module(
      File "/tmp/build-env-lekq9y_k/lib/python3.10/site-packages/poetry/core/masonry/utils/module.py", line 69, in __init__
        raise ModuleOrPackageNotFound(
    poetry.core.masonry.utils.module.ModuleOrPackageNotFound: No file/folder found for package donpapi
    
    ERROR Backend subprocess exited when trying to invoke build_wheel
    

    cf. https://github.com/python-poetry/poetry/issues/1110

    After pyproject.toml update

    $ poetry build           
    Building donpapi (1.0.0)
      - Building sdist
      - Built donpapi-1.0.0.tar.gz
      - Building wheel
      - Built donpapi-1.0.0-py3-none-any.whl
    
    $  python -m build --wheel
    * Creating virtualenv isolated environment...
    * Installing packages in isolated environment... (poetry-core>=1.0.0)
    * Getting dependencies for wheel...
    * Building wheel...
    Successfully built donpapi-1.0.0-py3-none-any.whl
    
    opened by noraj 0
  • cookies in report and some improvment on the UI

    cookies in report and some improvment on the UI

    adding a section for cookies in the report cookies expire date are printed in readable format section are toggled by default show number of credz in each sections top bar

    opened by login-securite 0
  • Lazagne with DonPAPI

    Lazagne with DonPAPI

    Hello,

    Nice project !

    I wanted to give you some idea to deal with Lazagne modules. I think you could not managed with the lazagne project but you should use lazagne forensic which has been designed to have a similar idea. The project is not up to date but could be done easily copying the code from lazagne modules and modifying from where the data are retrieved.

    What I would suggest you is to integrate lazagneforensic as an external project (like we do in pupy: https://github.com/n1nj4sec/pupy/tree/unstable/pupy/external), and you load the project as module into the code. We update all lazagneForensic modules and fix some compatible issue with your project (if there are).

    Like that if a fix is done on your project or mine, it could be easily fixed.

    If you don't want and want to do your own things, I have no problems with it.

    Have a nice day.

    opened by AlessandroZ 0
  • Missing license file

    Missing license file

    Hi,

    This project looks amazing and solves a large amount of possible problems, However looking at the codebase I wasn't able to find a LICENSE file, The only thing I could find is a message in the master file indicating the license is a modified version of Apache license with more details in the LICENSE file that I wasn't able to find.

    This software is provided under under a slightly modified version

    of the Apache Software License. See the accompanying LICENSE file

    for more information.

    If a license file could be added it will be great help !

    opened by idanlivni 1
Releases(v1.0.0)
Owner
Login Securite
Login Securite
log4j2 passive burp rce scanning tool get post cookie full parameter recognition

log4j2_burp_scan 自用脚本log4j2 被动 burp rce扫描工具 get post cookie 全参数识别,在ceye.io api速率限制下,最大线程扫描每一个参数,记录过滤已检测地址,重复地址 token替换为你自己的http://ceye.io/ token 和域名地址

5 Dec 10, 2021
Simple tool to create passwords.

PasswordGenerator Simple password generator: -Simplisitc Window Application -Allows Numbers, Symbols & letters upper and lowercase -Restricts rows of

DM 1 Jan 10, 2022
Script Crack Facebook Yang Kaya Akan Teh Hijau 🚶‍♂

r-mbf Script Crack Facebook 🚶‍♂ Bukti Recode [•] Install Script $ pkg update && pkg upgrade $ pkg install python $ pkg install git $ pip install requ

O'Hayo Smrn 3 Apr 02, 2022
Genpyteal - Experiment to rewrite Python into PyTeal using RedBaron

genpyteal Converts Python to PyTeal. Your mileage will vary depending on how muc

Jason Livesay 9 Oct 19, 2022
Profil3r is an OSINT tool that allows you to find potential profiles of a person on social networks, as well as their email addresses 🕵️

Profil3r is an OSINT tool that allows you to find potential profiles of a person on social networks, as well as their email addresses. This program also alerts you to the presence of a data leak for

1.1k Aug 24, 2021
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
Let's you scan the entire internet in a couple of hours and identify all Minecraft servers on IPV4

Minecraft-Server-Scanner Let's you scan the entire internet in a couple of hours and identify all Minecraft servers on IPV4 Installation and running i

116 Jan 08, 2023
Lnkbomb - Malicious shortcut generator for collecting NTLM hashes from insecure file shares

Lnkbomb Lnkbomb is used for uploading malicious shortcut files to insecure file

Joe Helle 216 Jan 08, 2023
Brute force attack tool for Azure AD Autologon/Seamless SSO

Brute force attack tool for Azure AD Autologon

nyxgeek 89 Jan 02, 2023
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
Exploiting CVE-2021-44228 in vCenter for remote code execution and more

Log4jCenter Exploiting CVE-2021-44228 in vCenter for remote code execution and more. Blog post detailing exploitation linked below: COMING SOON Why? P

81 Dec 20, 2022
An All-In-One Pure Python PoC for CVE-2021-44228

Python Log4RCE An all-in-one pure Python3 PoC for CVE-2021-44228. Configure Replace the global variables at the top of the script to your configuratio

Alexandre Lavoie 178 Nov 09, 2022
recover Firefox and more browsers logins

Browser Creds this script will recover saved browsers logins into txt files. It currently only support windows 10. currently support : Chrome Opera Fi

HugoLB 41 Nov 09, 2022
RedDrop is a quick and easy web server for capturing and processing encoded and encrypted payloads and tar archives.

RedDrop Exfil Server Check out the accompanying MaverisLabs Blog Post Here! RedDrop Exfil Server is a Python Flask Web Server for Penetration Testers,

53 Nov 01, 2022
Phishing-Crack tools to punish friends

Phishing-Crack Phishing Tool Version 1.0.0 Created By temirovazat A Phishing Tool With PHP and Python3 Features Fake Instagram Phishing Page Fake Face

3 Oct 04, 2022
A Python 3 script that uploads a tasks.pickle file that enables RCE in MotionEye

MotionEye/MotionEyeOS Authenticated RCE A Python 3 script that uploads a tasks.pickle file that enables RCE in MotionEye. You need administrator crede

Matt 1 Apr 18, 2022
A burp-suite plugin that extract all parameter names from in-scope requests

ParamsExtractor A burp-suite plugin that extract all parameters name from in-scope requests. You can run the plugin while you are working on the targe

29 Nov 09, 2022
pybotnet - A Python Library for building Botnet , Trojan or BackDoor for windows and linux with Telegram control panel

pybotnet A Python Library for building botnet , trojan or backdoor for windows and linux with Telegram control panel Disclaimer: Please note that this

</oNion 181 Jan 02, 2023
A traceroute tool that also displays IP information

infotr A traceroute tool that also displays IP information. This tool has only been tested on Linux. Quick Start First, install this tool from PyPI. p

K4YT3X 10 Oct 29, 2022
A python script to turn Ubuntu Desktop in a one stop security platform. The InfoSec Fortress installs the packages,tools, and resources to make Ubuntu 20.04 capable of both offensive and defensive security work.

infosec-fortress A python script to turn Ubuntu Desktop into a strong DFIR/RE System with some teeth (Purple Team Ops)! This is intended to create a s

James 41 Dec 30, 2022