Week 1: Ch 1: Intro to Penetration Testing

Intro to Penetration Testing

Computer and network security are perhaps the most talked-about topics in our modern era. As computing devices continue to permeate our lives, the security of such devices and networks is a growing concern. How to effectively test security is also a clearly important topic. One way to test network security is to conduct a penetration test. Penetration testing is the process of actually using the techniques that might be used by a malicious attacker, but rather than attempt to compromise the target system, these techniques are utilized to test the security of the target system.

You probably hear of some sort of breach of some system very frequently. Certainly, breaches are occurring every day, even if you are not diligently following such news. There are a variety of approaches to network and computer security. Some focus on appropriate security policies and procedures. Others focus on the devices that are used as countermeasures to attacks. Still others focus on secure programming as a means to ameliorate the growing tidal wave of cyber attacks. Each of those security perspectives has merit and should be part of any organization’s security strategy.

All the security measures one can implement are simply not reliable if they have not been adequately tested. One of the most effective methods for rigorously testing any system or device is to actually apply the very same techniques that attackers would apply. Only then can you be truly confident in your system’s security. This book is about learning to conduct effective, systematic penetration tests.

What is Penetration Testing?

You have already seen that penetration testing involves utilizing actual attack techniques; however, penetration testing is not the only form of security testing. Therefore, it is important to differentiate penetration testing from other forms of testing. As explained in the sections that follow, there are three primary methods for testing a network’s security:

  • Audits
  • Vulnerability Scans
  • Penetration Testing
Audits

An audit is usually a check of documentation. This means reviewing incident response plans, disaster recovery plans, and security policies. It also will involve checking past incident response reports to ensure compliance with the established plans and policies. In fact, this is the key to an audit: an audit is a check for compliance.

Audits can sometimes also involve a review of system logs. This might include firewall logs, intrusion detection system logs, or any other system logs that might provide insight into compliance with security policies. The primary focus of an audit is to evaluate if the target network complies with the appropriate policies, regulations, and, in some cases, laws that are applicable to that organization.

Audits are a valuable aspect of network security. But they can also be viewed as the opposite end of the spectrum from penetration testing. An audit is a rather passive process. No systems are actually affected, or perhaps even interacted with. An audit is an historical process, in that you are checking to see what has happened up to the time of the audit. Have policies been adhered to? Are applicable laws and standards being conformed to? These are all passive and historical questions. As you will see in this and subsequent chapters, a penetration test is checking what is occurring this very moment, and it is quite dynamic.

Vulnerability Scans

The purpose of a vulnerability scan is to detect known vulnerabilities in a target network or system. The first issue is to define what a known vulnerability is. A vulnerability is a flaw in any system that might allow security to be breached.

