EH Unit 3
EH Unit 3
This stage ensures that all tools, systems, and processes are in place to execute a successful
test, maintain data security, and provide a meaningful deliverable. The following outlines key
components of technical preparation:
By ensuring thorough technical preparation, penetration testers can streamline their efforts,
maintain client trust, and deliver accurate and actionable results.
Managing the Engagement in Ethical Hacking
Managing an ethical hacking engagement demands careful coordination, transparent
communication, and a structured approach to ensure it delivers value to the client while
maintaining the integrity of their systems. Below is an expanded outline of the critical
elements involved:
1. Project Initiation
a. Kick-off Meeting
This initial meeting sets the foundation for the entire engagement by aligning expectations
and defining processes:
• Sponsors and Contact Information: Identify all stakeholders involved in the project,
collecting their contact details and clarifying roles and responsibilities. This includes
defining escalation protocols, risk management roles, and decision-making
authorities to avoid confusion later.
• Building Teams:
o Red Team: Simulates realistic cyberattacks to uncover vulnerabilities.
o Blue Team: Focuses on detecting, preventing, and responding to threats.
o White Team: Mediates between teams, ensures rules are adhered to, and
acts as a bridge between the client and testers.
▪ Key Roles:
▪ CIO (Chief Information Officer): Provides executive-level
sponsorship to ensure alignment with business priorities and
acts as the ultimate authority on critical decisions during the
engagement.
▪ Firm Management: Ensures that the consulting firm’s activities
align with client goals, from resource allocation to managing
unexpected challenges.
▪ Client Technical Advisor: Serves as a knowledgeable liaison
between the client and the testers, minimizing disruptions by
addressing technical concerns efficiently.
o Shadow Consultant (if applicable): This additional resource, provided by the
consulting firm, can enhance the quality of the engagement by supporting
technical tasks and fostering trust with the client.
b. Planning and Scheduling
• Defining Schedule and Milestones: Create a detailed timeline for activities, such as
reconnaissance, scanning, and attack simulations. Ensure flexibility in timelines to
adapt to dynamic scenarios without compromising the test's depth.
• Risk Mitigation and Escalation Planning: Develop a comprehensive plan to handle
potential issues, such as adverse system impacts or data breaches, by outlining
specific escalation protocols and incident management measures.
Key Considerations
1. Flexibility and Adaptation: Ethical hacking engagements are dynamic and require the
ability to adjust strategies and timelines based on real-time findings to maximize
their effectiveness.
2. Clear Communication: Transparent and consistent updates between the service
provider and the client foster trust and ensure alignment on goals and expectations.
3. Balancing Testing Rigor and Risk: Ensure the testing process is thorough, uncovering
all potential vulnerabilities, while minimizing the risk of system disruptions or
damage during the engagement.
By addressing these aspects with a well-structured approach, ethical hacking engagements
can provide actionable insights that strengthen the client’s overall security framework while
maintaining trust and operational continuity.
Key Points on Social Engineering and Its Tactics:
Overview of Social Engineering:
1. Definition: Social engineering exploits human behavior to manipulate individuals into
revealing information or granting access.
2. Forms: Tactics range from emails and phone calls to face-to-face interactions or even
assuming identities to infiltrate organizations.
3. Example: A consultant impersonated a doctor to gain patient records and access
privileges over the phone.
The Physicality of Social Engineering:
1. Human Element: People are the weakest link in security due to mistakes or malicious
intent.
2. Motivators: Financial strain, political affiliations, or personal interests can lead
individuals to compromise security.
3. Testing Philosophy: Tests measure how well security controls protect against human
vulnerabilities and mimic real-world risks.
4. Consequences of Discovery: Catching the tester nullifies the test but adds realism by
increasing stakes similar to those of actual hackers.
Tactics in Social Engineering:
1. Email-Based Attacks:
o Email is a common medium due to its widespread usage and trust among
users.
o Hackers craft emails that appear familiar, using legitimate-looking sender
addresses to lower suspicion.
o Requests in emails often align with the recipient's role, making the request
seem valid.
o Awareness of past email-based viruses (e.g., "ILOVEYOU") has improved
vigilance, but trust in familiar sources remains a vulnerability.
2. Helpdesk Fraud:
Hackers exploit helpdesks, a critical point of contact in organizations, to gain unauthorized
access by manipulating helpdesk staff.
• Tactic:
o Call a helpdesk posing as an employee or legitimate user.
o Request password resets or access to restricted systems.
• Techniques:
o Impersonation: Provide fake credentials, such as fabricated HR IDs or
plausible answers to security questions, often sourced from public
information or prior breaches.
o Urgency and Pressure: Use scenarios like "a critical deadline" to rush the
helpdesk staff into bypassing standard procedures.
o Social Engineering: Build rapport with the helpdesk personnel to lower their
guard.
• Challenges:
o Even with verification mechanisms, helpdesk staff may be manipulated,
especially if the attacker is skilled at exploiting human emotions like sympathy
or urgency.
1. Phishing
Phishing is a cybercrime where attackers deceive individuals into revealing sensitive information, such as login credentials, financial details, or personal
information. This is usually done by pretending to be a trustworthy entity in electronic communications, like emails, messages, or websites. Phishing can cause
financial loss, identity theft, or unauthorized access to accounts.
1. Email Phishing
• Definition: The most common form where attackers send fraudulent emails appearing to be from reputable organizations.
• Characteristics:
o Urgent calls to action (e.g., "Your account will be locked unless you act now").
o Fake links or attachments leading to malicious websites.
• Example: An email from a "bank" requesting you to verify your account details.
2. Spear Phishing
5. Clone Phishing
6. Pharming
• Definition: Redirecting victims to fake websites without their knowledge by compromising DNS (Domain Name System) settings.
• Characteristics:
o Happens even if you type the correct URL.
o Involves manipulating DNS or infected devices.
• Example: Visiting a "bank" website but unknowingly landing on a counterfeit page.
• Definition: Creating fake websites optimized for search engines to rank highly.
• Characteristics:
o Sites appear in search results for common queries.
o Steal information when victims interact.
• Example: A fake shopping website appearing in search results for "cheap electronics."
2. Baiting
Baiting relies on enticing the victim with something attractive, such as free software, music, or USB drives left in public areas.
• Digital Baiting:
o Offering "free" downloads that infect systems with malware.
o Fake advertisements that redirect to malicious sites.
• Physical Baiting:
o Leaving USB drives labeled "Confidential" or "Salary Details" in conspicuous places, hoping someone will plug them into a computer.
3. Pretexting
Pretexting involves fabricating a believable scenario (or pretext) to gain trust and extract information.
• Examples:
o Impersonating IT support to request login credentials.
o Pretending to be a colleague or partner needing sensitive documents urgently.
• Key Components:
o Extensive research to make the pretext convincing.
o Building rapport and establishing credibility.
4. Tailgating and Piggybacking
These are physical social engineering techniques used to gain access to secure areas.
• Tailgating: Following someone through a secure entry point without proper credentials.
• Piggybacking: Convincing someone to hold the door open, typically under a pretext (e.g., “I forgot my badge”).
1. Observation
Observation involves gathering information by watching activities, processes, and habits of a
target. It typically precedes an attack and helps identify exploitable patterns.
• Example 1: A company relying on a shredding service appeared secure but left
sensitive documents in unsecured trash bags. By switching the bags, the tester
gained access to sensitive data.
• Example 2: Observing employees in a smoking area enabled testers to piggyback into
a facility after gaining familiarity with the staff.
Value: Observation reveals vulnerabilities in routines and physical access systems without
directly attacking.
2. Dumpster Diving
This method involves retrieving discarded information from trash to uncover sensitive data.
• Common finds: Network diagrams, internal communications, bills, and human
resource documents.
• Example: Testers discovered a competitor’s previous penetration test deliverables in
a dumpster, demonstrating the risks of inadequate disposal methods.
Value: Provides high-value insights with minimal investment. Mitigation strategies, such as
shredding documents, are simple and effective.
4. Theft
Theft involves removing valuable items or information that have not been discarded.
• Examples: Stealing laptops, badges, or even servers.
• Risks: High-risk activity, requiring clear objectives and customer consent.
• Example: A tester removed a server from a facility to assess exposure to physical
threats but later found it did not contain the targeted database.
Value: Demonstrates the feasibility of physical breaches and theft of assets, emphasizing the
need for stringent physical access controls.
Conclusion
Physical security assessments in ethical hacking complement digital security measures by
addressing vulnerabilities in physical access and operational procedures. Strategies like
observation, dumpster diving, wardriving, and theft reveal critical gaps, helping
organizations implement comprehensive security protocols to mitigate risks.
Internet Reconnaissance:
1. General Information
Internet reconnaissance begins with gathering publicly available data about a target,
leveraging web content and discussions.
1.1 Web Sites
• Importance of Web Sites:
o Central to business operations since the 1990s.
o Companies often share excessive information inadvertently.
• Types of Exposed Information:
o Personal information, work history, photos of executives.
o Press releases, success stories, partnership details, locations, and
documentation.
• Risks of Overexposure:
o Hackers can infer sensitive operational details.
o Unintentional sharing of network security information (e.g., remote access
configurations).
• Sources Beyond Target Site:
o Partner or customer websites may reveal more data about the target.
o Case studies or news articles on external sites may expose security
vulnerabilities.
1.2 Newsgroups
• Definition:
Online discussion forums hosted on Usenet, covering diverse topics.
• Reconnaissance Potential:
o Employees or ex-employees discussing sensitive corporate details.
o E-mail signatures in posts revealing names and domains.
• Example Case:
o An employee revealed firewall misconfigurations while seeking technical help.
o Hacker exploited these details to penetrate the network.
• Value for Testers:
o Helps identify potential security lapses or attacks in progress.
o Provides clues about corporate vulnerabilities from user discussions.
2. Technical Reconnaissance
Technical reconnaissance examines systems and applications to gather information about
the target’s network infrastructure.
2.1 Ping Sweeps
• Purpose:
Discover active systems by sending ICMP (ping) requests.
• Challenges:
o Many networks block ICMP requests to prevent DoS attacks.
o Sequential pings can trigger intrusion detection systems (IDS).
• Alternative Use:
o Effective from inside the network after gaining access to a system.
2.2 Scanning
Network scanning involves sending requests to systems to determine services, ports, and
vulnerabilities.
2.2.1 Types of Scans
1. Passive Scans:
o Sends SYN packets to identify open ports.
o Helps detect active systems, even when ICMP is blocked.
o Focuses on standard ports (1–1023) but can include all ports (1–65535) for
comprehensive results.
o Risk: High-port scans may alert administrators or IDS.
2. Active Scans:
o Completes the connection to confirm service validity.
o Useful against decoys like honeypots or systems ghosting open ports.
o Balances detection risk with deeper verification.
3. Interactive Scans:
o Engages with the service to gather detailed information (e.g., banner data).
o Example: Testing an SMTP server by issuing commands like MAIL FROM or
RCPT.
o Risk: Interaction can resemble exploitation and increases detection likelihood.
2.2.2 Purpose and Caution
• Purpose:
Identify vulnerabilities and characteristics of target systems.
• Caution:
o Must balance thoroughness with stealth to avoid detection.
o Escalation to exploitation phase requires prior approval if ethical testing.
What Is Steganography?
A steganography technique involves hiding sensitive information within an ordinary, non-
secret file or message, so that it will not be detected. The sensitive information will then be
extracted from the ordinary file or message at its destination, thus avoiding
detection. Steganography is an additional step that can be used in conjunction with
encryption in order to conceal or protect data.
Steganography is a means of concealing secret information within (or even on top of) an
otherwise mundane, non-secret document or other media to avoid detection. It comes from
the Greek words steganos, which means “covered” or “hidden,” and graph, which means “to
write.” Hence, “hidden writing.”
You can use steganography to hide text, video, images, or even audio data. It’s a helpful bit
of knowledge, limited only by the type of medium and the author’s imagination.
Ethical Implications
While ethical hacking (penetration testing) aims to identify and fix vulnerabilities, malicious
hacking can lead to severe consequences, including data breaches, financial loss, and
compromised privacy. Governments and organizations globally enforce strict laws to prevent
and punish wireless hacking.
Types of Firewall
3. Software Firewall
A software firewall is any firewall that is set up locally or on a cloud server. When it comes to
controlling the inflow and outflow of data packets and limiting the number of networks that
can be linked to a single device, they may be the most advantageous. But the problem with
software firewall is they are time-consuming.
4. Hardware Firewall
They also go by the name “firewalls based on physical appliances.” It guarantees that the
malicious data is halted before it reaches the network endpoint that is in danger.
5. Application Layer Firewall
Application layer firewall can inspect and filter the packets on any OSI layer, up to the
application layer. It has the ability to block specific content, also recognize when certain
application and protocols (like HTTP, FTP) are being misused. In other words, Application
layer firewalls are hosts that run proxy servers. A proxy firewall prevents the direct
connection between either side of the firewall, each packet has to pass through the proxy.
6. Next Generation Firewalls (NGFW)
• Description: Combine traditional firewall functions with advanced features like
intrusion prevention, deep packet inspection, and threat intelligence.
• Pros: Highly effective against modern threats, such as malware and ransomware.
• Cons: Expensive and resource-intensive.
7. Circuit Level Gateway Firewall
This works as the Sessions layer of the OSI Model’s . This allows for the simultaneous setup
of two Transmission Control Protocol (TCP) connections. It can effortlessly allow data packets
to flow without using quite a lot of computing power. These firewalls are ineffective because
they do not inspect data packets; if malware is found in a data packet, they will permit it to
pass provided that TCP connections are established properly.
8. Stateless firewall
A stateless firewall is a type of network security device that filters packets purely based on
predefined rules, without considering the context or state of a connection. It inspects each
incoming or outgoing packet independently, using criteria like source/destination IP
addresses, port numbers, and protocols. Stateless firewalls are simple and fast but lack the
ability to track active sessions or connections.
What is Honeypot?
In cybersecurity, A honeypot in cybersecurity is a decoy system, server, or application
designed to mimic a real, vulnerable target within a network.It is set up to attract attackers,
allowing defenders to observe and analyze their methods, tools, and tactics. Honeypots can
be used to:
1. Detect Threats: Identify unauthorized access attempts and understand the behavior
of malicious actors.
2. Divert Attacks: Serve as a distraction, reducing the likelihood of successful attacks on
actual systems.
3. Collect Intelligence: Gather data on new or emerging threats to improve defensive
strategies.
4. Improve Security Measures: Test the effectiveness of existing security controls and
learn from vulnerabilities.
Types of Honeypot
1. Based on their deployment, Honeypots are divided into
• Production Honeypots: Mimic real systems and are used in actual network
environments to distract attackers and protect critical assets.
• Research Honeypots: Designed for studying attack strategies and learning about the
latest cyber threats, typically used by security researchers.
Signature-Based IDS
A Signature-Based IDS identifies intrusions by comparing incoming data packets or
activities against a database of known attack patterns or signatures.
Characteristics:
• Database-driven: Relies on pre-defined rules or signatures of known attacks.
• Effective against known threats: Quickly identifies and alerts administrators about
attacks already documented.
• Low false positives: Since it looks for specific patterns, legitimate activities rarely
trigger alerts.
• Requires updates: Needs frequent updates to stay current with new attack
signatures.
Example:
Detecting a SQL injection attempt based on a known malicious payload like:
sql
Copy code
' OR '1'='1' --
Drawback:
• Ineffective against unknown attacks or zero-day exploits, as no signature exists for
new threats.
Anomaly-Based IDS
An Anomaly-Based IDS uses machine learning or statistical analysis to detect unusual
patterns or behaviors that deviate from normal activity.
Characteristics:
• Behavior-driven: Builds a baseline of normal network or system behavior.
• Effective against unknown threats: Can identify zero-day attacks and new threat
patterns.
• High false positives: Legitimate activities that deviate from the baseline can be
flagged as anomalies.
• Requires tuning: Needs training and refinement to accurately distinguish between
normal and malicious activities.
Example:
Flagging a user account that suddenly downloads large amounts of sensitive data
outside of regular working hours.
Drawback:
• More prone to false alarms, especially during the initial stages of deployment.
Comparison Table:
Feature Signature-Based IDS Anomaly-Based IDS
Detection Matches known Detects deviations from
Approach signatures normal behavior
Strong against known Strong against unknown
Effectiveness
threats threats
Requires regular Requires training and
Maintenance
signature updates tuning
False Positives Low High
Example Detecting a virus from a Detecting unusual
Scenario known pattern network spikes
Both methods are often used together in a hybrid approach for comprehensive
security coverage.
IDS tools work by analyzing network packets and comparing them with known attack
signatures or behavioral patterns. If the IDS believes that it has identified an intruder, it
sends an alert to system administrators or security teams. These alerts contain detailed
information about the detected activity, letting employees quickly investigate and react. IDS
plays a vital role in maintaining the security and integrity of computer networks and systems.
The benefits of IDS include:
• Early threat detection: IDS tools can proactively defend against cyberattacks by
detecting potential threats at an early stage of the intrusion.
• Greater visibility: IDS solutions enhance organizations’ visibility into their IT
environment, helping security teams respond to attacks more quickly and effectively.
The limitations of IDS include:
• False positives and false negatives: IDS tools aren’t perfect; they can generate both
false positives (labeling benign events as threats) and false negatives (failing to detect
real threats).
• Inability to prevent attacks: IDS solutions can detect attacks once they occur, but
they are unable to prevent them from occurring in the first place.
What Is IPS (Intrusion Prevention System)?
What is IPS in networking, and how does it differ from IDS? An intrusion prevention system
(IPS) is a cybersecurity solution that builds on the capabilities of IDS. IPS cyber security tools
cannot only detect potential intrusions but also actively prevent and mitigate them.
As with IDS, the types of IPS include:
• Network-based: A network-based IPS (NIPS) is deployed at strategic points within a
computer network, often at network gateways. It can protect the organization’s
entire network, including multiple connected hosts and devices.
• Host-based: A host-based IPS (HIPS) is deployed on a specific machine or server,
offering protection to a single host. It monitors system activities and can take actions
to block or limit access to system resources.
• Hybrid: A hybrid IPS combines both network-based and host-based approaches. For
example, a hybrid IPS may be primarily network-based but also include features for
protecting individual hosts.
The benefits of IPS include:
• Real-time threat prevention: IPS can block or mitigate identified threats in real time,
providing 24/7 automated protection for IT environments.
• Enhanced network defense: Unlike IDS tools, IPS systems are able not only to detect
threats but take action to defend against them by blocking malicious and suspicious
traffic.
The limitations of IPS include:
• Performance impact: IPS tools must examine all incoming and outgoing traffic, which
can introduce latency and slow down network performance.
• Frequent updates: For maximum effectiveness, IPS solutions need to be regularly
updated with the latest information about threat signatures, which can require
significant time investment and expertise.
Differences Between IDS and IPS
Now that we’ve discussed IDS and IPS definitions, what can we say about IDS vs. IPS?
The main difference between IDS and IPS is that while IDS tools are only capable of detecting
intrusions, IPS tools can actively prevent them as well. This basic distinction has several
important repercussions for the question of IDS vs. IPS:
• Functionality: IDS tools are restricted to detecting threats, while IPS tools can both
detect and prevent them.
• Response: IDS tools send alerts when a threat is detected, while IPS tools can
automatically block threats based on predefined security policies or rules.
• Workflow: IDS tools passively monitor data flow, while IPS tools actively inspect
network packets and take action to prevent or mitigate threats.
Advances in IDS/IPS Technology
IDS/IPS technology has significantly evolved since it was introduced. Some developments in
IDS/IPS solutions include:
• Machine learning and AI: IDS/IPS tools can use machine learning and artificial
intelligence to enhance their detection capabilities, learning from historical data
about cyber threats.
• Behavioral analysis: IDS/IPS tools can use a technique known as behavioral analysis:
comparing network traffic or user behavior to a baseline that helps identify
anomalies or deviations.
• Cloud-based deployments: With the increasing adoption of cloud computing, many
IDS/IPS tools can now be deployed in cloud-based IT environments to make them
more flexible and scalable.
IDS/IPS and Regulatory Compliance
Installing IDS and IPS tools may be necessary for organizations to meet regulatory
compliance requirements. The use cases of IDS and IPS for regulatory compliance include:
• Threat detection and incident response: IDS and IPS solutions actively monitor
network traffic, system logs, and events to detect and defend against security
threats.
• Protecting sensitive data: By blocking unauthorized access to confidential
information, IDS and IPS are invaluable tools for complying with data privacy
standards.
• Logging and reporting: IDS and IPS solutions generate system logs and provide
reporting capabilities that companies can use in the event of an external audit.
Many data privacy and security regulations explicitly or implicitly require organizations to
implement IDS and IPS tools. For example, PCI DSS is a security standard for businesses that
handle payment card information. According to PCI DSS Requirement 11.4, companies must
“use network intrusion detection and/or intrusion prevention techniques to detect and/or
prevent intrusions into the network.”
The GDPR (General Data Protection Regulation) is another regulation that may require
IDS/IPS solutions. The GDPR is a law in the European Union that safeguards the privacy of
citizens’ personal data. According to the GDPR, businesses must take “appropriate technical
and organizational measures” to protect this data against breaches and unauthorized access,
which could include deploying an IDS/IPS.
Vulnerabilities are weaknesses in a system that gives threats the opportunity to compromise
assets. All systems have vulnerabilities. Even though the technologies are improving but the
number of vulnerabilities are increasing such as tens of millions of lines of code, many
developers, human weaknesses, etc. Vulnerabilities mostly happened because of Hardware,
Software, Network and Procedural vulnerabilities.
1. Hardware Vulnerability:
A hardware vulnerability is a weakness which can used to attack the system hardware
through physically or remotely.
For examples:
1. Old version of systems or devices
2. Unprotected storage
3. Unencrypted devices, etc.
2. Software Vulnerability:
A software error happen in development or configuration such as the execution of it can
violate the security policy. For examples:
1. Lack of input validation
2. Unverified uploads
3. Cross-site scripting
4. Unencrypted data, etc.
3. Network Vulnerability:
A weakness happen in network which can be hardware or software.
For examples:
1. Unprotected communication
2. Malware or malicious software (e.g.:Viruses, Keyloggers, Worms, etc)
3. Social engineering attacks
4. Misconfigured firewalls
4. Procedural Vulnerability:
A weakness happen in an organization operational methods.
For examples:
1. Password procedure – Password should follow the standard password policy.
2. Training procedure – Employees must know which actions should be taken and what
to do to handle the security. Employees must never be asked for user credentials
online. Make the employees know social engineering and phishing threats.