Introduction
Methodology: a body of methods, rules, and postulates employed by a discipline: a particular procedure or set of procedures (www.merriam-webster) wither a criminal, activist, or well-meaning hobbyist most attackers, and by far most successful attackers, each follows a methodology when performing their attacks. A methodology has the same advantages when conducting an authorized penetration test (pentest).
Over the years the successful habits of attackers and pentesters has evolved into ever increasingly complex methodologies that act as frameworks to organize the steps taken to gain unauthorized access to systems. In addition, it seems that in order to stand out as more credible, many methodologies today have become huge and complex. There is often more emphases on outlining every detail than on being a framework that can adjust to the different situations and environments that are typically encountered during pentesting.
Comparison of Methodologies
This is a comparison of the "Hacking Exposed" and the tpf Methodologies. Notice that in some cases multiple steps of the Hacking Exposed methodology are compressed into one step in the tpf methodology. Also, there also several steps in the Hacking Exposed methodology that are not represented in the tpf approach. This illustrates some of the significant differences between the two. The Hacking Exposed approach is much closer to the way an actual intruder would go about attacking a target, while the tpf approach takes into consideration limiting the potential of disruption.
There is another complicating factor: the idea of a "security engagement", has evolved from simple scanning and attacking to many variations on pentesting, vulnerability scanning, red team testing, application testing, code review... each having their own methodology fine-tuned for that situation, but that also overlaps other methodologies.
In this specific methodolgy, we began with an older methodology that is associated with the "Hacking Exposed" book series. A very straightforward and flexible methodology that covers the entire attack process. It has been modified to reflect the types of engagements and goals typically dealt with. For example, there is less emphasis on identifying and fingerprinting hosts that are logically near the target, and less emphasis on gathering profile information from social media and other Internet resources. In addition, gaining a remote administrative shell or altering the operation of the target is not the exclusive goal as much as identifying issues that either actually lead to any level of compromise, or would entice an attacker to probe further and deeper.
There are many reasons for studying an attack methodology:
Pentesting is the practice of employing all available tools and techniques including; proofs-of-concept attack code, malicious/crafted/false communications packets, and brute-forcing credentials in order to interfere with or functionally violate any of the three aspects of security: Confidentiality, Integrity, and Availability.
This means:
The scope of a pentest engagement usually includes the system(s), components, applications, and other aspects or functions that are considered under review and subject to probing, interrogation and attack. This typically means all physical and logical aspects of the target host system, unless explicitly excluded from review.
In the case of pentesting, the scope includes a computer's operating system, network interfaces, communications, out-of-band communications channels, applications, services, configurations and peripherals. In other words, the entire computer, everything connected to it, everything it is running, and all means of communicating with it.
The goal of a pentest is to identify attack vectors that can actually be exploited to compromise the security standing of a target host or network. While pentesting typically is an attempt to gain a remote shell on the target system, escalate privileges and create backdoors for further use, our perspective is different. We want to identify exploits that the target is susceptible to, issues that may alone or in combination represent a risk, and attain all other goals as stated in the engagement agreement agreed on in the Preparation section of this methodology.
Not all of the tools listed in this page will always be used in every engagement. This page lists the primary tools that should be considered, but does not limit an actual engagement to the tools listed here.
As you find that a tool or technique seldom returns useful results: the documentation should be reviewed, help page reviewed, manpages reviewed, Google searched for examples and suggestions, and so on to find better strategies or parameters. If this does not lead to useful results, the team members should consider changing how the tool or technique is used, and if another should be used in its place, or if it should simply be dropped.
Likewise, we must be aware of new tools and techniques that could add to the processes, both Vulnerability Scanning and Pentesting.
During the engagement rather than being focused exclusively on the host in question, the operator should remain open to attack vectors and insecure conditions that may be possible by pivoting through other hosts or applications.
When performing a pentest, you want to keep in mind the ROI (Return on Investment) in time and effort you spend. A pentest can takes days and weeks to probe every potential issue. We need to balance the time and effort spent on the different steps of a pentest so that the most significant information is discovered within a reasonable amount of time. Below is an illustration of the "rule of thumb" for the relative amounts of time spent during a typical engagement. Over all, you should begin to reevaluate your time management if steps 2-5 take longer than 16 work hours. The first and last steps typically span several days due to scheduling and availability of the stakeholders'.
Preparation
Before the first keystroke, you want to address your authorization to perform a pentest and define its scope, timeframe, limitations, and goals.
Once you have the necessary information, submit a VAN for approval that clearly states this project is a pentest.
Reconnaissance - Passive/Indirect Reconnaissance
Description - Here you reference Internet based resources for information about the target host, the owning agency, people who are close to the system or may have elevated permissions, historic information about the target and so on. You do not yet query the target or its environment directly.
All of the information you discover is used to begin building a profile of the target. That profile is then used to determine additional probes and pertinent attacks techniques.
Goal - To begin building a profile of the target. You want to construct a dossier of the target that gives you enough information and insight about the target to select and prepare the attacks that are most likely to succeed.
Tools & Techniques
Use the different search resources in the guide page to search for this and other relevant information that will help you fill-out a detailed target profile in the report template.
Enumeration - Active Reconnaissance
Description - "Enumeration is the process of gathering information about a target machine by actively connecting to it." www.ehacking.net
Here for the first time you begin to query and probe the target directly rather than indirectly.
The goal here is to identify as much detail as you can about the target system, its hardware, its configurations, and its software components. The information you are looking for will help fill-out your target profile in the report template.
As you identify specifics such as the make and model of component hardware and software, you will return to the Internet to search for specifics of those components. This includes default credentials and know vulnerabilities. Refer to the different online database that provide information about vulnerabilities in those components.
Search within Metasploit and searchsploit, to identify potential exploits to test against the target or its components.
Goal - Identify the target's potential attack vectors and known vulnerabilities. These include outdated software, vulnerable software, default account names (for password guessing)
Tools & Techniques
Attack
Description - Here you take the targeting information you have gathered and organize into a target profile and launch the actual attacks.
Goal - Establishing an otherwise unauthorized functional session with a host's OS or applications. Gain otherwise unauthorized access to the file system, processes, etc...
Create a Denial-of-service condition that can both be confirmed and terminated, which may mean restarting the service(s) or host.
Tools & Techniques
Demonstrating Intrusion
Description - In this phase, you want to collect evidence of the success of the intrusion or exploit. This means screen shots of remote shells showing identifying information about files on the file system, and system information such as network interfaces.
Goal - Gather and record adequate information to demonstrate the degree to which information could be accessed or vulnerabilities could be leveraged and security violated.
Tools & Techniques
Reporting
Description - Throughout the above process, you will want to make detailed and timestamped notes of your observations, actions and their results, along with potential implications. Specifically the information that entices you to look further as well as any actual intrusions.
Goal - Use the information gathered in the Attack and Demonstrating Intrusion section, along with any others, to add value to the report. This includes observations, findings and their remediation.
There is no need to classify these findings in detail because everything discovered in a pentest is considered either an actionable compromise, or an informational issue that the client should be made aware.
Do not include examples of the actual exploit in the report. Instead, include a description of the intrusion, the name and type of exploit used, and the results. Conclude with the suggested steps for remediation.
Tools & Techniques