Pentest Studyguide Pt0-001 Samplelesson
Pentest Studyguide Pt0-001 Samplelesson
Pentest Studyguide Pt0-001 Samplelesson
PenTest+
Study Guide
Exam PT0-001
The Official
CompTIA®
PenTest+® Study
Guide (Exam
PT0-001)
Copyrighted Material
Acknowledgements
Notices
DISCLAIMER
While CompTIA, Inc. takes care to ensure the accuracy and quality of these materials, we cannot guarantee their accuracy, and all
materials are provided without any warranty whatsoever, including, but not limited to, the implied warranties of merchantability or
fitness for a particular purpose. The use of screenshots, photographs of another entity's products, or another entity's product name
or service in this book is for editorial purposes only. No such use should be construed to imply sponsorship or endorsement of the
book by nor any affiliation of such entity with CompTIA. This courseware may contain links to sites on the Internet that are owned
and operated by third parties (the "External Sites"). CompTIA is not responsible for the availability of, or the content located on or
through, any External Site. Please contact CompTIA if you have any concerns regarding such links or External Sites.
TRADEMARK NOTICES
® ®
CompTIA , PenTest+ , and the CompTIA logo are registered trademarks of CompTIA, Inc., in the U.S. and other countries. All other
product and service names used may be common law or registered trademarks of their respective proprietors.
COPYRIGHT NOTICE
Copyright © 2018 CompTIA, Inc. All rights reserved. Screenshots used for illustrative purposes are the property of the software
proprietor. Except as permitted under the Copyright Act of 1976, no part of this publication may be reproduced or distributed in any
form or by any means, or stored in a database or retrieval system, without the prior written permission of CompTIA, 3500 Lacey
Road, Suite 100, Downers Grove, IL 60515-5439.
This book conveys no rights in the software or other products about which it was written; all use or licensing of such software or
other products is the responsibility of the user according to terms and conditions of the owner. If you believe that this book, related
materials, or any other CompTIA materials are being reproduced or transmitted without permission, please call 1-866-835-8020 or
visit www.help.comptia.org.
Copyrighted Material
| Table of Contents |
Copyrighted Material
Copyrighted Material
Security remains one of the hottest topics in IT and other industries. It seems that each
week brings news of some new breach of privacy or security. As organizations scramble to
protect themselves and their customers, the ability to conduct penetration testing is an
emerging skill set that is becoming ever more valuable to the organizations seeking
protection, and ever more lucrative for those who possess these skills. In this guide, you will
be introduced to some general concepts and methodologies related to pen testing, and you
will work your way through a simulated pen test for a fictitious company.
This guide can also assist you if you are pursuing the CompTIA PenTest+ certification, as
tested in exam PT0-001. The guide is designed to provide content and activities that
correlate to the exam objectives, and therefore can be a resource as you prepare for the
examination.
Guide Description
Target Student
This guide is designed for IT professionals who want to develop penetration testing skills to
enable them to identify information-system vulnerabilities and effective remediation
techniques for those vulnerabilities. Target students who also need to offer practical
recommendations for action to properly protect information systems and their contents will
derive those skills from this guide.
This guide is also designed for individuals who are preparing to take the CompTIA PenTest
+ certification exam PT0-001, or who plan to use PenTest+ as the foundation for more
advanced security certifications or career roles. Individuals seeking this certification should
have three to four years of hands-on experience performing penetration tests, vulnerability
assessments, and vulnerability management.
Guide Prerequisites
To be fit for this advanced guide, you should have:
• Intermediate knowledge of information security concepts, including but not limited to
identity and access management (IAM), cryptographic concepts and implementations,
computer networking concepts and implementations, and common security
technologies.
• Practical experience in securing various computing environments, including small to
medium businesses, as well as enterprise environments.
You can obtain this level of skills and knowledge by training for CompTIA® Security+®
(Exam SY0-501) or by demonstrating this level of knowledge by passing the exam.
Copyrighted Material
Guide Objectives
After you complete this guide, you will be able to plan, conduct, analyze, and report on penetration
tests.
You will:
• Plan and scope penetration tests.
• Conduct passive reconnaissance.
• Perform non-technical tests to gather information.
• Conduct active reconnaissance.
• Analyze vulnerabilities.
• Penetrate networks.
• Exploit host-based vulnerabilities.
• Test applications.
• Complete post-exploit tasks.
• Analyze and report pen test results.
As a Reference
The organization and layout of this book make it an easy-to-use resource for future reference.
Taking advantage of the glossary, index, and table of contents, you can use this book as a first
source of definitions, background information, and summaries.
Guide Icons
Watch throughout the material for the following visual cues.
Icon Description
A Caution note makes you aware of places where you need to be particularly careful
with your actions, settings, or decisions so that you can be sure to get the desired
results of an activity or task.
Lesson Introduction
In today's computing environment, security exploits and issues are more prevalent than
ever. Most organizations have developed strong security postures to protect their assets. In
many cases, these security postures include the practice of testing the organization's
information systems to determine how resistant they are to unauthorized access and usage.
Providing a clear plan and specifying the scope of these tests is essential for both the
organization and the individuals performing the testing, as these actions ensure that the
testing process is clearly bounded and understood by all stakeholders.
Lesson Objectives
In this lesson, you will:
• Explain common concepts related to penetration testing.
• Plan a pen test engagement.
• Scope and negotiate a pen test engagement.
• Prepare for a pen test engagement.
Copyrighted Material
TOPIC A
Introduction to Penetration Testing Concepts
Before you begin to plan and scope a penetration test, it is essential that you have a grasp of certain
basic concepts surrounding the practice of penetration testing. This topic introduces those concepts,
along with generally accepted processes and toolsets, to provide a core base of information upon
which you can build your penetration testing skills and experience.
Penetration Testing
Penetration Testing Often, the terms "vulnerability assessment" and "penetration testing" are used interchangeably,
You can also compare although they are not the same. The key difference between the two is validation. Vulnerability
pen testing to other assessment is the practice of evaluating a computer system, a network, or an application to identify
security exercises. You potential weaknesses. It is typically performed using an automated tool, which produces a list of
might consider polling vulnerabilities based on known signatures. Many of these can be false positives or not actually
attendees and asking exploitable. Penetration testing, or pen testing, goes beyond simple vulnerability testing. It seeks
them for other terms to exploit vulnerabilities and produce evidence of success as part of its report. It often includes
related to security
social engineering and testing of physical controls, as well as testing technical weaknesses.
assessment, and then
comparing the
characteristics of each.
Figure 1-2: Comparing a cyber attack process with a pen test process.
The additional stages in this pen test provide the scaffolding that ensures that the intended tests are
conducted and that the results are communicated to decision-makers for review and further action.
In some instances where automated pen testing is used, the analysis and reporting phases might be
replaced with a phase to implement configuration settings.
The phases of the pen test process are described in the following table.
Planning Most recognized pen test processes include a planning phase. Depending
on the authority that promulgates the process, this phase might also
include identifying the scope of the engagement, documenting logistical
details, and other preliminary activities that need to occur before the
commencement of the pen test.
Reconnaissance In the reconnaissance phase, the tester gathers information about the
target organization and systems prior to the start of the pen test. This can
include both passive information gathering, such as collecting publicly
available information about the organization, and deliberate acts, such as
scanning ports to detect possible vulnerabilities.
Scanning The scanning phase is generally a bit more in depth than the
reconnaissance phase. This is where vulnerability assessment begins.
Static and dynamic scanning tools evaluate how a target responds to
intrusions.
Gaining access This phase is when the actual exploit begins, by applying the information
gained by reconnaissance and scanning to begin to attack target systems.
Hashcat A free password recovery tool that is included with Kali Linux and is
available for Linux, OS X, and Windows. It includes a very wide range of
hashing algorithms and password cracking methods. Hashcat purports
itself to be the fastest recovery tool available.
Medusa A command-line-based free password cracking tool that is often used in
brute force password attacks on remote authentication servers. It
purports itself to specialize in parallel attacks, with the ability to locally
test 2,000 passwords per minute.
THC-Hydra A free network login password cracking tool that is included with Kali
Linux. It supports a number of authentication protocols.
CeWL A Ruby app that crawls websites to generate word lists that can be used
with password crackers such as John the Ripper. It is included with Kali
Linux.
OLLYDBG A reverse-engineering tool included with Kali Linux that analyzes binary
code found in 32-bit Windows applications.
Immunity debugger A reverse-engineering tool that includes both command-line and
graphical user interfaces and that can load and modify Python scripts
during runtime.
GDB (GNU Project Debugger) An open source reverse-engineering tool that
works on most Unix and Windows versions, along with macOS.
WinDBG (Windows Debugger) A free debugging tool created and distributed by
Microsoft for Windows operating systems.
IDA (Interactive Disassembler) A reverse-engineering tool that generates
source code from machine code for Windows, Mac OS X, and Linux
applications.
Findbugs and FindBugs is an open source static code analyzer or static application
findsecbugs security testing (SAST) tool that detects possible bugs in Java
programs. FindSecurityBugs is an open source plugin that detects security
issues in Java web applications.
Peach Peach Tech offers several dynamic application security testing
(DAST) products for pen testing, including Peach API Security, which
helps secure web APIs against the OWASP Top 10, and Peach Fuzzer, an
automated security testing platform for prevention of zero-day attacks.
Within Peach Fuzzer, modular test definitions called Peach Pits enable
you to fully customize exploits against test targets.
AFL (american fuzzy lop) An open source DAST tool that feeds input to a
program to test for bugs and possible security vulnerabilities.
SonarQube An open source SAST platform that continuously inspects code quality to
help discover bugs and security vulnerabilities.
Whois A protocol that queries databases that store registered users or assignees
of an Internet resource, such as a domain name.
Nslookup A Windows command-line utility that queries DNS and displays domain
names or IP address mappings, depending on the options used.
FOCA (Fingerprinting and Organization with Collected Archives) A network
infrastructure mapping tool that analyzes metadata from many file types
to enumerate users, folders, software and OS information, and other
information.
theHarvester A tool included with Kali Linux that gathers information such as email
addresses, subdomains, host names, open ports, and banners from
publicly available sources.
Shodan A search engine that returns information about the types of devices
connected to the Internet by inspecting the metadata included in service
banners.
Maltego A proprietary software tool that assists with gathering open source
intelligence (OSINT) and with forensics by analyzing relationships
between people, groups, websites, domains, networks, and applications. A
community version named Maltego Teeth is included with Kali Linux.
Recon-ng A web reconnaissance tool that is written in Python and is included with
Kali Linux. It uses over 80 "modules" to automate OSINT. Some of its
features include: search for files, discover hosts/contacts/email addresses,
snoop DNS caches, look for VPNs, look up password hashes, and
perform geolocation.
Censys A search engine that returns information about the types of devices
connected to the Internet.
OWASP ZAP (Open Web Application Security Project Zed Attack Proxy) An open
source web application security scanner.
Burp Suite An integrated platform included with Kali Linux for testing the security
of web applications. Acting as a local proxy, it allows the attacker to
capture, analyze, and manipulate HTTP traffic.
SET (Social Engineer Toolkit) An open source pen testing framework included
with Kali Linux that supports the use of social engineering to penetrate a
network or system.
BeEF (Browser Exploitation Framework) A pen testing tool included with Kali
Linux that focuses on web browsers and that can be used for XSS and
injection attacks against a website.
Wireshark An open source network protocol analyzer that is included with Kali
Linux. Can be used to sniff many traffic types, re-create entire TCP
sessions, and capture copies of files transmitted on the network.
hping A free packet generator and analyzer for TCP/IP networks. Often used
for firewall testing and advanced network testing, hping3 is included with
Kali Linux.
Searchsploit A tool included in the exploitdb package on Kali Linux that enables you
to search the Exploit Database archive.
Powersploit A series of Microsoft PowerShell scripts that pen testers can use in post-
exploit scenarios. This tool is included in Kali Linux.
Responder A fake server and relay tool that is included with Kali Linux. It responds
to LLMNR, NBT-NS, POP, IMAP, SMTP, and SQL queries in order to
possibly recover sensitive information such as user names and passwords.
Impacket A collection of Python classes that provide low-level program access to
packets, as well as to protocols and their implementation.
Empire (PowerShell Empire) A post-exploitation framework for Windows
devices. It allows the attacker to run PowerShell agents without needing
powershell.exe. It is commonly used to escalate privileges, launch other
modules to capture data and extract passwords, and install persistent
backdoors.
Metasploit Framework A command-line-based pen testing framework developed by Rapid 7 that
is included with Kali Linux and that enables you to find, exploit, and
validate vulnerabilities. Metasploit also has GUI-based commercial and
community versions.
to be suspended until the security breach is handled. If it is historical, the pen test team should
log the discovery and continue with the task at hand.
• Regular progress briefings within the team. If different members of the pen test team are
conducting simultaneous attacks, there should be internal coordination to ensure team members
are not accidentally interfering with each other. The lead might opt to have daily "scrum" type
meetings, in which each member describes what they did yesterday, what they will do today, and
identify anything blocking their efforts. The lead or project manager can then allocate resources
or request conflicting activities to be temporarily suspended.
• Regular progress briefings with the client. If the pen test will take more than a few days, the
client might want regular progress updates. This can be done weekly or as deemed necessary.
Keep in mind that "the client" is probably not just one person but could be several managers
who need to remain in the communications loop. The client may request that these managers
each directly receive a copy of status updates, or they may request that reports are given to only
one representative, who will internally distribute copies. Typically, the final report is given to a
single party as part of a formal handoff. In some cases, certain findings may be too sensitive to
share with all on the approved recipients list. However, this is more likely to be the exception
rather than the rule. Having a clear communication path will ensure that all relevant parties
receive reports in a timely manner. Emergencies would be handled separately, though ongoing
issues such as client interference, delays, or other problems should be raised at status meetings.
• Clear identification of the reasoning behind communication activities. Consider how a
situation might need to be addressed if the pen test attempt is detected. It is possible that several
testers might focus their efforts on a key system at the same time, thus making the breach
debilitating or quite obvious. In such a case, the testing team might need to work together to
scale back on their efforts to de-escalate the effects of the test. Providing situational awareness to
key client personnel can also help deconflict the breach, enabling the pen test to continue so
that additional issues can be found, exploited, and analyzed.
• Possible adjustments to the engagement. The nature of a pen test is that it is a fluid process.
Information that is discovered during the reconnaissance phase drives the decisions on what
exploits to try and, ultimately, what solutions to propose. Awareness of the need for contingency
planning for the pen test engagement itself enables you to incorporate it into your plans and to
re-prioritize the goals of one activity or large sections of the pen test.
• Disclosure of findings. It is incumbent upon a company to fully disclose vulnerabilities and
breaches to their customers, suppliers, regulators, or members of the public who may be harmed
by the breach. If you, the pen tester, were paid to help discover those vulnerabilities and
breaches, any findings should be strictly confidential for both legal and ethical reasons. An
exception to this could be if you uncovered criminal conduct, in which case you might be
obligated to notify law enforcement. If a question arises regarding disclosure of findings, even if
disclosure would be for the general public good, it is not the pen tester's job to make that
decision. You should consult with your team's legal counsel in such cases.
Note: For more information on vulnerability disclosure, see https://vuls.cert.org/
confluence/display/Wiki/Vulnerability+Disclosure+Policy.
Contract Types
As part of the legal issues relevant to the pen testing process, you will encounter several types of Contract Types
contractual agreements. Some of these are described in the following table.
Master service An agreement that establishes precedence and guidelines for any business
agreement (MSA) documents that are executed between two parties. It can be used to cover
recurring costs and foreseen additional charges during a project without
the need for an additional contract.
A Sample SOW
Authorizations
Authorizations Another facet of establishing and conducting a pen testing engagement involves the process of
Point out to students that collecting written authorizations to conduct the testing activities. In some situations, authorization
the authorization is the documents (which can be completed and signed forms, letters, or other types of documents) exist as
basis for the "get out of addenda to the SOW.
jail free card" that pen
testers should carry with Written authorization documents help control the amount of liability incurred by the pen tester. In
them as they conduct situations where a third-party service provider, such as a cloud service provider, might be affected,
their tests.
you might need to ensure that you have proper authorization from the service provider in addition
to the client.
Most written authorization documents include the following information:
• Who the proper signing authority is, or who can authorize that the pen testing can take place.
This includes a statement that the undersigned is a signing authority for the organization.
• Who is authorized to perform the pen test.
• What specific networks, hosts, and applications can be tested.
• The time period that the authorization is active.
Finally, it is strongly recommended that all parties arrange for legal review of the authorization
document.
Sample Authorization
Template (2 Slides)
Legal Restrictions
Legal Restrictions In addition to specific contractual requirements, other legal differences that depend on your
Poll learners for other organization's environment can affect the pen testing process. Some of these environmental
examples of potential restrictions include:
legal requirements.
• Export restrictions: In the United States, export controls regulate the shipment or transfer of
certain items outside of the US. These items can include software, technology, services, and
other controlled items. Other nations might have similar restrictions to the sharing of certain
items outside their borders.
• Local and national governmental restrictions: It is highly probable that governmental restrictions
control the use of technology and tools used during the pen testing process. This includes not
only the technology and tools, but also the information gathered by the testers and even the
actual process of exploiting computer systems, such as port scanning.
• Corporate or organizational policies: Many companies and organizations now have specific
policies that regulate pen testing activities, so you will need to be aware of any particular
restrictions adopted by the company or organization that is undergoing pen testing.
TOPIC B
Plan a Pen Test Engagement
Before embarking on the pen test process, it is imperative that you plan for the engagement.
Evaluating the various considerations should help you build a clear project plan that all stakeholders
can use as a guide throughout the entire process.
WSDL and/or WADL Web Services Description Language and Web Application Description
Language files are XML documents that describe SOAP-based or
RESTful web services.
SOAP project file A file that enables you to test SOAP-based web services. These files often
are created from the information in a WSDL file or service.
SDK documentation Documentation for a collection of development tools that support the
creation of applications for a certain platform.
Swagger document The REST API equivalent of a WSDL document.
XSD file A document that defines the structure and data types for an XML
schema.
Budget
Budget Any agreement between two parties is likely to have budgetary considerations and constraints,
You might want to poll including pen test engagements. Each party must consider the services provided worth the time and
learners to see if they money spent. Budget often drives the scope of the penetration test:
have anecdotal
• The service provider, or pen tester, wants to minimize the expenses associated with pen testing
information about pen
test budgets as
and maximize revenue/compensation while providing an acceptable level of quality of service to
compared to other IT- the service consumer, or client organization.
related budgets. Or you • The service consumer wants to minimize its expenses while maximizing the volume/depth of
could give them a few testing and overall quality of service. In addition, the service consumer considers the cost of pen
minutes to search for testing to be an investment in the security posture of the organization.
information related to
pen test budgets and Note: There may be cases, such as in compliance testing, where budget is less of a consideration.
briefly discuss what they
find.
Technical Constraints
Technical Constraints A comprehensive pen test plan should not only include what should be tested, but it should also
describe anything that is specifically excluded from the test engagement. In addition, there might be
technical barriers in place that could prevent the pen testing team from fully testing some
organizational resources. Some technical constraints, including choice of tools, will be driven by
budget. All constraints should be described in detail in the pen test plan. Common technical
constraint scenarios include:
• A legacy server is considered too fragile to withstand denial-of-service or buffer overflow attacks.
• Attacking a website hosted by a third party might be too disruptive to the provider's other
customers.
• An offshore data center is too expensive to physically visit, so attack choices must be remote in
nature.
Rules of Engagement
In pen testing, the rules of engagement is a document or section of a document that outlines how Rules of Engagement
the pen testing is to be conducted. They describe the expectations of the client and the rights and
limitations of the test team.
Some facets of the rules of engagement are described in this table.
Component Description
Timeline The timeline of a pen test engagement is a clear enumeration of the tasks
that are to be performed as part of the engagement, and the individuals or
teams responsible for performing those tasks. As the engagement
progresses, stakeholders can use the timeline as a progress indicator, and
adjust it as needed during the engagement to account for any unexpected
events. The timeline is often shared with stakeholders in a Gantt chart
format.
Location of test team The location of the test team in relation to the client organization needs
to be agreed upon. Depending on factors such as how many locations an
organization occupies, whether or not remote installations are in different
nations, and what sort of remote technology is available to access multiple
locations, the parties should agree and record the amount of travel
required, if any, to conduct the pen test.
Temporal restrictions When the actual test begins, are there constraints on the days and times
for testing that the testing can be performed?
Transparency of testing At the client organization, who will know about the pen testing?
For the test team, what information will be provided prior to the start of
the engagement?
Test boundaries What's being tested, and what is not?
Define the acceptable actions, such as social engineering and physical
security tasks
If invasive attacks, such as DoS attacks, are part of the testing, are there
any restrictions on their use?
Impact Analysis
Planning a pen test engagement involves estimating what effect testing will have on normal business Impact Analysis
operations. When planning a test, the pen test team will advise the client on potential impacts to
different types of systems. This will be informed by target type, criticality to the business, and testing
approach. The analysis should also allow for unforeseen impacts. Both sides must work together to
manage the risk ahead of time, as well as have clear communication protocols and remediation plans
in place to minimize any impact that may actually occur. There should be clear triggers, escalation
procedures, and timelines for alerting the other side in case of an incident. Depending on the client's
risk appetite, some systems may get more attention and faster response than others.
Remediation Timeline
Remediation is the implementation of a solution for a given vulnerability. When taken into Remediation Timeline
consideration with impact analysis, organizations can choose to address the highest-risk issues first,
or they might decide to address issues that can be quickly or inexpensively resolved. There might
also be issues that an organization could decide not to address, and thus accept the risk associated
with those vulnerabilities.
Disclaimers
Disclaimers A comprehensive pen test plan should also include some disclaimer clauses to further protect the
parties involved in the engagement.
To protect the pen testing team, a point-in-time assessment clause might be included in the plan.
This clause should state that the pen test results have a limited life cycle and are not to be
interpreted as a security guarantee. In fact, even one configuration change could cause the pen test
report to be outdated. When an organization schedules periodic pen tests with the same or even
different testing teams, any repercussions from configuration changes can be identified and
remedied.
As you saw during the discussion of budgets, clients want the broadest scope at the lowest price,
and usually expect results within the shortest possible time frame. A comprehensiveness clause can
detail the boundaries with regard to scope, price, and time frame. It can also acknowledge that not
every vulnerability might be found during an engagement.
TOPIC C
Scope and Negotiate a Pen Test Engagement
It is essential that each pen test engagement have clear boundaries that are understood and agreed to
by both parties. Although often conducted in conjunction with the initial planning, you still need to
make sure that scoping considerations are as accurate as possible to provide direction and level-
settting to the client organization as well as the test team, particularly in the case of large or complex
engagements that might need to be implemented in stages.
Scoping
Defining the scope of your engagement is one of the most crucial things you can do when Scoping
negotiating a contract. The scope is the basis for the SOW. When the scope is clear, all stakeholders
understand what is considered an appropriate target, and the limits of what the pen test team can do
to that target. Pen test team members must know what protocol to follow when they encounter
something that is out of scope.
For example, it is very common for someone from the client's IT department to ask consultants for
small favors or to "check this one item" in the course of their duties. The pen tester must know if
the request is within scope, and if it is not, how to respond and escalate the request. Usually, the
response should be a polite, "let me check with my supervisor on how we can assist you with this."
Types of Assessments
Types of Assessments There are several general categories of assessment that an organization can use to help define the
scope of a pen test engagement.
• Goal-based or objective-based assessments provide focus points for the pen test. They begin
by the client listing the items or information that needs to be protected. Then, the pen test team
will develop plans to obtain the goal or objective through any attack techniques available. This
approach closely mimics the attacks that might be launched by a malicious party, so they can
provide significant ROI for the client organization.
• Compliance-based assessments are government- or industry-required tests based on an
established compliance framework. Common US compliance frameworks include PCI DSS,
DISA STIG, FEDRAMP, and FISMA.
• Red team assessments test an organization's detection and response capabilities by emulating a
malicious actor who targets attacks and avoids detection. The red team accesses sensitive
information any way it can without being caught in the act. Red teams usually have longer time
frames in which to work. Because stealth and avoidance is of great importance to the red team,
they function more like an advanced persistent threat (APT), keeping a low profile while
infiltrating the network. By contrast, pen test teams are usually time constrained and often
cannot afford to be as patient. As such, they may be "noisy," while red teams are "quieter."
Color Teams
The idea of color teams evolved from military readiness exercises. In general, red teams attack, while
blue teams defend. In some instances, purple teams help coordinate interactions between red and
blue teams, and in other cases, white teams establish rules and monitor the testing.
Compliance-Based Assessments
Compliance-Based Compliance is a broader discipline in which pen testing can, but does not necessarily have to, play a
Assessments part. Compliance is usually assessed through a comprehensive audit of administrative, technical, and
physical controls, and their design, implementation, maintenance, and effectiveness. Penetration
testing can be used to validate the effectiveness of many of these controls. Because compliance is
either government- or industry-mandated, it would take precedence over any company policy. The
key aspects of compliance-based assessments include:
• Clearly defined objectives based on regulations or compliance frameworks (what to look for).
• Possible mandated rules for completing the assessment (how to look).
• Focus on password policies, data isolation, and key management.
• Limitations on network or storage access.
Types of Strategies
Types of Strategies The following table describes the types of strategies used in most pen test engagements. Which
strategy you use will have an effect on the scope of the project.
Black box test • The pen tester is provided virtually no information about the systems
or networks being tested, thus simulating an outside attacker who
knows little about the target other than what can be determined
through basic reconnaissance techniques.
• Also referred to as a zero knowledge test, the pen tester must gather
information about the target and verify that information with the
client before the actual testing can begin.
• The client verification confirms that the test is being conducted within
the established scope.
• Tests are often conducted with very few people at the target
organization being aware that the testing is taking place, thus
providing a test of how personnel monitor, detect, and respond to
security incidents.
Gray box test • The pen tester is provided with some knowledge and insight of
internal architectures and systems, along with other preliminary
information about the target and its assets, to simulate an internal
attacker who knows some but not all information about the target
systems and networks.
• Also referred to as a partial knowledge test, the pen tester tries to
gather additional information about the target through basic and
advanced reconnaissance techniques.
White box test • The pen tester is provided with knowledge about all aspects of the
target systems and networks, to simulate an internal attacker who has
extensive knowledge of the systems and networks that are being
targeted.
• Considered to be the opposite of a black box test, a white box test is
often conducted as a follow-up to a black box test.
• Because the tester already has information about the function and
design of the targets, the reconnaissance phase can be skipped.
• Competitor organizations might try to gain unauthorized access to a business rival's sensitive
information.
Some governmental agencies categorize cyber adversaries into one of six tiers, as outlined in the
following table.
Tier Description
Be aware that higher-tier threat actors can use lower-level methods and techniques to accomplish
their objectives. Or they might use lower-level threat actors as proxies, in which case the lower-tier
proxies get access to higher-tier capabilities.
Threat Models
Threat Models Threat models identify and classify potential attack methods, or attack vectors, which are the paths
that attacks can take. They can encompass the overall security of an organization, or they can apply
to specific computers or other assets that are targeted in an attack. Threat models can be activity-
focused or asset-focused, and they can assist the security-conscious organization to evaluate risk and
potential mitigation strategies to counter the potential attacks. When creating a threat model, the
security team starts from an undesirable end result (such as data stolen from a particular database
hosted on a particular server) and then reverse engineers the steps required for an attacker to finally
reach that end result. Whenever possible, controls are then identified and implemented at the
various attack steps. The goal of threat modeling is to disrupt the attack vector so the end goal
cannot be achieved.
Types of Targets
Scoping a pen test engagement also entails determining what types of items to target. The type of Types of Targets (3
target helps determine the scope and type of attack. The following table summarizes common Slides)
targets and strategies for targeting them.
Internal Assets can be accessed from within An excellent candidate for all attack
the organization. Internal attacks types IF direct access to the internal
might be caused by malicious insiders network can be established.
or by external hackers who have
gained credentials through a phishing
attack.
On-site Asset is physically located where an Accessibility depends on controls at
attack is being carried out. the site. A physical attack might go
undetected at a large facility with many
people. Centralized resource locations
will probably have more points of
entry and attack vectors to choose
from.
Off-site Asset provides a service for an An organization's remote offices and
organization but is not necessarily satellite locations are less likely to have
located at the same place. as many security controls as
headquarters. As such, an attacker
would lose the "cover" of anonymity.
However, lax security might still make
it possible to carry out physical, Wi-Fi,
or possibly remote access/VPN
attacks. You would have to assess if
the remote location is worth the
effort. If the remote location does not
itself house interesting assets, it might
provide a back door (such as an
unguarded WAN or VPN link) to the
main facility.
External Asset is visible on the Internet, such Not a good candidate for attacks (such
as a website, web application, email, or as sniffing or ARP poisoning) that
DNS server. require direct access to the network
segment.
First-party hosted Hosted by the client organization. Might be easier to attack than third-
party hosted services, as most
companies do not have the same
resources, expertise, or security focus
as a provider.
Third-party Hosted by a vendor or partner of the Not impossible targets, but established
hosted client organization. providers are more likely to have good
controls in place. Smaller, newer
hosting companies may have fewer
resources and less security expertise.
These might be easier to attack than
larger, more mature providers. All
third parties can be vulnerable to zero-
day attacks.
Fragile Systems
Another type of potential target includes systems that are inherently unstable and have a tendency to
crash, and systems that need to run older, unpatched versions of operating systems to support
legacy applications. These are often referred to as fragile systems. Part of your scoping efforts
should be to identify any fragile systems that might be tested, and to what extent they can be
exploited.
Specialized Systems
Specialized Systems As you scope a pen test engagement, you will also want to identify any specialized systems that you
As you describe SCADA want included in the tests. Common specialized systems are described in the following table.
systems, point out that
they are often Type of Specialized Description
considered to be fragile System
systems, as the slightest
anomaly can trigger a Industrial control Networked systems that control critical infrastructure such as water,
DoS situation. systems (ICSs) electrical, transportation, and telecommunication services.
Embedded systems Computer hardware and software that have a specific function within a
larger system such as a home appliance or an industrial machine.
Supervisory control ICSs that send and receive remote-control signals to and from embedded
and data acquisition systems.
(SCADA) systems
IoT devices Any objects (electronic or not) that are connected to the Internet by using
embedded electronic components.
Mobile systems Smartphones, tablets, wearable devices, and other mobile computing
devices.
Point-of-sale (PoS) Stations that typically consist of a cash register, barcode scanner, and a
systems debit and credit card scanner.
Biometric devices Devices that identify individuals by their physical characteristics, such as
thumbprint scanners, retinal scanners, voice-recognition software, and
facial-recognition software.
Application containers Virtualized environments that are designed to package and run a single
computing application or service and that can share the same host kernel.
Risk Responses
How an organization deals with identified risk depends on the thresholds established for various Risk Responses
forms of risk, and those thresholds are normally set according to the risk appetite of the
organization. The following table describes four basic risk response approaches.
Avoidance In risk avoidance, an organization takes steps to ensure that risk has
been completely eliminated, or reduced to zero, by terminating the
process, activity, or application that is the source of the risk.
Transference In risk transference, the organization moves the responsibility for
managing risk to another organization, such as an insurance company,
cloud service provider, or other outsourcing provider.
Mitigation In risk mitigation, the organization implements controls and
countermeasures to reduce the likelihood and impact of risk, with the
goal of reducing the potential effects so that they are below the
organization's risk threshold.
Acceptance In risk acceptance, after the organization identifies and analyzes a risk, it
determines that the risk is within acceptable limits, so no additional action
is required.
Not all risks can be avoided, transferred, or completely mitigated. It might take a combination of
response techniques for risks to be within acceptable levels.
Tolerance to Impact
It's highly likely that pen testing will have an effect on the performance of the networks, hosts, and Tolerance to Impact
applications being tested. For instance, attempting to invoke a DoS attack on a public-facing website
will probably prevent customers from reaching the website during the test. The client organization
must balance the need for testing with the need for continuous business operations. As you are
scoping a pen test engagement, the client organization needs to identify which business operations
and assets can be tested without exceeding its risk tolerance levels.
Scheduling
Scheduling Determining a timeline for pen testing events is also an integral part of defining the scope of the
engagement. For potentially disruptive actions such as launching a DoS attack, the client
organization might allow the attack but specify that it take place on weekends to minimize the effect
on customers. Both start and end dates should be specified in the plan, along with notification to the
client stakeholders to verify the beginning and ending of each test.
Note: By nature, pen testing is time constrained. Very seldom will you find an engagement that
lasts longer than 2 to 4 weeks.
Scope Creep
Scope Creep Scope creep is the condition that occurs when a client requests additional services after a SOW has
been signed and the project scope has been documented. This is not a condition that is limited to
pen testing; in fact, practically every project manager or building contractor can provide examples of
scope creep that happened with various projects.
The big problem with scope creep is that it takes resources away from those items that are
documented in the SOW. It can also become a source of contention when it comes time to bill the
client. If you initially discussed pen testing a dozen systems in three weeks and the client asks you to
test another eight systems with the same end date, several things can happen:
• The time you expected to be able to spend on each system is reduced, unless you add more
testers.
• Testing of the original dozen systems might be less thorough to account for the need to test the
extra systems.
• If the testing organization provided a low quote to get the client's testing business, there might
be little profit built into the price, so adding more systems to be tested might force the testing
organization to take a loss on the engagement.
• Any legal protection spelled out in the SOW for the original systems might not carry over to the
additional systems.
While it is easy to understand the desire to keep the client organization satisfied, testing
organizations should carefully explain the ramifications of performing additional work without
another agreement. The testing organization can try to negotiate extra money and time, possibly at a
reduced rate.
General Considerations
General Considerations The following table describes some general considerations to take into account while scoping pen
(2 Slides) test engagements.
Consideration Description
Organizational policies • Organizational policies are formalized statements defining how the
organization intends to meet its long-term goals.
• They can cover numerous topics, including security, privacy,
compliance, and acceptable use of resources.
• Pen test engagements should be designed so as to be in concert with
existing organizational policies.
Security exceptions • Some organizations provide ways to apply for policy exceptions,
where certain organizational policies are not enforced for identified
technologies or resources.
• Existing security exceptions should be identified as being either within
or outside of the engagement's scope.
Consideration Description
NAC • Network Access Control encompasses the collected protocols,
policies, and hardware that govern if and how devices can connect to
a network.
• If a device can pass a health check, it can connect to the network.
• Devices are agent-based or agentless.
Whitelisting and • Whitelisting blocks all users or IP addresses except those included on
blacklisting (IPS/WAF the whitelist, while blacklisting allows all users or IP addresses except
whitelisting) those included on the blacklist.
• These practices are commonly used with intrusion protection systems
(IPSs) and web application firewalls (WAFs).
• It is generally recognized that implementing whitelists is more
restrictive and thus more secure than implementing blacklists.
Certificate and public • Certificate and public key pinning is the process of associating a host
key pinning with its expected X.509 certificate or public key.
• Pinning bypasses the certificate authority (CA) hierarchy and chain of
trust to lessen the impact of man-in-the-middle attacks.
• Used in securing wireless channels, the act of pinning a certificate or
public key helps guard against vulnerabilities in well-known protocols
such as VPN, SSL, and TLS.
Scoping Checklists
Some organizations or testing entities employ a pen test scope document or checklist to record the Scoping Checklists
information shared and decisions made during the scoping and negotiating of each engagement.
There are many sample templates and checklists available on the web, so you might be able to find
one that meets your needs without a lot of revision.
• Find ways to avoid scope creep; consider including disclaimer language to protect the test team
from any adverse events resulting from allowing or denying scope creep.
• Consider using a scoping checklist to gather information that will help shape the boundaries of
the engagement.
• Identify each deliverable, including all documents and meetings.
TOPIC D
Prepare for a Pen Test Engagement
After a pen test engagement is planned and properly scoped out, there are a few things the client
organization and testing entity need to accomplish before the actual pen test starts. These activities
will help streamline the overall process and ensure that the pen test engagement is fully documented
and understood by all relevant parties.
Team Preparation
Team Preparation (2 Getting ready for a penetration test involves preparing the client as much as preparing the pen test
Slides) team itself. Penetration testing is, by its very nature, more intrusive than a simple vulnerability scan.
Although the pen test team will take every precaution to minimize the impact of a test on the
production network, issues can and do arise. For that reason, precautions and contingency plans
must be in place for when an emergency arises.
Here are some best practices when preparing the client:
• Ensure that the client provides you with technical points of contact that you can reach before,
during, and after the test.
• Ensure that key IT personnel have been informed about the upcoming test.
• Ensure that the client has up-to-date, verified backups of critical systems and is ready to work
with you to address any unexpected consequences or availability issues.
• Ensure that all relevant client personnel are aware of the potential risks of the penetration test
and are prepared to work with the pen test team to restore crashed or adversely affected systems.
• Ensure that the client understands that stepping up security just before a penetration test is not a
sustainable approach:
• You want to produce a report on the true state of the environment, not one that has been
quickly spruced up a few days prior to the test.
• Company staff, especially the IT department, should behave normally during the test, and not
be in any state of heightened alertness, as this will incorrectly represent their security posture.
It is usually best to only let managers know about the impending test.
• Unless it's your intent to test a target's incident response capabilities, ensure that the IT
department contacts you first when they detect a breach, rather than launching incident
response procedures or calling law enforcement.
Here are some best practices when preparing the pen test team:
• Ensure that all team members are clear on the scope and limitations of the test.
• Ensure that all testers are mindful of the final objective of assessing the client's security risks and
producing an actionable report.
• Ensure that all testers have contact information and clear escalation procedures in case anything
goes wrong during a test.
• Ensure that all testers document their actions and outcomes in a central repository.
• Ensure that all testers have a "get out of jail free" card with them that clearly establishes
authorization for their pen testing activities, including 24-hour contact information for their
immediate supervisor(s).
• Ensure that the project lead is aware at all times of individual team member movements and
activities, and that team members inform their supervisor(s) in real time when they begin and end
each test.
• Ensure that all team members understand that missteps and accidents can and do happen, to
report them immediately, and to be prepared to assist in restoring affected systems.
• When you have your initial assignments and sequencing ready, call a tactical meeting to outline
the plan to the team. In some cases, an experienced team might self-organize, and collaboratively
determine sequencing and task allocation.
Contingency Planning
Contingency Planning By necessity, penetration testers use the same tools as malicious attackers. For this reason, you must
expect problems to arise during the test. The SOW should list all targeted systems, but collateral
damage can also occur. Testing can exacerbate existing problems, or take down an already fragile
system. Before the test starts, you must make sure that the client has up-to-date, verified backups of
all important systems, and contingency plans to quickly restore any system or service that has
crashed. Often this can be as simple as rebooting a system or reverting a virtual machine to a
previous snapshot. However, restoration activities, including reboots, can take some time. If
department managers are aware of upcoming tests, they can also make provisions for downtime of
any system or service that their staff depends on.
Go Live
Go Live When the planning is done, and the team has received their starting assignments, it's time to "Go
Live" and actually start the test. Although select client managers and IT personnel may know, the
Go Live date and time should generally be secret and (hopefully) unexpected. In some cases, you
might want to have passive reconnaissance and OSINT gathering completed even before the Go
Live date.
Guidelines for Preparing Guidelines for Preparing for a Pen Test Engagement
for a Pen Test
Engagement (2 Slides) Here are some guidelines you can follow when preparing for a pen test engagement.
• Ensure that your team is well trained in the tasks they will undertake.
• Make sure there is a clear chain of command with a clear communications path.
• Train the team to consult their supervisor when confronted with an unexpected situation or
decision.
• Pair less experienced testers with more experienced ones unless it puts the activity at risk.
• Ensure that the client's IT department (at least the managers) is aware of the test, and that they
have good backups and contingency plans to restore affected systems.
• Train your team to stay within the scope of the engagement unless authorized to expand their
investigation.
• Train your team to log evidence of previous or existing malicious activity, to continue with what
they are doing, and to escalate findings for further instruction.
• Ensure that the team fully documents their steps, collects as much data as possible, and uploads
this information to a central repository for analysis.
ACTIVITY 1-1
Planning and Scoping Penetration Tests Review
Scenario
Answer the following review questions.
1. Do you have pen testing experience? How do the standards, frameworks, and
processes discussed in this lesson map to your experiences?
A: Answers will vary, but might include conducting goals-based assessments and using a particular
framework, such as the OWASP testing framework.
2. Have you ever experienced scope creep? What were the circumstances and
outcomes?
A: Answers will vary, but might include the client asking for additional hosts to be included in the test,
or for more exhaustive testing to be performed on the hosts. Either example would likely cause the
pen test team to experience time and budgetary constraints that were not planned for.
Summary
In this lesson, you planned and scoped pen tests. By clearly defining the plan and scope, you ensure
that both parties in the agreement can easily determine what actions and assets are part of the pen
test engagement, and what actions and assets are not.