CompTIA Security+ Exam Notes

CompTIA Security+ Exam Notes
Let Us Help You Pass

Wednesday, October 29, 2025

Inside Hash-Based Relay Attacks: How NTLM Authentication Is Exploited

 Hash-Based Relay Attack

A hash-based relay attack, often referred to as an NTLM relay attack, is a technique used by attackers to exploit authentication mechanisms in Windows environments—particularly those using the NTLM protocol. Here's a detailed explanation:

What Is a Hash-Based Relay?
In a hash-based relay attack, an attacker captures authentication hashes (typically NTLM hashes) from a legitimate user and relays them to another service that accepts them, effectively impersonating the user without needing their password.

How It Works – Step by Step
1. Intercepting the Hash
  • The attacker sets up a rogue server (e.g., using tools like Responder) that listens for authentication attempts.
  • When a user tries to access a network resource (e.g., a shared folder), their system sends NTLM authentication data (hashes) to the rogue server.
2. Relaying the Hash
  • Instead of cracking the hash, the attacker relays it to a legitimate service (e.g., SMB on port 445) that accepts NTLM authentication.
  • If the target service does not enforce protections like SMB signing, it will accept the hash and grant access.
3. Gaining Access
  • The attacker now has access to the target system or service as the user whose hash was relayed.
  • This can lead to privilege escalation, lateral movement, or data exfiltration.
Tools Commonly Used
  • Responder: Captures NTLM hashes from network traffic.
  • ntlmrelayx (Impacket): Relays captured hashes to target services.
  • Metasploit: Includes modules for NTLM relay and SMB exploitation.
Common Targets
  • SMB (port 445): Most common and vulnerable to NTLM relay.
  • LDAP, HTTP, RDP: Can also be targeted depending on configuration.
  • Exchange, SQL Server, and other internal services.
Defenses Against Hash-Based Relay Attacks
  • Technical Controls
    • Enforce SMB signing: Prevents unauthorized message tampering.
    • Disable NTLM where possible: Use Kerberos instead.
    • Segment networks: Limit exposure of sensitive services.
    • Use strong firewall rules: Block unnecessary ports and services.
  • Monitoring & Detection
    • Monitor for unusual authentication patterns.
    • Use endpoint detection and response (EDR) tools.
    • Log and alert on NTLM authentication attempts.

Tuesday, October 28, 2025

Understanding TLS Proxies: How Encrypted Traffic Is Inspected and Managed

 TLS Proxy

A TLS proxy (Transport Layer Security proxy) is a device or software that intercepts and inspects encrypted traffic between clients and servers. It acts as a man-in-the-middle (MITM) for TLS/SSL connections, allowing organizations to monitor, filter, or modify encrypted communications for security, compliance, or performance reasons.

How a TLS Proxy Works
1. Client Initiates TLS Connection:
  • A user’s device (client) tries to connect securely to a server (e.g., a website using HTTPS).
2. Proxy Intercepts the Request:
  • The TLS proxy intercepts the connection request and presents its own certificate to the client.
3. Client Trusts the Proxy:
  • If the proxy’s certificate is trusted (usually via a pre-installed root certificate), the client establishes a secure TLS session with the proxy.
4. Proxy Establishes Connection to Server:
  • The proxy then initiates a separate TLS session with the actual server.
5. Traffic Inspection and Forwarding:
  • The proxy decrypts the traffic from the client, inspects or modifies it, then re-encrypts it and forwards it to the server, and vice versa.
Why Use a TLS Proxy?
Security
  • Detect malware hidden in encrypted traffic.
  • Prevent data exfiltration.
  • Enforce security policies (e.g., block access to specific sites).
Compliance
  • Ensure sensitive data (e.g., PII, financial information) is handled in accordance with regulations such as GDPR and HIPAA.
Monitoring & Logging
  • Track user activity for auditing.
  • Analyze traffic patterns.
