Chapter 1
In This Chapter
Understanding hackers’ and malicious users’ objectives
Examining how the ethical hacking process came about
Understanding the dangers your computer systems face
Starting to use the ethical hacking process for security testing
This book is about testing your computers and networks for security vulnerabilities and plugging the holes you find before the bad guys get a chance to exploit them.
Most people have heard of hackers and malicious users. Many have even suffered the consequences of their criminal actions. So who are these people? And why do you need to know about them? The next few sections give you the lowdown on these attackers.
Malicious users (or internal attackers) try to compromise computers and sensitive information from the inside as authorized and “trusted” users. Malicious users go for systems they believe they can compromise for ill-gotten gains or revenge.
Malicious attackers are, generally speaking, both hackers and malicious users. For the sake of simplicity, I refer to both as hackers and specify hacker or malicious user only when I need to differentiate and drill down further into their unique tools, techniques, and ways of thinking.
Hacker has two meanings:
The good-guy (white hat) hackers don’t like being lumped in the same category as the bad-guy (black hat) hackers. (In case you’re curious, the white hat and black hat terms come from old Western TV shows in which the good guys wore white cowboy hats and the bad guys wore black cowboy hats.) Gray hat hackers are a little bit of both. Whatever the case, most people have a negative connotation of the word hacker.
Many malicious hackers claim that they don’t cause damage but instead help others for the “greater good” of society. Yeah, right. Malicious hackers are electronic miscreants and deserve the consequences of their actions.
Be careful not to confuse criminal hackers with security researchers. Researchers not only hack aboveboard and develop the amazing tools that we get to use in our work, but also they (usually) take responsible steps to disclose their findings and publish their code.
Malicious user — meaning a rogue employee, contractor, intern, or other user who abuses his or her trusted privileges — is a common term in security circles and in headlines about information breaches. The issue isn’t necessarily users “hacking” internal systems, but rather users who abuse the computer access privileges they’ve been given. Users ferret through critical database systems to glean sensitive information, e-mail confidential client information to the competition or elsewhere to the cloud, or delete sensitive files from servers that they probably didn’t need to have access to in the first place. There’s also the occasional ignorant insider whose intent is not malicious but who still causes security problems by moving, deleting, or corrupting sensitive information. Even an innocent “fat-finger” on the keyboard can have dire consequences in the business world.
Malicious users are often the worst enemies of IT and information security professionals because they know exactly where to go to get the goods and don’t need to be computer savvy to compromise sensitive information. These users have the access they need and the management trusts them — often without question.
So, what about that Edward Snowden guy — the former National Security Agency employee who ratted out his own employer? That’s a complicated subject and I talk about hacker motivations in Chapter 2. Regardless of what you think of Snowden, he abused his authority and violated the terms of his non-disclosure agreement.
You need protection from hacker shenanigans; you have to become as savvy as the guys trying to attack your systems. A true security assessment professional possesses the skills, mindset, and tools of a hacker but is also trustworthy. He or she performs the hacks as security tests against systems based on how hackers might work.
Many people confuse security testing via the ethical hacking approach with security auditing, but there are big differences, namely in the objectives. Security auditing involves comparing a company’s security policies (or compliance requirements) to what’s actually taking place. The intent of security auditing is to validate that security controls exist — typically using a risk-based approach. Auditing often involves reviewing business processes and, in many cases, might not be very technical. I often refer to security audits as security checklists because they’re usually based on (you guessed it) checklists.
Conversely, security assessments based around ethical hacking focus on vulnerabilities that can be exploited. This testing approach validates that security controls do not exist or are ineffectual at best. Ethical hacking can be both highly technical and nontechnical, and although you do use a formal methodology, it tends to be a bit less structured than formal auditing. Where auditing is required (such as for the ISO 9001 and 27001 certifications) in your organization, you might consider integrating the ethical hacking techniques I outline in this book into your IT/security audit program. They complement one another really well.
If you choose to make ethical hacking an important part of your business’s information risk management program, you really need to have a documented security testing policy. Such a policy outlines who’s doing the testing, the general type of testing that is performed, and how often the testing takes place. Specific procedures for carrying out your security tests could outline the methodologies I cover in this book. You might also consider creating a security standards document that outlines the specific security testing tools that are used and specific people performing the testing. You might also list standard testing dates, such as once per quarter for external systems and biannual tests for internal systems — whatever works for your business.
Your own internal policies might dictate how management views security testing, but you also need to consider the state, federal, and international laws and regulations that affect your business. In particular, the Digital Millennium Copyright Act (DMCA) sends chills down the spines of legitimate researchers. See www.eff.org/issues/dmca
for everything the DMCA has to offer.
Many of the federal laws and regulations in the United States — such as the Health Insurance Portability and Accountability Act (HIPAA), Health Information Technology for Economic and Clinical Health (HITECH) Act, Gramm-Leach-Bliley Act (GLBA), North American Electric Reliability Corporation (NERC) Critical Infrastructure Protection (CIP) requirements, and PCI DSS — require strong security controls and consistent security evaluations. Related international laws such as the Canadian Personal Information Protection and Electronic Documents Act (PIPEDA), the European Union’s Data Protection Directive, and Japan’s Personal Information Protection Act (JPIPA) are no different. Incorporating your security tests into these compliance requirements is a great way to meet the state and federal regulations and beef up your overall information security and privacy program.
To catch a thief, you must think like a thief. That’s the basis for ethical hacking. Knowing your enemy is absolutely critical. The law of averages works against security. With the increased number of hackers and their expanding knowledge, and the growing number of system vulnerabilities and other unknowns, eventually all computer systems and applications will be hacked or compromised in some way. Protecting your systems from the bad guys — and not just the generic vulnerabilities that everyone knows about — is absolutely critical. When you know hacker tricks, you find out how vulnerable your systems really are.
Hacking preys on weak security practices and undisclosed vulnerabilities. More and more research, such as the annual Verizon Data Breach Investigations Report (www.verizonenterprise.com/DBIR
), is showing that long-standing, known vulnerabilities are also being targeted. Firewalls, encryption, and passwords can create a false feeling of safety. These security systems often focus on high-level vulnerabilities, such as basic access control, without affecting how the bad guys work. Attacking your own systems to discover vulnerabilities — especially the low-hanging fruit that gets so many people into trouble — helps make them more secure. Ethical hacking is a proven method of greatly hardening your systems from attack. If you don’t identify weaknesses, it’s only a matter of time before the vulnerabilities are exploited.
As hackers expand their knowledge, so should you. You must think like them and work like them to protect your systems from them. As the ethical hacker, you must know the activities that hackers carry out and how to stop their efforts. Knowing what to look for and how to use that information helps you to thwart hackers’ efforts.
Anticipating all the possible vulnerabilities you’ll have in your systems and business processes is impossible. You certainly can’t plan for all types of attacks — especially the unknown ones. However, the more combinations you try and the more you test whole systems instead of individual units, the better your chances are of discovering vulnerabilities that affect your information systems in their entirety.
Don’t take your security testing too far, though; hardening your systems from unlikely attacks makes little sense. For instance, if you don’t have a lot of foot traffic in your office and no internal web server running, you might not have as much to worry about as a cloud service provider might have.
It’s one thing to know generally that your systems are under fire from hackers around the world and malicious users around the office; it’s another to understand the specific attacks against your systems that are possible. This section discusses some well-known attacks but is by no means a comprehensive listing.
Many security vulnerabilities aren’t critical by themselves. However, exploiting several vulnerabilities at the same time can take its toll on a system or network environment. For example, a default Windows OS configuration, a weak SQL Server administrator password, or a server hosted on a wireless network might not be major security concerns by themselves — but someone exploiting all three of these vulnerabilities at the same time could lead to sensitive information disclosure and more.
The possible vulnerabilities and attacks have grown enormously in recent years because of virtualization, cloud computing, and even social media. These three things alone have added immeasurable complexity to your IT environment.
Exploits that involve manipulating people — end users and even yourself — are the greatest vulnerability within any computer or network infrastructure. Humans are trusting by nature, which can lead to social engineering exploits. Social engineering is the exploitation of the trusting nature of human beings to gain information — often via e-mail phishing — for malicious purposes. Check out Chapter 6 for more information about social engineering and how to guard your systems against it.
Other common and effective attacks against information systems are physical. Hackers break into buildings, computer rooms, or other areas containing critical information or property to steal computers, servers, and other valuable equipment. Physical attacks can also include dumpster diving — rummaging through trash cans and dumpsters for intellectual property, passwords, network diagrams, and other information.
Attacks against network infrastructures can be easy to accomplish because many networks can be reached from anywhere in the world via the Internet. Some examples of network infrastructure attacks include the following:
Hacking an operating system (OS) is a preferred method of the bad guys. OS attacks make up a large portion of attacks simply because every computer has an operating system, and OSes are susceptible to many well-known exploits, including vulnerabilities that remain unpatched years later.
Occasionally, some operating systems that tend to be more secure out of the box — such as the old-but-still-out-there Novell NetWare, OpenBSD, and IBM Series i — are attacked, and vulnerabilities turn up. But hackers tend to prefer attacking Windows, Linux, and, more recently, Mac OS X, because they’re more widely used.
Here are some examples of attacks on operating systems:
Applications take a lot of hits by hackers. Programs (such as e-mail server software and web applications) are often beaten down. For example:
Security professionals must carry out the same attacks against computer systems, physical controls, and people that malicious hackers do. (I introduce those attacks in the preceding section.) A security professional’s intent, however, is to highlight any associated weaknesses. Parts II through V of this book cover how you might proceed with these attacks in detail, along with specific countermeasures you can implement against attacks against your business.
To ensure his or her security testing is performed adequately and professionally, every security professional must abide by a few basic tenets. The following sections introduce the principles you need to follow.
The word ethical in this context means working with high professional morals and values. Whether you’re performing security tests against your own systems or for someone who has hired you, everything you do must be aboveboard in support of the company’s goals. No hidden agendas allowed! This also includes reporting all your findings regardless of whether or not it will create political backlash.
Trustworthiness is the ultimate tenet. It’s also the best way to get (and keep) people on your side in support of your security program. The misuse of information is absolutely forbidden. That’s what the bad guys do. Let them receive a fine or go to prison because of their poor choices. Keep in mind that you can be ethical but not trustworthy and vice versa, along the lines of Edward Snowden.
Treat the information you gather with the utmost respect. All information you obtain during your testing — from web application flaws to clear text e-mail passwords to personally identifiable information (PII) and beyond — must be kept private. Nothing good can come of snooping into confidential corporate information or employees’ private lives.
One of the biggest mistakes I’ve seen people make when trying to test their own systems is inadvertently crashing the systems they’re trying to keep running. It doesn’t happen as much is it used to, given the resiliency of today’s systems. However, poor planning and timing can have negative consequences.
Although it’s not likely, you can create DoS conditions on your systems when testing. Running too many tests too quickly can cause system lockups, data corruption, reboots, and more. This is especially true when testing websites and applications. I should know: I’ve done it! Don’t rush and assume that a network or specific host can handle the beating that network tools and vulnerability scanners can dish out.
You can even accidentally create an account lockout or a system lockout condition by using vulnerability scanners or by socially engineering someone into changing a password, not realizing the consequences of your actions. Proceed with caution and common sense. Either way, be it you or someone else, these weaknesses still exist, and it’s better that you discover them first!
Like practically any IT or security project, you need to plan your security testing. It’s been said that action without planning is at the root of every failure. Strategic and tactical issues in the ethical hacking process need to be determined and agreed upon. To ensure the success of your efforts, spend time up front planning for any amount of testing — from a simple OS password-cracking test against a few servers to an all-out vulnerability assessment of a web environment.
Getting approval for security testing is essential. Make sure that what you’re doing is known and visible — at least to the decision makers. Obtaining sponsorship of the project is the first step. This is how your testing objectives will be defined. Sponsorship could come from your manager, an executive, your client, or even yourself if you’re the boss. You need someone to back you up and sign off on your plan. Otherwise, your testing might be called off unexpectedly if someone (including third parties such as cloud service and hosting providers) claims you were never authorized to perform the tests. Even worse, you get fired or charged with criminal activity — it has happened!
The authorization can be as simple as an internal memo or an e-mail from your boss when you perform these tests on your own systems. If you’re testing for a client, have a signed contract stating the client’s support and authorization. Get written approval on this sponsorship as soon as possible to ensure that none of your time or effort is wasted. This documentation is your “Get Out of Jail Free” card if anyone such as your Internet Service Provider (ISP), cloud service provider, or related vendor questions what you’re doing, or worse, if the authorities come calling. Don’t laugh — it wouldn’t be the first time it has happened.
One slip can crash your systems — not necessarily what anyone wants. You need a detailed plan, but that doesn’t mean you need volumes of testing procedures to make things overly complex. A well-defined scope includes the following information:
Risks involved: Have a contingency plan for your ethical hacking process in case something goes awry. What if you’re assessing your firewall or web application and you take it down? This can cause system unavailability, which can reduce system performance or employee productivity. Even worse, it might cause loss of data integrity, loss of data itself, and even bad publicity. It’ll most certainly tick off a person or two and make you look bad.
Handle social engineering and DoS attacks carefully. Determine how they affect the people and systems you test.
Dates the tests will be performed and your overall timeline: Determining when the tests are performed is something you must think long and hard about. Do you perform tests during normal business hours? How about late at night or early in the morning so that production systems aren’t affected? Involve others to make sure they approve of your timing.
You may get pushback and suffer DoS-related consequences, but the best approach is an unlimited attack, where any type of test is possible at any time of day. The bad guys aren’t breaking into your systems within a limited scope, so why should you? Some exceptions to this approach are performing all out DoS attacks, social engineering, and physical security tests.
Whether or not you intend to be detected: One of your goals might be to perform the tests without being detected. For example, you might perform your tests on remote systems or on a remote office and you might not want the users to be aware of what you’re doing. Otherwise, the users or IT staff might catch on to you and be on their best behavior — instead of their normal behavior.
Knowledge of the systems you have before you start testing: You don’t need extensive knowledge of the systems you’re testing — just a basic understanding. This basic understanding helps protect you and the tested systems.
Understanding the systems you’re testing shouldn’t be difficult if you’re hacking your own in-house systems. If you’re testing a client’s systems, you may have to dig deeper. In fact, I’ve only had one or two clients ask for a fully blind assessment. Most IT managers and others responsible for security are scared of these assessments — and they can take more time, cost more, and be less effective. Base the type of test you perform on your organization’s or client’s needs.
As with any project, if you don’t have the right tools for your security testing, you will have difficulty accomplishing the task effectively. Having said that, just because you use the right tools doesn’t mean that you’ll discover all the right vulnerabilities. Experience counts.
Many tools focus on specific tests, and no tool can test for everything. For the same reason that you wouldn’t drive a nail with a screwdriver, don’t use a port scanner to uncover specific network vulnerabilities. This is why you need a set of specific tools for the task. The more (and better) tools you have, the easier your ethical hacking efforts are.
Make sure you’re using the right tool for the task:
I discuss these tools and many others in Parts II through V when I go into the specific tests. The Appendix contains a more comprehensive listing of these tools for your reference.
The capabilities of many security and hacking tools are often misunderstood. This misunderstanding has cast a negative light on otherwise excellent and legitimate tools. Even government agencies around the world are talking about making them illegal! Part of this misunderstanding is due to the complexity of many security testing tools. Whichever tools you use, familiarize yourself with them before you start using them. That way, you’re prepared to use the tools in the ways they’re intended to be used. Here are ways to do that:
Look for these characteristics in tools for security testing:
These features can save you a ton of time and effort when you’re performing your tests and writing your final reports.
Good security testing takes persistence. Time and patience are important. Also, be careful when you’re performing your ethical hacking tests. A criminal on your network or a seemingly benign employee looking over your shoulder might watch what’s going on and use this information against you or your business.
Making sure that no hackers are on your systems before you start isn’t practical. Be sure you keep everything as quiet and private as possible. This is especially critical when transmitting and storing your test results. If possible, encrypt any e-mails and files containing sensitive test information via an encrypted Zip file, or cloud-based file sharing service.
You’re now on a reconnaissance mission. Harness as much information as possible about your organization and systems, much like malicious hackers do. Start with a broad view and narrow your focus:
Search the Internet for your organization’s name, your computer and network system names, and your IP addresses.
Google is a great place to start.
Narrow your scope, targeting the specific systems you’re testing.
Whether you’re assessing physical security structures or web applications, a casual assessment can turn up a lot of information about your systems.
Check out Chapters 4 and 5 to find out more information and tips on this process.
Assess your results to see what you’ve uncovered, assuming that the vulnerabilities haven’t been made obvious before now. This is where knowledge counts. Your skill at evaluating the results and correlating the specific vulnerabilities discovered will get better with practice. You’ll end up knowing your systems much better than anyone else. This makes the evaluation process much simpler moving forward.
When you finish your security tests, you (or your client) still need to implement your recommendations to make sure the systems are secure. Otherwise, all the time, money, and effort spent on ethical hacking goes to waste. Sadly, I see this very scenario fairly often.
3.138.123.106