Pentest Notes Mod 1
Pentest Notes Mod 1
Penetration testing
Penetration testing (often called "pen testing") is a controlled cybersecurity assessment
where ethical hackers simulate real-world cyberattacks against an organization’s IT
infrastructure. This includes networks, computer systems, web applications, databases,
and other digital assets. The objective is to uncover security vulnerabilities that could be
exploited by malicious attackers and provide recommendations for mitigation.
Purpose
The primary objective of penetration testing is to enhance the security posture of an
organization by identifying and addressing vulnerabilities before they can be exploited
by cybercriminals. Other purposes include:
Notes Mod 1 1
Definition
A traditional penetration testing model where cybersecurity professionals manually
perform security assessments. Testers simulate an attacker’s perspective to uncover
security flaws that automated tools might miss.
Key Characteristics
Conducted by skilled penetration testers with certifications like CREST, OSCP,
CEH.
Process
1. Planning & Scope Definition
Advantages
Identifies complex vulnerabilities that automated tools miss.
Limitations
Time-consuming and expensive due to human effort.
Notes Mod 1 2
Not continuous, meaning vulnerabilities can emerge between tests.
2. Hybrid Penetration Testing (PTaaS)
Definition
A model that combines manual penetration testing with automated security tools,
offering an efficient and scalable approach.
Key Characteristics
Blends human expertise with automated testing tools.
Process
1. Automated Scanning
Advantages
Faster than manual testing due to automation.
Limitations
Depends on the quality of the automated tools used.
Notes Mod 1 3
Definition
A fully automated penetration testing model that provides continuous security
testing to simulate real-world attacks.
Key Characteristics
Continuously scans and tests for security threats.
Process
1. Continuous Vulnerability Scanning
Advantages
Proactively detects vulnerabilities before attackers do.
Limitations
Cannot replace manual testing entirely—misses logical vulnerabilities.
Notes Mod 1 4
Continuous
Manual Penetration Hybrid Penetration
Feature Automated
Testing Testing (PTaaS)
Penetration Testing
Combination of
Approach Fully manual Fully automated
manual & automated
On-demand or
Frequency One-time or periodic Continuous
scheduled
Key Purpose
Assess security levels, manage risks, comply with regulations, and build customer
trust.
Cost Savings
Helps avoid costs associated with data breaches and cyber-attacks.
Regulatory Compliance
Aligns with standards like PCI DSS, ISO 27001, and NIST CSF.
Strategic Benefits
Notes Mod 1 5
Demonstrates commitment to security for stakeholders.
Maximizing ROI
Conduct penetration testing regularly to keep up with evolving threats.
Software Company
: Improved security of digital services, aligning with Agile development and reducing
business risk
Notes Mod 1 6
various penetration testing types, their objectives, targets, and commonly used
techniques.
Objective:
Test firewalls, routers, switches, VPNs, and other network components for
weaknesses.
Targets:
Common Techniques:
Scanning for open ports and services: Using tools like Nmap to
discover network services and potential entry points.
Objective
Identify security flaws in web applications that attackers could use to steal
data, hijack sessions, or manipulate databases.
Notes Mod 1 7
Targets
Web servers: Hosting applications and databases.
Common Techniques
SQL Injection (SQLi): Injecting malicious SQL queries to extract or modify
database contents.
Objective
Evaluate the security of an organization’s wireless network infrastructure to
prevent unauthorized access and data interception.
Targets
Wi-Fi encryption protocols: WEP, WPA, WPA2, WPA3.
Common Techniques
Cracking weak Wi-Fi encryption: Using tools like Aircrack-ng to break
WEP or weak WPA passwords.
Notes Mod 1 8
Detecting unauthorized access points: Identifying rogue Wi-Fi hotspots set
up to trick users.
Objective
Assess human security awareness by attempting to deceive employees into
revealing sensitive information or granting unauthorized access.
Targets
Employees: Staff members unaware of cybersecurity threats.
Common Techniques
Phishing emails or phone calls: Crafting emails that mimic legitimate
messages to trick employees into providing credentials or clicking malicious
links.
Objective
Evaluate an organization's physical security measures, including access
control systems, surveillance, and alarm mechanisms.
Notes Mod 1 9
Targets
Office buildings and data centers: Checking if physical barriers prevent
unauthorized access.
Common Techniques
Tailgating (Piggybacking): Following an authorized employee into a secured
area without proper authentication.
Penetration testing strategies are essential to ensure a structured and effective approach
to identifying security vulnerabilities. Different strategies help in targeting various
aspects of an organization’s security posture.
Description: The tester has little or no prior knowledge about the target
system.
Key Aspects:
Common Techniques:
Notes Mod 1 10
Port scanning and service enumeration
Key Aspects:
Common Techniques:
Configuration audits
Key Aspects:
Common Techniques:
Notes Mod 1 11
Different Methods of Penetration Testing
There are several different types of penetration testing methodologies that address how
a penetration test should be performed:
These facts provide actionable information that can measurably improve your
operational security.
By using the OSSTMM you no longer have to rely on general best practices,
anecdotal evidence.
Notes Mod 1 12
A. Induction Phase: the Analyst begins the audit with an
understanding of the audit requirements, the scope, and the constraints
to the auditing of this scope.
Discovery phase: which is divided into two parts, the first part includes
information gathering, network scanning, service identification, and OS
detection, the second part involves vulnerability assessment.
Attack phase: which is the heart of every penetration test. If you are able
to compromise a target and a new host is discovered, in case the system is
dual-homed or is connected with multiple interfaces, you would go back to
step 2, that is, discovery, and repeat it until no targets are left. It consists of
things such as “gaining access,” “escalating privileges,” “system
Notes Mod 1 13
browsing,” and “install additional tools.” We will go through each of these
steps in detail in the following chapters.
Reporting phase: indicate that you plan something and you report it you
attack a target and report the results.
Basically contains almost everything that you would test a web application for.
Notes Mod 1 14
Insecure Design: The cause of insecure design is the same as the cause of
insecure coding, which is a lack of knowledge and awareness of security
vulnerabilities. Most of the time, security is not taken as a serious issue
and is not included in the list of requirements for software development.
Notes Mod 1 15
Server-side request forgery (SSRF): is a vulnerability when an application
makes a request to an unauthenticated, remote host and does not validate
the request correctly.
System software security: This type of penetration testing assesses the security of
an organization's operating systems and other system software.
This is the initial phase where the objectives, scope, and methodology of the
penetration test are defined. It involves close collaboration between the penetration
testing team and the organization to ensure a safe and effective test.
Notes Mod 1 16
Key Activities:
Defining the Scope: Identify which systems, networks, and applications will
be tested (e.g., internal vs. external systems).
Setting the Timeline and Deliverables: Establish a timeline for testing and
define the expected outcomes.
Key Activities:
Passive Reconnaissance: Collect publicly available information about the
target, such as domain names, IP addresses, WHOIS records, employee details,
and social media intelligence.
Active Reconnaissance: Use tools like Nmap to scan for open ports,
operating systems, and running services.
Key Activities:
Notes Mod 1 17
Gaining Initial Access: Exploiting identified vulnerabilities using tools like
Metasploit, SQLmap, and Burp Suite.
4. Reporting Phase
Once the test is complete, a detailed report is created, outlining the findings, risks,
and recommendations. This report is presented to the organization to help them
mitigate vulnerabilities.
Notes Mod 1 18
1. Pre-engagement (Planning and Preparation)
This initial phase defines the scope, rules of engagement, and objectives of the
penetration test. It ensures that the testing process is conducted in a safe, legal, and
efficient manner.
Key Activities:
Defining scope (systems, networks, applications to be tested).
Selecting the type of penetration test (Black Box, Gray Box, or White Box).
Key Activities:
Passive Reconnaissance: Gathering publicly available data (e.g., WHOIS records,
social media, company websites).
3. Vulnerability Analysis
In this phase, testers analyze the gathered information to identify security weaknesses
in the target environment.
Key Activities:
Notes Mod 1 19
Scanning for known vulnerabilities using tools like Nessus, OpenVAS, or Burp
Suite.
Mapping attack paths to determine how an attacker might move through the
network.
Key Activities:
Using tools like Metasploit, SQLmap, Hydra to exploit weaknesses.
⚠️ Note: The goal is not to cause damage but to assess real-world security risks.
5. Post-Exploitation (Maintaining Access)
If the penetration tester gains access, they simulate what a real attacker would do after
breaching the system.
Key Activities:
Privilege Escalation: Gaining admin/root-level access.
Notes Mod 1 20
Persistence Mechanisms: Attempting to plant backdoors or maintain access (if
allowed).
Key Activities:
Removing malicious payloads, backdoors, scripts, and tools.
Notes Mod 1 21
OSSTMM (Open Source Security Testing Methodology Manual):
These facts provide actionable information that can measurably improve your
operational security.
By using the OSSTMM you no longer have to rely on general best practices,
anecdotal evidence.
Notes Mod 1 22
conveyed to interactions with assets. This phase will define the scope.
Discovery phase: which is divided into two parts, the first part includes
information gathering, network scanning, service identification, and OS
detection, the second part involves vulnerability assessment.
Attack phase: which is the heart of every penetration test. If you are able
to compromise a target and a new host is discovered, in case the system is
dual-homed or is connected with multiple interfaces, you would go back to
step 2, that is, discovery, and repeat it until no targets are left. It consists of
things such as “gaining access,” “escalating privileges,” “system
browsing,” and “install additional tools.” We will go through each of these
steps in detail in the following chapters.
Reporting phase: indicate that you plan something and you report it you
attack a target and report the results.
Notes Mod 1 23
Basically contains almost everything that you would test a web application for.
Insecure Design: The cause of insecure design is the same as the cause of
insecure coding, which is a lack of knowledge and awareness of security
vulnerabilities. Most of the time, security is not taken as a serious issue
and is not included in the list of requirements for software development.
Notes Mod 1 24
Default Credentials being used
Notes Mod 1 25
Key Characteristics:
Defined Scope:
A good penetration test begins with a clearly defined scope. This includes
specifying the systems, networks, and applications to be tested, as well as the
limitations of the test.
The test should simulate real-world attack scenarios to accurately assess the
organization's security posture. This involves using the same tools and
techniques that malicious actors would use.
Comprehensive Reporting:
The penetration test should produce a detailed report that outlines the findings
of the test, including the vulnerabilities that were found, the steps that were
taken to exploit them, and recommendations for remediation.
Ethical Conduct:
Skilled Testers:
It is very important that the penetration testers are skilled. The testers must
have up to date knowledge of current threats, and how to test for them.
Clear Communication:
Good communication is needed between the penetration testing team and the
organization being tested. This helps to ensure that the testing is conducted
smoothly and that the organization understands the findings of the test.
Additional Considerations:
Notes Mod 1 26
Regular Testing:
Remediation:
The organization should take steps to remediate the vulnerabilities that are
found during the penetration test.
By adhering to these characteristics, organizations can ensure that their penetration tests
are effective in identifying and mitigating security risks.
Notes Mod 1 27