Performance Optimization
  • Cache content.
  • Compress data.
Challenges and Risks
  • Privacy Concerns: Intercepting encrypted traffic can violate user privacy.
  • Trust Issues: If the proxy’s certificate isn’t properly managed, users may see security warnings.
  • Breaks End-to-End Encryption: TLS proxies terminate encryption, which can be problematic for apps requiring strict security.
  • Compatibility Problems: Some applications (e.g., certificate pinning) may fail when TLS is intercepted.
Common Use Cases
  • Enterprise Networks: To inspect employee web traffic.
  • Schools: To block inappropriate content.
  • Security Appliances: Firewalls and antivirus solutions often include TLS proxy capabilities.
  • Cloud Services: For secure API traffic inspection.

WinPEAS: Windows Privilege Escalation Tool Overview

 WinPEAS
(Windows Privilege Escalation Awsome Script)

WinPEAS (Windows Privilege Escalation Awesome Script) is a powerful post-exploitation tool used primarily by penetration testers, ethical hackers, and red teamers to identify privilege escalation opportunities on Windows systems. Here's a detailed breakdown of its purpose, functionality, and usage:

What Is WinPEAS?
WinPEAS is part of the PEASS-ng suite developed by Carlos Polop. It automates scanning Windows systems for misconfigurations, vulnerabilities, and security weaknesses that could allow a low-privileged user to escalate their privileges. 

Key Features
  • Automated Enumeration: Scans for privilege escalation vectors across services, registry, file permissions, scheduled tasks, and more.
  • Color-Coded Output: Highlights critical findings in red, informative ones in green, and other categories in blue, cyan, and yellow for quick visual analysis. [manageengine.com]
  • Lightweight & Versatile: Available in .exe, .ps1, and .bat formats, compatible with both x86 and x64 architectures.
  • Offline Analysis: Output can be saved for later review.
  • Minimal Privilege Requirement: Can run without admin rights and still gather valuable system data.
Privilege Escalation Vectors Detected
WinPEAS identifies a wide range of potential vulnerabilities, including:
  • Unquoted Service Paths: Services with paths not enclosed in quotes can be exploited to run malicious executables.
  • Weak Service Permissions: Services that can be modified by non-admin users.
  • Registry Misconfigurations: Keys like AlwaysInstallElevated that allow MSI files to run with admin privileges.
  • Writable Directories & Files: Identifies locations where low-privileged users can write or modify files.
  • DLL Hijacking Opportunities: Detects insecure DLL loading paths.
  • Scheduled Tasks: Finds misconfigured or vulnerable scheduled tasks.
  • Token Privileges: Checks for powerful privileges like SeDebugPrivilege or SeImpersonatePrivilege. 
WinPEAS Variants
  • winPEAS.exe: C# executable, requires .NET ≥ 4.5.2.
  • winPEAS.ps1: PowerShell script version.
  • winPEAS.bat: Batch script version for basic enumeration.
Each variant is suited for different environments and levels of access. The .exe version is the most feature-rich. 

Execution Steps
1. Download: Get the latest version from the https://github.com/peass-ng/PEASS-ng/releases/latest.
2. Transfer to Target: Use SMB, reverse shell, or HTTP server.
3. Run the Tool:


Or redirect output:


4. Analyze Output: Focus on red-highlighted sections for critical escalation paths.

Use Cases
  • CTFs and Training Labs
  • Internal Penetration Tests
  • Real-World Breach Simulations
  • Security Audits

Monday, October 27, 2025

Cisco Discovery Protocol Explained: Features, Commands, and Use Cases

 CDP (Cisco Discovery Protocol)

Cisco Discovery Protocol (CDP) is a proprietary Layer 2 network protocol developed by Cisco Systems. It is used to share information about directly connected Cisco devices, helping network administrators discover and manage network topology more efficiently.

