• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Pentest Red Team Techniques - Credential Access

dEEpEst

☣☣ In The Depths ☣☣
Staff member
Administrator
Super Moderator
Hacker
Specter
Crawler
Shadow
Joined
Mar 29, 2018
Messages
13,861
Solutions
4
Reputation
27
Reaction score
45,546
Points
1,813
Credits
55,350
‎7 Years of Service‎
 
56%

Credential Access​

The adversary is trying to steal account names and passwords.

Credential Access consists of techniques for stealing credentials like account names and passwords. Techniques used to get credential include keylogging or credential dumping. Using legitimate credentials can give adversaries access to systems, make them harder to detect, and provide the opportunity to create more accounts to help achieve their goals.

Unsecured Credentials​

Adversaries may search compromised systems to find and obtain insecurely stored credentials. These credentials can be stored and/or misplaced in many locations on a system, including plaintext files (e.g. Bash History), operating system or application-specific repositories (e.g. Credentials in Registry), or other specialized files/artifacts (e.g. Private Keys).
 
Last edited:

Group Policy Preferences​

Adversaries may attempt to find unsecured credentials in Group Policy Preferences(GPP). GPP are tools that allow administrators to create domain policies with embedded credentials. These policies allow administrators to set local accounts.

These group policies are stored in SYSVOL on a domain controller. This means that any domain user can view the SYSVOL share and decrypt the password (using the AES key that has been made public).

The following tools and scripts can be used to gather and decrypt the password file from Group Policy Preference XML files:

· Metasploit's post exploitation module: post/windows/gather/credentials/gpp

· Get-GPPPassword

· Gppredecrypt.py

On the SYSVOL share, adversaries may use the following command to enumerate potential GPP XML files: dir /s * .xml

References:

This site explains it way better and has incredible demonstrations easy to follow.

This link is hidden for visitors. Please Log in or register now.
 

Private Keys​

Adversaries may search for private key certificate files on compromised systems for insecurely stored credentials. Private cryptographic keys and certificates are used for authentication, encryption/decryption, and digital signatures. Common key certificate file extensions include: .key, .pgp, .gpg, .ppk, .p21, .pem, .pfx, .cer, .p7b, .asc.

Adversaries may also look commonly key directories, such as ~/.shh for SSH keys on * nix-based systems or C:\Users\(username)\.ssh\ on Windows. These private keys can be used to authenticate to Remote Services like SSH or for use in decrypting other collected files such as email.

Adversary tools have been discovered that search compromised systems for file extensions relating to cryptographic keys and certificates.

Some private keys require a password or passphrase for operation, so an adversary may also use Input Capture for keylogging or attempt to Brute Force the passphrase off-line.

Example

Even though its uncommon but not impossible there are Windows SSH Server's that allow users to SSH onto their machines. An example of this is BitVise an SSH Server for Windows machines

image

Scanning our machine gives us an SSH info for Windows

image

Some places to search and extensions for are the ones mentioned above or common to SSH we can find our ssh keys in the Windows Folder .ssh

image

To use your SSH keys, copy your public SSH key to the system you want to connect to. Use your private SSH key on your own system. Your private key will match up with the public key, and grant access.
 

Credentials in Registry​

Adversaries may search the Registry on compromised systems for insecurely stored credentials. The Windows Registry stores configuration information that can be used by the system or other programs. Adversaries may query the Registry looking for credentials and passwords that have been stored for use by other programs or services. Sometimes these credentials are used for automatic logons.

Example commands to find Registry keys related to password information:

· Local Machine Hive: reg query HKLM /f password /t REG_SZ /s

· Current User Hive: reg query HKCU /f password /t REG_SZ /s

Example

In this Demo is simply as running both of the commands mentioned with the different permissions available (User and Administrator)

User

image

Administrator

image
 

Credentials in Files​

Adversaries may search local file systems and remote file shares for files containing insecurely stored credentials. These can be files created by users to store their own credentials, shared credential stores for a group of individuals, configuration files containing passwords for a system or service, or source code/binary files containing embedded passwords.

It is possible to extract passwords from backups or saved virtual machines through OS Credential Dumping. Passwords may also be obtained from Group Policy Preferences stored on the Windows Domain Controller.

In cloud environments, authenticated user credentials are often stored in local configuration and credential files. In some cases, these files can be copied and reused on another machine or the contents can be read and then used to authenticate without needing to copy any files.

Example