When a vulnerability in any computer system is confirmed, it is assigned a Common Vulnerabilities and Exposure number, also commonly called a CVE number. (Mitre, 2016, Common Vulnerabilities and Exposures: The Standard for Information Security Vulnerability Names. Retrieved from https://cve.mitre.org/.)

The Mitre Corporation describes the CVE system in this manner:

“Common Vulnerabilities and Exposures (CVE) is a list of common identifiers for publicly known cyber security vulnerabilities. Use of CVE Identifiers, or ‘CVE IDs,’ which are assigned by CVE Numbering Authorities (CNAs) from around the world, ensures confidence among parties when used to discuss or share information about a unique software or firmware vulnerability, provides a baseline for tool evaluation, and enables data exchange for cybersecurity automation.”

Vulnerability scans are related to penetration tests, but they are not, in and of themselves, penetration tests. This may be one of the most common misconceptions in cyber security. I personally often begin my penetration testing process with one or more vulnerability scans. However, these are just to aid in selecting targets for the penetration test. They are not themselves the penetration test.

A vulnerability scan is, however, a critical part of security testing. And, as you will see in later chapters, a vulnerability scan can be mostly an automated process. Therefore, it is definitely recommended that any network be subjected to a vulnerability scan at regularly scheduled intervals.

Penetration Tests

As was previously mentioned, a penetration test is the utilization of actual hacking techniques in order to test the security of a target system; however, penetration testing and hacking are not synonymous.

Let us begin by defining hacking. Contrary to what you may have gleaned from media portrayals, hacking is not inherently criminal. Hacking is a process of attempting to understand a system by finding and exploiting flaws in that system. Of course, those techniques can be used for criminal activities, but the majority of the hacking community are not criminals and do not violate the law. They are researchers trying to understand systems. In many cases, that research is informal, individual, and outside of any academic setting, but it is still research. Put more succinctly, hacking is about learning.

This brings us to what penetration testing is. Penetration testing is a formal process, and it should involve standard project management methodologies. The goal of penetration testing is to attempt to exploit flaws in a target system. In essence, you attempt to penetrate the system, thus the name.

How does penetration testing differ from hacking? The first, and most obvious, difference is the approach. Hacking is an ad hoc, unstructured process. The hackers are simply satisfying their own intellectual curiosity. This means that when a hacker is hacking a system, he or she simply indulges their curiosity and explores whatever nuances of the system are of interest. Penetration testers have a goal: testing system security. For a penetration tester, idle curiosity is a luxury. There are specific testing goals that must be reached.

The second difference between hacking and penetration testing is the scope. A hacker might focus on only a single aspect of a system. The penetration tester is focusing on a scope that has been determined in advance.

A third difference is legality. As I stated earlier, hacking is not necessarily criminal. And a great many hackers are law-abiding people. However, certainly some hackers are engaged in criminal activity. A penetration tester is never engaged in cybercrime. The penetration tester always has the permission of the system’s owners. In fact, as we will discuss later in this chapter, a clean criminal background and impeccable ethics are must-have qualities for a penetration tester.

The Hybrid Test

Larger organizations will conduct audits, vulnerability scans, and penetration tests separately. Sometimes these tests are even conducted by separate teams; however, such an approach might not be cost effective for smaller organizations. As I stated earlier, I often begin my penetration test with a few vulnerability scans. In a hybrid test, one first expands that initial vulnerability scan and includes the reports of that scan in the final penetration testing report.

It may also be useful to preface your test with a brief review of policy compliance and past incident reports. The final product of these steps is to have a penetration test that includes a vulnerability assessment and a brief audit. This can often be a cost-effective solution for smaller organizations.

Terminology

Before we go much further, it is important that you understand basic terminology used in the hacking and penetration testing communities. Some of these terms are in very wide use, and you are likely to have heard of them before. Others will be less common, possibly new to you.

  • Ad hoc testing: Testing carried out with no systematic approach or methodology. It is hoped that this book will steer you away from that.
  • Black hat hacker: A hacker who does break the law. This term is synonymous with cracker, but the term black hat hacker is far more common. Contrary to some media portrayals, a black hat is not necessarily any more skilled. Someone can break the law and still have only minimal skill.
  • Cracker: One who breaks into a system in order to do something malicious, illegal, or harmful. Synonymous with black hat hacker.
  • Ethical hacker: Someone who is using hacking techniques for legal and ethical purposes.
  • Footprinting: Scanning a target to learn about that target.
  • Gray hat hacker: A hacker who usually obeys the law but in some instances will cross the line into black hat hacking.
  • Hacker: One who tries to learn about a system by examining it in detail by reverse-engineering or probing the system. This is an important definition. Hackers are not necessarily criminals. One can be a hacker and never break the law, nor do anything unethical.
  • Script kiddy: A slang term for an unskilled person who purports to be a skilled hacker. Some people download a tool or two, learn to use those, then consider themselves great hackers, when they are not.
  • White hat hacker: A hacker who does not break the law, often synonymous with ethical hacker. Essentially this is a person who uses hacking skills in a legal and ethical manner.

These are basic terms, and you will see others introduced in the text as we go along. Another issue that must be addressed along with terminology is the hacker culture. Again, I will stress that while penetration testing and hacking are closely related, they are not the same thing. This may make you wonder why you need to be concerned about the hacker culture. The fact is that you can learn a great deal from hackers. Therefore, an understanding of the hacking culture can be very useful.

The hacking culture is generally one of exploration. Yes, there are some people in the hacking community who commit crimes, but that is not all, nor even most, of the hacking community. In fact, there is not an organized, uniform “hacking community.” The community is incredibly diverse and amorphous. The one thing that binds it together and makes it a community is the desire for knowledge. And that is the key element in the hacker world. Knowledge is king. Among the hacking community, degrees and certifications count very little; what you can prove you know, what you can do, is what is important. This is key if you choose to visit one of the major hacking conventions, such as DEF CON. The attendees are only concerned about learning. And they can be harsh critics when it comes to speakers and presenters. They expect all speakers and presenters to provide new and applicable knowledge.

That aspect of the hacking culture is exactly why it is so critical for you to be connected to it. It is a place where you can learn things, things that are not always published in books and journals. I will, however, reiterate that hacking and penetration testing are not the same things. But penetration testing does require knowledge of hacking techniques. Therefore, knowing as many diverse hacking techniques as you can is critical (and we will explore many of these later in this book).

While I have already stressed (and will continue to stress) that hacking and pen testing are separate but related activities, professional pen testers should take from the hacking community that love of learning. Penetration testing, vulnerabilities, and system security in general are constantly changing. If you literally knew everything there was to know about penetration testing today, that knowledge would start to become dated and new knowledge would be needed within 24 months. Some people find that aspect of this profession quite daunting. I find it exhilarating. As a hacker or a professional penetration tester, you are on a lifelong journey of constantly learning. The one constant is that no one (not even this author) ever knows enough. And that hunger to know more is the defining characteristic of the hacking community.

Methodologies

Methodology is one of the key elements that separate penetration testing from hacking. What approach do you use to perform a penetration test? There are various general approaches we will examine first, then we will delve into more specific methodologies. Methodology is separate from penetration testing standards.

Nature of the Test

There are three broad categories of penetration testing. They are usually termed black box, white box, and gray box. These designations are a description of how much information the penetration tester is given prior to the test.

Black Box

A black box test involves the penetration tester having as little information about the target network as possible, perhaps only the organization’s name and URL or IP address of their gateway router. The goal of such tests is to simulate an external attacker attempting to breach the network. Obviously, a black box test must be done by an outside party, as any member of the organization’s own IT department would have some knowledge of the organization’s network.

As with any approach to testing, there are benefits and drawbacks to black box testing. One benefit is that it does exactly mimic an outside attack. A second benefit is that the skill of your penetration tester will become immediately obvious. If they are not very skilled, they may have difficulty making any successful penetration of your network.

The most significant drawback to this approach is that it will always be more costly. It takes significantly more time to conduct a black box test, because the penetration tester must first learn about the target network. Furthermore, he or she must learn by scanning and probing. This all takes time.

White Box

As the name suggests, this is the complete opposite of the black box test. This approach to penetration testing involves the tester having extensive knowledge of the target system. This will include the following:

  • IP addresses of workstations and servers
  • Operating system information for computers
  • IP addresses for switches and routers
  • Information regarding security devices such as firewalls and intrusion detection systems

A white box test can be done by internal or external staff. There are two major advantages to this approach, the first being that it is well suited for your internal staff to perform because they already have some significant knowledge of the network. A second advantage is that this approach takes less time and is thus less expensive. The tester will have no need for a discovery or scanning phase, and will often have specific targeted items to test. The main disadvantage involves the use of internal staff.

Gray Box

This is a rather generic term without specific boundaries. It essentially means anything between black box and white box. Or to put it another way, the tester is given some network information but not all information. As a practical matter, this is often the easiest to initiate. The penetration tester is given whatever system information is readily available, with no need for an exhaustive assembly of all information.

This test approach will be faster than the black box, because there is less discovery needed; however, there will be a discovery phase. The tester will need to perform scanning and discovery. That discovery will be less extensive and faster than black box testing, however, simply because the tester begins with some level of knowledge.

Unlike the information disclosed in white box testing, with gray box testing the tester will get general information such as the IP address of key servers, and perhaps operating systems being used, but not a diagram nor the IP addresses of all (or even most) computers on the network.

Depending on the level of information available to the tester, gray box testing can be done by internal or external testers. Internal testers can perform gray box tests, because it is unlikely that any internal employees have complete knowledge of the organization’s networks.

In my own penetration tests, I most often perform gray box tests. This seems to be a good fit for both the client and myself. I have enough information to perform a robust and effective test, and the cost is acceptable to the client.

Approaches

The first issue to address in choosing an approach is to identify the driving motivation behind the penetration test. This may seem like an odd question, but it bears examination. Is this penetration test being motivated by general concerns of the organization? Is it being conducted simply to comply with some particular standard (such as the Payment Card Industry Data Security Standard [PCI DSS])? Or is the testing in response to specific incidents, either at that organization or simply incidents the organization has become aware of that have generated concern?

The basis for the penetration test will drive how the test is conducted. Let us address the first scenario. If the organization simply has a general concern for cyber security, then the test will be driven almost entirely by the penetration tester. This requires that the penetration tester do some preliminary investigation to find out what sorts of breaches are most common in the organization’s industry and which attacks the organization is most likely to be subjected to based on its size, notoriety, and other factors.

The main problem with a penetration test that is based on general concerns is that it lacks focus. This can lead to you failing to test those items that are actually most important. Therefore, when conducting a penetration test that has not been given a focus by the client, it is important that you have a conversation with the client and establish goals.

When a penetration test is motivated by compliance with specific standards, such as PCI DSS, then the process is far simpler. You must carefully review the standard in question and ensure you are testing every single requirement; however, you should always view standards as a minimum level of penetration testing, not the maximum. You can always test more thoroughly than the standard requires.

If the penetration test is being conducted in response to a specific incident, then the goal is clear. You must test any attacks similar to that incident. As with standards-focused tests, this is just a minimum. You may need to test beyond just the class of incidents that are of concern to the customer.

This brings us to the issue of quality in testing. Regardless of the motivation for testing or the approach being used (black box, white box, gray box), the goal is a high-quality, effective test. One concern is that any person, and any tool, can make a mistake. Therefore, one key element of quality control in testing is to repeat key tests with a different tool or technique. If you are working with a team, then the repeat test should also be done by a different person. If you are a solo penetration tester, then conduct the second test not only with a different tool/technique but also on a different date. If you find the same issue using a different technique on a different date, then the chances of this being an error are significantly reduced.

Ethical Issues

Ethical issues are seldom covered in hacking and penetration tests, and when they are covered, they are given very minimal coverage. This is unfortunate, as penetration testing is an area where ethical behavior is very critical. There are two issues that make ethics in pen testing such a critical topic.

The first issue related to ethics is the access a penetration tester will have to an organization’s network. A penetration tester is literally being asked to attempt to hack into a network. That alone would require a high level of ethics. In addition to the nature of penetration testing, the fact is that during a penetration test you will see a great deal of private information. That is inevitable if you are able to successfully breach that organization’s network.

These two facts, both of which stem from the very nature of penetration testing, require a high level of ethics in any penetration tester. You must treat all data you see as confidential. In fact, my own default position is that everything I see is confidential unless I am expressly told otherwise.

The second issue regarding ethics and penetration testing is being honest about one’s skills. It is very easy to find penetration testers who grossly exaggerate their own skillset. There are multiple reasons for this exaggeration. The first is that computer security in general and penetration testing in particular are hot topics. There is a high demand for computer security professionals, and frankly one can make a significant amount of money in this field. This leads some to exaggerate their skills and credentials in order to get more money.

There is a second reason for this exaggeration. Computer security in general, and penetration testing in particular, are exciting. One could argue that they are the most exciting topics in all of the IT industry. Think for a moment about how many times you have seen hacking as part of the plot of some movie or television drama. It is likely that you can easily think of many such examples. Now contrast that with other subdomains of the IT profession. For example, I suspect you cannot recall many movies where database administration or mainframe programming played a central role. In addition to the glamorous (but almost entirely unrealistic) image that media provides of hacking and penetration testing, we have the fact that these skillsets are now integral to national security. Putting those factors together, many think it is just “cool” to claim greater skills and experience than they have.

While you may be tempted to succumb to that desire to exaggerate a bit, I strongly encourage you not to do so. In the short term, that might indeed get you profits, but in the long term it can be detrimental to your career. Ethics are important in any profession, but they are even more critical here. If you want to have more skills, then work hard and actually develop those skills, don’t simply exaggerate. And later in this chapter we will discuss ways you can enhance your skillset.

Media representations may have led you to believe that organizations commonly hire convicted cyber criminals to perform penetration testing. That may have been true 30 years ago, but is less true with each passing year. Today there are law-abiding, ethical pen testers who have had formal training and have the requisite skills (as you are gaining from this book). There is no need to hire someone who has already proven they lack ethics. Therefore, any ethical issues are likely to impact your professional opportunities. You should always conduct yourself with a high ethical standard.

Everything is Confidential

Some people parse a confidentiality agreement, seeking some nuance that will permit them to reveal what they know. I recommend the opposite approach. Every piece of information you encounter is considered confidential unless you are expressly told otherwise.

Security testing, including penetration testing, will often inadvertently expose you to confidential information of the target organization. Your clients need to feel confident that you will treat that information with the greatest discretion. Obviously, that confidentiality does not include covering up illegal acts. But aside from criminal activity, you should keep all client information confidential, even if it is not explicitly detailed in a confidentiality agreement.

Keep in Your Lane

We all have a set of skills. Hopefully, by completing this book and studying diligently, you will expand your skill set. But regardless of how much you expand your skills, there will always be limits. Be aware of your own limits and if a task is outside your skillset, then tell the client you are not the appropriate person for that specific test.

By way of example, I am reasonably competent at various aspects of cyber security and penetration testing, but I am completely unskilled in subjects such as physical penetration testing (actually trying to enter the target building) and social engineering. And some standards actually require an organization to do a physical penetration test. I always tell clients that they should hire someone else for that aspect of their testing. I am simply not very good at those things and it is unlikely that I can perform an adequate test. You might think being open about your shortcomings would cause you to lose clients, but I have found exactly the opposite. Many clients are very thankful for my honesty.

If You Break It, You Bought It

In the process of penetration testing, you will be prodding someone’s systems—their computers, servers, devices, network, etc. It is entirely possible to cause a disruption to business. You must be very careful to avoid this.

One way you can minimize the chance of disrupting the client’s business is by conducting your test when the client has the least activity. This might be quite inconvenient for you (for example, conducting a website penetration test at 2 a.m. Sunday) but it is one way to protect your client’s systems.

The penetration testing contract should detail exactly what tests will be performed, at what times, and under what conditions. This will help clarify your role. You should take every step you can to minimize any disruption to the client’s system. With particularly sensitive systems, conducting tests on backup copies rather than the live system may be warranted.

Legal Issues

As you progress through this book, you will learn a variety of hands-on hacking techniques. The intent is for you to utilize these skills in order to test an organization’s systems. Using these skills without explicit permission is a crime, and in many cases it can be multiple crimes. In this section, we look at several laws that affect hacking. The sections that follow cover the laws of which every penetration tester should be aware. The focus is primarily on U.S. laws, but a few laws from other countries are also discussed.

Computer Fraud and Abuse Act (CFAA): 18 U.S. Code § 1030

This law is perhaps one of the most fundamental computer crime laws, and merits careful study by anyone interested in the field of computer crime. The primary reason to consider this legislation as pivotal is that it was the first significant federal legislation designed to provide some protection against computer-based crimes. Prior to this legislation, courts relied on common law definitions and adaptations of legislation concerning traditional, non-computer crimes in order to prosecute computer crimes.

Throughout the 1970s and early 1980s, the frequency and severity of computer crimes increased. In response to this growing problem, the Comprehensive Crime Control Act of 1984 was amended to include provisions to specifically address the unauthorized access and use of computers and computer networks. These provisions made it a felony offense to access classified information in a computer without authorization. They also made it a misdemeanor offense to access financial records in a computer system.

However, these amendments were not considered in and of themselves to be adequate. Thus, during 1985, both the House and the Senate held hearings on potential computer crime bills. These hearings eventually culminated in the Computer Fraud and Abuse Act (CFAA), enacted by Congress in 1986, which amended 18 USC § 1030. The original goal of this act was to provide legal protection for computers and computer systems that were in one of the following categories:

  • Under direct control of some federal entity
  • Part of a financial institution
  • Involved in interstate or foreign commerce

As you can see, this law was aimed at protecting computer systems that came within the federal purview. This act made several activities explicitly criminal. First and foremost was accessing a computer without authorization in order to obtain any of the following types of information:

  • National security information
  • Financial records
  • Information from a consumer reporting agency
  • Information from any department or agency of the United States
Unlawful Access to Stored Communications: 18 U.S. Code § 2701

The actual wording of the statute is as follows:

Offense.—Except as provided in subsection (c) of this section whoever—

(1) intentionally accesses without authorization a facility through which an electronic communication service is provided; or

(2) intentionally exceeds an authorization to access that facility; and thereby obtains, alters, or prevents authorized access to a wire or electronic communication while it is in electronic storage in such system shall be punished as provided in subsection (b) of this section.

Both of these elements are germane to hacking techniques and to penetration testing. Note number 2, “intentionally exceeds an authorization to access.” Even if you have authorization, exceeding your mandate is not only unethical, it could be a federal crime. It should be noted that the first offense can get up to 5 years in prison. Up to 10 years incarceration is possible for further offenses.

Identity Theft Enforcement and Restitution Act

This act was actually an extension of the 1984 Computer Fraud and Abuse Act. It was written in response to the growing threat of identity theft and the perceived inadequacy of existing laws. One of its most important provisions was to allow prosecution of computer fraud offenses for conduct not involving an interstate or foreign communication. This meant that purely domestic incidents occurring completely within one state were now prosecutable under federal law. Beyond that important provision, this act expanded the definition of cyber extortion to include threats to damage computer systems or steal data.

Another important aspect of this legislation was that it expanded identity theft laws to organizations. Prior to this, only natural persons could legally be considered victims of identity theft. Under this act organizations can also legally be considered victims of identity theft and fraud. This law also made it a criminal offense to conspire to commit computer fraud.

Fraud and Related Activity in Connection with Access Devices: 18 U.S. Code § 1029

This is closely related to 18 U.S. Code § 1030 but covers access devices (such as routers). Essentially this law mimics USC 1030 but applies to devices used to access systems. What is most fascinating about this law, in my opinion, is that it also covers counterfeit access devices. Later in this book you will learn about rogue access devices and man-in-the-middle attacks. This law would expressly relate to that.

State Laws

There are 50 different states within the United States, and it is beyond the scope of this book to cover the laws in each and every state. It is recommended that you consult the laws in any state in which you work as a penetration tester.

International Laws

It is beyond the scope of this book to cover laws in every country. A good rule of thumb is that any access without permission is very likely to be a crime in any jurisdiction; however, we can cover a few prominent laws in this section.

EU Directive 2013/40

On 3 September 2013, new EU Directive 2013/40 on attacks against information systems (the “Directive”) came into force. It is aimed at large-scale cyber attacks, and directs each member state to enact tougher criminal laws against cyber crimes.

Saudi Arabia

Saudi Arabia has the Anti-Cyber Crime Law (Royal Decree No. M/17 dated 8 Rabi1 1428). Article 6 of that law provides for up to 5 years in prison and fines equivalent to about 800,000 U.S. dollars for a range of offences including:

“production, preparation, transmission, or storage of material impinging on public order, religious values, public morals, and privacy, through the information network or computers.”

Jordan Information Systems and Cyber Crime Law

Also known as the Information Systems Crime Law of 2010, the following are a few excerpts from that law:

“Anyone who intentionally accesses a website or information system in any manner without authorization or in violation or excess of an authorization, shall be punished by imprisonment for a term not less than one week and not exceeding three months, or by a fine of not less than (100) one hundred Dinars and not exceeding (200) two hundred Dinars, or both punishments.”

“Anyone who installs, publishes or uses intentionally a program through an information network or information system, with the purpose of canceling, deleting, adding, destroying, disclosing, extinguishing, blocking, altering, changing, transferring, copying, capturing, or enabling others to view data or information, or obstructing, interfering, hindering, stopping the operation of an information system or preventing access to it, or altering a website or canceling it, destroying it, or altering its content or operating it, assuming its identity or the identity of the owner without authorization or in violation or excess of the authorization shall be punished by imprisonment for a term not less than three months and not exceeding one year or by a fine of not less than (200) two hundred Dinars and not exceeding (1000) one thousand Dinars, or both punishments.”

Unauthorized Computer Access Law

This is a Japanese law dating to 1998, but still in force. It is broadly worded and thus can be applied to a wide range of activities. A few interesting excerpts from that law are given here:

“An act of making available a specific use which is restricted by an access control function by making in operation a specific computer having that access control function through inputting into that specific computer, via telecommunication line, another person’s identification code for that access control function (to exclude such acts conducted by the access administrator who has added the access control function concerned, or conducted with the approval of the access administrator concerned or of the authorized user for that identification code);”

“No person shall provide another person’s identification code relating to an access control function to a person other than the access administrator for that access control function or the authorized user for that identification code, in indicating that it is the identification code for which specific computer’s specific use, or at the request of a person who has such knowledge, excepting the case where such acts are conducted by that access administrator, or with the approval of that access administrator or of that authorized user.”

Certifications

It is important for a penetration tester to understand the role of industry certification tests and training. There are several such certification tests and training courses available. I must be clear, however, that it is not my intent to endorse nor to denounce any of these certifications. I want to give you an unbiased view of each of the major certifications.

Before we examine specific certifications, let us first address the controversial issue of the value of any certification. Certifications are controversial in the entire computer industry, and very much so in the penetration testing subdomain. You will find some people who advocate a particular certification as the Holy Grail of training, and intimate that one cannot be a professional penetration tester without that certification. Others will tell you that exact same certification is entirely worthless and a complete waste of your time. And yet others will tell you all certifications are completely worthless.

The reality is that all these views come from a misunderstanding of what any certification actually means. A certification does not mean you are a master of that topic. It means you have demonstrated a minimum level of competency on a specific set of objectives. Among those who successfully obtain a given certification, there is still wide variation in their actual skillset.

So why bother with certifications? One reason is learning. I personally hold 42 certifications (as of this writing, possibly more by publication). Some were very illuminating; I learned a great deal studying for them. From others I learned very little. However, in every single one, I learned something. I cannot recall any of these certifications wherein I learned nothing at all.

Another reason is that employers and clients need to have some verifiable indication that you have the requisite skillset. Certifications provide one such indicator. I would, however, never recommend hiring someone based solely on that person’s possessing a particular certification. The certifications must be taken as part of the entire profile. Formal education, informal training, and experience are all very important factors as well. The bottom line, however, is that many companies will not hire you if you don’t have at least one or two certifications. For that reason, I strongly suggest you consider one or more of these as part of your professional education. Now that you have an overview of certifications, we can discuss specific industry certifications. There are more certifications than what you see listed here. In recent years there has been an explosion of certifications. It would be a herculean challenge to list them all. So, what I have chosen are the most well-known certifications relevant to penetration testing, with one exception. There is one I will describe that is not well known and I will explain why when we get to that one.

CEH

The Certified Ethical Hacker is the flagship certification of the EC-Council (https://www.eccouncil.org). This certification has some very significant positives, and a few negatives. Let us begin with the positives. It is the oldest hacking/penetration testing certification. That means everyone knows what it is, and virtually any company considering hiring you is likely to be familiar with it. There are also several books one can use to self-study for this test. A simple search on Amazon for “CEH” will show you some of these.

At press time, the course/test is currently in version 9. This means there has been plenty of time to work out issues and make improvements. My opinion of the test itself is that it covers a wide range of tools and concepts that any penetration tester should be familiar with.

Now, what about the drawbacks to this certification? Many in the hacking community take a dim view of this certification. One reason is that earlier versions had some issues, including overlooking key subjects. Another common criticism is that the CEH covers a very broad array of tools, with no real depth on any of them. At press time, the cost for the test is $550. If you self-study or take an unofficial training course, then you must also pay a $100 application fee to see if you are eligible to take the test. Eligibility is based on 2 years of experience in cyber security.

GPEN

GIAC Penetration Tester (GPEN) is the basic penetration testing course/certification from the SANS Institute (https://www.giac.org/certification/penetration-tester-gpen). In order to properly review this certification, I must first make a few observations about SANS training in general. If you use your favorite search engine to search for any topic related to computer security (e.g. “pen testing methodology,” “SQL Injection,” “Windows Forensics,” etc.), it is virtually guaranteed that at least one of the results you will get is a SANS paper. SANS has an excellent reputation for quality papers. In fact, later in this book, I will be citing a few SANS papers as sources. And what is even better is that their papers are freely available on the Internet for anyone to read.

A second positive issue with SANS training is that the training has an excellent reputation. In my entire career, having spoken to literally thousands of IT professionals all over the world, I have yet to meet a single person who has complained that they did not learn new information in a SANS course.

So, what is the downside? First, their courses are simply the most expensive IT training courses I have ever found. Often IT training courses range from $1500 to $2800 for a 1-week/40-hour course. SANS courses are well in excess of $4000. Also, they do not publish the test objectives, so it is very difficult to self-study. If you do choose to simply take the exam without taking their course, it will cost over $1100 to take the test, and you will have great difficulty finding self-study material.

The GPEN itself is a good general penetration testing course that covers the essential topics one needs to be a penetration tester. The training does combine a mix of hands-on labs with lecture/theory.

OSCP

The Offensive Security Certified Professional (OSCP) certification from Offensive Security (https://www.offensive-security.com/information-security-certifications/oscp-offensive-security-certified-professional/) has gained a very good reputation in the hacking community. Unlike the certification tests, it is not a written test. The test taker must successfully hack into test systems. This makes it a very realistic test of your hacking skills. Put another way, it is impossible to pass the OSCP and not have actual hacking skills.

The primary drawback of OSCP is that it does not really teach or test pen testing—it tests hacking. And, as I hope I have made clear in this chapter, pen testing is not simply hacking techniques. The test and course are $800, which is rather low priced compared to many other certification courses. According to Offensive Security’s website, you must sign up for their course in order to take the test; you cannot simply challenge the test as you can with other certification vendors.

Mile2

Mile2 security training (https://mile2.com) and certifications are less well known than those of EC-Council or ISC2. The reputation of Mile2 certifications in the industry is actually solid. They are not as well known or as highly prized as SANS or Offensive Security certifications, but certainly don’t have a poor reputation either. The main advantages are that you take the tests online at your convenience, and they have multiple levels of pen-testing/hacking certifications, starting with their most basic Certified Vulnerability Assessment and topping out with the Certified Penetration Testing Consultant. They also have a range of certifications, from relatively beginner levels to more sophisticated. And they have one very significant advantage: Their tests are far less expensive than any of the others.

CISSP

The Certified Information System Security Professional (CISSP) is not actually a penetration testing certification. Rather, it is a general information security certification. It may seem peculiar that I include it here. The CISSP is the original IT security certification. It is the oldest and most well known. Frankly speaking, many IT security jobs list CISSP even for penetration testing of digital forensics jobs. It is often said that any IT security professional will need to get the CISSP at some point. This is why I mention it here.

The test itself is 250 questions covering 8 domains (it was previously 10 domains) over the breadth of IT security. It has often been described as being a “mile wide and an inch deep.” This means it covers a wide array of topics without much depth on any particular topic. I would agree with this assessment. But that is precisely why it is such a valuable test. It is critical that an IT security professional, regardless of specialty, have a good general understanding of the breadth of IT security topics.

At press time, the test costs $550 and requires four years of experience with a college degree, or five years without. Experience is rather broadly defined, so if you have been in the IT industry for several years, there is a good chance you will meet the experience criteria. There are many courses, both official and unofficial, for the CISSP, as well as many self-study books one can find on Amazon.com

PPT

This is the lesser-known certification I mentioned earlier. In this case let me begin with the negatives before the positives. The most obvious negative is that it is less well known. People may not immediately recognize “Professional Penetration Tester” certification, though it is hoped that the name itself will clarify the intent. In full disclosure, this test is one I created and it is currently in version 2.

In order to describe the positives of this test, allow me to explain why I created it. In my opinion there are many good tests already out there, including the ones I previously described in this section. However, I felt there were a few things lacking, so I created a test and certification to address these issues.

The first issue is that the current tests described in this section give little to no coverage of pen testing standards or methodologies. The PPT does cover the standards and methodologies you will see in [Chapter 2](). The PPT also covers standard hacking techniques such as SQL injection (which you will learn in [Chapter 7](), “Web Hacking”), nmap scanning (which you will learn in [Chapter 4](), “Reconnaissance”), information gathering (which you will learn in Chapter 4, basic Linux (which you will learn in [Chapter 9](), “Introduction to Linux”), and other pen testing/hacking topics.

The second issue I noticed was how expensive certification tests have become. I thought there should be a penetration testing certification that is more affordable. And with that in mind, I created the Professional Penetration Tester exam, which is taken online at a cost of $99.

This Book and Certifications

First, you should know this is not a certification preparation book. It is not designed specifically to prepare you for any of the certification tests mentioned; however, the topics covered in this book are also on one or more of the aforementioned certification tests. If you fully master what is in this book, then you would have covered the bulk of the material for GPEN, CEH, or even OSCP. And of course, you will have covered all of PPT. The reason is that these tests all have some overlap. All of them cover nmap, SQL injection, Windows hacking, Metasploit, etc. So while this is not a certification preparation guide, it can certainly be a useful tool in helping you prepare for many certification tests.

Careers in Penetration Testing

Whether you are reading this book as a textbook for a formal class you are taking or as self-study, it is very likely that you are hoping either to enter this field or to advance within the field. For this reason, I wish to take a few paragraphs to discuss what career options are available to you. In the next section I will discuss skills you need, and how to build upon those skills.

Security Administrators

The first, and most obvious career path for penetration testing skills is for security administrators. These professionals don’t specialize in penetration testing; rather, they are concerned with a broad scope of cyber security concerns. Even though these security professionals may not do penetration tests as part of their daily tasks, learning penetration testing is very important, for three reasons.

The first reason is so that the security professional can conduct a limited penetration test whenever he or she feels it is necessary. This can be in response to some security vulnerability that has been in the media, or a recent breach in the organization. There are numerous scenarios in which the security administrator may wish to perform some limited penetration test on some aspect of his or her organization’s systems.

The second reason for the general security professional to learn penetration testing is so that they know enough to be able to effectively hire a competent outside consultant when needed. It is very difficult to judge the competency of a professional if you have absolutely no idea about that profession. Having at least basic penetration testing skills will allow you to readily assess the competency of an outside consultant you may wish to hire.

The third reason pertains to the hacking techniques we will discuss beginning in [Chapter 3](), “Cryptography.” In my opinion, it is virtually impossible to secure your network against threats you do not understand. In other words, you may wish to have at least basic hacking skills in order to better inform your selection of security countermeasures. If you know what the attackers know, you will be better able to defend against their attacks. If you fully master the skills in this book, that would be adequate for any security administrator.

Commercial Penetration Testing

Many companies today hire their own internal penetration testers. And other companies provide penetration testing services to customers. In either case, these companies require people with penetration testing skills. In fact, some companies have extensive penetration testing teams with subspecialties within those teams.

As you might expect, commercial penetration testing requires significantly more skills than simply being a penetration testing skilled security administrator. Many of these teams are specialized, so you may find yourself specializing in malware, web penetration testing, PCI DSS penetration testing, or some other subtopic. And as you can probably guess, mastering all the skills in this book would qualify you as an entry-level commercial penetration tester, but you would have much more to learn as your career progresses.

Government/National Defense

Since I first began working on cyber security, the industry has grown dramatically. There are now jobs that simply did not exist when I began. For example, the U.S. military has jobs (called Military Occupational Specialties) for cyber security. That literally means you enlist in the U.S. Army, Air Force, or Marines, with a cyber security specialty. The advantage is that no prior training is required; the military will provide the necessary training. Furthermore, the military will conduct a security clearance, passing which will be very helpful even in the civilian world.

It is also possible to work for defense contracting agencies. All of the major contracting agencies have cyber security sections. However, the defense contracting companies expect you to already have a high level of skill and experience. They don’t provide the training.

Intelligence agencies, most notably the NSA, hire people with hacking/penetration testing skills. As you can probably surmise, they are looking for people who not only have very high skill levels but also can pass a very rigorous background check. The need for ethics and confidentiality will, quite obviously, be extremely high in such organizations.

Law Enforcement

Obviously, police officers don’t hack into networks, at least not routinely. However, it is important for anyone in law enforcement who is responsible for investigating cyber crimes to understand how those crimes are committed. Having a working knowledge of the techniques used by attackers will make any law enforcement officer more capable at investigating such breaches. I have personally taught multiple hacking courses to various law enforcement agencies, for this very reason.

I began this section stating that law enforcement officers don’t hack into networks. There are exceptions. For example, there is the famous case of the “playpen” website. This was a dark website that distributed child pornography. The FBI managed to infect that site with spyware to help catch the customers who came to the site to traffic in pornographic images of children. This is a situation where hacking skills were used to catch criminals. Incidentally, in this case, a Metasploit payload was used. We will be exploring Metasploit in [Chapters 13]() through [16]().

Building Your Skillset

Regardless of your purpose in using this book, or your professional aspirations, it should be noted that this book provides a foundation for your penetration testing. There is always more to learn. In fact, you are entering a field where you can never know it all. There will always be new techniques and new countermeasures. So, let us take a little time here to discuss how you can best improve your skills.

The first, most critical thing to do is to practice what you see in this book. Don’t just read it, do it! There will be plenty of hands-on labs. Do each and every one of them. But do not stop there. The labs are meant to introduce you to a particular tool or technique. You should explore beyond the labs.

Another issue to consider is your depth of knowledge about computer science in general. There are certainly penetration testers who do not have a significant background in computer science. However, the more you know about computer science, the better you will be as a penetration tester. You should strive to have a solid working knowledge of operating systems and networking technology as a minimum.

It will also be important for you to continually learn new techniques. This is a very rapidly changing field. What you learn today can quickly become obsolete.

Summary

This chapter has given you a broad introduction to the field of penetration testing. Various legal and ethical issues have been discussed, as well as some general terminology. Specific industry certifications have been described. It is important that you be familiar with the different types of tests, relevant legal and ethical considerations, and the terminology used in penetration testing.