All exams← All Certified Ethical Hacker (CEH) notes

System Hacking: Certified Ethical Hacker (CEH) revision notes

Revision notes

## System Hacking: Privilege Escalation & Malware

System Hacking involves gaining deeper access to a compromised system and maintaining that access. A primary goal is Privilege Escalation, which is the act of gaining higher-level access than initially obtained. This can be achieved through various methods:

  • Kernel Exploits: Exploiting vulnerabilities in the operating system's kernel to gain root or system-level privileges.
  • Misconfigurations: Leveraging improperly configured services, applications, or file permissions. Examples include SUID/SGID binaries on Linux (allowing a user to run an executable with the permissions of the file owner/group) or weak permissions on Windows services.
  • DLL Hijacking: Placing a malicious DLL in a directory where a legitimate application expects to load a system DLL, causing the application to load the malicious one instead.
  • Path Environment Variable Exploitation: Manipulating the system's PATH variable to execute a malicious binary instead of a legitimate one when a command is run.
  • Scheduled Tasks: Modifying or creating scheduled tasks to execute commands with elevated privileges.

Malware & Evasion

Malware (Malicious Software) is a significant component of system hacking. Key types include:

  • Rootkits: Designed to hide the presence of malware and provide persistent backdoor access by modifying core OS components.
  • Ransomware: Encrypts user data and demands a ransom for its release.
  • Trojans: Disguised as legitimate software but perform malicious actions.
  • Spyware: Gathers information about a user without their knowledge.

Malware Analysis can be Static (examining code without execution, e.g., disassemblers) or Dynamic (observing behavior in a controlled environment, e.g., sandboxes). Attackers use Anti-Malware Evasion techniques like polymorphism, metamorphism, and obfuscation to bypass detection.

Password Attacks & Covering Tracks

Password Cracking is crucial for gaining access to other systems or accounts. Techniques include:

  • Brute-Force Attacks: Trying every possible combination.
  • Dictionary Attacks: Using pre-compiled lists of common passwords.
  • Rainbow Tables: Pre-computed tables of hash values to quickly reverse password hashes (e.g., NTLM for Windows).
  • Hybrid Attacks: Combining dictionary and brute-force methods.

Covering Tracks is essential to avoid detection and maintain persistence. This involves:

  • Clearing Logs: Erasing event logs, web server logs, or other system logs.
  • Modifying Timestamps: Using tools like `touch` (Linux) or `Set-ItemProperty` (PowerShell) to change file access, modification, and creation times.
  • Steganography: Hiding data, such as malicious payloads or exfiltrated information, within seemingly innocent files (images, audio).
  • Alternate Data Streams (ADS): On NTFS file systems, this technique allows data to be hidden within existing files without affecting their apparent size or functionality.

Key facts

Flashcards

What is the primary goal of Privilege Escalation?
To gain higher-level access (e.g., root, administrator) on a compromised system.
tap to reveal
What is the purpose of the SUID bit on a Linux executable?
It allows the executable to run with the permissions of the file owner, regardless of the user executing it.
tap to reveal
Which type of malware is specifically designed to hide its presence and maintain persistent access?
A Rootkit.
tap to reveal
What is Steganography?
The technique of hiding data within other seemingly innocuous data, such as images or audio files.
tap to reveal
What are Rainbow Tables used for in password cracking?
They are pre-computed tables of hash values used to quickly reverse password hashes without brute-forcing each time.
tap to reveal
On an NTFS file system, how can data be hidden without affecting the apparent size of a file?
Using Alternate Data Streams (ADS).
tap to reveal
What is the difference between static and dynamic malware analysis?
Static analysis examines code without execution, while dynamic analysis observes malware behavior in a controlled environment (e.g., sandbox).
tap to reveal
Practice questions

System Hacking: 5 practice questions

Q1. An attacker uses a technique that involves pre-calculating the hashes of millions of likely passwords and storing them in a large lookup file for rapid comparison against a captured password hash. What is this technique called?
  • A.  Hybrid Attack
  • B.  Rainbow Table Attack
  • C.  Brute-Force Attack
  • D.  Pass-the-Hash Attack
Show answer & explanation
✓ Answer: B. Rainbow Table Attack
A Rainbow Table Attack uses precomputed hashes to reverse-lookup a password from its hash, trading significant storage space for a massive increase in cracking speed compared to brute-forcing.
Q2. During post-exploitation on a Windows system, an ethical hacker wants to hide a malicious payload within a legitimate text file without altering its visible size or content. Which NTFS file system feature is ideal for this purpose?
  • A.  Alternate Data Streams (ADS)
  • B.  Encrypting File System (EFS)
  • C.  Volume Shadow Copy Service (VSS)
  • D.  Master File Table (MFT) slack space
Show answer & explanation
✓ Answer: A. Alternate Data Streams (ADS)
Alternate Data Streams (ADS) is an NTFS feature that allows data to be stored in a separate, hidden stream attached to a file, making it invisible to standard directory listings.
Q3. What is the primary goal of using a rootkit after successfully compromising a system?
  • A.  To escalate user privileges to administrator
  • B.  To perform the initial system exploit
  • C.  To hide malicious activities and maintain persistent access
  • D.  To encrypt system files for ransom
Show answer & explanation
✓ Answer: C. To hide malicious activities and maintain persistent access
A rootkit's main function is to conceal the attacker's presence by hiding files, processes, and network connections, thereby maintaining long-term, undetected access to the compromised system.
Q4. An attacker gains a low-privilege shell on a Windows server and discovers a service with an unquoted path: C:\Program Files\Example App\service.exe. How can this misconfiguration be exploited for privilege escalation?
  • A.  By placing a malicious executable named 'Program.exe' in C:\.
  • B.  By using Mimikatz to extract credentials from the service's memory.
  • C.  By performing a DLL hijacking attack in the System32 folder.
  • D.  By modifying the service's permissions in the registry.
Show answer & explanation
✓ Answer: A. By placing a malicious executable named 'Program.exe' in C:\.
The Windows CreateProcess function will try to execute 'C:\Program.exe' if it exists. An attacker can place malware there to have it executed with the service's (often SYSTEM) privileges.
Q5. After gaining access, an attacker wants to clear the Security event log on a modern Windows Server to erase their tracks. Which built-in command-line utility is designed for this task?
  • A.  auditpol.exe
  • B.  wevtutil.exe
  • C.  regedit.exe
  • D.  logman.exe
Show answer & explanation
✓ Answer: B. wevtutil.exe
The 'wevtutil.exe' utility is the modern command-line tool for managing Windows Event Logs. The command 'wevtutil cl Security' is used specifically to clear the Security log.
Test yourself
See the Certified Ethical Hacker (CEH) page

More Certified Ethical Hacker (CEH) topics