Let's not go too far, shall we??. Were here checking out the latest and greatest techniques to Dump Credentials, Capture Hashes, and Exploit Services. But what about just searching for the passwords??.

Here is where SauronEye comes in a great tool, that searches incredibly quick through the entire system for keywords and specific file extension.

SauronEye.exe -d C:\Users\dwinchester\ --filetypes .txt .docx .xlsx .xls --contents --keywords password pass* -v

image

References:

This link is hidden for visitors. Please Log in or register now.
 

Steal or Forge Kerberos Tickets​

Adversaries may attempt to subvert Kerberos authentication by stealing or forging Kerberos tickets to enable Pass the Ticket.

Kerberos is an authentication protocol widely used in modern Windows domain environments . In Kerberos environment, referred to as "realms", there are three basic participants: clients, service, and Key Distribution Center (KDC). Clients request access to a service and though=rough the exchange of Kerberos tickets.=, originating from KDC, they are granted access after having successfully authenticated. The KDC is responsible for both authentication and ticket granting. Attackers may attempt to abuse Kerberos by stealing tickets or forging tickets to enable unauthorized access.
 

AS-REP Roasting​

Adversaries may reveal credentials of accounts that have disabled Kerberos preauthenticatiion by Password Cracking Kerberos messages.

Preauthentication offers protection against offline Password Cracking. When enabled, a user requesting access to a resource initiates communications with the Domain Controller (DC) by sending an Authentication Server Request (AS-REQ) message with a timestamp that is encrypted with the hash of their password. If any and only if the DC is able to successfully decrypt the timestamp with the hash of the user's password, it will then send an Authentication Server Response (AS-REP) message that contains the Ticket Granting Ticket(TGT) to the user. Part of the AS-REP message is signed with the user's password.

For each account found without preauthentication, an adversary may send an AS-REQ message without the encrypted timestamp and receive an AS-REP message with TGT data which may be encrypted with an insecure algorithm such as RC4. The recovered encrypted data may be vulnerable to offline Password Cracking attacks similarly to Kerberoasting and expose plaintext credentials.

An account registered to a domain, with or without special privileges, can be abused to list all domain accounts that have preauthentication disabled by utilizing Windows tools like PowerShell with an LDAP filter. Alternatively, the adversary may send an AS-REQ message for each user. If the DC responds without errors, the account does not require preauthentication and the AS-REP message will already contain the encrypted data.

Cracked hashes may enable Persistence, Privilege Escalation, and Lateral Movement via access to Valid Accounts.

Example

As worked previously with Kerberoasting we will use Impacket tools to achieve our goal (Please do remember that this can also be achieved with other tools [Rubeus, PowerShell]). We will first find a user with our credentials form a domain user that we already have access to.

image

Once this is achieved we want to save the hash and crack it.

image

This is a very great technique when enumerating Domain users and you manage to find a user with the

DONT_REQ_PREAUTH value and use this technique to gain credentials.

References:

This link is hidden for visitors. Please Log in or register now.
 

Kerberoasting​

Adversaries may abuse a valid Kerberos ticket-granting ticket (TGT) or sniff network traffic to obtain a ticket-granting service (TGS) ticket that may be vulnerable to Brute Force.

Service principal names (SPNs) are used to uniquely identify each instance of a Windows service. To enable authentication, Kerberos requires that SPNs be associated with at least one service logon account (an account specifically tasked with running a service).

Adversaries possessing a valid Kerberos ticket-granting ticket (TGT) may request one or more Kerberos ticket-granting service (TGS) service tickets for any SPN from a domain controller (DC). Portions of these tickets may be encrypted with the RC4 algorithm, meaning the Kerberos 5 TGS-REP type 23 hash of the service account associated with the SPN is used as the private key and is thus vulnerable to offline Brute Force attacks that may expose plaintext credentials.

This same attack could be executed using service tickets captured from network traffic.

Cracked hashes may enable Persistence, Privilege Escalation, and Lateral movement via access to Valid Accounts.

Example:

First let us understand Kerberos it ensures a high level of security to network resources. It is compromised by 3 different parties. The Key Distribution Center(KDC), the client user and the server with the desired access. The KDC is installed as part of the domain controller and performs two service functions: the Authentication Service (AS) and the Ticket-Granting Service (TGS).

AS (Authentication Service) Exchange

