EH Ch - 5

Social Engineering


Goals of Social Engineering


Common Social Engineering Techniques


Phishing and Online Attacks


Tools, Threats, and Defense


Phases of a Social Engineering Attack


Research Phase


Target Selection Phase


Relationship Building Phase


Exploitation Phase


Social Engineering Attack Techniques


Physical-Based Social Engineering


Pretexting


Eavesdropping & Shoulder Surfing


Dumpster Diving


Piggybacking / Tailgating


Electronic-Based Social Engineering


Phishing


Common Phishing Techniques


Advanced Phishing Attacks


Scareware


Impersonation Attacks


Common Impersonation Scams


Phone-Based Social Engineering


Smishing and Vishing


Business Email Compromise (BEC)


Hacking Databases

• Databases store sensitive business and user data
• Compromise leads to privacy breaches, financial loss, reputational damage
• Attackers target databases for maximum impact and profit


Why Databases Are Prime Targets

• Designed for efficient data storage and retrieval
• Elevated privileges allow data theft and manipulation
• Malicious content can be injected into stored data
• Privilege escalation often starts from weak applications or internal systems


Common Attack Paths

• SQL Injection through vulnerable input fields
• Compromising internal machines behind the firewall
• Using trusted internal access to reach database servers
• Lateral movement to gain full database control


Finding Databases on the Network

• Databases may be internet-facing or internal
• Identifying database servers is the first attack step


Internet-Exposed Databases

• Full internet scanning is inefficient
• Shodan helps locate publicly exposed database services quickly


Internal Network Discovery

• Used after perimeter compromise
• Enumeration tools identify hosts, ports, and services
• Helps locate internal database servers


Using Nmap for Database Detection

• Scans default database ports
• MSSQL – 1433
• MySQL – 3306
• PostgreSQL – 5432
• MongoDB – 27017
• Elastic – 9300
• Cassandra – 9042


Nmap Scripts and Scanning

• Uses database detection scripts
• mysql-info.nse
• ms-sql-info.nse
• oracle-sid-brute.nse
• db2-info.nse
• Scripts executed using the --script option


Discovering Databases with SQLmap

• Identifies known and unknown SQL databases
• Automates database discovery
• Supports multiple database platforms
• Effective after a target is identified


Exploring databases

Types of Databases

• Relational Database: Data is stored in tables with keys and relationships between tables. A common example is linking customer data with orders using a customer ID.
• Distributed Database: Data is spread across multiple network locations and kept consistent using replication.
• Object-Oriented Database: Data is stored as objects, similar to object-oriented programming concepts, combining data and behavior.


Database Structures

• Record: A collection of related data items treated as a single unit.
• Column: Represents a single data attribute, such as age, status, or location.
• Row: A single entry or line of data within a table, made up of multiple columns.


Network-Based Database Attacks

• These attacks target databases by exploiting weaknesses in the network infrastructure.
• Attackers focus on misconfigurations, insecure architectures, and vulnerable protocols.
• Goals include unauthorized access, data theft, and disruption of database services.


Network-Based Attacks – Listeners & Protocols

• Databases use network listeners to accept client connections (e.g., Oracle, MS SQL, MySQL).
• Attackers probe listeners for buffer overflows, DoS flaws, connector issues, and injections.
• Common listening ports exposed to the internet are heavily scanned.
• Database communication protocols (HTTP/HTTPS, NetBIOS, MS-DCOM, etc.) may contain implementation flaws that enable exploitation.


Database Engine Faults and Bugs

• The database engine processes queries and commands from users and applications.
• It is the most complex component, making it a common source of vulnerabilities.
• Bugs can exist due to design flaws or poor input handling.


Database Engine Faults and Bugs – Impact

• Vulnerabilities include improper user validation and buffer overflows.
• Such flaws may cause the database to return unauthorized data.
• In severe cases, attackers can gain full control over the database engine.


Brute-Force Attacks on Credentials

• Compromised credentials are one of the easiest ways to access databases.
• These attacks are difficult to detect because valid accounts are used.
• Weak or default passwords significantly increase risk.


Misconfigurations

Database security requires continuous maintenance, monitoring, and vulnerability management. Poor configuration practices by administrators or developers often create serious security gaps. Documentation and automation help track changes and reduce human error.


Excessive Services and Privileges

• Using database servers to run extra services like web servers increases attack surface.
• Granting users and service accounts more privileges than necessary violates least-privilege principles.
• Such practices are more commonly observed in Windows-based environments.


Insecure Settings and Weak Controls

• Allowing insecure protocols or unrestricted API access exposes databases to misuse.
• Failure to use built-in security features, such as limiting failed login attempts, weakens defense.
• Not enforcing password complexity enables easy credential compromise.


Monitoring and Production Risks

• Poor query control can lead to excessive CPU usage and database crashes.
• Auditing features left disabled reduce visibility into attacks and misuse.
• Development settings left active in production environments create critical vulnerabilities.