Post Exploitation
Reference : https://github.com/0xsyr0/Awesome-Cybersecurity-Handbooks/blob/main/handbooks/10_post_exploitation.md
Post Exploitation
Table of Contents
Resources
ADCSKiller - An ADCS Exploitation Automation Tool
An ADCS Exploitation Automation Tool Weaponizing Certipy and Coercer
https://github.com/grimlockx/ADCSKiller
ADCSTemplate
A PowerShell module for exporting, importing, removing, permissioning, publishing Active Directory Certificate Templates. It also includes a DSC resource for creating AD CS templates using these functions. This was built with the intent of using DSC for rapid lab builds. Could also work in production to move templates between AD CS environments.
https://github.com/GoateePFE/ADCSTemplate
adPEAS
Powershell tool to automate Active Directory enumeration.
https://github.com/61106960/adPEAS
BloodHound
BloodHound uses graph theory to reveal the hidden and often unintended relationships within an Active Directory or Azure environment.
https://github.com/BloodHoundAD/BloodHound
BloodHound
Fork of BloodHound with PKI nodes and edges for Certipy along with some minor personal improvements
https://github.com/ly4k/BloodHound
BloodHound Docker
BloodHound Docker Ready to Use
https://github.com/belane/docker-bloodhound
BloodHound Python
BloodHound.py is a Python based ingestor for BloodHound, based on Impacket.
https://github.com/fox-it/BloodHound.py
BloodyAD Framework
BloodyAD is an Active Directory Privilege Escalation Framework, it can be used manually using bloodyAD.py or automatically by combining pathgen.py and autobloody.py.
https://github.com/CravateRouge/bloodyAD
Certify
Active Directory certificate abuse.
https://github.com/GhostPack/Certify
Certipy
Tool for Active Directory Certificate Services enumeration and abuse
https://github.com/ly4k/Certipy
check_vulnerabledrivers.ps1
A quick script to check for vulnerable drivers. Compares drivers on system with list from loldrivers.io
https://gist.github.com/api0cradle/d52832e36aaf86d443b3b9f58d20c01d
Coercer
A python script to automatically coerce a Windows server to authenticate on an arbitrary machine through 9 methods.
https://github.com/p0dalirius/Coercer
CSExec (a C Sharp psexec implementation)
An implementation of PSExec in C#
https://github.com/malcomvetter/CSExec
DLLSideloader
PowerShell script to generate "proxy" counterparts to easily perform DLL Sideloading
https://github.com/Flangvik/DLLSideloader
dnsteal
This is a fake DNS server that allows you to stealthily extract files from a victim machine through DNS requests.
https://github.com/m57/dnsteal
enum4linux
A Linux alternative to enum.exe for enumerating data from Windows and Samba hosts.
https://github.com/CiscoCXSecurity/enum4linux
enum4linux-ng
A next generation version of enum4linux.
https://github.com/cddmp/enum4linux-ng
EvilTree
A python3 remake of the classic "tree" command with the additional feature of searching for user provided keywords/regex in files, highlighting those that contain matches.
https://github.com/t3l3machus/eviltree
GhostPack-Compiled Binaries
Compiled Binaries for Ghostpack (.NET v4.0)
https://github.com/r3motecontrol/Ghostpack-CompiledBinaries
GTFOBins
GTFOBins is a curated list of Unix binaries that can be used to bypass local security restrictions in misconfigured systems.
https://gtfobins.github.io/
HEKATOMB
Hekatomb is a python script that connects to LDAP directory to retrieve all computers and users informations. Then it will download all DPAPI blob of all users from all computers and uses Domain backup keys to decrypt them.
https://github.com/Processus-Thief/HEKATOMB
Impacket
Impacket is a collection of Python classes for working with network protocols. Impacket is focused on providing low-level programmatic access to the packets and for some protocols (e.g. SMB1-3 and MSRPC) the protocol implementation itself.
https://github.com/fortra/impacket
Impacket Static Binaries
Standalone binaries for Linux/Windows of Impacket's examples
https://github.com/ropnop/impacket_static_binaries
JAWS
JAWS is PowerShell script designed to help penetration testers (and CTFers) quickly identify potential privilege escalation vectors on Windows systems.
https://github.com/411Hall/JAWS
KrbRelay
Framework for Kerberos relaying
https://github.com/cube0x0/KrbRelay
KrbRelayUp
KrbRelayUp - a universal no-fix local privilege escalation in windows domain environments where LDAP signing is not enforced (the default settings).
https://github.com/Dec0ne/KrbRelayUp
Krbrelayx
Kerberos unconstrained delegation abuse toolkit
https://github.com/dirkjanm/krbrelayx
LAPSDumper
Dumping LAPS from Python
https://github.com/n00py/LAPSDumper
LinEnum
Privilege Escalation Enumeration
https://github.com/rebootuser/LinEnum
linWinPwn
linWinPwn is a bash script that automates a number of Active Directory Enumeration and Vulnerability checks
https://github.com/lefayjey/linWinPwn
LOLAPPS
LOLAPPS is a compendium of applications that can be used to carry out day-to-day exploitation.
https://lolapps-project.github.io/#
LOLBAS
The goal of the LOLBAS project is to document every binary, script, and library that can be used for Living Off The Land techniques.
https://lolbas-project.github.io/#
LOLDrivers
Living Off The Land Drivers is a curated list of Windows drivers used by adversaries to bypass security controls and carry out attacks. The project helps security professionals stay informed and mitigate potential threats.
https://www.loldrivers.io
LOOBins
Living Off the Orchard: macOS Binaries (LOOBins) is designed to provide detailed information on various built-in macOS binaries and how they can be used by threat actors for malicious purposes.
https://www.loobins.io
lsassy
Python tool to remotely extract credentials on a set of hosts.
https://github.com/Hackndo/lsassy
nanodump
LSASS dumper
https://github.com/helpsystems/nanodump
NTLMRelay2Self
An other No-Fix LPE, NTLMRelay2Self over HTTP (Webdav).
https://github.com/med0x2e/NTLMRelay2Self
Obfuscated SharpCollection
Attempt at Obfuscated version of SharpCollection
https://github.com/Flangvik/ObfuscatedSharpCollection
PassTheCert
Proof-of-Concept tool to authenticate to an LDAP/S server with a certificate through Schannel
https://github.com/AlmondOffSec/PassTheCert
PEASS-ng
Privilege Escalation Awesome Scripts SUITE new generation
https://github.com/carlospolop/PEASS-ng
Ping Castle
Ping Castle is a tool designed to assess quickly the Active Directory security level with a methodology based on risk assessment and a maturity framework.
https://github.com/vletoux/pingcastle
PKINITtools
Tools for Kerberos PKINIT and relaying to AD CS
https://github.com/dirkjanm/PKINITtools
powercat
Netcat: The powershell version.
https://github.com/besimorhino/powercat
Powermad
PowerShell MachineAccountQuota and DNS exploit tools
https://github.com/Kevin-Robertson/Powermad/blob/master/Powermad.ps1
PowerSharpPack
Many useful offensive CSharp Projects wraped into Powershell for easy usage.
https://github.com/S3cur3Th1sSh1t/PowerSharpPack
PowershellKerberos
Some scripts to abuse kerberos using Powershell
https://github.com/MzHmO/PowershellKerberos
PowerShell-Suite
My musings with PowerShell
https://github.com/FuzzySecurity/PowerShell-Suite
PowerSploit
PowerSploit is a collection of Microsoft PowerShell modules that can be used to aid penetration testers during all phases of an assessment.
https://github.com/PowerShellMafia/PowerSploit
PowerUp
PowerUp aims to be a clearinghouse of common Windows privilege escalation vectors that rely on misconfigurations.
https://github.com/PowerShellMafia/PowerSploit/blob/master/Privesc/PowerUp.ps1
PowerView
PowerView is a PowerShell tool to gain network situational awareness on Windows domains.
https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1
PowerView.py
PowerView alternative
https://github.com/aniqfakhrul/powerview.py
PPLdump
Dump the memory of a PPL with a userland exploit
https://github.com/itm4n/PPLdump
Priv2Admin
Exploitation paths allowing you to (mis)use the Windows Privileges to elevate your rights within the OS.
https://github.com/gtworek/Priv2Admin
PSPKIAudit
PowerShell toolkit for AD CS auditing based on the PSPKI toolkit.
https://github.com/GhostPack/PSPKIAudit
pspy
pspy is a command line tool designed to snoop on processes without need for root permissions.
https://github.com/DominicBreuker/pspy
pth-toolkit
A modified version of the passing-the-hash tool collection https://code.google.com/p/passing-the-hash/ designed to be portable and work straight out of the box even on the most 'bare bones' systems.
https://github.com/byt3bl33d3r/pth-toolkit
pwncat
Post-Exploitation Platform
https://github.com/calebstewart/pwncat
PyWhisker
Python version of the C# tool for "Shadow Credentials" attacks
https://github.com/ShutdownRepo/pywhisker
Rubeus
Rubeus is a C# toolset for raw Kerberos interaction and abuses.
https://github.com/GhostPack/Rubeus
RunasCs
RunasCs - Csharp and open version of windows builtin runas.exe
https://github.com/antonioCoco/RunasCs
RustHound
Active Directory data collector for BloodHound written in rust.
https://github.com/OPENCYBER-FR/RustHound
scavenger
scavenger is a multi-threaded post-exploitation scanning tool for scavenging systems, finding most frequently used files and folders as well as "interesting" files containing sensitive information.
https://github.com/SpiderLabs/scavenger
SCShell
Fileless lateral movement tool that relies on ChangeServiceConfigA to run command
https://github.com/Mr-Un1k0d3r/SCShell
Seatbelt
Seatbelt is a C# project that performs a number of security oriented host-survey "safety checks" relevant from both offensive and defensive security perspectives.
https://github.com/GhostPack/Seatbelt
SeBackupPrivilege
Use SE_BACKUP_NAME/SeBackupPrivilege to access objects you shouldn't have access to.
https://github.com/giuliano108/SeBackupPrivilege
SharpCollection
Nightly builds of common C# offensive tools, fresh from their respective master branches built and released in a CDI fashion using Azure DevOps release pipelines.
https://github.com/Flangvik/SharpCollection
SharpEventPersist
Persistence by writing/reading shellcode from Event Log
https://github.com/improsec/SharpEventPersist
SharpExfiltrate
Modular C# framework to exfiltrate loot over secure and trusted channels.
https://github.com/Flangvik/SharpExfiltrate
SharpHound
C# Data Collector for BloodHound
https://github.com/BloodHoundAD/SharpHound
SharpStay
.NET project for installing Persistence
https://github.com/0xthirteen/SharpStay
Sharp-Suite
Also known by Microsoft as Knifecoat hot_pepper
https://github.com/FuzzySecurity/Sharp-Suite
SharpView
C# implementation of harmj0y's PowerView
https://github.com/tevora-threat/SharpView
Sherlock
PowerShell script to quickly find missing software patches for local privilege escalation vulnerabilities.
https://github.com/rasta-mouse/Sherlock
SMBeagle
SMBeagle - Fileshare auditing tool.
https://github.com/punk-security/smbeagle
static-binaries
This repo contains a bunch of statically-linked binaries of various tools, along with the Dockerfiles / other build scripts that can be used to build them.
https://github.com/andrew-d/static-binaries
SUDO_KILLER
A tool to identify and exploit sudo rules' misconfigurations and vulnerabilities within sudo for linux privilege escalation.
https://github.com/TH3xACE/SUDO_KILLER
tickey
Tool to extract Kerberos tickets from Linux kernel keys.
https://github.com/TarlogicSecurity/tickey
Villain
Villain is a Windows & Linux backdoor generator and multi-session handler that allows users to connect with sibling servers (other machines running Villain) and share their backdoor sessions, handy for working as a team.
https://github.com/t3l3machus/Villain
WADComs
WADComs is an interactive cheat sheet, containing a curated list of offensive security tools and their respective commands, to be used against Windows/AD environments.
https://wadcoms.github.io
Watson
Watson is a .NET tool designed to enumerate missing KBs and suggest exploits for Privilege Escalation vulnerabilities.
https://github.com/rasta-mouse/Watson
WESNG
WES-NG is a tool based on the output of Windows' systeminfo utility which provides the list of vulnerabilities the OS is vulnerable to, including any exploits for these vulnerabilities.
https://github.com/bitsadmin/wesng
Whisker
Whisker is a C# tool for taking over Active Directory user and computer accounts by manipulating their msDS-KeyCredentialLink attribute, effectively adding "Shadow Credentials" to the target account.
https://github.com/eladshamir/Whisker
Windows-privesc-check
Tries to find misconfigurations that could allow local unprivileged users to escalate privileges to other users or to access local apps (e.g. databases).
https://github.com/pentestmonkey/windows-privesc-check
Windows Privilege Escalation Fundamentals
How-to Windows Privilege Escalation
https://www.fuzzysecurity.com/tutorials/16.html
Windows Privilege Escalation
Windows privlege escalation methodology
https://github.com/frizb/Windows-Privilege-Escalation
WinPwn
Automation for internal Windows Penetrationtest / AD-Security
https://github.com/S3cur3Th1sSh1t/WinPwn
wmiexec-Pro
New generation of wmiexec.py
https://github.com/XiaoliChan/wmiexec-Pro
accesschk
Checking File Permissions
Checking Service Permissions
Checking Path Permissions to find Unquoted Service Paths
Checking Registry Entries
Apache2
Read first Line of a File with apache2 Binary
AppLocker
https://github.com/api0cradle/UltimateAppLockerByPassList
Bypass List (Windows 10 Build 1803)
APT
Bash
SUID Privilege Escalation
White Collar eval Arbitrary Code Execution
https://www.vidarholen.net/contents/blog/?p=716
Example
Bash Debugging Mode
Bash <4.4
BloodHound
https://github.com/BloodHoundAD/BloodHound
Installation
Installing and starting Database
http://localhost:7474/browser/
Alternatively
Database Password Reset
http://localhost:7474/browser/
Custom Queries
https://github.com/mgeeky/Penetration-Testing-Tools/blob/master/red-teaming/bloodhound/Handy-BloodHound-Cypher-Queries.md
Custom Query Location on macOS
BloodHound Python
Build Docker Container
Collection Method All
LDAP Dumping
Parsing
Certify
https://github.com/GhostPack/Certify
Certipy
https://github.com/ly4k/Certipy
https://github.com/ly4k/BloodHound/
Common Commands
Certificate Handling
Account Creation
Authentication
LDAP-Shell
Certificate Forging
Certificate Request
Run the following command twice because of a current issue with certipy.
Start BloodHound Fork
ClamAV
File Replacement Privilege Escalation
Vulnerable Version 1.0.0
Example
Create a custom authorized_keys file to replace another one. Then create a custom database with the hex value of the string you want to parse for.
custom_malware.db
Execution
Credentials File
https://twitter.com/NinjaParanoid/status/1516442028963659777?t=g7ed0vt6ER8nS75qd-g0sQ&s=09
https://www.nirsoft.net/utils/credentials_file_view.html
dd
Execute Shellcode
DNS
Data Exfiltration
Extract /etc/passwd
^C, ^H, and ^? are the corresponding single ASCII values.
enum4linux
https://github.com/CiscoCXSecurity/enum4linux
enum4linux-ng
https://github.com/cddmp/enum4linux-ng
Excel
.csv Files Command Injection
If the file get's parsed on a Linux operationg system, commands can be injected to the rows.
Evil-WinRM
https://github.com/Hackplayers/evil-winrm
Using Certificate and Private Key
Deactivate Windows Defender
PowerView.ps1
https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Recon/PowerView.ps1
Check User
Code Execution
Find a File
Read a File
Remove a User from a Group
find
Specific Size
Modified Files
Passwords
Group Permissions
User specific Files
SUID and SGID Files
functions
Bash <4.2-048
gdbus
Privilege Escalation
https://unit42.paloaltonetworks.com/usbcreator-d-bus-privilege-escalation-in-ubuntu-desktop/
gem
Git
Git apply (Malicious Patch) Privilege Escalation
Payload
Execution
Git Attributes Privilege Escalation
https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#filters_b
Notice that I only found this within a CTF so far. The pre-requisites are git commit get's executed via script.
Payload
Execution
gMSADumper
https://github.com/micahvandeusen/gMSADumper
grep
gsocket
Shell
Impacket
https://github.com/fortra/impacket
impacket-smbclient
impacket-getTGT
impacket-GetNPUsers
impacket-getUserSPNs / GetUserSPNs.py
impacket-secretsdump
impacket-psexec
impacket-ticketer
Requirements
Valid User
NTHASH
Domain-SID
Fixing [-] exceptions must derive from BaseException
Issue
To fix it
dacledit.py
https://github.com/fortra/impacket/blob/204c5b6b73f4d44bce0243a8f345f00e308c9c20/examples/dacledit.py
Fixing msada_guids Error
Then put the msada_guids.py into the same directory as dacledit.py
https://github.com/Porchetta-Industries/CrackMapExec/blob/master/cme/helpers/msada_guids.py
owneredit.py
https://github.com/fortra/impacket/blob/5c477e71a60e3cc434ebc0fcc374d6d108f58f41/examples/owneredit.py
Internet Information Service (IIS)
Application Pool Credential Dumping
JAWS
https://github.com/411Hall/JAWS
Kerberos
Authentication
https://csforza.gitbook.io/pentesting-articles-and-notes/windows/active-directory/kerberos-authentication
If a user wants to obtain access to resources within a Active Directory network, he must obtain a ticket through a 6-step process.
User sends a request to the
Kerberos Distribution Center (KDC)with his password hash and a timestamp. (AS-REQ)If the
password hashof the user matches that for the user on theKDC, the user receives aTicket Granting Ticketencrypted and signed by thekrbtgtaccount. (AS-REP)The
TGT, including thekrbtgt hash, is sent to theKDCorDCin order to recieve aKerberos Service Ticket (TGS). (TGS-REQ)User then receives a
TGSencrypted with thehashof the service account he wishes to access. (TGS-REP)User then connects to the server and attempts to use the service he sent the
initial requestfor with theTGSincluded. (AP-REQ)User gains access and mutual authentication is given between the server and client if necessary (AP-REP).
Constrained Delegation
https://csforza.gitbook.io/pentesting-articles-and-notes/windows/active-directory/privilege-escalation/constrained-delegation
https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/abusing-kerberos-constrained-delegation
Constrained Delegationlimits the services to which a service can access on behalf of a user.This service account must still be
trustedtodelegate.The user does
not authenticatewithKerberosto theconstrained service.Instead of authenticating to the
KDCfirst, like in a regular Kerberos ticket request, the user authenticatesdirectly to the service.Once the user authenticates to the service, the service then requests a
forwardable TGTto theKDCwithout the user's password included.The
KDCchecks theTRUSTED_TO_AUTHENTICATE_FOR_DELEGATIONattribute on the service and whether or not the user's account is blocked.If everything checks out a ticket is returned.
Ticket gets
passed backto theKDCand aTGS ticketis requested to thesecond service.KDCchecks themsDS-AllowedToDelegateTofield on the second service and if it is listed, then anaccess ticketis granted.TGSgets sent to the next service and the user now can authenticate to it.
The Service for User (S4U) extension is used to aid the impersonation process when Constrained Delegation is used. The extension has two extensions within it:
Service for User to Self (S4U2Self): This allows a service to obtain aforwardable TGSto itself on the user's behalf with theUser Principal Namesupplied. No password is included.Service for User to Proxy (S4U2proxy): This allows the service toobtainthe requiredTGSon the user's behalf to the second service the user needs to connect to. This second service will have themsDS-AllowedToDelegateToattribute given to it. User tokens can be forwarded to thoseSPN'swhich have this attribute given.
Delegation occurs not only for the specified service, but also for ANY service running under the account that is running the service.
Unconstrained Delegation
https://csforza.gitbook.io/pentesting-articles-and-notes/windows/active-directory/privilege-escalation/unconstrained-delegation
https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/domain-compromise-via-unrestricted-kerberos-delegation
Kerberos Delegation allows for users to access resources on another server via a service that the user has access to. The service the user is connected to impersonates that user by resusing his credentials which then allows the user to gain access to that server.
When
Unconstrained Delegationis enabled, the user'sTGTis sent along with theTGSto the first hop service. ThatTGTgets stored in the server'sLSASSwhich allows the service to take it out and delegate with it if necessary.Accounts or services with
Unconstrained Delegationcan be escalated to an account with higher privileges, if a Domain Admin or a higher privileged user connecting to that machine.The
TGTcan be extracted and the ticketreused.
Resource-based Constrained Delegation (RBCD)
https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/resource-based-constrained-delegation-ad-computer-object-take-over-and-privilged-code-execution
https://blog.netwrix.com/2022/09/29/resource-based-constrained-delegation-abuse/
https://learn.microsoft.com/en-us/windows-server/security/kerberos/kerberos-constrained-delegation-overview
In
unconstrainedandconstrained Kerberos delegation, acomputer/useris told what resources it can delegate authentications to.In
Resource-based Kerberos Delegation, computers (resources) specify who theytrustand who candelegateauthentications to them.By supporting constrained delegation across domains,
servicescan beconfiguredto useconstrained delegationtoauthenticatetoserversin other domains rather than using unconstrained delegation.This provides
authentication supportfor across domain service solutions by using an existing Kerberos infrastructurewithoutneeding to trustfront-end servicesto delegate to any service.
Prerequisites
Populate the
msDS-AllowedToActOnBehalfOfOtherIdentityattribute with a computer account that will be controlled.Know a
SPNset on the object to gain access.Create a new
computer accountusing PowerMad (allowed due to the default MachineAccountQuota value).Leverage Rubeus to abuse
Resource-Based Constrained Delegation.
Kerberoasting
https://csforza.gitbook.io/pentesting-articles-and-notes/windows/active-directory/privilege-escalation/kerberoasting
https://xedex.gitbook.io/internalpentest/internal-pentest/active-directory/post-compromise-attacks/kerberoasting
All user accounts that have
Service Principal Names (SPN's)set can be kerberoasted.Relatively silent technique because it leaves only one
4769 ID eventon the log.
AS-REP Roasting
https://csforza.gitbook.io/pentesting-articles-and-notes/windows/active-directory/privilege-escalation/as-rep-roasting
https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/as-rep-roasting-using-rubeus-and-hashcat
ASPREPRoast is about retrieving crackable hashes from KRB5 AS-REP responses for users without kerberoast preauthentication enabled. This isn't as useful as Kerberoasting, as accounts have to have DONT_REQ_PREAUTH explicitly set for them to be vulnerable and you are still reliant upon weak password complexity for the attack to work.
AS-REP roastingis a technique that allows retrieving password hashes for users that haveDo not require Kerberos preauthenticationproperty selected.Those hashes can then be cracked offline.
Silver, Golden and Diamond Tickets
Silver Ticket is a forged service authentication ticket (Service Principal Name (SPN) and Machine Account Keys (Hash in RC4 or AES) needed). Silver Tickets do not touch the Domain Controller (DC).
Golden Ticket is a Ticket Granting Ticket (TGT) and completely forged offline (KRBTGT Account Hash needed).
Diamond Ticket is essentially a Golden Ticket but requested from a Domain Controller (DC).
Attacking Kerberos
https://gist.github.com/TarlogicSecurity/2f221924fef8c14a1d8e29f3cb5c5c4a
Bruteforce
With List of Users
Check Passwords for all Users in Domain
ASPREPRoast
Check ASPREPRoast for all Domain Users (Credentials required)
Check ASPREPRoast for a List of Users (No Credentials required)
Check ASPREPRoast for all Domain Users in Domain
Kerberoasting
Overpass The Hash/Pass The Key (PTK)
Request TGT with Hash
Request TGT with aesKey (More secure Encryption, probably more stealth due is it used by Default)
Request TGT with Password
Set TGT for Impacket Usage
Execute Remote Commands
Ask and inject the Ticket
Execute a CMD on Remote Host
Pass The Ticket (PTT)
Harvest Tickets from Linux
Check Type and Location of Tickets
If none return, default is FILE:/tmp/krb5cc_%{uid}
In Case of File Tickets it is possible to Copy-Paste them to use them
In Case of being KEYRING Tickets, the Tool tickey can be used to get them
To dump User Tickets, if root, it is recommended to dump them all by injecting in other user processes
To inject, the Ticket have to be copied in a reachable Folder by all Users
Harvest Tickets from Windows
Convert Tickets dumped with Rubeus into base64
Convert Tickets between Linux and Windows Format with ticket_converter.py
https://github.com/Zer1t0/ticket_converter
Using Ticket on Linux
Execute Remote Commands by using TGT
Using Ticket on Windows
Inject Ticket with mimikatz
Inject Ticket with Rubeus
Execute a CMD on Remote Host
Silver Ticket
Impacket Examples
Generate TGS with NTLM
Generate TGS with aesKey
Set the ticket for impacket use
Execute Remote Commands by using TGT
mimikatz Examples
Generate TGS with NTLM
Generate TGS with AES 128bit Key
Generate TGS with AES 256bit Key (More secure Encryption, probably more stealth due is it used by Default)
Inject TGS with Mimikatz
##3## Rubeus Examples
Execute CMD on Remote Host
Golden Ticket
Impacket Examples
Generate TGT with NTLM
Generate TGT with aesKey
Set TGT for Impacket Usage
Execute Remote Commands by using TGT
mimikatz Examples
Generate TGT with NTLM
Generate TGT with AES 128bit Key
Generate TGT with AES 256bit Key (More secure Encryption, probably more stealth due is it used by Default)
Inject TGT with Mimikatz
Rubeus Examples
Inject Ticket with Rubeus
Execute CMD on Remote Host
Get NTLM from Password
Krbrelayx
https://github.com/dirkjanm/krbrelayx
Abuse DNS Delegation Zones with dnstool.py
LAPS
LDAP
https://github.com/infosecn1nja/AD-Attack-Defense
https://www.poweradmin.com/blog/restoring-deleted-objects-from-active-directory-using-ad-recycle-bin/
https://adsecurity.org/?p=2288
Queries
ldapsearch
LD_PRELOAD
https://www.hackingarticles.in/linux-privilege-escalation-using-ld_preload/
shell.c
or
Compiling
Privilege Escalation
LD_LIBRARY_PATH
Get Information about Libraries
shell.c
Compiling
Privilege Escalation
Linux
adduser.sh
capsh
Linux Wildcards
https://www.defensecode.com/public/DefenseCode_Unix_WildCards_Gone_Wild.txt
With the command touch -- --checkpoint=1 will be a file created. Why? Because the -- behind the command touch is telling touch, that there's option to be wait for. Instead of an option, it creates a file, named --checkpoint=1.
or
So after creating the --checkpoint=1 file, i created another file, which executes a shell script.
or
To delete a misconfigured file, put a ./ in front of it.
logrotten
https://github.com/whotwagner/logrotten
Skeleton Payload
Syntax
If "create"-option is set in logrotate.cfg
If "compress"-option is set in logrotate.cfg
Lsass
Dump
Lua
Code Execution
machinectl
Microsoft Windows
Common Commands
Adding Users to Groups
Enable Remote Desktop (RDP)
or
Hashes
https://medium.com/@petergombos/lm-ntlm-net-ntlmv2-oh-my-a9b235c58ed4
https://byt3bl33d3r.github.io/practical-guide-to-ntlm-relaying-in-2017-aka-getting-a-foothold-in-under-5-minutes.html
LM Hashes are deprecated and so there are replaced by an empty string (aad3b435b51404eeaad3b435b51404ee).
If a
Hashstarts with31d6, chances are pretty good, that there is noPasswordset for the user.
LM
Oldestpassword storage used byMicrosoft WindowsIf available, they can be obtained from
SAMdatabases on aMicrosoft Windowssystem or from theNTDSdatabase of aDomain ControllerWhen dumping
SAM/NTDSdatabases, they are shown together within theNTHashbefore the colonCan be used for
Pass-The-Hash
Example
Algorithm
Convert all
lower casetoupper casePad password to
14characters with NULL charactersSplit the password to two
7character chunksCreate two
DESkeys from each7character chunkDES
encryptthe string "KGS!@#$%" with these twochunksConcatenatethe two DES encrypted strings. This is the LM hash.
Cracking
NTHash (NTLM)
The way how passwords are stored on
modernMicrosoft WindowssystemsCan be optained by dumping the
SAMdatabase or usingmimikatzThey are also stored in the
NTDSfile onDomain CotnrollersCan be used for
Pass-The-Hash
Example
Algorithm
Cracking
Net-NTLMv1 (NTLMv1)
NTLMprotocol uses theNTHashinChallenge-Responsebetween aserverand aclientThe
v1of the protocol uses both, theNThash and theLMhash, depending on configuration and what is available.Can be obtained by using
ResponderValues for cracking are
K1,K2orK3from the algorithmVersion 1 is
deprecatedbut still used in some old systems on the networkCan be used for
Relaying
Example
Algorithm
Cracking
Net-NTLMv2 (NTLMv2)
New and improved version of the
NTLMprotocolHarder to crack
Same concept as
NTLMv1, only with a different algorithm and response sent to the serverCan also be captured by using
ResponderDefault in Microsoft Windows since
Microsoft Windows 2000Can be used for
Relaying
Example
Algorithm
Cracking
Privileges and Permissions
AlwaysInstallElevated
Registry Handling
Enable Colored Output
Then open a new Terminal Window.
Check for Auto Run Programs
Get Registry Key Information
Modify Registry Key
Search the Registry for Passwords
Searching for Credentials
Unattended Windows Installations
Potential Files containing Passwords
Search for Passwords
PowerShell History
Saved Windows Credentials
IIS Configuration
PuTTY
Service Handling
Tasks & Services
Scheduled Tasks
Unquoted Service Paths
Search for Unquoted Service Paths by using sc qc.
Insecure Service Permissions
SeBackup and SeRestore Privilege
Backup SAM and SYSTEM Hashes
Dumping Hashes
Pass the Hash
SeTakeOwnership Privilege
Click the Ease of Access button on the logon screen to get a shell with NT Authority\System privileges.
SeImpersonate and SeAssignPrimaryToken Privilege
https://github.com/antonioCoco/RogueWinRM
WMIC
Microsoft Windows Defender
Check Whitelisted Paths
Malicious Test String
Minimalistic Offensive Security Tools
https://github.com/InfosecMatter/Minimalistic-offensive-security-tools
port-scan-tcp.ps1
PassTheCert
https://offsec.almond.consulting/authenticating-with-certificates-when-pkinit-is-not-supported.html
https://github.com/AlmondOffSec/PassTheCert/tree/main/Python
Path Variable Hijacking
Finding accessible SUID Files
Find writeable Paths
Add current Directory
Binary File
pika
Remote Code Execution (RCE)
Ping Sweep
On a Linux Operating System
On a Windows Operating System
With Meterpreter
PKINITtools
plotting
Exploit race condition on linux by swapping file paths between 2 files very quickly (normal file, symlink to root owned file, swap, swap ,swap).
Port Scanning
On a Linux Operating System
On a Windows Operating System
PoshADCS
https://github.com/cfalta/PoshADCS/blob/master/ADCS.ps1
powercat
https://github.com/besimorhino/powercat
File Transfer
Powermad
PowerShell Constrained Language Mode (CLM)
Bypass Test
Bypass
Example
PowerSploit
https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Recon/PowerView.ps1
Import
or
Set Credentials
Example
PowerView
https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1
PRET
https://github.com/RUB-NDS/PRET
procdump
pspy
https://github.com/DominicBreuker/pspy
pth-toolkit
https://github.com/byt3bl33d3r/pth-toolkit
pwncat
https://github.com/calebstewart/pwncat
https://pwncat.readthedocs.io/en/latest/usage.html
Common Commands
Python
System Shell
Python Library Hijacking
https://rastating.github.io/privilege-escalation-via-python-library-hijacking/
https://medium.com/@klockw3rk/privilege-escalation-hijacking-python-library-2a0e92a45ca7
Get the current Path
remoteshell.py
Include Path
rpcclient
LDAP
Queries
Rubeus
https://github.com/GhostPack/Rubeus
Overpass the Hash
Pass the Hash
.NET Reflection
Example
RunasCs
https://github.com/antonioCoco/RunasCs
SeBackupPrivilege Privilege Escalation (diskshadow)
https://github.com/giuliano108/SeBackupPrivilege/tree/master/SeBackupPrivilegeCmdLets/bin/Debug
Script for PowerShell Environment
Copy ntds.dit
Export System Registry Value
Download ndts.dit and system and get the hashes from secretsdump.py of the impacket-suite.
setcap
SharpHound
https://github.com/BloodHoundAD/BloodHound/blob/master/Collectors/SharpHound.exe
Shell Upgrade
or
Alternatively:
Oneliner
Fixing Staircase Effect
or
Sherlock
https://github.com/rasta-mouse/Sherlock
Config
Add Find-AllVulns at the end of the script to run it as soon as it get's loaded.
systemctl
Malicious Service Privilege Escalation
Payload
Installation
Execution
Time Stomping
Universal Privilege Escalation and Persistence Printer
User Group Exploitation
https://wixnic.github.io/linux-privesc-groups/
https://www.hackingarticles.in/multiple-ways-to-get-root-through-writable-file/
Possibilities
Find modifyable Files
Option 1
Option 2
VSS
https://docs.microsoft.com/en-us/windows/security/identity-protection/access-control/active-directory-security-groups#bkmk-serveroperators
Abusing Server Operator Group Membership to get a Reverse Shell
WDigest
Store Cleartext Credentials Cleartext in LSASS
Whisker
Windows-Exploit-Suggester
https://github.com/AonCyberLabs/Windows-Exploit-Suggester
Prerequisites
Update
Usage
winexe
writeDACL
https://blog.fox-it.com/2018/04/26/escalating-privileges-with-acls-in-active-directory/
Usage
Last updated
Was this helpful?