Purpose of CDP
CDP allows Cisco devices to advertise their existence and capabilities to neighboring devices. It helps in:
  • Network mapping
  • Troubleshooting connectivity issues
  • Verifying device configurations
  • Identifying misconfigured or unauthorized devices
How CDP Works
  • CDP operates at Layer 2 (Data Link Layer) of the OSI model.
  • It sends periodic broadcast messages (CDP advertisements) to multicast MAC address 01:00:0C:CC:CC:CC.
  • These messages contain information such as:
    • Device ID (hostname)
    • IP address
    • Port ID
    • Platform (hardware model)
    • Capabilities (e.g., router, switch)
    • Software version
CDP Packet Structure
Each CDP packet includes:
  • Header: Protocol version and TTL (Time to Live)
  • TLVs (Type-Length-Value): Encoded fields that carry device information
Common CDP Commands (Cisco CLI)
  • show cdp neighbors: Displays directly connected Cisco devices
  • show cdp neighbors detail: Provides detailed info, including IP addresses
  • cdp enable: Enables CDP on an interface
  • no cdp enable: Disables CDP on an interface
  • cdp run: Enables CDP globally
  • no cdp run: Disables CDP globally
Security Considerations
  • CDP can expose sensitive network information if not properly secured.
  • It should be disabled on interfaces connected to untrusted networks (e.g., internet-facing ports).
  • Alternatives like LLDP (Link Layer Discovery Protocol) are preferred in multi-vendor environments.
Use Cases
  • Network topology discovery
  • Automated inventory management
  • Troubleshooting and diagnostics
  • VoIP deployments (e.g., auto-configuring IP phones)

Rubeus: Kerberos Exploitation for Penetration Testers

 Rubeus

Rubeus is a powerful post-exploitation tool designed to abuse Kerberos in Windows Active Directory (AD) environments. It’s widely used by penetration testers and red teamers to manipulate authentication mechanisms, extract credentials, and move laterally across compromised networks.

What Is Kerberos?
Kerberos is a network authentication protocol used in AD environments. It uses tickets to allow nodes to prove their identity securely. Rubeus interacts with these tickets to perform various attacks.

Key Capabilities of Rubeus
1. Kerberoasting
  • Extracts service account hashes from service tickets (TGS).
  • These hashes can be cracked offline to reveal plaintext passwords.
2. Ticket Harvesting
  • Dumps Kerberos tickets from memory (e.g., using sekurlsa::tickets via Mimikatz).
  • Useful for replay or pass-the-ticket attacks.
3. Pass-the-Ticket
  • Injects stolen Kerberos tickets into memory to impersonate users.
  • Enables lateral movement without needing passwords.
4. Overpass-the-Hash
  • Uses NTLM hashes to request Kerberos tickets.
  • Bridges NTLM and Kerberos authentication methods.
5. Golden Ticket Attack
  • Creates forged TGTs using the KRBTGT account hash.
  • Grants unrestricted access to the domain.
6. Silver Ticket Attack
  • Creates forged service tickets (TGS) for specific services.
  • Less detectable than Golden Tickets.
7. AS-REP Roasting
  • Targets accounts that don’t require pre-authentication.
  • Extracts encrypted data that can be cracked offline.
8. Ticket Renewal and Request
  • Requests new tickets or renews existing ones.
  • Useful for maintaining persistence.
Why Rubeus Is Valuable
  • Written in C#, making it easy to compile and modify.
  • It can be executed in memory to evade antivirus detection.
  • Integrates well with other tools like Mimikatz and Cobalt Strike.
Ethical Use
Rubeus should only be used in environments where you have explicit permission to test. Unauthorized use is illegal and unethical.

Sunday, October 26, 2025

Broadcast Domains: Definition, Examples, and Management

 Broadcast Domain

A broadcast domain is a logical division of a computer network in which all devices can directly receive broadcast frames from any other device within the same domain. In simpler terms, it's a segment of a network where a broadcast sent by one device is heard by all the different devices.

