EH Ch - 3

Exploiting the Windows OS

--

Why Windows Faces More Risk

--

Workstation vs Server

--

Windows Attack Surface

--

SMB DoS Vulnerability (CVE-2022-32230)

--

Print Spooler Privilege Escalation (CVE-2022-38028)

--

Drivers as an Exploitation Path

--

How Attackers Insert Malicious Drivers

--

Supply Chain Attack Examples

--

Exploiting Windows Networking

--

--

Address Resolution Protocol (ARP)

--
arp.gif

--

ARP Flood / MAC Flooding

--

ARP Poisoning / Spoofing

--

Simple Network Management Protocol (SNMP)

--

!Pasted image 20251125105157.png

SNMP Attacks – Sniff and Capture

--

SNMP Attacks – Impersonate Manager

--

SNMP Attacks – Inject Data

--

Tools for SNMP Attacks

--

Defending Against SNMP Attacks


NetBIOS Overview

NetBIOS (Network Basic Input/Output System) enables communication between programs on computers within a local network.
Runs mainly on TCP port 139.

--
NetBIOS over TCP/IP (NetBT) ports:


NetBIOS Names

Each device has a unique NetBIOS name:

Common suffixes

Name Suffix Service
Computer name 00 Workstation service
Domain name 00 Domain name
Computer name 03 Messenger service
Username 03 Messenger service
Computer name 06 RAS service
Computer name 20 File server service
Computer name 21 RAS client service
Domain name 1B Domain master browser
Domain name 1C Domain controllers
Domain name 1D Master browser
Domain name 1E Browser elections

--
Understanding suffixes reveals valuable targets:


NetBIOS Enumeration

Primary tool: nbtstat.exe
Displays name tables, caches, and sessions.

--

Commands

nbtstat -a <NetBIOS-name> nbtstat -A <IP-address>

--

Useful switches

--

Example

nbtstat -n
Returns the local NetBIOS name table, showing unique/group entries and services running.


Login Accounts

Name Type Description
Administrator Login Account Full system control; cannot be deleted but can be renamed.
Default Account Login Account Default System-Managed Account (DSMA); disabled by default; used for multi-user-aware or user-agnostic programs.
Guest Login Account Very limited login account; deprecated in Windows 10+.
WDAGUtilityAccount Login Account Used by Windows Defender Application Guard to isolate Edge browser sessions.

--

Security Principles

Name Type Description
Authenticated Users Security Principle Basic rights for any authenticated session.
Everyone Security Principle Basic rights without needing authentication.
LOCAL SERVICE Security Principle Same access as standard Users; accesses network as null session (no credentials).
SYSTEM Security Principle Highest privilege; used by OS components like LSASS and SMSS before user login.

--

Security Groups

Name Type Description
Administrators Security Group Grants full administrative privileges; Administrator added by default.
Backup Operators Security Group Can access files regardless of permissions for backup/restore tasks.
Guests Security Group Very limited permissions; Guest account is the default member.

--

Password Attack Paths

1. Exploit → Password Attack

2. Password Attack → Exploit

--
3. Social Engineering for Passwords


Why Attackers Harvest Credentials

Attackers with admin-level access collect as many usernames and passwords as possible.
Credentials allow movement from one machine to entire networks, including financially valuable accounts.


Post-Exploitation Goal

Once inside:


Standalone Systems (Non-Domain)

On standalone Windows systems, account/password data is stored in:


Why Dumping SAM Matters

Even a single SAM file may contain:


Active Directory Environments

In domain networks, credentials are stored in the NTDS database:
C:\Windows\NTDS\ntds.dit
Domain controllers maintain all domain account and password data.


Cached Domain Credentials

Windows clients store recent domain login hashes so users can log in offline.
Attackers dump these to:


Why Credential Dumping Is Powerful

With valid credentials:


Standalone Systems: The Security Accounts Manager (SAM)

On a standalone system (not part of a Windows domain), user account and password data are stored locally in the Security Accounts Manager (SAM) registry hive.

--


Active Directory Domain: The NTDS.DIT Database

For systems that are part of an Active Directory (AD) domain, account and password information is maintained by the Domain Controller(s) in the Active Directory database.

--


Password Caching and Authentication

Windows clients that authenticate to a domain also cache password hashes to allow users to log on even when the Domain Controller is unavailable (e.g., a traveling laptop user).

--


Key Post-Exploit Activity: Dumping SAM and NTDS.DIT

The process of extracting the SAM or the NTDS.DIT file is one of the most powerful steps for privilege escalation, as it yields hashes that can be used for Pass-the-Hash (PtH) attacks or to reveal plaintext passwords (if cracked).

--


LINUX OS HACKING


Linux Security


Exploring the Linux File System

The Linux file system employs a hierarchical structure rooted at the / directory, which is the equivalent of the primary drive in Windows. Unlike Windows, Linux does not use drive letters (like C: or D:); instead, disks are referenced as volumes mounted at a specific point, beginning at the root (/)

--

Access and File Permissions

Permissions are granted to at least one of three categories:

  1. Owner: The creator of the file (automatic permission).
  2. Group: A collection of users that share access rights.
  3. Other: Everyone else on the system.

--

System Essentials and Core Binaries

--

Configuration and System State

--

User Data and Storage


What is SUID?

SUID is a special permission assigned to an executable file that allows the user running it to execute the file with the permissions of the file's owner.

--
Common Use Case: If an application (like the passwd command) needs to make changes to a system-wide file (like /etc/shadow) but is run by a normal user, it is given the SUID permission. Since the owner is typically root, the binary executes with root privileges.

--
Vulnerability: If an SUID binary contains a vulnerability (like a buffer overflow or race condition), an attacker can exploit it to execute arbitrary commands with the owner's elevated privileges, often leading directly to root access.


sudo find / -type f -perm -04000 -ls

All passwords on linux stored in /etc/passwd