When initially login on to a network, users must negotiate access by providing a log-in name and password in order to be verified by the AS portion of a KDC within their domain. The KDC has access to Active Directory user account information. Once successfully authenticated, the user is granted a Ticket Granting Ticket(TGT) that is valid for the local domain.. The TGT has a default lifetime of 10 hours and may be renewed throughout the users' log-on session without requiring the user to re-enter his password. The TGT is cached on the local machine in volatile memory space and used to request sessions with services throughout the network.

The AS request identifies the client to the KDC in plain text. If preauthentication is enabled, a time stamp will be encrypted using the user's password hash as an encryption key. If the KDC reads a valid time when using the user's password hash (stored in Active Directory) to decrypt the time stamp, the KDC knows that request isn't replay of a previous request. The preauthentication feature may be disabled for a specific user in order to support some applications that don't support the security feature. You can UN-check the "Do not require Kerberos" option in AD.

If the KDC approves the client's request for a TGT, the reply (referred to as the AS reply) will include two sections: a TGT encrypted with a key that only the KDC(TGS) can decrypt and a session key encrypted with the user's password hash to handle future communications with the KDC. Because the client system cannot read the TGT contents, it must blindly present the ticket to the TGS for service tickets. The TGT includes time to live parameters, authorization data, a session key to use when communicating with the client and the client's name.

TGS Exchange

The user presents the TGT to the TGS portion of the KDC when desiring access to a server service. The TGS on the KDC authenticates the user's TGT and creates a ticket and session key for both the client and the remote server. This information, known as the service ticket, is then cached locally on the client machine.

The TGS receives the client's TGT and reads it using its own key. If the TGS approves of the client's request, a service ticket is generated for both the client and the target server. The client reads its portion using the TGS session key retrieved earlier from the AS reply. The client presents the server portion if the TGS reply to the target server in the client/server exchange.

Client/Server Exchange Detail

The client blindly passes the server portion of the service ticket to the server in the client/server request to establish a client/server session. If mutual authentication is enabled, the target server runs a time stamp encrypted using the service ticket session key. If the time stamp decrypts correctly, not only has the client authenticated himself to the server, but the server also has authenticated to the client. The target server never has to directly communicate with the KDC. This reduces downtime and pressure on the KDC.

A TGT and a service ticket are needed to access services on remote computers, but they also are required to successfully log on to a local system. When the log-on window appears, password encryption using a one-way hash algorithm occurs immediately and negotiations commence with the KDC for a valid TGT and service ticket. The process is the same as accessing a remote service. An access token is created for the user containing all security groups to wich they belong. This access token is attached to the user's log-on session and is subsequently inherited by any process or application the users starts.

Referral Tickets

The AS and TGS functions are separate within the KDC. This permits the user to use the TGT obtained from an ASA in his domain to obtain service tickets from a TGS in other domains. This is accomplished through referral tickets.

Once a trust has been established between two domains, referral tickets can be granted to clients requesting authorizing for services in other domains. When there is a trust established between the two domains, an inter-domain key based on the trust passwords becomes available for authenticating KDC functions. This can be explained by example of a user/client seeking services in another domain. User client in example1.com request authority from a server in example2.com. User utilizes referral tickets.

1. The client contacts it's domain KDC TGS using a TGT. The KDC recognizes a request for a session with a foreign domain server and responds by returning a referral ticket for the KDC in the foreign domain.

2. The client contacts the KDC of the foreign domain with the referral ticket. This ticket is encrypted with the inner-domain key. Given that the decryption works, the TGS service for foreign domains returns a service ticket for the server service.

3. The client performs the client/server exchange with the server and begins the user session with the service.

This is only a very small understanding on what is going on with Kerberos.

In a nutshell

Basically, Kerberos comes down to just this:

· a protocol for authentication

· uses tickets to authenticate

· avoids storing passwords locally or sending them over the internet

· involves a trusted 3rd-party

· built on symmetric-key cryptography

Example