How It Works
When a device sends a broadcast message (e.g., ARP requests or DHCP discovery), that message is intended for all devices in the same broadcast domain. These messages are typically sent to the MAC address FF:FF:FF:FF:FF:FF, which is the broadcast address at the data link layer.

What Defines a Broadcast Domain?
  • Routers: Break up broadcast domains. A broadcast sent in one domain will not pass through a router to another.
  • Switches and Hubs: By default, do not break broadcast domains. All ports on a switch (unless configured with VLANs) are in the same broadcast domain.
  • VLANs (Virtual LANs): Can be used to create multiple broadcast domains on a single switch.
Example Scenario
Imagine a small office network:
  • All computers are connected to the same switch.
  • If one computer sends a broadcast (e.g., looking for a printer), all others receive it.
  • This is one broadcast domain.
Now, if a router is placed between two switches:
  • Broadcasts from one side won’t reach the other.
  • Each side is now a separate broadcast domain.
Why Broadcast Domains Matter
  • Performance: Too many devices in a single broadcast domain can lead to excessive broadcast traffic, slowing the network.
  • Security: Isolating broadcast domains can help contain potential threats or misconfigurations.
  • Scalability: Segmenting networks into smaller broadcast domains makes them easier to manage and troubleshoot.
How to Manage Broadcast Domains
  • Use routers or Layer 3 switches to segment networks.
  • Implement VLANs to logically separate devices even if they’re on the same physical switch.
  • Monitor broadcast traffic to avoid broadcast storms.

KRACK Wi-Fi Attack: How It Works and How to Stay Safe

 KRACK (Key Reinstallation Attack)

KRACK (Key Reinstallation Attack) is a serious vulnerability discovered in 2017 that affects the WPA2 protocol, which secures most modern Wi-Fi networks. Here's a detailed explanation:

What Is KRACK?
KRACK is a man-in-the-middle (MitM) attack that exploits a flaw in the 4-way handshake used by WPA2 to establish a secure connection between a client (like a phone or laptop) and a Wi-Fi access point.

The attack was discovered by Mathy Vanhoef, a security researcher, and it revealed that WPA2, previously considered very secure, had a critical design flaw.

How the WPA2 4-Way Handshake Works
When a device connects to a Wi-Fi network, the 4-way handshake is used to:
1. Confirm that both the client and access point know the correct password.
2. Generate a fresh encryption key, called the PTK (Pairwise Transient Key).
3. Install the key to encrypt traffic.

How KRACK Exploits the Handshake
The vulnerability lies in Step 3 of the handshake. If an attacker replays the third message of the handshake, the client will reinstall the same encryption key, resetting associated parameters such as the packet number (nonce).

This allows the attacker to:
  • Decrypt packets.
  • Replay packets.
  • Forge packets.
  • In some cases, inject malware or manipulate data.
What KRACK Can Do
  • Eavesdrop on sensitive data like passwords, emails, and credit card numbers.
  • Hijack connections to websites or services.
  • Inject malicious content into unencrypted HTTP traffic.
Who Is Affected?
  • All WPA2 implementations were vulnerable at the time of discovery.
  • Affected devices include Windows, Linux, Android, macOS, iOS, and many IoT devices.
  • Android and Linux were especially vulnerable due to how they handled key reinstallation (they reset the key to all zeros).
How to Protect Against KRACK
1. Update your devices: Most major vendors released patches shortly after the vulnerability was disclosed.
2. Use HTTPS: Even if Wi-Fi is compromised, HTTPS encrypts web traffic.
3. Use VPNs: Adds an extra layer of encryption.
4. Replace outdated routers: Some older routers may never receive patches.

Final Thoughts
KRACK didn’t break the encryption algorithm itself (like AES), but instead exploited a flaw in how the protocol was implemented. It was a wake-up call for the security community and led to the development of WPA3, which addresses many of WPA2’s weaknesses.