Pentesting Model
Pentesting Model
discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/312593208
CITATION READS
1 262
1 author:
Chuck Easttom
Collin College
35 PUBLICATIONS 16 CITATIONS
SEE PROFILE
All content following this page was uploaded by Chuck Easttom on 22 January 2017.
The user has requested enhancement of the downloaded file. All in-text references underlined in blue are added to the original document
and are linked to publications on ResearchGate, letting you access and read them immediately.
Research Gate Publication
The field of penetration testing is a growing subset of cyber security (Yeo, 2013). The process of
penetration testing needs to be a methodical process that includes a detailed analysis of the threats
and potential attackers (Bishop, 2007). The industry is replete with penetration testing certifications
such as GPEN from the SANS Institute, Certified Ethical Hacker from EC-Council, and Offensive
Securities OCSP (Easttom, 2016). Each of these certifications and their associated training courses,
emphasizes a different aspect of penetration testing.
In addition to the training and certifications in the field of penetration testing, there are
industry tools that have become widely accepted in the penetration testing community. Kali Linux is
a Linux distribution that includes several security tools, including widely used penetration testing
tools (Beggs, 2014). Perhaps the most widely used penetration testing tool is Metasploit (Jaswal,
2016).
Each of the current, widely accepted, penetration standards recommends a particular sequence of
tasks. There is overlap between the different methodologies, but each has its own elements,
particular to that specific standard. The Pen Testing Execution Standard (PTES, 2016) recommends
seven stages
• Pre-engagement Interactions
• Intelligence Gathering
• Threat Modeling
• Vulnerability Analysis
• Exploitation
• Post Exploitation
• Reporting
It is noteworthy that in this process, the first four stages involve pre-penetration test information
gathering.
NIST 800-115 (U.S. Department of Commerce, 2015) uses four phases
• Planning
• Discovery
• Attack
• Reporting
The National Security Agency InfoSec Assessment Methodology (NSA- IAM) describes three
general phases, each sub-divided into specific tasks to be conducted during that phase (Cross, 2000;
Johnson, 2004).
• Pre-Assessment
o Determine and manage the customer’s expectations
o Gain an understanding of the organization’s information criticality
o Determine customer’s goals and objectives
o Determine the system boundaries
© 2014, IJIRIS All Rights Reserved Page | 1
Research Gate Publication
The method described in this paper is a four-phase process that combines elements from each of
the previously described standards and is consistent with those standards. Thus, this four-phase
methodology could be used in conjunction with any of the aforementioned standards. The
methodology describes your approach to penetration testing for a particular test. This will include:
1. The amount of information given (i.e. black box, white box, gray box testing).
2. Is this testing for some standard (NSA-IAM, PCI, etc.)?
3. Will this test involve internal and external testing, or just one of those options?
4. Will this test include physical penetration testing and/or social engineering?
5. What is the mix of manual and automated testing?
Most importantly, the methodology should describe the reasons for choosing a specific
methodology. An example methodology statement might look something like the following example:
This test is being conducted for PCI-DSS requirements. The test will involve internal and
external testing, and be conducted with the tester being given extensive information (i.e. a
white box test). This specific test sill not include physical testing or social engineering. The
test will involve both automated and manual tasks with the primary tools used being:
Metasploit
OWASP-ZAP
Vega
Nmap
Nessus
These tools will be used in conjunction with manual testing techniques.
Page | 2
Research Gate Publication
The test will begin with internal and external vulnerability scans. This will be followed by
assessing specific PCI-DSS required security controls. Then manual attempts will be made to
penetrate the network.
Of course, more detail is usually preferred. This preceding example is merely meant as a starting
point of a basic methodology statement might look.
Pre- Engagement
The most important element of the pre-engagement is a thorough contract. It must include the
following
1. Scope of the test
2. Any items not to be tested
3. Goals of the test
4. Time frame of the test
5. Any standards to be met (PCI, NIST, etc.)
Any ambiguities in the contract are likely to lead to dissatisfaction for the penetration testing
customer. Clearly legal advice is preferred for any contract, but the preceding list provides an
overview of the technical issues that must be addressed in the contract.
In addition to the contract, information gathering is also critical in the pre-engagement phase.
Failure to gather the appropriate information in this phase can lead to incorrect test focus or
execution. Gather information regarding the following;
1. Any past breaches. Details on such breaches are important. Obviously, you wish to begin by
testing these, to ensure the network is no longer susceptible to them.
2. Any recent risk analysis or audits. This information can also assist you in determining what
areas are most critical to test.
3. Any specific concerns the customer has. This can also guide you to testing the appropriate
areas.
4. Ensure that you and the client agree on the scope as well as what a penetration test can do. It
is important that the client have realistic expectations.
The preceding list is exemplary, not exhaustive. More information is always desirable.
Page | 3
Research Gate Publication
Network scanning along with wireless and Bluetooth scanning are also recommended1. This
can determine if the wireless is secured, if unencrypted data is being sent over the network, and give
a general overview of the network traffic.
3) Phase 3 - Breaching
Now you must attempt to breach. This will include manually conducting SQL Injection and Cross-
site scripting, trying to deliver malware from Metasploit, attempting phishing, delivering a harmless
virus, etc. It is recommended that the penetration tester combine both automated and manual
methods. Specific tools may vary depending on current trends, vulnerabilities identified, and the
target network. For example, a Windows network may require attempts to exploit using Power Shell.
In almost all cases, Metasploit will be useful in attempting to exploit identified vulnerabilities.
Reporting
II. Introduction
This is where you describe testing goals and objectives. This section must also include
what the testing goals were, what was tested and what was excluded. This is often
referred to as the scope of work.
This section should include rules of engagement and any past breaches or risk
assessments. Such past activity should be guiding the prioritization of your penetration
testing.
Page | 4
Research Gate Publication
V. Remediation steps
This section provides details on how the flaws found in penetration testing can be
addressed and mitigated. These should be detailed enough to allow any competent
technical person to be able to correct the problems you discovered. This is a critical part
of the report. It is not enough to simply state that there are problems, you must provide
clear guidance on how to address those problems.
External
After completing the pre-engagement activities and the phase 1- passive scanning, the active
scanning is the next step. In a small network, such as the one described in this scenario, active
scanning will flow naturally into phase 3 – breaching. It is often easiest to start with external testing.
1. Begin with port scanning all public facing IP addresses (the web server and gateway router.
2. Then use vulnerability scanners to scan the website (Vega, OWASP Zap, Burp Suite, etc.)
3. Manually attempt several common attacks on the web server (Cross Site Scripting, SQL
Injection, Website path traversal, etc.)
4. Try appropriate Metasploit attacks on the web server (depending on the server) and on the
router. You may wish to use some Metasploit scans on the web server, particularly
anonymous FTP scan.
5. Attempt to access the wireless. This should include both trying to break into the Wi-Fi as
well as attempts to access the administrative screen for the wireless access point.
Page | 5
Research Gate Publication
6. Attempt standard attacks such as grab the banner, zone transfer, etc.
7. Try default passwords on any public facing device.
Internal
Now move internally. This part is done from inside the network
1. Begin with network enumeration which is internal active scanning.
2. Now a network wide vulnerability scan using one or more tools
3. Nmap scan the entire network. Identify what ports and services are running to determine if
they all need to be running.
4. Use a packet sniffer to scan network traffic including wireless traffic. Note any sensitive data
that is being sent unencrypted and whether the wireless traffic is secure.
5. Perform the standard Metasploit scans (Anonymous FTP, SMB, SSH, SQL Server, Etc.)
6. Attempt to exploit any vulnerabilities found.
7. Attempt standard attacks including
a. Try to connect to computers shares
b. Try to crack passwords on key machines
c. Try to telnet or ssh to printers
d. Attempt default passwords on any servers, printers, switches or routers and wireless
access points.
Of course, you must test all items indicated by any standard you are using. For example, PCI
requires all external communication of credit card data to be encrypted. I suggest you test all internal
and external data communication.
Optional Items
1. Send employees anonymous phishing email that will do something harmless such as redirect
them to a page admonishing them not to click on links or a harmless malware attachment that
just has a voice or popup telling them not to download attachments.
2. Attempt social engineering via phone or in person.
3. A penetration test is not a vulnerability scan, but can include vulnerability scanning (as
already shown in this document). In the same way, a penetration test is not an audit, but can
sometimes include elements of an audit. With that in mind, you may wish to check the
following items:
a. Password policies
i. Lockout policy
ii. Minimum requirements
iii. How often passwords are changed
b. Are there any unauthorized devices or software anywhere on the network?
c. Are there still accounts active for employees no longer with the organization?
This outline is a basic outline for a rather small network. Feel free to expand it and add to it as you
see fit. This should be considered the bare minimum of a pen test.
III. CONCLUSIONS
Page | 6
Research Gate Publication
Penetration testing is more than simply hacking. And therefore, it requires a methodology
that can be consistently applied. An appropriate methodology is based on well-established standards.
In this paper a methodology for penetration testing was described. This is meant as a general
template for penetration testing. Clearly, specific penetration tests will have individual requirements
that need to be addressed. It is also likely that further research would expound upon the
methodology espoused in this paper.
REFERENCES
Page | 7