On Kerberoasting let us use an incredible tool named Rubeus, its and Upgrade to some PowerShell tools (Not that they aren't necessary) and really great for various attacks on Active Directory.

First let's find some SPN users which we can use for grabbing there hash. Will use a great tool from Impacket to grab these hashes (Please be aware that there are other methods to achieve this and would be great for you to experiment with such as Invoke-Kerberoast with PowerShell)

image

Now let's save this hash and try cracking it with John The Ripper.

image

Above we see the full command for saving the hash.

Now with John the Ripper we pass our custom wordlist (which I recommend to work with instead of random wordlists) and wait for the hash to crack.

image

Kerberoasting is an efficient technique for hackers who have limited rights within a domain. Depending on the strength of the passwords, an attacker can quickly gain access to multiple accounts and then use them to launch additional attacks and collect data. The attack itself cannot be prevented, but selecting strong passwords can make it more difficult. Service accounts should therefore be treated much like
This link is hidden for visitors. Please Log in or register now.
. This includes creating a list of service accounts, checking when the password was last changed, as well as implementing a process for changing passwords on a regular basis.

References:

This link is hidden for visitors. Please Log in or register now.

This link is hidden for visitors. Please Log in or register now.

This link is hidden for visitors. Please Log in or register now.
 

Silver Ticket​

Adversaries who have the password hash of a target service account (e.g. SharePoint, MSSQL) may forge Kerberos ticket granting service (TGS) tickets, also known as silver tickets. Kerberos TGS tickets are also known as service tickets.

Silver tickets are more limited in scope in than golden tickets in that they only enable adversaries to access a particular resource (e.g. MSSQL) and the system that hosts the resource; however, unlike golden tickets, adversaries with the ability to forge silver tickets are able to create TGS tickets without interacting with the Key Distribution Center (KDC), potentially making detecting more difficult.

Password hashes for target services may be obtained using OS Credential Dumping or Kerberoasting.

Example

As mentioned Silver Ticket can be dangerous in there on way since the TGS is forged and no associated to the TGT this means the DC is never contacted. Yes it's more limited to whatever service it's targeted on but that can be sufficient means to reach your goals. Since all the event logs can be spoofed and they are all sent to the targeted server and not the DC this makes it very difficult to track.

Silver Tickets are forged Kerberos Ticket Granting Services (TGS) tickets, also called services tickets. As shown in the following graphic, there is no AS-REQ / AS-REP and no TGS-REQ / TGS-REP communication with the Domain Controller. Since a Silver Ticket is a forged TGS, there is no communication with a Domain controller

Now on this scenario we have a share inaccessible by our domain user that we currently hold DC\Dwinchester. But we are aware of another user that can.

Jwinchester, this being since the users is part of the Data Engineers Group

image

image

And that folder has permissions for that user. We can see that our current user has no permissions to even check the

permissions itself.

image

Since it's a DB folder we try to search for a user that has DB permissions we already know this with Jwinchester.

image

John is the perfect candidate, now let's get a ticket for this account. We will use a tool to grab SPNs

image

And Request the Ticket

image

We will then export the tickets and crack them offline. Crack the ticket and convert it to an NTLM Hash for Demo purposes this is already done.

image

Create the Silver Ticket

image

And remember the share we had no access too?. We can now enumerate the files on the Share

image

References:

This link is hidden for visitors. Please Log in or register now.

This link is hidden for visitors. Please Log in or register now.

This link is hidden for visitors. Please Log in or register now.
 

Golden Ticket​

Adversaries who have the KRBTGT account password hash may forge Kerberos ticket-granting tickets (TGT), also known as a golden ticket. Golden tickets enable adversaries to generate authentication material for any account in Active Directory.

Using a golden ticket, adversaries are then able to request ticket granting service (TGS) tickets, which enable access to specific resources. Golden tickets require adversaries to interact with the Key Distribution Center (KDC) in order to obtain TGS.

The KDC service runs all on domain controllers that are part of an Active Directory domain. KRBTGT is the Kerberos Key Distribution Center (KDC) service account and is responsible for encrypting and signing all Kerberos tickets. The KRBTGT password hash may be obtained using OS Credential Dumping and privileged access to a domain controller.

Example

As explained the most powerful account on the DC the KRBTGT Account this account is used to create TGT to any service in the Domain Controller, all that is needed (Easy to say) is to compromise the Domain Controller or use any other attack (DCSync) to grab the password hash of this account we can then use mimikatz to create and inject the Ticket to any service that is desired and this attack, is incredible for avoiding logs since these are legitimate TGTs.

Let's see this attack in action, after all the enumeration and all the hacking with all your setup you managed to get a shell on the DC (Domain Controller) and you grab a user, and this user has Administrator Access.

image

Here we continue with mimikatz and request the hashes for the KRBTGT user. We can see that there are old hashes and the most current one available for the user.

privilege::debug

lsadump::lsa /inject /name:krbtgt


On the Kali terminal you will need to make this a one-liner so that the mimkatz binary exits properly.

mimikatz.exe "privilege::debug" "lsadump::lsa /inject /name:krbtgt" exit

image

Continuing with the attack now we will request a Golden ticket and create a fake user this user will have total access to the DC and other machines, so from here the fake user created will have to permissions to list the folders of the domain controller. It makes no sense to do this attack since the DC and a high level user has been compromised but this is a great opportunity to avoid detection as these forged tickets are legitimate tickets created by the KRBTGT account.

image

mimikatz.exe "kerberos::golden /domain:dc1.dominioncyber.local /sid:S-1-5-21-4198639423-1025486511-2226459690 /rc4:a8bbd83cc1ded03f7db3b07d78e95036 /user:Youllnevercatchme /id:500 /ptt"

Let's confirm our assumptions.

image

We can list the DC directories and the user was authenticated to it as well, the Ticket is saved in the session and with mimikatz I used the msic::cmdcommand to prompt open a new cmd window with the session in memory this is also a great way to Privesc or to Maintain Persistence on a machine.
 

OS Credential Dumping​

Adversaries may attempt to dump credentials to obtain account login and credential material, normally on the form of a hash or a clear text password, from the operating system and software. Credentials can then be used to perform Lateral Movement and access restricted information.

Several of the tools mentioned in associated sub-techniques may be used by both adversaries and professional security testers. Additional custom tools likely exist as well.
 

DCSync​

Adversaries may attempt to access credentials and other sensitive information abusing a Windows Domain Controller's application programming interface (API) to simulate process from a remote domain controller using a technique called DCSync.

Members of the Administrators, Domain Admins, and Enterprise Admin groups or computer accounts on the domain controller are able to run DCSync to pull password data from Active Directory, which may include current and historical hashes potentially useful accounts such as KRBTGT and Administrators. The hashes can then in turn be used to create a Golden Ticket for use in Pass the Ticketor change an account's password as noted in Account Manipulation.

DCSync functionality has been included in the "lsadump" module in mimikatz. Lsadump also includes NetSync, which performs DCSync over a legacy replication protocol.

Example

DCSync an incredible technique that allows us to impersonate a DC (That is correct, impersonate!!) and request for the hashes of the DC.

This technique is an attack that allows to simulate the behavior of the Domain Controller (DC) in order to retrieve password data via domain replication. Utilizing the Microsoft Directory Replication Service Remote Protocol (MS-DRSR) to simulate the behavior of a DC the attack take's advantage of valid and necessary functions of Active Directory, which cannot be turned off or disabled.

DCSyncer

A tool built around mimikatz it applies the proper parameters and needed information to execute everything automatically it will dump the hashes for all user's no single hash supported, we need Domain Admins or a user with Replicating Directory Changes and Replicate Directory Changes All once these requirements are met we can achieve this attack, the tool is simple to execute and will do everything automatic.

image
 

Cached Domain Credentials​

Adversaries may attempt to access cached domain credentials used to allow authentication to occur in the event a domain controller is unavailable.

On Windows Vista and newer, the hash format is DCC2 (Domain Cached Credentials version 2)hash, known as MS-Cache v2 hash. The number of default cached credentials varies and can be altered per system. This hash does not allow pass-the-hash style attacks, and instead requires Password Cracking to recover the plaintext password.

With SYSTEM access, tools/utilities such as Mimikatz, Reg, and secretsdump.py can be used to extract the cached credentials.

Note: Cached credentials for Windows Vista are derived using PBKDF2.

Example

We can achieve this as well with mimkatz using the lsadump::cache module and retrieve the hashes.

image
 

LSA Secrets​

Adversaries with SYSTEM access to a host may attempt to access Local Security Authority (LSA) secrets, which can contain a variety of different credential materials, such as credentials for service accounts. LSA secrets are stored in the registry at HKEY_LOCAL_MACHINE\SECURITY\Policy\Secrets. LSA secrets can also be dumped from memory.

Reg can be used to extract from the Registry. Mimikatz ca be used to extract secrets from memory.

Example

A demo utilizing mimikatz for LSA Secrets.

image

Above we see just as the previous Demos we can achieve this by using mimikatz and the SAM and SYSTEM hive files as done previously we need to elevate our privileges to SYSTEM.

Reference:

This link is hidden for visitors. Please Log in or register now.
 

NTDS​

Adversaries may attempt to access or create a copy of the Active Directory domain database in order to steal credential information, as well as obtain other information about domain members such as devices, users, and access rights. By default, the NTDS file (NTDS.dit) is located in %Systemroot%\NTDS\Ntds.dit of a domain controller.

In addition to looking NTDS files on active Domain Controllers, attackers may search for backups that contain the same or similar information.

The following tools and techniques can be used to enumerate the NTDDS file and the contents of the entire Active Directory hashes.

· Volume Shadow Copy

· Secretsdump.py

· Using the in-built Windows tool ntdsutil.exe

· Invoke-NinjaCopy

Example

We learned previously to achieve this goal with secretsdump but here we have also PowerShell Tools and some built-in tools from Windows itself (LOLBINS) I will work with some demonstration such as Ninja Copy and ntdsutil.exe

Ntdsutil.exe

When using the following commands the windows utility ntdsutil will create a copy in a directory created by the Tool which will save the ntds.dit file and we will have access to it.

image

With this we can continue and grab the SYSTEM Hive from the Registry Key to decrypt the file and extract the hashes. This can be done offline as well. As DSINternal offer a PowerShell Module that can be used to interact with the file and extract the password hashes.

Sample:

image

References:

This link is hidden for visitors. Please Log in or register now.


This link is hidden for visitors. Please Log in or register now.
 

Security Account Manager​

Adversaries may attempt to extract credential material from the Security Account Manager(SAM) database wither through in-memory techniques or through the Windows Registry where the SAM database is stored. The SAM is a database file that contains local account for the host, typically those found with the net user command. Enumerating the SAM database requires SYSTEM level access.

A number of tools can be used to retrieve the SAM file through in-memory techniques:

· Pwdumpx.exe

· Gsecdump

· Mimikatz

· Secretsdump.py

Alternatively, the SAM can be extracted from the Registry with Reg:

· Reg save HKML\sam sam

· Reg save HKLM\system system

Creddump7 can then be used to process the SAM database locally to retrieve hashes.

Notes: RID 500 account is the local, built-in administrator. RID501 is the guest account. *user accounts start with a RID of 1,000+

Example

In this demo will work with secretsdump and mimkatz very well working tools to achieve these goals, will also work with the Registry to obtain the hashes from them.

For example secretsdump we will attack the DC in this occasion we will use Domain Admin credentials and have it dump the hashes of the entire Domain

image

Above we see the technique successful but be aware that this will NOT dump local accounts only Domain Accounts.

What about mimikatz, dump the SAM and grab credentials as well. To have this attack effective we will need to Dump the SAM Database from Registry.

image

Once running mimkatz we will start the privilege::debug

image

Then elevate our privileges to system by using the token::elevate

image

Then finally grab the creds from the files we save from registry

image

Another tool I encountered was PWDUMP from BlackArchLinux this requires the same two files the SAM and SYSTEM from the Registry and will dump hashes but sure to use the correct order of SYSTEM and then SAM files.

image

I do encourage to try other tools to achieve this goal as well, as there is a plethora of them out there, Good Luck.
 

LSASS Memory​

Adversaries may attempt to access credential material stored in the process memory of the Local Security SubSystem Service (LSASS). After a user logs on, the system generates and stores a variety of credential materials in LSASS process memory. These credential materials can be harvested by an administrative user or SYSTEM and used to conduct Lateral Movement using Use Alternate Authentication Material.

As well as in-memory techniques, the LSASS process memory can be dumped from the target host and analyzed on a local system.

For example, on the target host use procdump:

· Procdump -ma lsass.exe lsass_dump

Locally, mimikatz can be run using:

· Ekurlsa::minidump lsassdump.dmp

· Sekurlsa::logonPasswords

Windows Security Support Provider(SSP) DLLs are loaded into LSASS process at system start. Once loaded into the LSA, SSP DLLs have access to encrypted and plaintext passwords that are stored in Windows, such as any logged-on user's Domain password or smart card PINs. The SSP configuration is stored in two Registry keys:

· HKLM\SYSTEM\CurrentControlSet\Control\Lsa\Security Packages

· HKLM\SYSTEM\CurrentControlSet\Control\Lsa\OSConfig\Security Packages

An adversary may modify these Registry keys to add new SSPs, which will be loaded the next time the system boots, or when AddSecurityPackage Windows API function is called.

The following SSPs can be used to access credentials:

· Msv: Interactive logons, batch logons, and service logons are done through the MSV authentication package.

· Wdigest: The Digest Authentication protocol is designed for use with Hypertext Transfer Protocol (HTTP) and Simple Authentication Security Layer (SASL) exchanges.

· Kerberos: Preferred for mutual client-server domain authentication in Windows 2000 and later.

· CredSSP: Provides SSO and Network Level Authentication for Remote Desktop Services.

Example

There are various methods for Dumping Credentials here but I will work with the most commonly known for Demonstration Purposes, will start with mimikatz.

Administrator Privileges are needed

When we have the mimikatz binary on Disk we can run it with the following commands and Dump Credentials. Down below we see a demonstration of a successful attack

image

Now will continue with another sample, ProcDump. A windows signed binary from SysinternalSuite will create a dump of the lsass process and have credentials stored on it.

image

Above we see the image of Procdump executing and dumping our process. We can see our file below dumped on the machine.

image

Now to extract credentials is simple we can use tools such as mimikatz or pypykatz on another machine and work with this file, here are a few demonstrations:

image

Above we see that we can change mimikatz to MINIDUMP and have it grab the credentials from the DUMP file. But what if we only have a Linux box?, another feasible option would be to use pypykatz the python version of mimikatz.

image

Above we can see a sample of pypykatz grabbing creds from a dump file. Let's proceed with MiniDumpW. This was designed to work specifically with rundll32 it requires 3 arguments where the third one is the should have everything wrapped in quotation marks as the 2 first are ignored.

One of the first thing we need to find first is the process of lsass.exe

image

Once located we use the command properly

image

And we see our dmp file created.

image

We can also use this with mimikatz offline or as well with pypykatz.

image
 

Network Sniffing​

Adversaries may sniff network traffic to capture information about an environment, including authentication material passed over the network. Network sniffing refers to using the network interface on a system to monitor or capture information sent over a wired or wireless connection. An adversary may place a network interface into promiscuous mode to passively access data in transit over the network, or use span ports to capture a larger amount of data.

Data captured via this technique may include user credentials, especially those sent over an insecure, unencrypted protocol. Techniques for name service resolution poisoning, such as LLMNR/NBT-NS Poisoning and SMB Relay, can also be used to capture credentials to websites, proxies, and internal systems by redirecting traffic to an adversary.

Network sniffing may also reveal configuration details, such as running services, version numbers, and other network characteristics (e.g.: IP address, hostnames, VLAN IDs) necessary for subsequent Lateral Movement and/or Defense Evasion activities.

Example

A great tool to work with when dong Network Sniffing is WireShark and Bettercap, I understand there might be more [please do let me know] but these are very common and well known tools to achieve Network Sniffing.

Bettercap:

image

WireShark

image
 

Modify Authentication Process​

Adversaries may modify authentication mechanisms and processes to access user credentials or enable otherwise unwarranted access to accounts. The authentication process is handled by mechanisms, such as the Local Security Authentication Server(LSASS) process and the Security Accounts Manager (SAM) on Windows or pluggable authentication modules (PAM) on Unix-based systems, responsible for gathering, storing, and validating credentials.

Adversaries may maliciously modify a part of this process to either reveal credentials or bypass authentication mechanisms. Compromised credentials or access may be used to bypass authentication mechanisms. Compromised credentials or access may be used to bypass access controls placed on various resources on systems within the network and may even be used for persistent access to remote systems and externally available services, such as VPNs, Outlook Web Access and remote desktop.
 

Password Filter DLL​

Adversaries may register malicious filter dynamic link libraries (DLLs) into the authentication process to acquire user credentials as they are validated.

Windows password filter are password policy enforcement mechanisms for both domain and local accounts. Filters are implemented as DLLs containing a method to validate potential passwords against password policies. Filter DLLs can be positioned on local computers for local accounts and/or domain controllers for domain accounts. Before registering new passwords in the Security Accounts Manager (SAM), the Local Security Authority (LSA) requests validation from each registered filter. Any potential changes cannot take effect until every registered filter acknowledges validation.

Adversaries can register malicious password filters to harvest credentials from local computers and/or entire domains. To perform proper validation, filters must receive plain-text credentials from the LSA. A malicious password filter would receive these plain-text credentials every time a password request is made.

Example:

Props to PentestBlog there is a video Demo!! And also a tool that has been utilized. Please do go check it out.

This link is hidden for visitors. Please Log in or register now.

This link is hidden for visitors. Please Log in or register now.
 
Back
Top