Complete coverage of the new CompTIA Security+ (SY0-601) exam to help you pass on the first attempt
Ian Neil
BIRMINGHAM—MUMBAI
Copyright © 2020 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Vijin Boricha
Acquisition Editor: Rahul Nair
Senior Editor: Arun Nadar
Content Development Editor: Pratik Andrade
Technical Editor: Yoginee Marathe
Copy Editor: Safis Editing
Project Coordinator: Neil Dmello
Proofreader: Safis Editing
Indexer: Rekha Nair
Production Designer: Vijay Kamble
First published: September 2018
Second published: December 2020
Production reference: 1221220
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-80056-424-4
Subscribe to our online digital library for full access to over 7,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Ian Neil is one of the world's top trainers of Security+ he has the ability to break down the information into manageable chunks so that people with no background knowledge can gain the skills required to become certified. He has recently worked for the US Army in Europe and designed a Security+ course that catered for people from all backgrounds (not just the IT professional), with an extremely successful pass rate. He is an MCT, MCSE, A+, Network+, Security+, CASP, and RESILIA practitioner, who over the past 23 years, has worked with high-end training providers and was one of the first technical trainers to train Microsoft internal staff when they opened their Bucharest Office in 2006.
Crystal Voiles is an IT specialist with more than 30 years of IT experience ranging from help desk support, desktop support, system administration, and cyber security support.
For the last 10 years, she has served as a cyber security specialist, managing several cyber security tools, including Assured Compliance Assessment Solution (ACAS), Host-Based Security System (HBSS), Tanium, System Center Configuration Manager (SCCM), and Enterprise Mission Assurance Support Service (eMASS).
Currently serving as the Information Systems Security Manager (ISSM) for a small medical organization responsible for coordination and execution of security policies and controls, as well as assessing vulnerabilities within a medical company. She is responsible for data and network security processing, security systems management, and security violation investigations. She manages backup and security systems, employee training for approximately 900 end user accounts, security planning measures, and recovery of data in disaster testing situations.
Her certifications include Certified Information Systems Security Professional (CISSP), CompTIA Advanced Security Practitioner (CASP+), Security +, Microsoft Certified Professional (MCP), SCCM, and ITIL Foundations.
Rebecca Moffitt is an experienced information security and risk consultant with 8 years of experience in the industry.
Rebecca joined QA in October of 2018, and since then has been working as a cyber security technical specialist. Her areas of training have been primarily related to cyber security, information security, information assurance, and risk management. She most recently obtained her CISM via ISACA, and her CSRM via PECB. She is a certified Information Security Management Systems Lead Implementer and is proficient in ISO 27001, 27002, 27005, and has knowledge of ISO 31000, 27035, and 19011, as well as various cyber, information, and risk frameworks.
Rebecca is passionate about her profession and has spent time working with the younger generations, raising their awareness of the field of cyber/information security and sparking enthusiasm in them about a potential career in cyber security.
On a personal level, Rebecca is Canadian. The country lifestyle is rooted within her. She loves all things related to the East Coast lifestyle: kitchen parties, country music, and fiddleheads.
I would like to thank my family always, for their continual love and support.
- Rebecca Moffitt
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
This book will help you to understand security fundamentals, ranging from the CIA triad right through to identity and access management. This book describes network infrastructure and how it is evolving with the implementation of virtualization and different cloud models and their storage. You will learn how to secure devices and applications that are used by a company.
This book is designed for anyone who is seeking to pass the CompTIA Security+ SY0-601 exam. It is a stepping-stone for anyone who wants to become a security professional or move into cybersecurity.
Chapter 1, Understanding Security Fundamentals, covers some security fundamentals that will be expanded upon in later chapters.
Chapter 2, Implementing Public Key Infrastructure, goes into the different encryption types and teaches how certificates are issued and used.
Chapter 3, Investigating Identity and Access Management, looks at different types of authentication. We will look at the concepts of identity and access management.
Chapter 4, Exploring Virtualization and Cloud Concepts, gets you acquainted with various cloud models and cloud security, looking at their deployment and storage environments.
Chapter 5, Monitoring, Scanning, and Penetration Testing, looks at penetration testing, exercise types, scanning, threat hunting, and SIEM systems.
Chapter 6, Understanding Secure and Insecure Protocols, looks at when to use certain secure protocols.
Chapter 7, Delving into Network and Security Concepts, looks at network components, remote access, and network reconnaissance tools.
Chapter 8, Securing Wireless and Mobile Solutions, looks at wireless solutions and secure mobile solutions.
Chapter 9, Identifying Threats, Attacks, and Vulnerabilities, explores attacks and vulnerabilities, taking each type of attack in turn and its unique characteristics. This chapter is probably the most heavily tested module in the Security+ exam.
Chapter 10, Governance, Risk, and Compliance, looks at risk management and regulations and frameworks.
Chapter 11, Managing Application Security, looks at application development and security.
Chapter 12, Dealing with Incident Response Procedures, looks at preparing for disaster recovery incidents and how to recover.
Chapter 13, Mock Exam 1, includes mock questions, along with explanations, which will help assess whether you're ready for the test.
Chapter 14, Mock Exam 2, includes more mock questions, along with explanations, which will help assess whether you're ready for the test.
This certification guide assumes no prior knowledge of the product. You need to understand the information fully to become certified.
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: http://www.packtpub.com/sites/default/files/downloads/9781800564244_ColorImages.pdf.
There are a number of text conventions used throughout this book.
Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "The problem that arises is that strcpy cannot limit the size of characters being copied."
A block of code is set as follows:
int fun (char data [256]) {
int I
char tmp [64]; strcpy (tmp, data);
}
Any command-line input or output is written as follows:
Set-ExecutionPolicy Restricted
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "The SSID is still enabled. The administrator should check the box next to Disable Broadcast SSID."
Tips or important notes
Appear like this.
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packt.com.
In this chapter, we are going to look at some security fundamentals that will help you identify security threats in the system and mitigate them. With cybercrime increasing day by day, as an Information Technology (IT) professional, it is essential to first understand these fundamental concepts.
In this chapter, we will be covering the following topics:
Let's start off by looking at security fundamentals.
The fundamentals of security are the foundation of protecting our assets, and there must be a strategy or methodology that we adapt for security. This is the CIA triad; let's look at its breakdown.
Most security books start with the basics of security by featuring the CIA triad—this is a conceptual model designed to help those writing information security policies within an organization. It is a widely used security model and it stands for confidentiality, integrity, and availability, the three key principles that should be used to guarantee you have a secure system:
Figure 1.1 – CIA triad
We'll discuss these principles in more depth here:
We also tend to encrypt data to keep it confidential. There are two types of encryption, known as symmetric and asymmetric. Symmetric encryption uses one key, known as the private key or shared key. Asymmetric encryption uses two keys, known as the private key and the public key.
Least Privilege is where you give someone only the most limited access required so that they can perform their job role; this is known as a need-to-know basis. The company will write a least privilege policy so that the administrators know how to manage it.
Defense in Depth is the concept of protecting a company's data with a series of protective layers so that if one layer fails, another layer will already be in place to thwart an attack. We start with our data, then we encrypt it to protect it:
Let's look at this from the intruder's perspective, trying to jump the fence, and see how many layers they have to circumvent:
Figure 1.2 – Defense in Depth model
Let's now compare the different control types.
There is a wide variety of different security controls that are used to mitigate the risk of being attacked; the three main categories are managerial, operational, and technical. We are going to look at these in more detail; you need to be familiar with each of these controls and when each of them should be applied. Let's start by looking at the three main controls.
Managerial Controls are written by managers to create organizational policies and procedures to reduce risk within companies. They incorporate regulatory frameworks so that the companies are legally compliant. The following are examples of management controls:
Operational controls are executed by company personnel during their day-to-day operations. Examples of these are the following:
a. Example 1 – When you are finished for the day, you clear your desk and lock all documents away; another employee would remind you that your identity badge should be worn at all times and you should challenge anyone not wearing a badge.
b. Example 2 – Companies need their employees to complete annual cybersecurity training as the risk is getting greater each day.
Technical Controls are those implemented by the IT team to reduce the risk to the business.
These could include the following:
Let's now look at other control types, from deterrents to physical controls, when we try and stop attacks at the source.
Deterrent Controls could be CCTV and motion sensors. When someone is walking past a building and the motion sensors detect them, it turns the lights on to deter them. A building with a sign saying that it is being filmed with CCTV prevents someone from breaking into your premises, even though there may not be film inside the camera—but they don't know that!
Detective Controls are used to investigate an incident that has happened and needs to be investigated; these could include the following:
Corrective Controls are the actions you take to recover from an incident. You may lose a hard drive that contained data; in that case, you would replace the data from a backup you had previously taken.
Fire Suppression Systems are another form of corrective control. There may have been a fire in your data center that destroyed many servers, therefore when you purchase a replacement, you may install an oxygen suppressant system that will starve a fire of the oxygen needed. This method uses argon/nitrogen and carbon dioxide to displace the oxygen in the server room.
Compensating Controls can also be called Alternative or Secondary Controls and can be used instead of a primary control that has failed or is not available. Once a primary control has failed, we need a secondary control. This is similar to when you go shopping and you have $100 in cash—once you have spent your cash, you will have to use a credit card as a compensating control.
Example: When a new employee arrives, they should log in using a smart card and PIN. It may take 3–5 days to get a new smart card, so during the waiting period, they may log in using a username and password.
Preventative Controls are in place to deter any attack; this could be having a security guard with a large dog walking around the perimeter of your building. This would make someone trying to break in think twice about doing so. Some of the preventive measures that can be taken are as follows:
The three main parts of access controls are identifying an individual, authenticating them when they insert a password or PIN, and then authorization, where an individual is granted permission to the different forms of data. For example, someone working in finance will need a higher level of security clearance and have to access different data than a person who dispatches an order in finished goods:
Discretionary Access Control involves New Technology File System (NTFS) file permissions, which are used in Microsoft operating systems. The user is only given the access that they need to perform their job. They are sometimes referred to as user-based or user-centric. The permissions are as follows:
The following diagram shows a user called Ian who had Read and Read & execute permissions:
Figure 1.3 – DAC file permissions
Mandatory Access Control (MAC) is based on the classification level of the data. MAC looks at how much damage could be inflicted to the interests of the nation. These are as follows:
Examples of MAC based on the classification level of data are as follows:
Once classified data has been written, it is owned by the company. For example, if a Colonel writes a classified document, it belongs to the Army. Let's look at three roles:
Role-based access control is a subset of the department carrying out a subset of duties within a department. An example would be two people within the finance department who only handle petty cash. In IT terms, it could be that only two people of the IT team administer the email server.
In Rule-Based Access Control (RBAC), a rule is applied to all of the people within a department, for example, contractors will only have access between 8 a.m. and 5 p.m., and the help desk people will only be able to access building 1, where their place of work is. It can be time-based or have some sort of restriction, but it applies to the whole department.
In Attribute-Based Access Control (ABAC), access is restricted based on an attribute in the account. John could be an executive and some data could be restricted to only those with the executive attribute. This is a user attribute from the directory services, such as a department or a location. You may wish to give different levels of control to different departments.
To control access to data, people may be put into groups to simplify access. An example would be if there were two people who worked in IT who needed access to IT data. For example, let's call them Bill and Ben. We first of all place them into the IT group, and then that group is given access to the data:
Figure 1.4 – Group-based access
Another example is where members of a sales team may have full control of the sales data by using group-based access, but you may need two new starters to have only read access. In this case, you would create a group called new starters and give those people inside that group only read permission to the data.
In this section, we are going to look at Linux file permissions. These appear frequently in the Security+ exam even though they are not covered in the exam objectives.
Linux file permissions come in a numerical format; the first number represents the owner, the second number represents the group, and the third number represents all other users:
a. Permissions:
b. Numerical values:
Unlike a Windows permission that will execute an application, the execute function in Linux allows you to view or search. A permission of 6 would be read and write. A value of 2 would be write, and a value of 7 would be read, write, and execute. Some examples are as follows:
a. Owner: Read, write, and execute
b. Group: Read and write
c. All other users: Read
Another way the permissions can be set is by alphabetical values, as shown:
a. R: Read
b. W: Write
c. X: Execute
When using alphabetical values, each set of permission is shown as three dashes. Full control for the three entities are as follows:
a. Owner Full Control: rwx --- ---
b. Group Full Control: --- rwx ---
c. User Full Control: --- --- rwx
a. Owner has read, write, and execute (full control).
b. Group has read, write, and execute (full control).
c. Others have only read and write permissions.
Physical security controls are put in place to stop unauthorized access to the company or accessing the data. Physical security controls are easily identifiable as you can touch them. Let's look at each of them in turn.
In this section, we will look at different types of perimeter security systems:
Figure 1.5 – Robot sentry
Tip
Robot sentries can shout out warnings to deter intruders. They could also be armed.
In this section, we will look at different types of building security systems:
Tip
Conduits and cable distribution protect the Ethernet cable between the wall jack and the patch panel.
In this section, we will look at different device protection systems:
Tip
An air gap is an isolated computer; the only way to extract data is by using a USB or CD ROM.
Digital forensics is used by the police when they are investigating crimes and need to find digital evidence so that they can secure a conviction. We will be looking at computer- and web-based attacks.
In 2006, Forensic Process 19, proposed by NIST, consisted of four different phases: collection, examination, analysis, and reporting. Here's a diagram showing these phases:
Figure 1.6 – Forensics cycle
Let's look at each of these phases:
There are many different components to a forensic investigation; we will look at each of them in turn:
Example 1 – Web-Based Attack: An attacker is attacking the company website and the security team is trying to capture the network traffic to find the source of the attack. This is the most volatile evidence.
Example 2 – Attack inside a Computer: When someone has attacked your computer, you need to capture the evidence in accordance with the order of volatility:
a. CPU Cache: Fast block of volatile memory used by the CPU
b. Random Access Memory (RAM): Volatile memory used to run applications
c. Swap/Page File/Virtual Memory: Used for running applications when RAM is totally exhausted.
d. Hard Drive: Data at rest for storing data
Example 3 – Removable Storage Drive Attached to a Computer/Server: Someone has left a USB flash drive plugged into your fileserver. When it is in use, programs such as Word are launched in RAM, so we would capture the volatile memory first.
Example 4 – Command-Line Tools: You need to know which command-line tool provides information that could disappear if you reboot the computer, and that would be netstat. With netstat -an, the listening and established ports are shown. If you reboot the computer, all of the established connections will be lost.
Tip
Order of volatility is collecting the most perishable evidence first. In a web-based attack, we should collect the network traffic with a packet sniffer.
Open up Command Prompt on your computer and type netstat -an. You should now see the listening and established ports; count them, and write the numbers down. Run the shutdown /r /t 0 command to immediately reboot the machine. Log back in, go to Command Prompt, and run netstat -an; what is the difference? You will see that you have lost information that could have been used as evidence.
In this section, we will look at different types of evidence collection:
Example 1 – Missing Entry on the Chain of Custody Document: On Monday, 15 laptops were collected by the system administrator. The next day, the system administrator passed them on to the IT manager. On Wednesday, the IT director presents the 15 laptops as evidence to the court. The judge looks at the chain of custody document and notices that there was no formal handover between the IT manager and the IT director. With the handover missing, the judge wants to investigate the chain of custody.
Example 2 – Evidence Leaves the Detective's Possession: The FBI arrests a known criminal and collects 43 hard drives that they bag and tag, before placing them in two bags. They arrest the criminal and take him from Arizona to New York by airplane. One detective is handcuffed to the criminal while the other carries the two bags.
When they arrived at check-in, the airline clerk tells them that the carry-on bags are more than the 8 kg allowance, and therefore they are too heavy and need to go in the hold. The detective complies, but locks the suitcases to prevent theft. Because the evidence is not physically in their possession at all times, the chain of custody is broken as there is a chance that someone working for the airline could tamper with the evidence. Therefore, they cannot prove to the court that the integrity of the evidence has been kept intact at all times.
Example: Dr. Death has been prescribing new drugs to patients in a large hospital who have been dying. An auditor has been sent to investigate the possibility of foul play, and then following the audit, the FBI is notified. The doctor has been emailing a pharmaceutical company that has been supplying the drugs for a trial. The FBI does not want the doctor to be alerted, so they have the hospital's IT team put his mailbox on legal hold. When the mailbox is on legal hold, the mailbox limit is lifted; the doctor can still send and receive emails, but cannot delete anything. This way, they are not alerted to the fact that they are under investigation.
Example: The police in three separate countries are trying to identify where the data started from in a chain, then who handled the data along the line. They have the following information about when it was first created:
a. New York: Created 3 a.m.
b. London: Created 4 a.m.
c. Berlin: Created 4.30 a.m.
By recording the time offset, it looks as if it started off in New York, but if we apply time normalization, when it is 4 a.m. in London, the time in New York is 11 p.m. the day before, so it cannot be New York. When it is 4.30 a.m. in Berlin, it is only 3.30 a.m. in London; therefore, it originated in Berlin. This looked the least unlikely before the time offset of the data collection had time normalization applied.
Figure 1.7 – Time stamps
Tip
You should capture a system image from a laptop and take a forensic copy from a removable drive
Example: Your company uses an account lockout of three attempts. If an attacker tries to log in once to three separate computers, each computer would not identify it as an attack, as it is a single attempt on each computer, but a SIEM system would pick up these attempts as three failed logins attempts and alert the administrators in real time.
Tip
You should remove a computer with a dynamically expanding virus immediately rather than collect the network traffic.
In the last few years, the growth of cloud computing and resources has been increasing year on year. Cloud forensics has different needs than that of traditional forensics. One of the primary aspects that a cloud provider must provide is security of the data stored in the cloud.
In 2012, Cloud Forensic Process 26 was created to focus on the competence and admissibility of evidence. The stages are as follows:
Cloud services, because of the nature of their business, create virtual machines and then destroy them on a regular basis. This prevents the collection of forensic evidence. The forensic team needs to prove to the cloud provider their reasons for the collection of the evidence and they have to rely on the cloud provider sending them the correct evidence that they require.
By inserting right-to-audit clauses into supply chain contracts, an auditor can visit the premises without notice and inspect the contractor's books and records to ensure that the contractor is complying with its obligation under the contract. This would help them identify the following:
Cloud data should be stored and have data sovereignty in regions. The US introduced the CLOUD Act in 2018 due to the problems that the FBI faced in forcing Microsoft to hand over data stored in Ireland. In 2019, the UK received royal assent for the Overseas Production Act (COPOA), which allows the UK to seek data stored overseas as part of a criminal investigation. In 2019, the US and the UK signed a data-sharing agreement to give law enforcement agencies in each country faster access to evidence held by providers, such as social media or web hosting. In 2016, a similar agreement was set between the US and the EU; however, with the introduction of General Data Protection Regulation (GDPR), all websites in the US that have consumers from the EU have to abide by GDPR.
If a data breach occurs, a company can be fined more than £10 million for failing to report a breach. The EU uses GDPR, and notifications of data breaches must be reported within 72 hours. Other countries have their own reporting timescale.
Now it's time to check your knowledge. Answer these questions and check your answers, found in the Assessment section at the end of the book:
Public Key Infrastructure (PKI) is asymmetric encryption that has a Certificate Authority and the associated infrastructure to support issuing and managing certificates. Certificates are used for both encryption and authentication, and in this chapter, we are going to look at different encryption types and how certificates are issued and used. This is the most difficult module for students to understand, so we have focused on making the most difficult aspects seem easy. If you are going to be successful in the Security+ exam, you must know this module thoroughly.
In this chapter, we are going to cover the following topics:
The PKI provides asymmetric techniques using two keys: a public key and a private key. There is a certificate hierarchy, which is called the Certificate Authority, that manages, signs, issues, validates, and revokes certificates. Let's first look at the components of the certificate hierarchy. A certificate is known as an X509 certificate.
The Certificate Authority (CA) is the ultimate authority as it holds the master key, also known as the root key, for signing all of the certificates that it gives the Intermediary, which then, in turn, issues the certificate to the requester.
Figure 2.1 – CA Hierarchy
Let's look at the CA hierarchy shown in the preceding diagram in more depth:
There are different types of CA:
The benefit of using a third-party CA is that all of the management is carried out by them; once you purchase the certificate, all you have to do is install it. They keep an up-to-date Certificate Revocation List (CRL) where you can check whether your certificate is valid. A certificate that is not valid will not work if you are going to sell goods and services to other companies; this is known as a B2B transaction, which requires a public CA.
For example, I put gas in my car and go to pay for it. I give the attendant some monopoly money, but they refuse to take it; this would be the equivalent of a private CA. Businesses will not accept it as payment. I then go to the cash machine outside and withdraw $100 and I give this to the attendant; he smiles and accepts it and gives me some change. This is the equivalent of a public CA.
If you wish to trade and exchange certificates with other businesses, you need to get your certificate from a public CA. The certificate that follows has been issued to the Bank of Scotland from a public CA called DigiCert Global CA. You can see on the front of the certificate the purpose for use and also the dates that it is valid for. The X509 has an OID, which is basically the certificate's serial number – the same way that paper money has serial numbers:
Figure 2.2 – Certificate
Tip
Certificate pinning prevents the compromising of the CA, certificate fraud, and SSL man-in-the-middle attacks.
Certificates have some form of trust where the certificate can check whether or not it is valid. We are going to look at different trust models. You need to ensure that you know when each is used:
a. Hierarchical Trust Model: This uses a hierarchy from the root CA down to the intermediary (also known as a subordinate); this is the normal PKI model. An example can be seen in the certificate hierarchy diagram earlier in this chapter.
b. Bridge Trust Model: The bridge trust model is peer-to-peer, where two separate PKI environments trust each other. The certificate authorities communicate with each other, allowing for cross certification. Sometimes, this is referred to as the trust model.
Tip
Certificate chaining shows the trust from the vendor, the vendor CA, and the computer. Fewer than three layers results in trust errors
Each time a certificate is used, the first thing that must happen is that it must be checked for validity. The following diagram shows the certificate validity process:
Figure 2.3 – Certificate validity
There are three separate processes that you must know thoroughly, and these are as follows:
Tip
Certificate validity can only be done by the CRL or OCSP. OCSP is used only when the CRL is going slow or has been replaced by the OCSP
We are now going to look at the different ways in which certificates are managed in a PKI environment, starting with the request for a new certificate and ending with different certificate formats. You must learn all of this information thoroughly as these aspects are heavily tested:
Figure 2.4 – Key escrow
Tip
The Data Recovery Agent (DRA) needs a private key from the key escrow to recover data.
Figure 2.5 – Certificate format and file extensions
As a security professional, you will be responsible for purchasing new certificates, and therefore, you must learn the certificate types thoroughly to ensure that you make the correct purchases. We will start with the self-signed certificate, which can roll out with applications such as Microsoft Exchange Server or Skype, and finish with extended validation where the certificate has a high level of trust:
Figure 2.6 – Extended validation
Companies applying for the extended validation certificate would have to provide more detailed information about the company.
Tip
A wildcard certificate can be installed on multiple public facing websites as a cheaper option. A self-signed certificate can be installed on internal facing websites as a cheaper option.
There are two main types of encryption that use certificates, and these are asymmetric and symmetric. We need to learn about each thoroughly. Let's start by understanding what encryption is. Please remember that you are taking plaintext and changing it into ciphertext.
Encryption is where we take plaintext that can be easily read and convert it into ciphertext that cannot be easily read:
Figure 2.7 – Caesar Cipher ROT 13 table
When receiving the message, GVZR SBE GRN, then we would apply ROT 13, but instead of going forward 13 places to decipher, we would simply go back 13 places, and the message would be TIME FOR TEA. From the preceding table, select a letter from the top and then the corresponding ROT 13 equivalent below it for both encryption and decryption.
There are two types of encryption that use certificates: asymmetric and symmetric. Let's look at each of these in turn:
Diffie Hellman (DH): When symmetric data is in transit, it is protected by Diffie Hellman, whose main purpose is to create a secure tunnel for symmetric data to pass through. It does not encrypt data, but creates a secure tunnel.
The first stage in encryption is the key exchange. You will always keep your private key and give away your public key. You will always use the recipient's public key to encrypt:
Figure 2.8 – Key exchange
In the preceding diagram, there are two different key pairs: the black key pair and the white key pair. These work together. Remember: the private key is your bank card; you will always retain it, but the public key is your deposit slip; you will give it away so that people can pay money into your account. The person who is sending the data is on the From side, and the person receiving the data is on the To side. A good way to remember the labels would be to think of South-East on the left-hand side and Distinguished-Visitor on the right. These labels stand for the following:
For example, Bob wants to encrypt data and send it to Carol. How is this done? Let's look at the following diagram. We can see that Bob owns the black key pair and Carol owns the white key pair. The first thing that needs to happen before encryption can happen is that they exchange public keys:
Figure 2.9 – Encryption
You can see under the column for Bob that he has his private key, which he will always keep, and the public key that Carol has given him. In the preceding diagram, you can see the label E, for encryption. Therefore, Bob uses Carol's public key to encrypt the data. Then, under Carol, you can see the letter D, for decryption. Therefore, when the encrypted data arrives, Carol uses the other half of the white key pair, the private key, to decrypt the data.
Tip
Your private key, or a key pair, is never installed on another server. You always retain the private key just like your bank card. You give the public key away or install on another server.
When we send an email or document to someone, it could be intercepted in transit and altered. Your email address could be spoofed, and someone could send an email as if it was from you, but there is no guarantee of integrity. We sign the email or document with our private key and it is validated by our public key.
The first stage in digital signatures is to exchange public keys, the same principle as encryption. For example, George wants to send Mary an email and he wants to ensure that it has not been altered in transit:
Figure 2.10 – Digital signature
In Figure 2.10, you can see that George is going to sign the email with his private key when he sends it to Mary, and she then validates it with the public key that George has already given to her. When the email has been validated, she knows that the email has not been tampered with. It could be read in transit, but not tampered with.
When people are asked to sign contracts, they sometimes use a third-party provider that asks them to digitally sign the contract. This then makes the contract valid as the digital signature proves the identity of the signatory.
Then there's non-repudiation. When I complete a digital signature, I am using my private key, which I should never give away to sign the email or document, proving that it has come from me. Non-repudiation means that I cannot deny that it was me who signed the document. I could not say it was done by someone else. In the early 6th century, King Arthur would send messages to his knights on a parchment scroll and then would put his wax seal on the scroll to prove it came from him. The digital signature in modern life is doing the same – it is proving who it came from. The digital signature creates a one-way hash of the entire document, so it also provides integrity similar to hashing.
Tip
Encryption uses the recipients' public key, where a digital signature used the sender's private key.
If we look at symmetric and asymmetric keys, they use a cipher that has a number of bits attached to it—the lower the number of bits, the faster, and the higher the number of bits, the stronger and more secure it is.
For example, we have two people who are going to complete a challenge – they are Usain Bolt, who is DES, a 56-bit key, and we have King Arthur wearing armor, who has an RSA of 4,096 bits. The first part of the challenge is a 100-meter dash, in which Usain Bolt wins and King Arthur is held back by the weight of his armor, 90 meters behind. The second part of the challenge is a boxing match, and Usain keeps hitting King Arthur, who keeps laughing at him as he is being protected by his armor. Then, out of the blue, King Arthur lands a knockout blow to Usain. Since the challenge was for charity and the result was a draw, they are both happy.
For the Security+ exam, you must know the characteristics of each of the symmetric algorithms, from when it is used to its key length. Remember, they will never ask you which key encrypts or decrypts, as the answer would always be the private key, also known as the shared key. Let's look at each of these characteristics in turn:
Asymmetric algorithms use a PKI environment as they use two keys: a private key and a public key. Let's now look at different asymmetric techniques.
Diffie Hellman (DH) does not encrypt data. Its main purpose is to create a secure session so that symmetric data can travel down it. The DH handshake is shown in the following diagram:
Figure 2.11 – DH handshake
DH creates the keys used in the Internet Key Exchange (IKE); it uses UDP port 500 to set up the secure session for the L2TP/IPSec VPN. Once the secure tunnel has been created, then the symmetric encrypted data flows down the tunnel.
a. Diffie Hellman Ephemeral (DHE)
b. Elliptic Curve Diffie Hellman Ephemeral (ECDHE)
Tip
PGP is used for encryption between two people. S/MIME is used for digital signature between two people
If we think of encryption as playing table tennis where each person has just one bat and the pace is extremely fast, this is similar to symmetric encryption as it uses one key. Then, if we change the game and we give the players two bats, the first bat to stop the ball and the second bat to hit the ball back, this would be much slower. The same can be said for encryption; asymmetric encryption is much more secure as it has two keys and uses DH, an asymmetric technique for setting up a secure tunnel for the symmetric data. Symmetric encryption uses a block cipher and encrypts large blocks of data much faster than the asymmetric technique.
The binary operation Exclusive OR (XOR) is a binary operand from Boolean algebra. This operand will compare two bits and will produce one bit in return:
This is the opposite to binary. For example, we are going to use the word TREAD in ASCII format and then we are going to insert a key using the word HELLO so that we can complete an XOR operation. See the following diagram:
Figure 2.12 – XOR
XOR encryption is commonly used with AES, several symmetric ciphers, and a one-time pad.
Key stretching is where you append a random set of characters to a password to increase the size of the password and its hash, ensuring that a brute-force attack needs more compute time to crack the password.
Tip
Symmetric encryption is used to encrypt large amounts of data as they have small, fast keys and use block ciphers.
There are different cipher modes; most symmetric keys use a block cipher and can encrypt a large amount of data quicker than asymmetric encryption. Let's look at these in turn:
We have two teams of four people who have been tasked with unloading a five-ton lorry full of skittles and placing them in a room on the bottom floor of a building.
There are skittles in boxes and there are skittles that have been placed loose. One of the teams has loose skittles that need to be bagged and the other lorry has boxes of skittles. It is obvious that the team with boxes of skittles will win. The stream cipher is bagging the skittles, whereas the block cipher has boxes of skittles.
Modes of operation are how ciphers work to achieve encryption. Let's look at the different modes:
Figure 2.13 – Cipher Block Chaining
The next block of plaintext is XOR'd against the last encrypted block before you encrypt this block. When decrypting a ciphertext block, you need the XOR from the previous ciphertext block. If you are missing any blocks, then decryption cannot be done.
Tip
Stream cipher encrypts one bit at a time
Traditional computer chips use bits to store data in values of 1 where the bit is switched on, and a 0 value where the bit is switched off. Quantum computing uses qubits, which can be switched on or off at the same time or somewhere in between. This is known as a superposition.
A traditional computer trying to find the way from A to B could only try a single path at any one time until it found the path; however, quantum computing could try every path at the same time. Quantum computing will make cracking encryption much faster and, at this moment in time, Google has created a quantum computer that is 53 qubits, known as Sycamore, that made calculations in a few minutes that would have taken an earlier supercomputer 10,000 years to calculate. Post quantum computing could see a very powerful computer with massive qubits using Shor's algorithm to break PKI technology.
Blockchain was originally the technology that powered Bitcoin, but it has greater scope than that. It is a digital ledger of transactions and the data is secured by technology. Data is stored in batches called blocks that are distributed to many computers. Therefore, if you wanted to tamper with the blockchain, it would be impossible as you would have to change the data on every computer holding a copy. As they say, there is safety in numbers.
Blockchain can be used to store financial, medical, or land sale transactions. This data is chained together with a block of data holding both the hash for that block and the hash of the preceding block. To create a new block on the chain, the computer that wishes to add the block solves a cryptographic puzzle and sends the solution to the other computers participating on that blockchain. This is known as a proof of work. Once that has been verified by those computers on this network, a new block is added to the end of the chain. Should data in the chain be modified, a new block with the changes is added, referring to the amended block. Since the data is held by many computers, it makes it impossible to carry out fraudulent transactions as copies are held in multiple places.
Blockchain does not use intermediaries such as banks and financial institutions. Therefore, when someone presents data from the blockchain, it is known to be accurate and can be trusted. An example is where a brother and sister have been left a house in the will of one of their relatives and they want to ensure that they are the legal owners. They can follow each transaction in the blockchain from the purchase of the house, and the number of times it has been bought and sold, to prove that they are the legal owners.
Hashing is where the data inside a document is hashed using an algorithm, such as a Secure Hash Algorithm Version 1 (SHA1), SHA2, SHA3, and MD5. This turns the data inside the file into a long text string known as a hash value; this is also known as a message digest.
While you are hashing the same data, if you copy a file and therefore have two files containing the same data, then hash them with the same hashing algorithm. It will always produce the same hash value. Let's look at the following examples on hashing and data integrity:
In this section, we are going to outline the uses of different aspects of cryptography.
Asymmetric keys are obtained from a CA. If you are selling products or services with external entities, then you need to obtain your X509s from a public CA, otherwise your internal certificates will not be accepted.
SSL should now be depreciated as it is weak; an example of an exploit is the POODLE attack, which is a man-in-the-middle attack that exploits the vulnerabilities of SSL 3.0 using CBC. Asymmetric algorithms should not be using a key whose strength is 2046 or lower. However, an SSL VPN is the only VPN that uses an SSL certificate and works with legacy clients.
Ephemeral keys are short-lived keys that are used for a one-time only session. There are two types of ephemeral keys: Diffie Hellman Ephemeral (DHE) and Elliptic Curve Diffie Hellman Ephemeral (ECDHE). The other keys, used for other asymmetric and symmetric encryption, are known as static keys, as they have about a two-year lifespan.
Block cipher mode takes blocks of data depending on the key and encrypts that data in blocks—this makes the encryption of a large amount of data much faster.
In an L2TP/IPSec VPN tunnel, we have a choice of three different versions of symmetric encryption. The weakest is DES, which has a 56-bit key, followed by 3DES, which has a 168-bit key. The most secure is AES, as it can go from 128 bits up to 256 bits. Remember, symmetric encryption has only one key. It is much faster for encrypting a larger amount of data, but it needs DH, an asymmetric technique, to create a secure tunnel before it is used.
Symmetric encryption uses a block cipher, where blocks of data are encrypted. The key size determines how large the block of data is. For example, if I use DES, then I can only encrypt blocks of 56 bits, whereas AES can encrypt blocks of data of up to 256 bits.
Asymmetric encryption encrypts one bit at a time. Therefore, it is slower but more secure than symmetric encryption as it uses a larger key size and uses two keys: public and private.
Confusion massively changes the input to the output by putting it through a non-linear table created by the Symmetric Encryption – Secret Algorithm key.
A secret key is the piece of information that is used to encrypt and decrypt messages in symmetric encryption.
Tip
Ephemeral keys are for one-time use and they are of two types – DHE and ECDHE
A hashing algorithm takes the data from a document and generates a hexadecimal value from that input. If you take the same data and hash it with the same algorithm, it will generate the same hash. In the Security+ exam, the hashing algorithms are SHA-1, which is 160 bits, SHA-2, which is 256 bit, SHA-3, which is 512 bits, and MD5, which is 128 bits. Hashing is a one-way function to ensure that the integrity of the data is intact.
A crypto service provider is a software library. For example, Microsoft uses the Crypto API and has providers including the following:
A crypto module is a combination of hardware and software that implements crypto functions such as digital signatures, encryption, random number generation, and decryption.
One of the key functions of a security team is protecting a company's data, as it is difficult to put a price on lost data. Let's look at three types of data: at rest, in use, and in transit:
a. Desktops and Laptops: We could use Bitlocker, which is known in the Security+ exam as Full Disk Encryption (FDE). The desktop or laptop would need a TPM chip built into the motherboard. We could also use Data Loss Prevention (DLP) to prevent someone stealing the data with a USB drive. DLP works on a regular expression or a pattern match. Once that value has been matched, the data is blocked.
b. Tablets/Phones: Tablets and phones will need Full Device Encryption (FDE) to encrypt the device so that data cannot be stolen.
c. USB or Removable Drive: We can use Full Disk Encryption (FDE) so that if the drive is lost or stolen, the data is unreadable.
The Security+ exam is full of cryptographic terminologies, and in this section, we are going to start with obfuscation, which makes the code obscure. Try asking your family and friends to say the word obfuscation and watch them struggle. It is aptly named as the word itself is very obscure! You must know the terminology thoroughly.
Obfuscation is the process where you take source code and make it look obscure, so that if it is stolen, it would not be understood. It is used to mask data.
Pseudo-Random Number Generator (PRNG) refers to an algorithm that uses mathematical formulas to produce sequences of random numbers. Random numbers can be used when generating data encryption keys.
A nonce is an arbitrary number that can be used just once; it is often a random number.
When a VPN makes a secure connection, a key exchange is made for each secure session, but it links to the server's private key. With perfect forward secrecy, there is no link between the session key and the server's private key. Therefore, even if the VPN server has been compromised, the attacker cannot use the server's private key to decrypt the session.
The concept of security through obscurity is to prevent anyone from outside the organization from knowing the architecture or design of the system or any of its components. The internal people are aware of the weaknesses of the system, but you want to prevent an outside person from knowing anything about it. Obfuscation is a technique that makes stored source code unreadable.
If you hash the same data or password with the same hashing algorithm, then it will always create the same hash. Hashes are used to store passwords or digitally sign documents. A collision attack is where the attacker tries to match the hash; if the hash is matched, it is known as a collision, and this could compromise systems.
Steganography is where a document, image, audio file, or video file can be hidden inside another document, image, audio file, or video file. The document, image, or file will be larger, and images will have a much lower resolution.
Homomorphic Encryption allows an accountant to run calculations against data while it is still encrypted and could be used with data stored in the cloud.
Diffusion is a technique where you change one character of the input, which will change multiple bits of the output.
In today's world, security administrators need to look at how the company operates to ensure it is more secure. Do they want to implement smart cards for multifactor authentication? Do they want to implement a VPN so that remote users can connect to the company securely? Do they need to implement a DLP template to ensure that sensitive data cannot be emailed from the company?
Once the company's vision has been decided, the security team needs to look at the algorithms that they need. Normally, this would be the strongest possible. However, we need to ensure that the server has enough processing power to deal with any increase in key length. We should not be using a key of fewer than 2,046 bits as this is too insecure.
In the Security+ exam, use case just means examples of when something is used. We are now going to look at examples of when different cryptography techniques are used.
A company's data cannot be priced, and the disclosure of this data could cause grave danger to the company. If your competitors stole your secrets, they could beat you to the market and you would not get the rewards that you deserved. To prevent data from being accessed, we will encrypt the data to prevent it from being viewed and prevent any protocol analyzer from reading the packets. When people access the company's network from a remote location, they should use a L2TP/IPSec VPN tunnel, using AES as the encryption method to create a secure tunnel across the internet and to prevent man-in-the-middle attacks. Encryption could be coupled with mandatory access control to ensure that data is secure and kept confidential.
There are two main reasons for ensuring integrity. The first would be to hash data stored on a file server so that we can prove whether or not the data has been tampered with. This could also be the case for a forensic examination of a laptop seized by the police – the forensic scientist could hash the data before the examination and then re-hash it at the end to prove that they had not tampered with the data. The hash values should match. Another method of proving integrity would be to digitally sign an email with your private key to prove to the recipient that it has not been tampered with in transit. Prior to this, you had to send them your public key to validate the email. This proves that the email has maintained its integrity and has not been tampered with in transit.
When you digitally sign an email with your private key, you cannot deny that it was you, as there is only one private key; this is known as non-repudiation. When two separate parties decide to do a business deal together, they may use a third party to create a digital contract, but parties would log in to where the contract was stored. Once they digitally sign it, then it is legally binding.
When companies store their source code, they use obfuscation to make it obscure so that it cannot be read by anyone who steals it. This is also known as security by obscurity, where you want to prevent third parties knowing about your IT systems and identifying any weaknesses in the system.
Small Internet of Things (IoT) devices will need to use ECC for encryption, as it uses a small key – they do not have the processing power for conventional encryption.
We should be using the most secure encryption algorithm to prevent the encryption key from being cracked by attackers. The more secure the encryption key, the longer and more processing power it will take to gain the encryption key. In an RSA encryption environment, we should use a key with at least 3,072 bits. We should also look at implementing accelerator cards to reduce the amount of latency on the encryption or decryption.
A corporate environment should not use a single-factor username and password as they are not as secure as multifactor usernames and passwords. We should adopt at least two-factor authentication and use a smart card and PIN to make authentication more secure. Installing a RADIUS server adds an additional layer to authentication to ensure that authentication from the endpoints is more secure.
The more secure the encryption used and the higher the key length, the more processing power and memory the server will need. If there are not enough resources on the server, it could be vulnerable to a resource exhaustion attack, which causes the systems to hang or even crash; this is like a DoS attack. We must strike a balance between the hardware resources that the server has and the amount of processing power we use.
For these three practical exercises, you need a 2012/2016 server that is a domain controller.
If you are a home user and have access to a desktop with Windows 7, Windows 8.1, or Windows 10, and do not have a server, you can still complete the second exercise.
To build a certificate server, follow these steps:
Figure 2.14 – Certificate server
To encrypt data with EFS and stealing certificates, perform the following steps:
To revoke the EFS certificate, perform the following steps:
You will now notice that it has moved from Issued Certificates to Revoked Certificates.
Now it's time to check your knowledge. Answer the questions, and then check your answers, which can be found in the Assessments section at the end of the book:
Controlling and allowing access to computer systems is a key duty of any security professional. We will look at the different types of access control so that you can select the best solution for your company and, in an examination, choose the best method for a given scenario.
In this chapter, we will look at different types of authentication, looking first at Identity and Access Management concepts.
We will cover the following exam objectives in this chapter:
One of the first areas in IT security is giving someone access to the company's network to use resources for their job. There are four key elements to Identify and Access Management (IAM), and these are identity, authentication, authorization, and accounting. Let's look at each of these in the order that they should be presented:
An identify provider (IdP) is an entity that can validate that the credentials that are presented are valid. The identify could be a certificate, token, or details such as a username or password. IdP is used by cloud providers who use federation services to validate the identity of a user. An example of this is that they would use SAML to pass credentials to the IdP to validate their identity.
Example: A user authenticates using a token from a provider such as OKTA. The cloud provider uses SAML to pass the credentials back to OKTA to verify the user's identity.
The following can be used when assessing a person's identity as it needs to be unique to them:
Account management ranges from account creation on startup to its disablement when someone leaves the company. Fully understanding these concepts is crucial in obtaining the Security+ certification.
Each user in a system needs an account to access the network in a Microsoft Active Directory environment. The user account has a Security Identifier (SID) linked to the account. When I create a user called Ian, they may have an SID of 1-5-1-2345678-345678. When the account is deleted, the SID is gone, and a new SID is created.
For example, a member of the IT team has deleted a user account called Ian. It may have an SID of SID 1-5-1-2345678-345678, so he quickly creates another account called Ian, but this account cannot access resources as it has a new SID of SID 1-5-1-2345678-3499999. The first portion from left to right identifies the domain, and then the remainder is a serial number that is never reused.
There are various different types of user accounts and these are heavily tested in the Security+ exam; you must know when you would need each account:
Example: John Smith has been asked by Company A to deliver a presentation to company employees about a new pension plan. While he is delivering the presentation, he wants to show the latest share prices for the stock market. The finance department have asked the IT department to let John Smith access the company network to use the internet. The IT Director decided that the best course of action was to create a sponsored guest account that would allow John to have access to the company guest Wi-Fi.
Tip
A guest speaker should be allocated a sponsored guest account.
Tip
A service account is a type of administrator account used to run an application.
Example: A multinational corporation that has 100,000 employees has five members of the Human Resources (HR) team that receive and process email applications from potential employees. They all use a shared account called [email protected] and between them, they open and action the resumés that they receive.
Mr. Grumpy was one of the people who applied for a job within the company and has complained to the Chief Executive Officer (CEO) because he was not happy with how his application was handled. The CEO wanted to know which of the HR employees was responsible, but could not identify the person responsible as all five members of the HR team were using a shared account. They all denied dealing with the application.
Tip
When you need to monitor or audit to an employee level, you must eliminate the use of shared accounts.
Example: Baby monitors are getting more sophisticated and come with the ability to see and hear your baby from somewhere else in your home via a web browser. When the police have investigated such instances, they have found out that the baby monitors can be used to film children when they are asleep using the default user account and password. Most parents are unaware that this is possible.
Tip
If you do not change the default username and password for household devices, known as IoT, it is possible for a cybercriminal to hack into your home. This includes baby monitors, TVs, ovens, and refrigerators.
Let's now look at the different types of authentication.
There are various types of authentication and in this section, we are going to look at these, starting with security tokens and devices. Let's first look at biometric controls, followed by identity management using certificates.
There are different types of tokens that have different time limits. Let's look at the difference between the Time-Based One-Time Password and the HMAC-Based One-Time Password:
Figure 3.1 – TOTP
Next, we will look at certification-based authentication.
Certificate-based authentication is very popular as it provides two-factor authentication, which makes it more secure than single-factor authentication, such as a username and password. We will now look at its various types:
Let's now look at other types of authentication.
1EEE 802.1x is a port-based authentication protocol that is used when a device is connected to a switch or when a user authenticates to a wireless access point. Authentication is normally done by certificate.
Tip
Authentication with a password that has a short lifespan will be a TOTP.
Location can be added as an additional factor in authentication. Geofencing can be used to establish a region and can pinpoint whether or not you are in that region and if you are not, you will not be able to log in. This helps prevent fraud when someone from a foreign country attempts to log in to your systems and is used by many cloud providers. Let's look at some of these:
Each day there are different authentication technology methods, and we will look at some of these here:
Let's now learn how to implement authentication and authorization solutions in the next section.
In this section, we will look at the different types of authentication and authorization solutions that can be used. As an IT security professional, you will need good knowledge of these solutions. Let's start by looking at authentication management.
There are different types of authentication management and we will look at each of these in turn:
– Static KBA: These are questions that are common to the user. For example, "What is the name of your first school?" and these are deemed pretty weak.
Example: In 2008, the Alaska Governor Sarah Palin's Yahoo account was hacked by entering the answers to "Where did you first meet your spouse?", followed by her date of birth and ZIP code.
– Dynamic KBA: These are deemed to be more secure because they do not consist of questions provided beforehand.
Example: A bank wants to confirm the identify of a customer and they ask the customer to name three direct debit mandates, the date, and the amount paid.
Extensible Authentication Protocol (EAP) is an authentication framework allowing point-to-point connections. These are commonly used with wireless communication. Let's look at the various types of EAP:
The two main AAA servers are Microsoft's Remote Authentication Dial-In User Service (RADIUS) and CISCO's Terminal Access Controller Access-Control System Plus (TACACS+). Both of these servers provide authentication, authorization, and accounting. Let's look at each of these in turn:
A Virtual Private Network (VPN) allows someone working remotely, either from a hotel room or home, to connect securely through the internet to the corporate network:
Figure 3.2 – VPN
Let's now look at remote access services:
a. Password Authentication Protocol (PAP): PAP should be avoided at all costs as the passwords are transmitted as clear text and can be easily captured.
b. Challenge Handshake Authentication Protocol (CHAP): CHAP was used to connect to an RAS server with a four-stage process:
Figure 3.3 – Challenge Handshake Authentication Protocol
Let's understand this using the following four steps:
1. The client makes a connection request to the remote access server.
2. The RAS server replies with a challenge that is a random string.
3. The client uses their password as an encryption key to encrypt the challenge.
4. The RAS server encrypts the original challenge with the password stored for the user. If both values match, then the client is logged on.
Let's now look at access control schemes.
The three main parts of access controls are identifying an individual, authenticating them when they insert a password or PIN, and then authorization, where an individual has different forms of access to different data:
Example: Someone working in finance will need a higher level of security clearance and will have to access different data than a person who dispatches an order in finished goods.
Let's now look at privilege access management.
Privilege Access Management (PAM) is a solution that helps protect the privilege accounts within a domain, preventing attacks such as pass the hash, pass the ticket, and privilege escalation. It also gives visibility in terms of who is using privilege accounts and what tasks they are being used for. The setup for PAM is as follows:
Figure 3.4 – PAM diagram
The preceding ABC domain will hold the non-privilege account, and the bastion forest will hold the admin accounts. A bastion forest is a remote forest that has a very high level of security. The bastion forest works on a Just Enough Administration (JEA) approach by giving the administrator enough privileges to carry out a certain task.
Microsoft produced a JEA toolkit using Windows PowerShell so that each type of admin has a certain number of privileges for the tasks that they are allowed to carry out.
The company will use an identity management solution such as Microsoft Identify Management that holds the different policies for each type of privilege account.
Example: Fred is the SQL database administrator who wants to complete an update to the SQL database. In the following diagram, you can see that he first of all logs in to Identity Manager (IM) using Multi-Factor Authentication (MFA). IM looks at the policies that it holds relating to Fred's account and contacts the bastion domain that produced an admin Kerberos ticket that is then used to give Fred admin access to the SQL database to perform admin tasks:
Figure 3.5 – Obtaining admin privileges
Admin privileges cannot be obtained for day-to-day tasks such as accessing the internet or sending emails.
Mandatory Access Control (MAC) is based on the classification level of the data.
MAC looks at how much damage they could cause to the interest of the nation. These are as follows:
Examples of Mandatory Access Control (MAC) are as follows:
There are different roles associated with classifying, storing, and giving access to data, and these are as follows:
Discretionary access control involves New Technology File System (NTFS) file permissions, which are used in Microsoft operating systems. The user is only given the access that is required to perform their job. These could be classified as user-based or user-centric.
These permissions are shown in the following screenshot:
Figure 3.6 – DAC permissions
The permissions are as follows:
Least privilege is where you give someone only the most limited access required so that they can perform their job role; this is known as a "need to know" basis. The company will write a least privilege policy so that the administrators know how to manage it.
Linux permissions come in a numerical format; the first number represents the owner, the second number represents the group, and the third number represents all other users:
a. Owner: First number
b. Group: Second number
a. 4: Read (r)
b. 2: Write (w)
c. 1: Execute (x)
Unlike a Windows permission that will execute an application, the execute function in Linux allows you to view or search.
A permission of 6 would be read and write, a value of 2 would be write, and a value of 7 would be read, write, and execute. Some examples are as follows:
a. Owner: Read, write, and execute
b. Group: Read, write
c. All Other Users: Read
a. 776 File B, also shown as rwx rwx -rw
b. 677 File B
c. 777 File B
The highest would therefore be the third example.
Another way in which this can be shown in the exam is by using three sets of three dashes.
For example:
You can also change permissions in Linux. If the permission to File C is 654 and we wish to change these permissions to give full control, we will run the chmod 777 File C command, which changes the permissions to File C.
This is a subset of duties within a department. An example would be two people within the finance department who only handle the petty cash. In IT terms, it could be that only two of the IT team administer the email server.
In Rule-Based Access Control (RBAC), a rule is applied to all of the people within a department, for example, contractors will only have access between 8 a.m. and 5 p.m., and the help desk people will only be able to access Building 1, where their place of work is. It can be time-based or have some sort of restriction, but it applies to the whole department.
In Attribute-Based Access Control (ABAC), access is restricted based on an attribute in the account. John could be an executive and some data could be restricted to only those with the executive attribute. This is a user attribute from the directory services, such as a department or a location. You may wish to give different levels of control to different departments.
To control access to data, people may be put into groups to simplify access. An example would be if there were two people who worked in Information Technology (IT) who needed access to older IT data. These people are called Bill and Ben:
Figure 3.7 – Group-based access
Everyone in the sales team may have full control of the sales data by using group-based access, but you may need two new starters to have only read access. In this case, you would create a group called new starters and give those people inside that group only read permission to the data.
We are going to look at authentication and authorization design concepts that are used by corporate environments. We are going to look at directory services, federation services, biometrics, and multifactor authentication. Let's look at each of these in turn.
Identity management in a corporate environment will use a directory database. This is a centralized database that will authenticate all domain users. We are going to look at Microsoft's Active Directory, where a protocol called the Lightweight Directory Access Protocol (LDAP) manages the users in groups. Let's look at how it works.
Most companies have identity and access services through a directory that stores objects such as users and computers as X500 objects. These were developed by the International Telecommunication Union (ITU). These objects form what is called a distinguished name and are organized and stored by the LDAP.
There are only three values in X500 objects; these are DC (domain), Organization Unit (OU), and CN (anything else).
In this example, we have a domain called Domain A and an OU called Sales; this is where all of the sales department users and computers reside. We can see inside the Sales OU a computer called Computer 1:
When creating the X500 object, we start off with the object itself, Computer 1, and then continue up through the structure. As Computer 1 is neither an OU nor a domain, we give it a value of CN. Then we move up the structure to Sales. As it is an OU, we give it that value. Computer 1 is a CN, Sales is an OU, and the domain is divided into two portions, each having the value of DC. The distinguished name is here: CN=Computer1, OU=Sales, DC=DomainA, DC=com.
The way it is stored in the Active Directory can be viewed using a tool called ADSI Edit:
Figure 3.9 – ADSI Edit
LDAP is the active directory storeman responsible for storing the X500 objects. When the Active Directory is searched, then LDAP provides the information required. LDAPS is the secure version of LDAP.
Here are some examples.
Kerberos is the Microsoft authentication protocol that was introduced with the release of Windows Server 2000. It is the only authentication protocol that uses tickets, Updated Sequence Numbers (USN), and is time stamped. The process of obtaining your service ticket is called a Ticket Granting Ticket (TGT) session. It is important that the times on all servers and computers are within 5 minutes of each other; time can be synchronized by using a time source such as the Atomic Time clock.
If Kerberos authentication fails, this is normally down to the user's computer or device time clock being out of sync with the domain controller by 5 minutes or more. A Network Time Protocol (NTP) server can be placed on your LAN to keep the domain computers and servers in sync with each other.
A TGT session is where a user sends their credentials (username and password, or it could be a smart card and PIN) to a domain controller that starts the authentication process and, when it has been confirmed, will send back a Service Ticket that has a 10-hour lifespan. This service ticket is encrypted and cannot be altered:
Figure 3.10 – TGT session
Single Sign-On/Mutual Authentication: Kerberos provides single sign-on as the user needs to log in only once. It then uses their Service Ticket to prove who they are. This is exchanged for a Session Ticket, with the server that they want to access resources on. In the example here, the user will use their service ticket for mutual authentication with an email server:
Figure 3.11 – Mutual authentication
The preceding diagram shows the logged-in user exchanging their encrypted Service Ticket with the mail server, which, in return, provides mutual authentication by returning a Session Ticket. The logged-in user checks that the session ticket's timestamp is within 5 minutes of that of the domain controller. This means that Kerberos can complete mutual authentication.
Important note
You need to remember that Kerberos is the only authentication protocol that uses tickets. It will also prevent replay attacks as it uses USN numbers and timestamps. It can also prevent pass-the-hash attacks.
NT Lan Manager (NTLM): NTLM is a legacy authentication protocol that stores passwords using the MD4 hash that is very easy to crack. It was susceptible to the pass-the-hash attack. It was last used in a production environment in the 1990s. Kerberos prevents pass-the-hash attacks as it uses an encrypted database.
Transitive trust is where you have a parent domain and maybe one or more child domains; these are called trees. Refer to the following diagram:
Figure 3.12 – Transitive trust
Between the Parent domain and each child domain is two-way transitive trust, where resources can be shared two ways. Because the Parent domain trusts both child domains A and B, it can be said that Child A transitively trusts Child B as long as the administrator in Child B wishes to give someone from Child A access to resources and vice versa. Think of a domain as being people from the same company.
Tip
When the exam mentions a third party in relation to third-party authentication, this can only mean federation services. Federation services require cookies to be enabled.
Federation services are used when two different companies want to authenticate between each other when they participate in a joint venture. Think of two car manufacturers wanting to produce the best car engine in the world. Both companies have experts on engines, but they want to work together to produce a super engine. The companies don't want to merge with one another; they want to retain their own identify and have their own management in place. These are known, to each other, as third parties.
Each of these companies will have their own directory database, for example, an active directory, that will only have users from their domain. Therefore, normal domain authentication will not work. Let's now look at the two different domains and their directory databases:
Figure 3.13 – Directory databases
Company A has three users in its directory services – Mr. Red, Mr. Blue, and Mr. Green. Company B also has three users – Mr. Orange, Mr. Purple, and Mr. Yellow. This means that they can only change passwords for the people in their own domain.
If Mr. Orange was to try and access the Company A domain, he would need an account. Since he does not have an account, the security administrator from Company A has no way of providing authentication. He then needs to make an agreement with Company B to set up a federation trust where the people from the other domain would need to use alternative credentials instead of a username and password or a smart card and PIN. They use extended attributes.
User-Extended Attributes are extended attributes used by their directory services. They are, in addition to the basic attributes, comprising the following.
They both have decided that the extended attributes that they will use will be the user's email address. Because an email address is easy to find or guess, they will also need to use their domain password. This is known as a claim. When the exam talks about authentication using the phrase third party or extended attributes, think of federation services.
The two companies need to exchange the extended attribute information and require a special protocol to do that, so they use Security Assertion Mark-up Language (SAML) as it is XML-based authentication, which is used to pass the credentials between Company A and Company B. The companies are said to be peers of each other:
Figure 3.14 – SAML
Federation Services – Authentication: In this scenario, Mr. Yellow is going to authenticate himself with Company A so that he can access limited resources. He contacts Company A through a web browser, and it asks him for his Employee ID and password:
Figure 3.15 – Federation Services
Federation Services – Exchange of Extended Attributes: Company A now uses SAML to pass the authentication details of Mr. Yellow to Company B. Mr. Yellow's domain controller confirms that they are correct:
Figure 3.16 – Extended attributes sent to Company A using SAML
Once Company B confirms that Mr. Yellow's extended attributes are valid, the Company A domain controller sends a certificate to Mr. Yellow's laptop. This certificate is used next time for authentication. They could alternatively use cookies.
Tip
When the exam mentions authentication using extended attributes, this can only mean federation services. Cookies used for authentication would also be federation services.
Shibboleth is an open source federation service product that uses SAML authentication. It would be used in a small federation service environment. Shibboleth can use cookies.
SSO is used in a domain environment. This is where someone logs in to the domain and then can access several resources, such as the file or email server, without needing to input their credentials again. Think of it as an all-inclusive holiday, where you book into your hotel and the receptionist gives you a wristband that you produce when you want to consume food and drink. Federation services and Kerberos (Microsoft authentication protocol) are both good examples of SSO. You log in once and access all of your resources without needing to insert your credentials again.
More and more people are accessing web-based applications and need an account to log in. However, applications hosting companies do not want to be responsible for the creation and management of the account accessing the application. They use OAuth to help them facilitate this:
Biometrics is a method of authentication using an individual's characteristics, for example, using a fingerprint, as everyone's fingerprints are very different. In 1892, Inspector Eduardo Alvarez from Argentina made the first fingerprint identification in the case against Francisca Rojas, who murdered her two sons and cut her own throat in an attempt to place the blame on someone else, but the inspector proved that she was guilty.
We will now look at the types of biometrics:
Figure 3.17 – iPhone fingerprint scanner
Tip
Retina and iris scanners both look at an individual's eye and the scanners themselves are physical devices.
Microsoft has released a facial recognition program called Windows Hello, which was released with Windows 10; this uses a special USB infrared camera. It being infrared is much better than other facial recognition programs that can have problems with light. Biometric errors are as follows:
Exam Tip
When looking at FAR or FRR, remember to look at the middle letter. Authorized users are rejected, the middle letter in FRR is R for reject. Unauthorized users are allowed so we look for the middle letter being A therefore we get FAR. Remember Authorized that starts with A does not belong to FAR that has an A as the middle letter. A does not select A.
Figure 3.18 – Crossover error rate
There are different authentication factors that range from something you know, for example, a password, to something you are using, for example, an iris scanner. The following are the different authentication factors:
Figure 3.19 – Hardware token and key fob used with a proximity card
Let's look at combining different factors to determine a single factor, dual factor, or multifactor. Here are different factor examples:
Tip
The number of factors is determined by the different numbers of factor groups being mentioned.
We will now look at the main differences between being authenticated in the cloud or on-premises.
The perimeter of on-premises is very easy to establish and much easier to control as we can use proximity cards, while guards on reception can also control access to the company. You are responsible for the security of your building and for securing access to your computer systems that can be deemed trusted systems. They will never go offline. We can apply multi-factor authentication by using smart card authentication.
There may be a problem if you have no internet access as you will not be able to connect to the cloud. With the adoption of cloud computing, the security perimeter is no longer confined to the on-premises environment, but now extends outside of those parameters. Authentication within a cloud environment should adopt a zero-trust model, where every connection is deemed to be a hacker as we cannot see who is logging in. We could therefore use conditional access to prove who is the person logging in, using a series of if-then statements. These policies are enforced following a successful login. The three areas of conditional access are Signal, Decision, and Enforcement. Refer to the following diagram:
Figure 3.20 – Conditional access policy
Another security feature used by the cloud is risky logins. Cloud Service Providers (CSPs) have a central database of the devices that a person uses to log in. If the system deems that the device cannot be approved, it will notify the user of the risky login. If it is not approved, then user access will be blocked.
Let's now look at some common account management policies.
To ensure smooth account management, it is vital that company-wide policies are in place and that everyone within the company adheres to them otherwise chaos could ensue. Let's look at each of these policies in turn.
Multinational corporations will generate hundreds of accounts annually and need to have a standardized format. This is known as a standard naming convention. Account templates are copied and modified with the details of new employees. Some examples of standard naming conventions are as follows:
If you have John Smith and Jack Smith, you would have two J Smiths. Therefore, you may also use a middle initial, J A Smith, or a number at the end, J Smith1, to make them unique.
All user accounts need to be unique so that each person is responsible for their own account. If you leave your computer logged on to the network while you go for a coffee and someone deletes data using your account, then you are held responsible. A good practice would be to lock your screen while you are not at your desk to prevent this.
Without a standard naming convention, accounts would be created differently and cause chaos when you tried to find users in your directory service.
When employees move between departments, IT teams normally modify their account for the next department they move to; they don't generally get a new account. In the Security+ exam, when people move department, they are given new accounts and the old account remains active until it has been disabled.
There are a few times when the IT team will disable accounts as a good practice; let's look at the reasons for this:
Tip
When an employee leaves a company, the first stage is that the account is disabled and not deleted. You will also reset the password so that the old account holder cannot use the account.
Account recertification is a process where an auditor will review all of the user accounts. The auditor will have a matrix showing all of the active accounts and what privileges and access that they should have. If the auditor finds anything wrong, then they will report it to management, who will then either write a new account policy or make changes to the management of accounts using change management. For the purpose of the exam, the auditor should be looked at as a snitch; they will never take any action, but they will report their findings to management.
Account maintenance is ensuring that accounts are created in accordance with the standard naming convention, disabled when the employee initially leaves, and then deleted maybe 30 days later.
If you wish to find out when a user account has been granted a new set of privileges, then this can only be done via active monitoring of the accounts. This could be automated by using a Security Information and Event Management (SIEM) system that will create and alert you regarding changes to the system. You will not be alerted by a user account review as there could be 6-12 months between the review—you may need to know immediately.
Tip
If you want to know immediately when there is a change to a user account, such as it being given higher privileges, then you need active account monitoring or you need to set up a SIEM system.
Security Information and Event Management (SIEM). A SIEM system is used for real-time monitoring and can be used to aggregate, decipher, and normalize non-standard log formats; it can also filter out false positives. The only time that a SIEM system will not provide the correct information is when the wrong filters are used or where we scan the wrong host:
Figure 3.21 – Account expiry
Tip
If a person moves to a new department, they get a new account. If their old account is still being used, then we should get an auditor who will perform a user account review.
Figure 3.22 – Time and day restrictions
Example: A toy factory may employ university students to work prior to the busy Christmas period with three different shift patterns; 6 a.m. - 2 p.m., 2 - 10 p.m., and 10 p.m. - 6 a.m. Each employee will have a time and day restriction in place so that they can log in only for their individual shift times.
Tip
If a time restriction is to be placed on a group of contractors, RBAC will be used. Time and day restrictions can only be used for individuals.
When a company has a large number of users, it is difficult to give each user access to the resources that they need in order to perform their job. Groups are created and they will contain all users in that department. For example, the sales group will then contain all of the people working in sales and the group will be used to allow access to resources such as a printer or file structure. If you decide to use group-based access control and you have new employees or interns, you may create another group for them with lower permissions.
For example, in a large corporation, there are 25 employees who work in marketing and require full access to the marketing file share. Next week, they will have three new interns start with the company, but they need only read access to the same share. We therefore do the following:
Tip
If group-based access is used in the exam question, then the solution will be a group-based access solution.
An auditor will carry out a user account review periodically to ensure that old accounts are not being used after an employee either moves department or leaves the company. The auditor will also ensure that all employees have the correct number of permissions and privileges to carry out their jobs and that they don't have a higher level than required. Least privilege is giving the individual only the access that they require in order to perform their job.
Passwords are one of the most common ways of authenticating a user; they are also the authentication factor that is most likely to be inserted incorrectly, maybe because they use uppercase and lowercase characters, numbers, and special characters not seen in programming. Some people may have the Caps Lock key reversed without knowing it.
When a password is inserted, it is shown as a row of dots, and therefore users cannot see their input. However, in the password box in Windows 10, you can press the eye icon to see the password that you have inserted. This reduces the risk of people being locked out.
An administrator should have two accounts, one for day-to-day work and the other for administrative tasks. If your company is using a device such as a wireless router, the default administrative username and password should be changed as they are normally posted on the internet and could be used for hacking your device/network.
A group policy allows security administrators to create settings once and then push them out to all machines in their domain. This could cover maybe 5-10,000 machines. It reduces configuration errors and reduces the labor required to carry out the task. One portion of a group policy deals with passwords; please refer to the following screenshot:
Figure 3.23 – Password policies
Let's look at each of these, going from top to bottom:
a. Lowercase: For example, a, b, and c
b. Uppercase: For example, A, B, and C
c. Numbers: For example, 1, 2, and 3
d. Special Characters Not Used in Programming: For example, $ and @
If I choose the password P@$$w0rd, then it contains characters from all four groups, but it would be cracked very quickly as most password crackers replace the letter o with a zero and replace an a with the @ sign.
Tip
When purchasing devices, you should always change the default password that the manufacturer has set up to prevent someone hacking your device.
Once you are locked out, your account is disabled:
Figure 3.24 – Account lockout
Tip
Know the password options and types of password attacks thoroughly.
People can be locked out from time to time by forgetting their password. They can reset their passwords by going to a portal and selecting Forgotten my password, and then filling in personal details and having the password reset option send a code to their phone via SMS or by email.
Some desktop operating systems allow you to create a password reset disk so that you can save to an SD card or a USB drive; this is not normally used in a corporate environment.
The details of usernames and passwords that someone uses to access a network or an application are called credentials. Users will sometimes have more than one set of credentials to access their local network, and their Facebook, Hotmail, or Twitter account. It would be a serious security risk to use the same account and password for any two of these. Windows 10 has a Credential Manager that can store credentials in two categories – generic credentials and Windows 10. When you log in to an account and you check the Remember Password box, these details could be stored inside credential management to consolidate them. This can be for generic accounts used to access web portals or Windows 10 credentials:
Figure 3.25 – Credential Manager
Let's check out a practical exercise in the next section.
In this practical exercise, you need to prevent users from resetting their account by using the same password. The company should not allow users to change their password more than once every three days and these passwords need to be complex. A user must use a minimum of 12 passwords before they can reuse the original password. You need to prevent a hacker using more than five attempts at guessing a password:
Now it's time to check your knowledge. Answer these questions and check your answers, found in the Assessment section at the end of the book:
In today's world, most businesses either use virtualization as it allows them to recover very quickly from a disaster or they have moved to the cloud to avoid spending a vast amount of money on equipment and disaster recovery. In this chapter, we are going to look at cloud concepts and virtualization, which will be broken down into the following topics:
The demand for cloud computing has risen over the last few years as the workforce has been more mobile; the cloud solution is very cost-effective and maintains the high availability of systems. Before you decide to move to a Cloud Service Provider (CSP), you need to ensure that you trust them 100%.
There are many good reasons why cloud computing has become popular:
Example 1: A toy firm is hiring 50 temporary workers from October onward to deal with the rush for toys at Christmas. If the toy company were not on the cloud, they would have to purchase another 50 desktops, but instead, they lease Virtual Machines (VMs) from a CSP. Once the Christmas rush has ended, the lease of their machines ends. You only pay for what you need.
Example 2: An IT training company uses 12 laptops for the delivery of different courses. Each week the image changes and they have to roll it out 12 times – this is time-consuming. Images are stored in a library on a file server. When they move to the cloud, they just roll out one image and don't need to reimage each laptop. Today, they are delivering Word 2016, therefore they connect to cloud VM with an i5 processor with 4 GB of RAM for two days. They send an image to the CSP, which clones each desktop.
The next week, in another location, they will deliver Skype for Business, so they use the same laptops and don't need to reimage them. They connect to the cloud to VMs with quad-core i7 processors with striped disk sets and 64 GB of RAM. The course is now for five days, so it is longer and more expensive. The image is uploaded to the CSP, which clones the machines, and the course is ready to go. As the course duration is longer and the machines have more resources, the CSP will bill for the resources used. They do not need to purchase the additional hardware and the setup is more cost-effective.
Example: Company A is a newly formed business that has hit the marketplace running; there is a need for the company to rapidly expand and open new offices in Chicago and London, as sales in those locations are astronomically high. Normally, when a new site is opened, it needs to invest $100,000 in IT equipment, so the company has turned to a CSP for the new equipment. They will lease the offices until sufficient sales have been made to invest in purchasing a property. All of the employees will have laptops and high-speed fiber broadband. The network infrastructure will be cloud-based, therefore there is no need to purchase physical servers that would have reduced their cash flow. Cash flow is maintained, even though new equipment has been provided.
Example: A company is looking to upgrade their desktops and servers with the cost of hardware being $250,000 and a disposal fee of $25,000 in five years' time. If they move to the cloud, it is going to cost them $60,000 a year. However, they don't need to find the whole $250,000 in one lump sum as the CSP will update their hardware perpetually so that the hardware will never be obsolete. It will also help the company maintain a better cash flow, as capital expenditure is not required. The price is 1.8% higher per year, which could be justified as there are no maintenance fees or disaster recovery sites required, making it very cost-effective. The CSP deals with maintenance and disaster recovery as part of the cloud plan.
Example: One of your company offices is located in Northern California and recently was burned down by a wildfire; however, since your data and infrastructure are cloud-based, you can operate quickly from another location as long as you have internet access. If you had a traditional network, the infrastructure would have been burned down, your desktops would have been gone, and it could take a week or two to get back to an operational state.
Exam tip
Private cloud = single tenant Public cloud = multitenant Community cloud = same industry, and sharing resources
We will first look at the different cloud models and their characteristics. The most common cloud model is the public cloud, so let's start with that:
Figure 4.1 – Public cloud
Example: A small company does not want to invest $50,000 in IT systems, so they purchase their cloud package from a cloud provider where they and another company are hosted by the cloud provider. This is similar to someone renting one apartment in a block from a landlord – you lease but do not own the apartment. This is a multitenant environment where the cloud provider has multiple companies on the same virtual host.
Figure 4.2 – Private cloud
Example: An insurance company wants its sales staff to be in a cloud environment where they can access resources from anywhere, whether they are at home, at a customer's site, or in a hotel room. The problem they have is that they do not wish to share resources with other cloud tenants. Therefore, they purchase the hardware and their IT team hosts its own private cloud. The benefit of this is that the sales team can access any resources they want at any time of day or night. It is known as single-tenant but, like owning your own home, they buy the equipment.
Figure 4.3 – Community cloud
In the preceding diagram, you can see lawyers on the left-hand side, and on the right-hand side is a group of medical people – doctors and nurses. The lawyers cannot share the same software package as the medical people, since they have different requirements. Therefore, Community Cloud 1 is for lawyers who have brainstormed and financed the perfect legal application, which is hosted in the cloud – this is private to them. Community Cloud 2 is for a group of medical people. It could be two hospitals that have designed and shared the cost of making the perfect medical software package, which is hosted by the CSP.
Example: There is no application that can provide all of the functionality required for pawnbrokers to list the assets that have been pawned with the payment made against each asset. There is no application that can track assets that have not been reclaimed and that need to be sold in the shops and on the internet. Three of the largest pawnbroking companies enter into a business venture in which they get together and design the perfect application to enable their companies to be more efficient and save labor costs over time. The cloud provider creates this application and hosts it. This saves them the costs of purchasing new hardware. The cloud provider will also back up the data each night and guarantee 99.99% availability of the systems. This is known as a community cloud as the application is no good to anyone other than a pawnbroker.
Figure 4.4 – Hybrid cloud
In the bottom left-hand corner of the preceding figure, we have a brick factory. This is known as on-premises, as the company owns a brick-and-mortar building. In the top-right corner are servers in the cloud. The Cloud Access Security Broker (CASB) enforces the company's policies between the on-premises situation and the cloud.
There are different types of cloud services, and these are very heavily tested in the Security+ exam; therefore, we will show screenshots of the types of offerings. We will first look at infrastructure as a service, which is the model that you may have more control over.
If you think of a network infrastructure, you think of desktops, servers, firewalls, routers, and switches – the hardware devices for a network. When you purchase these devices, they have a default factory setting and these settings need to be configured. Desktops are bare-bones, meaning that they have no operating system installed. IaaS is the same; you need to preconfigure these devices, install an operating system, and maintain the patch management. See the pricing (as of writing this book) for IaaS in the screenshot that follows:
Figure 4.5 – Microsoft's IaaS offering (July 2018)
When you decide to use an IaaS model or IaaS models, you may install a virtual load balancer to provide a distributive allocation of some of your server capacity. A load balancer will allocate the load across multiple servers to ensure that no single server is overburdened.
Exam tip
IaaS is where you will install the operating system and patch it. This is the service under IaaS you have more control over. The private cloud is the cloud model that gives you more control.
This is where the CSP hosts a bespoke software application that is accessed through a web server. Let's look at three examples of this: Goldmine, Salesforce, and Office 365.
Example 1: GoldMine is a SaaS package, that is, a Customer Relationship Management (CRM) package, which is used by companies that sell products and services. It will host lists of their customers, with contact numbers and addresses:
Example 2: Salesforce is an internationally used software package employed by sales teams to show a sales forecast over a period of time. It will allow salespeople to enter potential sales leads, categorize them, and hold any correspondence between the parties:
Figure 4.7 – Salesforce – SaaS
Example 3: Office 365 is a Microsoft product where the packages range from email to various Office applications that are all hosted in the cloud. Each user has a 1 TB storage space. The premium package (as of the writing of this book) comes with Skype, Exchange for email, and SharePoint, which is a document management system:
Figure 4.8 – Microsoft Office 365 – SaaS
Exam tip
SaaS is a bespoke vendor application that cannot be modified and you use it with a pay-per-use model, as a subscription, and you cannot migrate any applications or services to any SaaS environment.
This provides the environment for developers to create applications; an example of this is Microsoft Azure. The platform provides a set of services to support the development and operation of applications, rolling them out to iOS, Android devices, as well as Windows devices. You could migrate your bespoke software applications under PaaS. Bespoke means customized.
SECaaS provides Identity and Access Management (IAM), which provides identity management that allows people to have secure access to applications from anywhere at any time. The following screenshot shows Okta providing secure web authentication into Google Apps:
Figure 4.9 – Okta security as a service (SECaaS) for Google Apps
The user in the preceding screenshot needs to validate their identity and has presented a SAML token from Okta, the identity provider (IdP).
Anything as a Service (XaaS) describes a multitude of other cloud services that are available, such as Network as a Service (NaaS), providing network resources; Desktop as a Service (DaaS); Backup as a Service (BaaS); and many more. As new services appear, they will fall under the category of XaaS.
In this section, we are going to look at different cloud computing concepts that may appear in the CompTIA Security+ exam. Make sure that you are familiar with them:
Example: An alert from the sensor of a life support system is sent to the cloud and then to the clinician, but with fog computing, which is closer to the sensor, it can reduce the latency as the clinician is alerted much more quickly:
Figure 4.10 – Fog computing
Example: Microsoft's version of Docker runs on Linux but allows application containers on Linux, Windows, and "macOS".
a. Software-Defined Network (SDN): Traditional networks route packets via a hardware router and are decentralized; however, in today's networks, more and more people are using virtualization, including cloud providers. A SDN is where packets are routed through a controller rather than traditional routers, which improves performance. It has three different planes: the control plane prioritizes the traffic, the data plane does switching and routing, and the management plane deals with monitoring the traffic. An overview of SDN can be found at https://www.cisco.com/c/en_au/solutions/software-defined-networking/overview.html.
b. Software-Defined Visibility (SDV): This gives you visibility of the network traffic use. It can collect and aggregate the data on the network traffic and provide good reports to the network administrators.
Cloud storage utilizes SAN for the virtual components used in a cloud network. A SAN is a hardware device that contains a large number of fast disks, such as Solid-State Drives (SSDs), and is isolated from the LAN as it has its own network servers. The disks are set up with some form of redundancy, such as RAID 5, so that the storage space is redundant. Each switch and storage system on the SAN must be interconnected, and the physical interconnections must support bandwidth levels that can adequately handle peak data activities. There are two connection types:
Example: In the following diagram, Server 1 is a virtual host, and it needs another 200 TB of disk space to host more VMs, but it has no physical disk slots available. It connects to the SAN using Ethernet and Ethernet switches; this connector is known as an iSCSi connector:
Figure 4.11 – SAN
The SAN allocates 200 TB by giving it a Logical Unit Number (LUN). This is known as |an iSCSi target. Server 1, which has been allocated the space, is known as the iSCSi initiator. Server 1 is diskless but still sets up the disk space using disk management as if it were a physical disk. To prevent latency, the connection between Server 1 and the SAN must be fast. Server 1 could be a virtual host that holds many VMs. It is vital that this server is fully patched at all times.
It is quite common to use cloud storage to hold your data, from the iCloud service provided by Apple, Google Drive provided by Google, OneDrive provided by Microsoft, or Dropbox provided by Dropbox, Inc. This storage resides on a SAN inside a data center. The consumer versions of cloud storage allow you to have limited storage space, but offer to sell you a business version or additional storage by charging a monthly subscription fee. Let's understand cloud storage by looking at the following diagram:
Figure 4.12 – Cloud storage
In the preceding diagram, you can see on the left-hand side a data center that has a vast amount of storage servers in a configuration called a server farm. The data center is a secure location where your data resides, but the data must stay within your world region. The Security+ exam may see it as different countries rather than world regions. The data center has a backup data center to provide redundancy. The storage on these servers is likely to be diskless SAN storage.
Cloud providers provide Binary Large OBject (BLOB) storage that can be used as a large storage area for a database or large amounts of binary or text data. It can be also used for images that can be used by a browser or video and audio files for streaming video or gaming.
To ensure that the cloud environment is as secure as possible, there are many controls that need to be in place. Let's look at some of these controls.
In a global Azure environment, there are Azure regions. Inside each region, there are high availability zones. These zones are physical locations that may hold two or more data centers and provide high availability within their zone. They are independent from each other with their own networks. Inside each network, they have their own power and Heating Ventilation and Air Conditioning (HVAC) systems that regulate their own cooling using hot and cold aisles. Applications can be distributed across multiple zones so that if one zone fails, the application is still available.
These are policies that state what access level or actions someone has to a particular resource. This is crucial for resource management and audit. We need to apply the principle of least privilege.
This is a secure application, and it could be called a vault where the keys, tokens, passwords, and SSH keys used by privileged accounts are stored. It could be a vault that is heavily encrypted to protect these items. Microsoft uses RSA 2048-bit keys to protect Azure secret management.
Integration is the process of how data is being handled from input to output. A cloud auditor is responsible for ensuring that the policies and controls that the cloud provider has put in place are being adopted. They will test that these controls and the system integration are working as expected. They will be an independent third party. Some of these controls may include the following:
It is vital that the data held in cloud storage is highly available, and that only those who are authorized can access the data. Let's look at permissions, encryption, replication, and high availability:
a. Local Redundant Storage (LRS): Three copies of your data are replicated at a single physical location. Not good for high availability. It is the cheapest solution, but if the power goes then everything has gone.
b. Zone Redundant Storage (ZRS): Data is replicated between three separate zones within your region. It should be used in your primary region; however, if a disaster affects the region then you have no access to data.
c. GEO Redundant Storage (GRS): Three copies of your data are replicated in a single physical location in the primary region using LRS, then one copy is replicated to a single location in a secondary region.
d. GEO Zone Redundant Storage (GZRS): Data is replicated between three separate zones within your primary region, then one copy is replicated to a single location in a secondary region.
In a cloud environment, you must ensure that your networks and VMs are protected against any attack. In this section, we will look at virtual networks, public and private subnets, segmentation, and API inspection and integration. Let's look at each of these in turn:
Figure 4.13 – Public and Private Subnets
10.0.0.0
172.16.x.x – 172.31.x.x
192.168.0.0
All other IP address ranges, except the APIPA 169.254.x.x, are public addresses. Private subnets will hold the domain infrastructure, such as domain controllers, mail servers, and database servers that you don't want to communicate directly with the internet.
These are the resources that a computer needs to function effectively. Let's look at resources that affect cloud computing:
These are the services that are required to secure our cloud environment. Let's look at each of them in turn:
More details can be found at https://www.digitalmarketplace.service.gov.uk/g-cloud/services/986853436243688.
a. Cost: An example of cost as a consideration would be CloudFlare that has a free version with limited features. At the time of publishing, the pro version is $20 per month, the business version is $200, and the enterprise version is Price on Application (POA). Each of the plans has additional features that can be added to that price. The enterprise solution is for customers with business-critical applications.
b. Need for Segmentation: The cloud environment uses a Zero-Trust model where each individual needs to provide their identity and location to gain access to the cloud environment. The firewall controls access to each of the cloud regions and zones.
c. Interconnection OSI Layers: A network firewall works on Layer 3 of the OSI controlling IP traffic, but most of the cloud firewalls are Web Application Firewalls working at Layer 7 of the OSI.
d. Cloud Native Controls versus Third-Party Solutions: Vendors such as Microsoft and Amazon Web Services (AWS) have their own tools, such as Azure Resource Manager (ARM) and AWS Cloud Formation. These tools make managing Microsoft and AWS cloud resources easy. Using third-party tools adds more flexibility.
Let's explore the different virtual network environments in the next section.
A virtual network is very similar to a physical network in many ways but, for the Security+ exam, we must know the concept of virtualization. To be able to host a virtual environment, we must install a hypervisor on a computer hosting the VMs. A hypervisor is software that runs on a virtual host that lets the host run virtual machines. There are two different types of hypervisor:
The main server in a virtual environment is called a host, and the VMs that it hosts are called guests. This is very similar to a party where the person holding the party is a host and the people attending the party are called guests. There are various different components of virtualization:
Figure 4.14 – Virtual host
Now, we will look at each of the components:
Figure 4.15 – Guest machines
Figure 4.16 – Virtual switch
Figure 4.17 – Snapshot
Sprawl Avoidance: One of the best ways to protect against VM sprawl is to have robust security policies for adding VMs to the network and use either a NIDS or Nmap to detect new hosts.
a. VM Escape Protection: One of the best ways to protect against VM escape is to ensure that the patches on the hypervisor and all VMs are always up to date. Ensure that guest privileges are low. The servers hosting the critical services should have redundancy and not be on a single host so that if one host is attacked, all of the critical services are set up as a single point of failure. We also need a snapshot for all servers and need to use VM migration so another copy is held in another location. We could also place a HIPS inside each VM to protect against an attack.
Now it's time to check your knowledge. Answer the questions, and then check your answers, which can be found in the Assessments section at the end of the book:
In this section, you will gain knowledge of different types of penetration testing and scanning concepts that are crucial to security professionals. You will explore security protocol use cases, understand different network components, and also learn to secure your wireless and mobile solutions.
This section comprises the following chapters:
One of the most important roles of a security professional is to keep the company's environment safe from attack and so, in this chapter, we are going to look at monitoring, scanning, and penetration testing.
In this chapter, we will cover the following topics:
A penetration test is an intrusive test where a third party has been authorized to carry out an attack on a company's network to identify weaknesses. The intrusive tests used by them can cause damage to your systems.
Penetration testing is commonly known as pen testing. Pen testers are given different amounts of information, including the following:
Example: A pen tester is about to carry out a pen test but has not been given any information on the system. As they arrive at the company, the IT manager offers them a cup of coffee and then gives them the Local Admin account of server 1. What type of pen test is this?
Answer: It is a gray box, as he has been given some information.
Before any pen testing commences, the following information needs to be established:
Exam Tip
A white box pen tester has all the information he needs, including the source code.
As the pen testers carry out their testing, they may incorporate techniques used by attackers. Let's look at these here:
Exam Tip
A pivot is gaining access to one computer so that an attack can then be launched on a computer running a critical service.
Let's now look at passive and active reconnaissance.
In the CompTIA Security+ exam, they measure the types of reconnaissance that could be used by an attacker. Let's first look at active and passive reconnaissance and then the tools that can be used to carry out these activities:
The following tools can be used for reconnaissance:
Exam tip
Lateral movement is used by attackers to make their detection by security teams much harder.
Let's now look at the different types of exercise in the next section.
Team exercises are similar to pen testing, but they use friendly IT professionals to participate in the different teams. The teams are red, blue, green, white, and purple. Let's look at each of these in turn:
Figure 5.1 – Exercise teams
Here is a brief overview of the different teams:
Exam tip
White teams set up the rules of engagement and judge cyber security events, ensuring reports are accurate and that countermeasures are suitable.
We will now look at the different vulnerability scanning concepts in the next section.
A vulnerability scanner is a passive scanner that identifies vulnerabilities or weaknesses in a system. For example, there could be a missing update for the operating system, anti-virus solutions, or account vulnerabilities. Microsoft has a vulnerability scanning tool called Microsoft Baseline Security Analyzer (MBSA), but there are many more in the marketplace.
A Zero-Day exploit cannot be traced by a vulnerability scanner; the exploit has not yet been identified and has no updates or patches available. Let's look at the type of output a vulnerability scanner could produce:
Exam tip
When looking at CVSS events, always deal with the critical events first.
There are two types of vulnerability scans – credentialed and non-credentialed. Let's look at these in turn:
Example: An administrator runs a non-credentialed scan on the network and finds that there are three missing patches. The scan does not provide many details on these missing patches. The administrator installs the missing patches to keep the systems up to date as they can only operate on the information produced for them.
There are two types of vulnerability scans; one does not cause harm and the other can. Let's look at the differences here:
Exam tip
A credentialed scan can produce more information and can audit the network. A non-credentialed scan is primitive and can only find missing patches or updates. It has fewer permissions than a credentialed scan.
There are different types of scans apart from those listed in the previous section. Let's look at each of these in turn:
A penetration test is more intrusive as it tries to fully exploit the vulnerabilities that it finds and could cause damage to IT systems, whereas most vulnerability scanners are non-intrusive, as they scan for vulnerabilities. Even a credentialed scan only scans the registry/permissions and finds missing patches and vulnerabilities. It is informational and does not exploit the system, and therefore is less likely to cause damage to systems. Running a vulnerability scan can be done at the drop of a hat and is much cheaper than organizing a pen test.
The systems on a network produce a massive amount of information in log files and most of them will be related to errors or possible attacks. They will require a real-time solution to correlate these events so that the security team can be alerted immediately. Let's look at the role that the SIEM and syslog server play.
Security Information and Event Management (SIEM) is regarded as an IT best practice, used by regulated industries as a whole, to fulfill security and audit compliance regulations, for example, HIPAA, GDPR, SOX, and PCI DSS. SIEM supports IT teams by consolidating event log values through the correlation, aggregation, normalizing standard, and non-standard log formats; it can also filter out false positives.
The only time that an SIEM system will not provide the correct information is when the wrong filters are used or the wrong host is monitored. In these cases, a false positive will be produced.
A System Logging (Syslog) protocol server is used to collect data from multiple sources and store them in a single location, such as an event logging database. Legitimate data can be filtered out, thereby reducing the amount of data held. The SIEM can benefit from the filtered data as searching becomes easier. The data between the syslog server and the SIEM system is encrypted.
The different aspects of a SIEM system is shown in the following diagram:
Figure 5.2 – SIEM cycle
Let's now look at the different aspects of a SIEM system:
Let's look at other functions that a SIEM server can carry out:
In the next section, we will look at Security Orchestration, Automation, and Response (SOAR) in detail.
SOAR is an automated tool that integrates all of your security processes and tools in a central location. As an automated process that is faster that humans searching for evidence of attacks, it helps reduce the mean time to detect (MTTD) and accelerates the time to respond to events.
This will produce faster alert information for the security operations team, where the human entities can take further action to keep the company safe. Let's look at the workflow in the following diagram:
Figure 5.3 – Security integration
As you can see in the preceding diagram, we first of all sort the raw data. The data would then be sent to a syslog server and then arrive at the SIEM server. The SIEM server would then correlate the events with the SOAR tools, which in turn alert the SOC team.
Threat hunting is a dynamic process of seeking out cybersecurity threats inside your network from attackers and malware threats. According to the Security Intelligence website, an average cybercriminal can spend 191 days inside your network before being discovered. Please look at this article at the following link for more information: https://securityintelligence.com/a-beginners-guide-to-threat-hunting/.
Let's now look at the process of threat hunting so that we can understand it better. We will look at intelligence fusion, threat feeds, advisories and bulletins, and manoeuvre:
Example: Let's look at two advisories, one in the US and the other in the UK. The Cyber Security and Infrastructure Agency, which is part of US Government Homeland Security, informs the public about threats. This helps you to protect your company. Please refer to Alert (AA20-245A) at https://us-cert.cisa.gov/ncas/alerts/aa20-245a. In the UK, the National Cyber Security Centre lists advisories at the following URL: https://www.ncsc.gov.uk/section/keep-up-to-date/reports-advisories.
The Microsoft Baseline Security Analyzer (MBSA) is an example of a vulnerability scanner, but you must realize that there are others.
In this exercise, we are going to download the MBSA tool and run it against our local computer to look for vulnerabilities:
Figure 5.4 – MBSA setup page
Figure 5.5 – Accepting the agreement
Figure 5.7 – Installation complete
Figure 5.8 – MBSA shortcut
Figure 5.9 – MBSA management console
Figure 5.10 – Obtaining security updates from Microsoft
Figure 5.11 – MBSA output
Figure 5.12 – Credentialed vulnerability scan
You can now see whether or not you have any vulnerabilities on your computer. There are hyperlinks below each item listed, giving you information on how to update your vulnerabilities.
Now it's time to check your knowledge. Answer the questions, and then check your answers, which can be found in the Assessments section at the end of the book:
In this chapter, we will be looking at secure protocols and their uses, known as use cases. We will also cover insecure protocols, as you need to know their functions so that you know which secure protocol is the most suitable one to replace it with. The topics discussed in this chapter appear very often in the Security+ exam.
In this chapter, we are going to cover the following topics:
Protocol refers to the rules required by different applications for the exchange of data, where the application can perform actions such as running commands on remote systems, sending and receiving emails, and downloading files from the internet. Each application has a special port number that it uses for communication. You can think of ports as being TV channels: if we want to watch sport, we go to the sports channels; if we want to watch the news, we go to the news channel. Applications are the same – if we want to send an email, we use an email application – and they all have a distinct port number for each communication mode.
There are two types of ports: Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). The main difference between the two is that TCP is connection-oriented as it uses a three-way handshake, and UDP is faster but less reliable as it is connectionless. The following diagram shows the three-way handshake:
Figure 6.1 – Three-way handshake
In a three-way handshake, the first packet that is sent is called a SYN packet, where the sending host informs the receiving host of the number of its next packet. The receiving host sends a SYN/ACK packet, where it says what its next packet is. The ACK packet acknowledges both kinds of packets, and then the data is sent. The data is sent in chunks, and when it is received, an acknowledgment is sent that tells the sending host to send more packets. Once all of the data is sent, a three-way handshake confirms that all of the data is intact and the session closes.
In a UDP session, the application is responsible for ensuring that everything is received, and because a three-way handshake is not used, the connection is faster but less reliable. You would use UDP for streaming video and gaming, where speed is paramount.
In this section, we are going to look in detail at the different insecure protocols and their use cases.
Example 1: Kerberos needs the times for all of the clients and servers to be within 5 minutes of each other or users may not be able to log in or access resources.
Example 2: SIEM servers collect logs and events from multiple servers and computers across the network. If the times are not synchronized, then the events cannot be put in chronological order.
There are different types of email protocols; some are web-based and some use the MAPI client on the desktop. Let's look at the insecure versions:
There are two types of Name Resolution: hostname resolution, which is the most common, and NETBIOS, which is a legacy name resolution that is very rarely used.
The most common form of name resolution is hostname resolution, where a database of hostnames for IP addresses called a DNS uses a flat file called the hosts file:
a. A: IPv4 host
b. AAAA: IPv6 host
c. CNAME: Alias
d. MX: Mail server
e. SRV Records: Finds services such as a domain controller
For example, say a user would like to visit the website ianneil501.com; to get there, they would enter www.ianneil501.com in their web browser:
Figure 6.2 – DNS name resolution
Hostname resolution adopts a strict process and takes the first entry for the hostname no matter whether it is right or wrong—this is a pitfall of the process. In the preceding example, the DNS cache is empty, so it would move onto the hosts file located on the local computer and then the DNS server.
If you needed to view the DNS cache, you would run the ipconfig/displaydns command, and if you wanted to clear the DNS cache, you would run the ipconfig/flushdns command. Let's look at this process, starting with the DNS cache:
a. DNS Cache: This stores recently resolved names; attackers will attempt to poison the DNS cache by putting in incorrect entries to divert you to an alternative illegitimate server. DNSSEC helps prevent DNS poisoning.
b. The Hosts File: This is a flat file where entries are manually inserted and read from top to bottom. The first entry is always taken, whether right or wrong. The purpose of a host file is that if one user needs to go to a server called Sneaky Beaky, you would put an entry for the Sneaky Beaky server in their local hosts file that would allow them to go there. If you put the entry in the DNS server, that would allow anyone to find that server.
c. DNS Server: This normally maintains only the hostnames for your domain. It needs to complete a referral process through the root server of the internet, which is represented by a dot. The nslookup command is used to verify DNS entries held by the DNS server.
d. Root Server: The root server refers requests to the .com server, which in turn refers requests to the authoritative DNS server for the ianneil501.com domain (in our previous example), which then replies with the IP address of the website.
e. Caching the Reply: A copy of the name resolution is placed in the DNS cache for future use.
PC1 <00>: <00> represents the workstation service.
PC2 <03>: <03> represents the messenger service.
PC3 <20>: <20> represents the server service.
In the past, when companies wanted meetings, such as a sales meeting, a date was set and the salespeople kept their schedule open, traveled to the location of the meeting the night before, and booked themselves into a hotel. This was very costly and time-consuming; nowadays, we use Videoconferencing, where everyone can attend the meeting, they do not have to travel, and can free their schedule more easily, making them more productive. In the Security+ exam, we need to be able to understand which protocols are used for such videoconferences:
Exam tip
Both Kerberos and SIEM systems are reliant upon an NTP server to synchronize times between the nodes on a network.
In this section, we are going to look in detail at the various secure protocols and their use cases. The Security+ exam wants you to select the correct secure protocol for a given scenario to make your environment secure.
As most protocols use TCP ports, I will only mention the UDP ports, and therefore you can assume that if something is not labeled UDP, it is TCP. We will look at the secure protocols and their use cases:
Let's look at each of them:
Each update to a directory service object is done by giving the change an Updated Sequence Number (USN). For example, if one change is USN 23, the change after that must be USN 24, and it is stamped with the time it happens, which is known as being timestamped. Kerberos prevents replay attacks, where an interception is performed and information is altered and replayed at a later time. As the timestamps and USNs become out of sequence in such cases, the traffic is rejected.
Figure 6.3 – ADSI Edit
When a systems administrator has 10,000 users and needs to find one of them, they use the search facility and LDAP brings back the result of the search.
The header is hashed by using SHA1, which is 160 bit, or MD5, which is 128 bit, to confirm the integrity of the packet. The encapsulated payload is the data and it is encrypted by DES (56 bit), 3DES (168 bit), or AES (128, 192, or 256 bit). These are symmetric encryptions using block ciphers and are used to encrypt large amounts of data:
Figure 6.4 – IPSec packet
IPSec can be used to create a secure session between two hosts on a network and it has two different modes:
a. Tunnel Mode: This is used with L2TP/IPSec VPNs, where both the header and the payload are encrypted. It's normally used externally.
b. Transport Mode: This is used between two servers or hosts on an internal network, where only the payload is encrypted.
Exam tip
IPSec can be used in tunnel mode with L2TP/IPSec and in transport mode between servers in a local area network.
a. Implicit Mode: This negotiates a secure session using TCP port 990 for the control channel and 998 for the data channel.
b. Explicit Mode: This is known as FTPES, where the client must request security; if they do not, the session will be refused.
Exam tip
You must know the purposes of the secure protocols and their associated ports.
In this section, we are going to look at additional use cases for subscription services, routing, switching, and Active Directory.
In the past, the traditional method for purchasing application software was to purchase the application on a DVD from a local store or wait 3-4 days for it to be delivered from Amazon. At that time, you would have to pay $300–$400 for the software. With the advent and evolution of the cloud, you can now obtain your applications through subscription services, where you pay a monthly fee and can download the application immediately.
Two examples of this are as follows:
The purpose of a router is to connect networks together, whether they are internal subnets or external networks, and route packets between them. A router sits at Layer 3 of the OSI reference model, where the data packets are known as IP packets, as Layer 3 of the OSI deals with IP addressing and delivery. If we look at the following figure, we can see five different routers that connect networks between New York, Dublin, Paris, London, and Edinburgh:
Figure 6.5 – Routing packets
If we think of these routers as post offices delivering mail, it may make it easier to understand. If mail arrives at the Paris post office, the people working there have two sacks, one for Dublin and the other for London; they just need to know where to send the mail next. They cannot have sacks for every destination in the world; it is just not feasible:
Routing packets is no more difficult than moving mail around the world; the router has many routes in a routing table and knows the next hop for packet delivery. Several protocols are used in the management and control of IP packets going through the router:
Exam tip
A client might not obtain an IP address from a DHCP server due to network connectivity issues or resource exhaustion, where there are no IP addresses left to lease.
A switch is an internal device that connects all of the users in a local area network so that they can communicate with each other. A computer connects to a wall jack into a patch panel, and then from the patch panel to the switch:
Figure 6.6 – Connecting to a switch
Let's look at the functionality and protocols used by a switch:
Microsoft's Active Directory is a very common directory service, and we are going to look at the components and protocols used by it:
Now it's time to check your knowledge. Answer the questions, and then check your answers, which can be found in the Assessments section at the end of the book:
IAN <00>
IAN <20>
What naming convention is used and what format is being shown?
There are many network components and topologies (layouts) that we need to know about in order to maintain a secure environment. We are going to look at each of these in turn. We need to know how each device is configured and which device is the most appropriate to use in different scenarios.
In this chapter, we will look at the following topics:
There are many different network components and we are going to look at each of these. For the Security+ exam, we need to know which device can be used in different scenarios, so let's first of all look at firewalls that prevent unauthorized access and then the other devices.
A firewall prevents unauthorized access to the corporate network, and in the Security+ exam, we tend to use a back-to-back configuration, as shown here:
Figure 7.1 – Back-to-back firewall configuration
You can see that each of these firewalls is not letting traffic pass through them; this is because we need to open only the ports that we need. If the firewall on the right is traversed, then the firewall on the left will hopefully prevent access to the internal network, known as the Local Area Network (LAN). To enable applications to pass through the firewall, we must open the port number for each application. Each application has a different port number. If you think of someone who wants to watch the news, the Democrats watch CNN on channel 21 and the Republicans will watch Fox News on channel 29. Each TV program has a different channel number.
If we want to enable internet access, we should make an exception to the Hypertext Transfer Protocol (HTTP) on TCP port 80. This is the port number that each web server uses for communication and it does not matter whether they use Internet Explorer, Microsoft Edge, Google Chrome, or Firefox. Each of these applications uses TCP port 80 for web traffic.
The directions of ports are outbound, coming from the internal network and going to the external network, or inbound, coming from the external network and going to the internal network. If we opened only the outbound port for port 80, the request would go out, but the incoming response would be prevented.
The main purpose of a firewall is to prevent unauthorized access to the network. The default setting is to block all traffic allowed by exception. There are many different firewalls:
Figure 7.2 – Host-based firewall
As the host-based firewall is an application on a desktop, it is vulnerable to attack. If someone disables the service running the Windows firewall service, then the firewall is disabled, and the computer becomes vulnerable. The following screenshot shows the firewall service in a Running state:
Figure 7.3 – Windows Firewall service
Exam tip
A UTM firewall is an all-in-one security appliance that acts as a firewall and does content and URL filtering. It can also inspect malware.
Network Address Translation (NAT) is where a request from a private internal IP address is translated to an external public IP address, hiding the internal network from external attack (refer to Figure 7.4):
Figure 7.4 – NAT
A NAT could be set up to hide an R&D network as a competitor may try to steal your new ideas and get them to market before you. A NAT could be set up on a firewall or a NAT server and is also used to protect a cloud VPC.
A router is a device that connects two different networks together when setting up a host machine; it is known as the default gateway. It is used by your company to give you access to other networks, for example, the internet. It has a routing table built into it, so it knows which route can be used to deliver network packets. The router is the IP equivalent of a post office sending letters around the world, but instead of letters, IP packets are being transported.
Quality of Service (QOS) ensures that applications have the amount of bandwidth they need to operate when there is limited network bandwidth.
The Access Control List (ACL) for network devices must not be confused with the ACL for files and folders; they are totally different. Two network devices that use the ACL are firewalls and routers. The ACL prevents access by using port numbers, application names, or IP addresses. When you install a new firewall or router, there are no rules, except the last rule of deny all. The default for either a router or firewall is to block all access allowed by creating exceptions by configuring allow rules for the traffic you want to allow through. If there are no allow rules, the last rule of deny applies. This is called an Implicit Deny.
Example: John has been doing some online shopping and bought a pair of shoes, but he cannot download the new book that he bought. He has used HTTP to gain access to a website, and then gone to the secure server for payment, using HTTPS for purchases to protect his credit card details. However, when trying to download the book, the traffic is being blocked by the firewall. The ACL allows TCP port 80 (HTTP) and TCP port 443 (HTTPS), but there is no allow rule for the FTP that uses TCP port 21:
Figure 7.5 – Implicit Deny
As there is a no allow rule on the firewall for FTP traffic, when the FTP traffic arrives, it is checked against the allow rules, and if there is no matching rule, it then drops down to the last rule, denying all traffic. This is known as Implicit Deny. Although the example is for a firewall, an ACL is used by the router. Both devices are filtering incoming traffic.
A switch is an internal device that connects all users in a LAN. The switch has a table listing the MAC addresses of the host connected to it:
Figure 7.6 – Switch
Once the switch has been installed, it builds up a routing table; each host is identified by their MAC address. The switch delivers the packet only to the host that requires the packet. Switches can be stacked when there are more than 48 users connected to the network:
Figure 7.7 – Network connections
A computer has an Ethernet cable that plugs into a wall jack, and then the wall jack is connected to the patch panel by cables that are laid under floors or above ceilings. A user cannot see them. From the patch panel, there is a cable that goes into one port on the switch. The Ethernet cabling is placed inside a conduit to protect the cable. It is very easy to plug a cable into a wall jack. Therefore, the network administrator must place security for each of these ports on the switch.
There are two types, 802.1x and port security and other protection that can be configured:
– Loop Protection: When two or more switches are joined together, they can create loops that create broadcast storms. We need to use the Spanning Tree Protocol (STP) to prevent this from happening by forwarding, listening, or blocking on some ports.
– Bridge Protocol Data Units (BPDU): These are frames that contain information about the STP. A BPDU attack will try and spoof the root bridge so that the STP is recalculated. A BPDU Guard enables the STP to stop such attempts.
– MAC Filtering: Every device that has a network interface, whether it is wired or wireless, has a unique address on its network interface called the Media Access Control (MAC) address. If one MAC address is added to the MAC filtering list, then all other devices wishing to use the wireless access point must be added to the MAC filtering list or they will be blocked:
Figure 7.8 – MAC filtering
Exam tip
If you want to prevent someone from plugging their laptop into a reception area, we will use port security to shut that port down. But if you want to prevent a rogue server or a wireless access point from connecting to the network, we will use 802.1x port security, which authenticates the device.
A tap or a port mirror (also known as port spanning) is set up on a port of a switch so that when the data arrives at that port, a splitter sends a copy to another device for later investigation, or it is sent to a sensor that will investigate the traffic and, if need be, inform the Network Intrusion Detection System (NIDS) of changes in traffic patterns.
Link aggregation allows you to connect multiple switches together so that they work as a single logical unit and prevent looping:
Figure 7.9 – Aggregation switch
This is used for fast recovery if one link fails.
When security teams are trying to find out the attack methods that hackers are using, they set up a website similar to the legitimate website with lower security, known as a honeypot. When the attack commences, the security team monitors the attack methods so that they can prevent future attacks. Another reason a honeypot is set up is as a decoy so that the real web server is not attacked. A group of honeypots is called a honeynet.
Exam tip
A honeypot can be used to examine the attack methods that hackers use.
A proxy server is a server that controls requests from clients seeking resources on the internet or an external network. Think of it as a go-between that makes requests on behalf of the client, ensuring that anyone outside of your network does not know the details of the requesting host. The proxy server maintains a log file of every request, and so can track a user's internet usage.
The flow of data is from internal to external, and so is known as a forward proxy:
Figure 7.10 – Forward proxy
It has three main functions: URL filter, content filter, and web page caching:
The purpose of caching is to reduce the bandwidth being used and also make the access to web pages faster as they are actually obtaining content from their LAN. There are different types of caching:
a. Active Caching: The IT team sets up jobs to cache web pages; for example, they cache www.nfl.com at 3 a.m. local time to ensure it has the latest results.
b. Caching: When new web pages are being requested (as long as they are not blocked by a filter), the pages are fetched and submitted to the requesting host and a copy is then placed in the cache. That way, the second time it is requested, it is retrieved from the cache.
c. Transparent Cache: This intercepts the request by the host to use HTTP TCP port 80 and forwards it to the proxy without modifying the requested web page. Refer to Figure 7.11 here:
Figure 7.11 – Transparent proxy
d. Non-Transparent Cache: The non-transparent proxy needs the proxy setting to be configured on the client computer to allow access through TCP port 8080:
Figure 7.12 – Non-transparent proxy
There are two types of forward proxy servers and these are as follows:
Example: If a company sets up a webinar through Skype or another video conference application, they can invite potential customers. All of the conferencing requests will pass through a reverse proxy that authenticates them and redirects their session to the relevant Skype server.
A jump server, also known as a jump host or jump box, is a hardened host that could be used as an intermediary device or as a gateway for administrators who would then connect to other servers for remote administration. It would only have secure remote access tools installed. It could be used to SSH into the screened subnet or an Azure public network.
A network load balancer is a device that is used when there is a high volume of traffic coming into the company's network or web server. It can be used to control access to web servers, video conferencing, or email.
The web traffic, shown in Figure 7.13, comes into the load balancer from the Virtual IP address (VIP) on the frontend and is sent to one of the web servers in the server farm:
Figure 7.13 – Load balancer
Let's now look at the scheduling of load balancers.
Scheduling is how the load is distributed by the load balancer, let's look at these options in turn:
Example: The load balancer (see Figure 7.13) has selected to send the request to Web 3, which has the least number of requests (50), and Web 4 will not be considered as it is currently offline. A user requesting three different pages may obtain them from different web servers but may not know this as the load balancer is optimizing the delivery of the web pages to the user.
Figure 7.14 – DNS Round Robin
Next, we will look at the configurations for load balancers.
There are many ways to set up a load balancer and we are going to look at each of these in turn:
With the increased use of cloud technology and remote sales workforces, there has been an increase in employees who require remote access capabilities. At the time of writing this book, the majority of companies are working from home using remote access due to the COVID-19 pandemic. Let's look at the different types of remote access technologies in this section.
There are times when people who are working remotely need to access the company's network to access resources. There are two main types of remote access: the old-fashioned remote access server, using a modem, and the more modern Virtual Private Network (VPN) solutions. Let's look at these in turn:
a. L2TP/IPSec: This is the most secure tunneling protocol that can use certification, Kerberos authentication, or a preshared key. L2TP/IPSec provides both a secure tunnel and authentication.
b. Secure Socket Layer (SSL) VPN: This works on legacy systems and uses SSL certificates for authentication. A newer version is TLS VPN.
c. HTML 5 VPN: This is a VPN, similar to the SSL VPN, as it uses certificates for authentication. It is very easy to set up and you just need an HTML5-compatible browser such as Opera, Edge, Firefox, or Safari. There have been issues with this VPN as it is very slow.
A VPN creates a tunnel across the internet, normally from home or a remote site to your work. We need to look at the L2TP/IPSec tunnel that works at Layer 3 of the OSI Reference Model, where IPSec is used to encrypt the data. An IPSec packet is formed of two different portions:
IPSec can be used to create a secure session between a client computer and a server. For example, you may have the financial data on a financial server. All members of the finance team will have IPSec tunnels created between their desktops and the financial server. This will prevent anyone using a packet sniffer from stealing data from the financial server or any session across the network. This is known as IPSec Transport Mode. It encrypts on the payload.
IPSec can also be used as a VPN protocol as part of the L2TP/IPSec tunneling protocol that is used by major vendors who create VPN solutions, such as Cisco, Microsoft, Sonic Wall, or Checkpoint. This is known as IPSec Tunnel Mode. It encrypts both the header and the payload.
The first stage of an IPSec session is to create a secure tunnel. This is known as a security association. In the Security+ exam, this is called Internet Key Exchange (IKE). Diffie Hellman is used to set up a secure tunnel before the data:
Figure 7.15 – Internet Key Exchange
The IKE phase of the IPSec session is using Diffie Hellman over UDP port 500 to create what is known as quick mode. This creates a secure session so that the data can flow through it.
The second phase is where the data is encrypted with DES, 3DES, or AES. AES provides the most secure VPN session as it uses 128, 192, or 256 bits. There are two different IPSec modes:
The purpose of the VPN concentrator is to set up the secure tunnel during the IKE phase. It needs to create a full IPSec tunnel. This is normally where you have a site-to-site VPN. See the next topic.
A site-to-site VPN is where you have two different sites, each with a VPN concentrator at each site, and it acts as a leased line. A site-to-site VPN can act like a point to point connection between two sites. The session is set to Always On, as opposed to dial on demand:
Figure 7.16 – Site-to-site VPN
There are two main session types:
An SSL VPN is a VPN that can be used with a web browser that uses an SSL certificate for the encryption. It has been replaced in recent times with Transport Layer Security (TLS), which is a more modern version of SSL. In the Security+ exam, an SSL VPN is normally used for legacy VPNs that don't support L2TP/IPSec and use an SSL certificate.
Exam tip
SSL VPNs are the only VPN to use an SSL certificate, and only need a web browser to make a connection. The SSL certificate could also be replaced by the more secure TLS certificate.
Split tunneling is where a secure VPN session is connected (this is the blue tunnel shown in the following diagram), and then the user opens an unsecured session that would allow the hacker to come in through the unsecured session and gain access to your company's network:
Figure 7.17 – Split tunnel
Example: John connects his L2TP/IPSec session into the company network and then he realizes that he needs a train ticket for tomorrow. Instead of dropping the secure session and then going to the rail website, he leaves it connected. Once he opens up his web browser, he is using HTTP on TCP port 80, which is unsecured. This means that, while he has the web browser open, a hacker could access his desktop and use the secure tunnel to gain access to the company network.
Exam tip
A VPN should always set up a full tunnel. No other form of tunneling, such as split tunneling, should be used.
We are going to look at different types of remote support, and the 'go to' version of secure remote access is Secure Shell (SSH). We will start by looking at SSH:
Example: Using a tool such as OpenSSH, the ssh-keygen -t RSA command generates a public and private RSA key pair on the administrator's desktop. The next step is to use the ssh-copy-id command to log in to the server and copy the public key across. This is added to the list of authorized key files on the server. While copying, the administrator may be asked to provide their credentials. If you are connecting to a host for the first time, you will get the following message:
Number of key(s) added:1
Now try logging into the machine, with ssh 'username@<ip address>' and check to make sure that only the key(s) you wanted is added.
If an administrator is logging in for the first time, he will use the ssh-root@server command.
We are going to look at secure network architecture and we will begin by looking at network appliances, starting with software-defined networks.
Traditional networks route packets via a hardware router and are decentralized. However, in today's networks, more and more people are using virtualization, including cloud providers. A Software-Defined Network (SDN) is where packets are routed through a controller rather than traditional routers, which improves performance.
Securing networks and protecting them is vital to protecting a company's assets. We use different zones and topologies, network separation and segmentation, and install firewalls to prevent unauthorized access to the network.
First of all, let's look at the different zones and topologies. There are three main zones: LAN, WAN, and screened subnet:
Example: A store sells designer sneakers at $230. However, the shop's owner purchases them from the manufacturer by placing orders on the extranet server. Access to the extranet web server is via a unique username and password, and the price the shop purchases the sneakers at is $125, allowing for a profit of $105. On the intranet, the web server has the manufacturing price of the sneakers, which are made in China, for a mere $5 a pair:
Figure 7.18 – Network zones
From this information, you should ask yourself three simple questions:
You can see why data in a LAN needs to be secure and not freely available to the general public.
Cybercrime is rife and is the largest growing criminal industry. In today's world, most businesses are interconnected and use the internet. Maintaining the security and integrity of data, including research and development, is paramount. We need to be able to isolate, segment, or segregate our network, both physically and virtually. Let's look at the options we have:
Example 1: The US Department of Defense has two distinct networks:
The Secret Internet Protocol Router Network (SIPRNet), where classified data, such as top secret or secret documentation, is accessed, and the Non-classified Internet Protocol Router Network (NIPRNet), where unclassified data is held. These two private networks have air gaps between them so that a desktop from the NIPRNet cannot access the SIPRNet, or vice versa.
Example 2: In a finance department, there is one computer that would be used to make electronic payments, such as Bankers' Automated Clearing System (BACS) or Clearing House Automated Payments System (CHAPS) transfers, and this machine would not be accessible by everyone in that finance department. Therefore, it would be isolated from the other departmental machines. This is also an example of an air gap.
Figure 7.19 – Two VLANs
A VLAN is created by using the software on the switch where you can bond a number of ports to work together as a separate logical network. If you look at Figure 7.19, you can see that port numbers 1-4 have been used to create a VLAN for the IT department, and then ports 20-24 have been used to create another VLAN for the finance department. Although both of these departments are on an internal device, creating the VLANs isolates them from other VLANs and the company's network. An important factor is that a VLAN tag is set up so that when traffic arrives at the switch, it knows where to send it.
Next, we will look at intrusion prevention systems.
An Intrusion Prevention Systems (IPS) protects the network against attacks. There are of two types. The first type is the Network Intrusion Prevention System (NIPS), which can only operate on your network and cannot work inside a host. The second is called the Host Intrusion Prevention System (HIPS), and it operates inside a host machine and cannot operate on the network.
An NIPS is an internal network device whose role is to prevent access to the network, and it is placed on the perimeter of your network behind your firewall. Think of NIPS as John Wick with a big gun whose job it is to shoot the bad guys; he is your network protection.
The Intrusion-Detection System (IDS) is the same as the IPS. There is the HIDS, which only works on a host, and the NIDS, which only works on the network. Think of the IDS as Sherlock Holmes, the famous detective. His job is to find different traffic patterns on the network and then inform John Wick, the NIPS, who will then remove them from the network.
Exam tip
NIPS has the capability to detect as well as protect if there are no NIDS on your network. To protect a virtual machine from attack, you will install an HIPS.
There are three modes of detection used by the NIPS/NIDS. For the purpose of the exam, you must know them thoroughly:
Anomaly-based NIPS/NIDS detect new patterns and are much more efficient than signature-based, systems which can only work with known variants.
There are different modes of operation for the sensors of the NIPS/NIDS:
When sensors are placed inside the network, they can only detect traffic once it is inside your network and has passed through your firewall. If you wish to detect attacks before they come into your network, the sensor must be placed on the network external to the firewall.
A sensor/collector can be a device, tap, or firewall log whose purpose is to alert the NIDS of any changes in traffic patterns within the network. If you place your first sensor on the internet side of your network, it will scan all of the traffic from the internet.
When we use analytics (how we analyze the data) to examine the information provided, it is based on rules that are set inside the IPS/IDS. However, no system is foolproof. They try their best but sometimes provide outcomes that are different to those expected. There are two different types:
Exam tip
A false positive is a false alarm; however, a false negative doesn't detect anything while you are being attacked.
If you have a Windows desktop or laptop and you go away on holiday for 2-3 weeks, when you come back, your device may need multiple updates.
After a remote client has authenticated, network access control (NAC) checks that the device being used is fully patched. See Figure 7.20:
Figure 7.20 – NAC
When the user is authenticated, the Health Authority (HAuth) checks against the registry of the client device to ensure that it is fully patched. A fully patched machine is deemed compliant and allowed access to the LAN. In the preceding diagram, the bottom laptop is compliant. If the device is not fully patched, it is deemed non-compliant and is redirected to a boundary network, which could also be known as a quarantine network. The components of NAC are as follows:
a. Permanent: The agent is installed on the host.
b. Dissolvable: A dissolvable agent is known as temporary and agentless and is installed for a single use.
The most common form of name resolution is hostname resolution. It is a database of hostnames and the IP addresses that they are allocated.
Domain Name System (DNS) is a hierarchical naming system that takes a hostname and resolves it to an IP address. This means that I don't need to know the actual IP address. of a website to visit it If I want to go to the Microsoft website, I know that I need to enter www.microsoft.com in my web browser and it will take me there. If I have a user called Ian in a domain called ianneil501.com, the hostname portion would be Ian and the Fully-Qualified Domain Name (FQDN) would be ian.ianneil501.com. Records in the DNS database are as follows:
Example: A user would like to visit the website of http://ianneil501.com. To get there, they would enter www.ianneil501.com in their web browser as per Figure 7.21. The hostname resolution follows a strict process:
Figure 7.21 – Hostname resolution
In Figure 7.21, the hostname resolution adopts a strict process and takes the first entry for that hostname, irrespective of whether it is right or wrong—this is a pitfall of the process. Let's look at this process, starting with the DNS cache:
In the preceding example, the DNS cache is empty, so it would move onto the host file located on the local computer. If you need to view the DNS cache, you would run the ipconfig /displaydns command, and if you wanted to clear the DNS cache, you would run the ipconfig /flushdns command.
When DNS resolution occurs, the first place that is checked is the DNS cache on the local machine. After that, it goes to the hosts file and then onto the DNS server. DNS poisoning is the process of putting bad entries into the DNS cache, diverting requests to a fraudulent website that has been made to look like the legitimate website (see Figure 7.22):
Figure 7.22 – DNS poisoning
If we look at Figure 7.22, Computer A has already visited the legitimate website, called Web 1, and its proper IP address of 1.1.1.1 has been placed in its DNS cache. When DNS resolution is performed, the DNS cache is searched first, followed by the hosts file, followed by the internal DNS server.
The attacker has now deleted the entry for Web 1 and inserted their entry for Web 1 with an IP address of 2.2.2.2. Now, when the user enters the www.web1.com URL, the only entry in the DNS cache is Web 1 2.2.2.2 and the user is diverted to a website that looks like the legitimate website. When they enter their card details to make a purchase, their account is emptied.
To prevent someone from gaining access to DNS records, DNSSEC was introduced to protect the DNS traffic. Each DNS record is digitally signed, creating an RRSIG record to protect against attacks, assuring you that they are valid, and that their integrity has been maintained.
Exam tip
DNSSEC produces an RRSIG record for each host.
Command-line tools are used every day by security professionals for network discovery and reconnaissance. Therefore, for the Security+ exam, you must be familiar with them, and so I have provided a screenshot for many of them. We are going to see when we would use each of them in turn:
Figure 7.23 – Ping
Figure 7.24 – Continuous ping
Figure 7.25 – Tracert
Figure 7.26 – Pathping
Figure 7.27 – Netstat
Exam tip
Netstat shows the established and listening port, but if you reboot the computer, the established connections disappear.
Figure 7.28 – Nslookup
Figure 7.29 – Dig
Figure 7.30 – ARP cache
The ipconfig /displaydns command is run in the following screenshot, and it shows the DNS cache on a computer:
Figure 7.32 – Clearing the DNS cache
tcpdump -i eth0 shows information on the first Ethernet adapter, as shown in the following screenshot:
Figure 7.33 – tcpdump
Figure 7.34 – Netcat
Figure 7.35 – Angry IP
Example: curl -s -I 192.168.24.21 will then fetch the HTTP headers and the output might look like this:
HTTP/1.1 200 OK
Date: Fri 16 Oct 2020 17:30:12 GMT
Server Apache/2.2.8 (Ubuntu) DAV/2
X-Powered-By PHP/5.2.4-2ubuntu5.24
Content-Type: text/html
Example: I want to search for the email addresses of a domain called mydomain.com, with a maximum search of 500 entries, and I want to have my source for searching as the google search engine. I would run the following syntax:
theharvester -d mydomain.com -l 500 -b google
Figure 7.36 – HIDS output
Figure 7.37 – Quarantined viruses
Figure 7.38 – System file checker
a. Concatenate (Cat): The cat command in Linux can be used to create files, view files, and also concatenate a number of files into another file. To create a new file called sportsfile, we use the following syntax:
cat > sportsfile
You can also concatenate the contents of three files and combine them in an output file using the following syntax:
cat file1.txt file2.txt file3.txt | sort > samplefile.txt
b. Head: The most important file in Linux is the /var/log/messages file, which shows system events such as a shutdown and reboot. We can use the head command to check the top 10 messages from that log using the following syntax:
head /var/log/messages -n 10
c. Tail: We can use the tail command to view the last 10 messages in the /var/log/messages log file using the following syntax:
tail /var/log/messages -n 10
d. Grep: This command is used to search text and log files for specific values. For example, if we wanted to search a file called telephone numbers for the number 236237, we would use the following syntax:
grep -f 236237 telephonenumbers.txt
e. If we want to search a whole directory for the word project, we can use the following syntax:
grep -r project
f. chmod: This command is used to change the permission level, for example:
chmod 766
Where the owner has rwx, the group has rw- and the others have rw-.
g. Logger: You can use logger to add a message to the local system log file or to a remote syslog server. We want the name of the local machine and a message of today we found a phishing attack to be added to the syslog server whose IP address is 1.1.1.1 at end of the /var/log/syslog file using the following syntax:
logger -n 1.1.1.1 'hostname' today we found a phishing attack
Example: Someone within the company is not working as they should be and has been surfing the web, and the manager has called you in as the security administrator to gather evidence. You decide that a protocol analyzer or packet sniffer is the best tool for tracking the information. You run a Wireshark session and capture visits to the NFL website. When you analyze the trace, you notice that the request is using the HTTP GET verb. This is the request for a page on www.nfl.com. In the following screenshot, we are looking at an article entitled Josh Hobbs and Mike Glennon drawing trade interest. The URL is https://www.nfl.com/news/josh-dobbs-mike-glennon-drawing-trade-interest-0ap3000000952209:
Figure 7.39 – Protocol analyzer
A protocol analyzer can also be referred to as a packet sniffer in the CompTIA Security+ exam.
Exploitation framework tools, such as the open source Metasploit Framework, can develop and execute exploit code against a remote target computer. This can be used to harden your IT systems before they are attacked. They use information from the National Vulnerability Database, that is comprised of Common Vulnerabilities and Exposures (CVE) and uses the Common Vulnerability Scoring System (CVSS), to show the level of severity of each of the vulnerabilities.
A forensics team may need to use tools to copy data or check the hash values to prove to the judge that the data has not been tampered with during the investigation. When a criminal's laptop arrives at the police station, the first thing a forensics team will do is to take a system image or a computer or a forensic copy of a removal drive. Let's look at some of the tools to begin with by cloning a disk:
In an SCSI environment, the first disk is known as /dev/sda, the second as/dev/sdb, and so on. If the first disk has two partitions, these will be sda1 and sda2.
The if command represents the input file and the of command represents the output file.
dd if = /dev/sda of = /dev/sdb
dd if=/dev/sda of=~/sdadisk.img
dd if=sdadisk.img of=/dev/sdb.
dcfldd if=/dev/sdb2 of=/media/disk/test_image.dd hash=md5, sha1 hashlog=/media/disk/hashlog.txt
Everyone using the TCP/IP protocol for connectivity and every device has a unique IP address. In this section, we are going to look at the differences between the two types of IP addresses: IP version 4 and IP version 6.
There are public addresses that you can lease, and private addresses that are free but can only be used internally. If you have a banger car, you can drive it around a private piece of land all day long, but as soon as you put it on a public road without any insurance, if you were caught by the police, they would impound the car. Private IP addresses can operate internally, but the routers on the internet will drop any private IP packets.
There are three private IP address ranges:
Each IP version 4 client needs an IP address and a subnet mask whose job is to determine whether the packet delivery is local or remote. If the packet is for a remote address, then the client needs to be configured with a default gateway – the router interface on the LAN. If the client does not have a default gateway, then it is restricted to communicating on the local network.
The subnet mask is used to divide IP addresses into blocks so that different subnets have their own IP address range. When using classful IP addressing, the default masks are as follows:
Class A: 255.0.0.0
Class B: 255.255.0.0
Class C: 255.255.255.0
The subnet mask can also tell whether the packet delivery is local or remote. If it is remote, it will send the packet to the default gateway.
With IP version 4 addresses, there are 4 octets each of 8 bits, making it 32-bit IP addressing. CIDR masks can be used in the same way as the subnet mask to divide networks into IP address ranges. If I have a CIDR mask of /24, that means I then have 24 bits for the network and 8 bits for hosts:
Cloud providers allocate CIDR blocks in both IP version 4 and IP version 6 for each different Virtual Private Clouds (VPC).
The automatic way of allocating IP addresses is to use a server called the Dynamic Host Configuration Protocol (DHCP) server. This is a server with a database of IP addresses that can allocate to requesting hosts. There is a four-stage process, and it is known as D-O-R-A.
IP version 4 observes the following steps to perform the lease:
A DHCP client will not always obtain an IP address because maybe it cannot connect to the DHCP server. Another reason is that the address pool is exhausted. In these cases, the local machine will allocate an Automated Private IP Address (APIPA), starting with 169.254.x.x. This is an excellent aid to troubleshooting, as it lets the network engineer know that the client cannot contact the DHCP server.
There are many reasons why this happens, so let's look at the DHCP process:
Figure 7.40 – DHCP process across subnets
If the DHCP client is on another subnet, it can cause some problems:
Exam tip
If you cannot get an IP address from a DHCP server, this is because of network connectivity or resource exhaustion. When this happens, you will get an APIPA address starting with 169.254.x.x.
IP version 6 addresses are in a colon-hexadecimal format and comprise 8 blocks of 4 digits, making it a 128-bit address. The first 64 bits from the left-hand side are the routing or network portion, and the last 64 bits will be used for the host. Using IP version 6 reduces that number of entries into a routing table and this will make routing more efficient. However, on the downside, companies would have to convert all of their network applications and devices to be IP version 6-compatible.
There are different address ranges, and the main four points are as follows:
Example 1: We have an IP version 6 address of 2001:ABCD:0000:0000:0000:0000:1230:0ABC that we want to simplify. In this case, we will remove only the leading zeros:
2001:ABCD:0000:0000:0000:0000:1230:0ABC
2001:ABCD::1230:ABC
You will notice that we have replaced four blocks of zeros with double colons. We need to count the remaining blocks and, since there are four, we know that four blocks are missing.
Example 2: We have an IP version 6 address of 2001:ABCD:0000:0000:ABCD:0000:1230:0ABC that we want to simplify. In this case, we will remove only the leading zeros:
2001:ABCD:0000:0000:ABCD:0000:1230:0ABC
2001:ABCD::ABCD:0:1230:ABC
You will notice that this is trickier as there are blocks of zeros in two places, but we replace the first blocks of zeros with the double colons, and then, if we have further blocks of zeros, we replace each of these with :0:. In the example, we count only six blocks, so we know we have only two blocks of zeros.
Exam tip
Cloud providers allocate IP addresses for VPC by using different CIDR blocks for each network.
Now it's time to check your knowledge. Answer the questions, and then check your answers, which can be found in the Assessments section at the end of the book:
Over the past 5 years, there has been an increased use of wireless devices, both in the workplace and in hotels and coffee shops. The demand is so high that if your hotel does not provide Wi-Fi, then your bookings may decrease. As wireless has increased, so have the mobile devices, ranging from IoT, smart phones, and tablets to laptops. Today's security professionals need to have a good fundamental knowledge of security for both mobile devices and wireless solutions. This is what we will be covering in this chapter.
In this chapter, we will cover the following topics:
Wireless communication is now part of everyday life, from using 4G/5G on your mobile phone to access the internet or using Bluetooth to listen to your music as you walk down the road. However, if your wireless device is insecure, this can lead to data loss and maybe someone stealing funds from your bank account.
Let's first look at the different types of wireless networks:
Exam tip
A guest wireless network gives visitors access to the internet and could also be used by employees at lunchtime.
In the following section, we will look at WAP controllers.
Whether you are a home or a business user, you will need to set up your WAP in order to provide an IP address and internet connectivity to the devices using the WAP. Let's look at the two different types of controllers.
Exam tip
Without the use of encryption, there are some simple methods for securing access to your WAP:
Figure 8.1 – SSID enabled
Figure 8.2 – MAC filtering
In the following section, we will look at the different wireless bands.
There are different wireless standards, and we need to know the limitations of each. The band selection is also known as the frequency:
In the Security+ exam, the wireless channels go from channel 1 up to channel 11, and the device placement should be as follows:
We place the device's channels as far apart as possible to prevent the overlap of adjacent channels and interference. Wireless devices can suffer interference from elevators, baby monitors, cordless phones, metal racking, and load-bearing walls, to name but a few things.
WAP uses antennas to operate. There are three main antenna types:
One of the security implications of having a wireless network is to ensure that wireless networks will have coverage. This will give access to resources in a timely fashion without the coverage being extended outside of the companies' boundaries where it could be hacked.
Let's look at options that need to be considered before setting up a wireless network:
Figure 8.3 – Heat map
The heat map could also show green as poor coverage and it can help you identify where you have channel overlap.
Exam tip
If my newly installed WLAN is not fully functional, we may not have carried out the site survey properly or placed it incorrectly.
If we want to set up a wireless network for the general public to access without any encryption or any passwords, we could use Open System Authentication, but users would have to access the WAP at their own risk.
Wireless networks need to be secure and they can be secured by using encryption. Let's look at the types of wireless encryption.
Let's look at the different types of WPA 2:
Let's now look at WPA3 and its features, which replaced WPA2. At the time of writing, this is 15 years old.
Wi-Fi Protected Access Version 3 (WPA 3) was released in 2018 to address the weaknesses in WPA2 and uses a much stronger 256-bit Galois/Counter Mode Protocol (GCMP-256) for encryption. There are two versions, WPA3-Personal for home users, and WPA3-Enterprise for corporate users.
Let's look at some of the features of WPA3:
When you join the wireless network at the airport, you are connected to the free Wi-Fi, yet you cannot access the internet right away. It redirects you to a captive portal so that you can provide additional validation of who you are, normally through an email address or your Facebook or Google account information. You could also need to agree to the terms of their AUP. You can also accept to pay their premium subscription, thereby giving you a faster connection.
There are three main types of attacks relating to wireless networks:
There are numerous wireless authentication protocols:
a. Protected Extensible Authentication Protocol (PEAP): The PEAP is a version of EAP that encapsulated the EAP data and made it more secure for WLANs.
b. EAP-FAST: EAP-FAST, developed by Cisco, is used in wireless networks and point-to-point connections to perform session authentication. It replaced LEAP, which was insecure.
c. EAP-TLS: EAP-TLS is the most secure version of wireless authentication as it requires a X509 certification from its local CA installed on the client that is stored in the Trusted Platform Module (TPM) chip.
d. EAP-TTLS: EAP-TTLS uses two phases; the first is to set up a secure session with the server, utilizing certificates that are seamless to the client, which will then use a protocol such as MS-CHAP to complete the session. It is designed to connect older legacy systems.
Example: Two different universities decide to have a joint venture for finance and mathematics. They decide on using federation services for authentication so that when the students go to the third-party university and connect to the network through a WAP, this makes it a RADIUS federation. If they connected via an Ethernet cable, it would just be federation services.
In the following section, we will look at how we can securely deploy mobile devices.
Mobile devices are now used in our everyday lives and they pose problems for security teams as they are very portable and extremely easy to steal. In this section, we will look at some of the problems that you may face as a security professional. But first, let's look at mobile device management.
Mobile Device Management (MDM) sets policies for the installation and protection of mobile devices. For example, they may prevent the camera from being used on mobile devices and could also prevent a smartphone from being able to send/receive texts. You can set password policies on the password length, or remote wipe for lost or stolen devices, where the device is rolled back to the factory setup.
Bring Your Own Device (BYOD) is where an employee is encouraged to bring in their own device so that they can use it for work. Although this may save the employer money, it also has its pitfalls. BYOD needs two policies to be effective, but I will break the onboarding/offboarding into separate parts:
Example 1: A new employee has brought their mobile device into the company and within 30 minutes, one of the file servers has caught a virus. The security team tracks the source of the virus to the mobile device. How could this have been avoided? It's simple – the onboarding policy has not been carried out properly; if it had been, the virus would have been removed before connecting the device.
Example 2: John, a member of the sales team, who has been using his tablet for BYOD, has just won the National Lottery and decided to leave the company. During the offboarding phase, he was asked to reset his tablet to its factory settings to ensure that the data was deleted. John has refused to do this as he has personal data and music files on the tablet. The company have called the local police and accused him of stealing their data. John informed the police officer that this is his personal device with his own data, and he produced a copy of the sales receipt for the device. The police officer was powerless and could do nothing further. The company would have to take John to court and prove that the data was theirs. John is now traveling the world, leaving the company with a further headache; they cannot take John to court because they don't know which country he is in. If they had used storage segmentation and asked John for the storage card on exit, this scenario would never have occurred.
Choose Your Own Device (CYOD) avoids problems of ownership because the company has a variety of tablets, phones, and laptops. When a new employee comes along, they merely choose one of these devices from a list. When they leave the company and offboard, the devices are taken from them as they belong to the company. The acceptable use policy would state that the devices can only store company data as they are corporate-owned devices.
Corporate-Owned Personally-Enabled (COPE) is where the company purchases the device, such as a tablet, phone, or laptop, and allows the employee to use it for personal use. This is a much better solution for the company than BYOD. However, the IT team can limit what applications run on the devices as they are corporate-owned. Some countries' laws prohibit the wiping of personal devices. With COPE, however, since the company owns the device, they have every right to wipe it remotely if it is lost or stolen.
Exam tip
With CYOD or COPE, there will only be a limited choice of devices and this is much easier to support than BYOD, which could involve thousands of devices.
In the following section, we will look at different mobile device connection methods.
There are various different connection methods for mobile devices:
Exam tip
NFC is used for contactless payments within 4 cm of the card.
Figure 8.4 – SATCOM
Let's now move on to the different types of mobile device concepts and the role each of them plays.
Mobile Device Management (MDM) is a management console that allows security administrators to control, secure, and enforce policies on smartphones, tablets, and other endpoint devices. You can prevent smartphones from sending text messages or using the camera. It sets up the authentication method, including the length of the password. Let's look at the different aspects of MDM:
An example of this is Microsoft Intune. Details can be found at https://www.microsoft.com/en-gb/microsoft-365/enterprise-mobility-security/microsoft-intune.
Mobile devices are very small and very easy to steal. Therefore, we need to look at how we can prevent someone from accessing the data even if the device's host has been lost or stolen. We will first look at screen locks and passwords, followed by biometrics, and then context-aware authentication:
Example: An iPhone gives you six attempts to log in, and after that it will disable the login for 1 minute. If you then fail on the seventh attempt, it locks you out for a further 2 minutes. If you continue to input the wrong PIN, you get locked out for 60 minutes on your ninth attempt.
Exam tip
Mobile devices need screen locks and strong passwords to protect them.
Example: Mary, a financial director based in London, is using context-aware authentication. For the authentication to be successful, the user must be Mary, the time has to be between 9 a.m. and 5 p.m., Monday to Friday, and she needs to be in London. If not all of these criteria are met, then authentication fails.
Corporate devices need to be controlled so that employees cannot simply connect to an app store and download every application that they wish. For example, allowing games on corporate devices would have an adverse impact on productivity and security. We are now going to look at the downloads, applications, and content managers, and their characteristics, followed by remote wipe:
Exam tip
Geo-tracking will tell you the location of a stolen device.
Mobile devices are very easy to lose or steal, so we must have some way of finding those devices; we are going to look at the differences between geofencing, geolocation, and using cable locks:
Exam tip
Geofencing prevents mobile devices from being removed from the company's premises.
To protect the data that is stored on a device, we should implement Full Device Encryption (FDE). The device requires a Trusted Platform Module (TPM) chip to store the encryption keys.
Example: A salesperson has just received a new company laptop where the operating system has been hardened. The device uses Bitlocker encryption, where the whole drive is encrypted to protect the data stored on the hard drive. In the Security+ exam, this is known as FDE.
Keeping your company data separate from personal data on a BYOD is very important. Let's look at two options for doing this:
Example: If you are using your own smartphone as a BYOD but your company has asked you to separate the business data that they give you from your personal data, for example, pictures of family and friends that you already have stored on the phone, the easiest way to do this is to install an SD card on the phone where you will store the company data. This makes offboarding your data pretty easy; all you would have to do is eject the SD card and surrender it to the company.
There are many different tools and features that roll out with mobile devices. As a security professional, you need to know the security threats that they pose. Some of the features that a security professional should be well-versed in are mentioned here:
Exam tip
Rooting and jailbreaking remove the vendor restrictions on a mobile device to allow unsupported software to be installed.
Now it's time to check your knowledge. Answer the questions, and then check your answers, which can be found in the Assessments section at the end of the book:
In this section, you will learn to identify the different types of malware and virus and take the appropriate action to protect against them. You will look at the importance of policies and regulatory frameworks in reducing the risk. Next, you will learn about secure coding techniques, quality control, and testing. Finally, you will discover incident response procedures and learn how to apply mitigation techniques or controls to secure an environment.
This section comprises the following chapters:
As a security professional, you must be fully aware of the different types of attacks that your company could be subjected to. The different attacks range from different types of malware that employees may come across to social engineering, where the attacker will contact them directly and try to exploit their personal vulnerability. We will then look at the different types of threat actors and their characteristics. And finally, we will look at password exploitation and other advanced attacks.
In this chapter, we will cover the following topics:
Let's start by looking at virus and malware attacks.
In today's world, viruses and malware are rife; there are many different variants, and we will look at each of these in turn:
Tip
Remember, the rule of thumb is that if you have to part with money, then it is ransomware.
An example of this is shown in Figure 9.1:
Figure 9.1 – Ransomware
Example: The Nimda virus was released in September 2001. Its name is admin spelt backward and refers to a file called admin.dll. When it runs, it continues to propagate itself. The main target of Nimda was Microsoft's IIS web server and file servers. It would create a Denial-of-Service (DoS) attack and its job was to simply slow networks down to a halt. When it accessed a server, it would run down mapped network drives of everyone connected to the server, and then it rewrote the system files so that they had an EML extension. Once it had totally destroyed a machine, a huge white envelope appeared on the desktop. This meant that it would no longer function.
Trojan.BHO.H File C:\WINDOWS\SysWOW64\fezegepo.dll
Trojan.Vundo File C:\WINDOWS\system32\fezegepo.dll
Example: Gh0st RAT is a RAT that was originally designed by threat actors in China. A user clicks on a link and a dropper program called server.exe installs Gh0st RAT with svchost.dll, which then allows the attacker to take control of the computer. It can then log keystrokes, download and upload files, and run webcam and microphone feeds.
We will look at social engineering attacks in the next section.
Social engineering attacks are based on the exploitation of someone's personality; they could be referred to as hacking the human. There are various types of social engineering attacks. Let's look at each of them in turn, starting with phishing/spear phishing:
Figure 9.2 – Phishing attack
Example: You get a text message that your Facebook account needs to be validated. When you click on the link, you are asked for your password or the website downloads a virus.
Example: Someone pretends to be from Netflix saying that there has been suspicious activity on your account. They ask you to confirm whether or not it was you and could you please confirm your account details.
Example: The hacker wants to know how many motion sensors there are in one part of the building. The attacker says to the security guard, "I bet the security in this building is pretty good. I bet you have about four motion detectors in the lobby", and the security guard says, "You are very close, but we actually have seven".
Exam tip
Eliciting information is where the attacker says a statement in the hope that you will correct them and provide them with accurate information.
a. Opening bank accounts, taking out loans, or getting credit cards
b. Obtaining passports or driving licenses
c. Ordering goods in your name
d. Taking over your existing accounts
e. Taking out mobile phone contracts
a. Social Media: All over the world, social media has been used to influence voters in forthcoming elections. Facebook and Twitter have been used extensively with many election campaigns.
b. Hybrid Warfare: Normally carried out by state actors to influence the balance of power in a country by using military, political, economic, or civil means, and conceivably running a campaign to spread disinformation. Refer to the following diagram:
Figure 9.3 – Hybrid warfare
Example 1: In May 2014, CyberBerkut, a Russian hacker group, exploited cyber vulnerabilities in the network of the Ukrainian National Election Commission to undermine the credibility of the elections.
Example 2: The deep sectarian, ethnic, and economic divisions in Syrian society were exploited by both Iran and ISIS with a view to achieving their strategic objectives.
From: Ian Neil (CEO)
To: All Staff
Subject: UPDATE YOUR FINANCIAL DETAILS
Dear All,
The finance team are moving to a new finance application and have told me that personnel within the company have not updated their bank details. You need to click on this link and update your details: http://update.details.wehackyou.com.
Failure to do so by the end of play today will result in disciplinary action against those individuals that do not comply.
Kind Regards,
Ian Neil
Chief Executive Officer
Tip
An email from your CEO, a high-level executive, or the HR manager telling you to fill in a form or click on a link, is an authority attack.
Tip
Allowing a fireman into your server room is an urgency attack.
Example: A personal secretary receives a phone call from someone claiming to be in charge of domain names while the CEO is at a conference. The caller tells the secretary that they are calling to renew the domain name and that it must be done in the next 30 minutes or else the company will lose the domain name. They state that the renewal will be $45. The secretary knows that the company website and email addresses cannot operate without the domain name. This attack is effective because the secretary cannot disturb the CEO during an important meeting, so they purchase the domain name renewal. It may well be 3-4 months before the renewal date.
We will look at threat actors in the next section.
A threat actor is another name for a hacker or attacker who is likely to attack your company; they all have different attributes. They will investigate your company from the outside, looking for details on social media and search engines. Let's now look at threat actor types:
a. Black Hat: The black hat hacker has no information because they are not authorized by the company.
b. Gray Hat: The gray hat hacker is provided with limited information from the company as they may be participating in the bug bounty program.
c. White Hat: The white hat hacker is a former black hat hacker who is employed by the company to test applications for flaws and vulnerabilities before its release. They have all of the information that they need, including the source code.
Tip
A competitor is a threat actor who will try and steal a company's trade secrets or sabotage your production systems to gain a competitive edge in the marketplace.
In this section, we discussed the different types of threat actors. Now, let's look at the different types of advanced attacks in the next section.
In this section, we will be looking at advanced attacks, starting with types of password attacks.
The two most common password attacks are dictionary attacks and brute-force attacks. Let's look at these in turn:
Which of the following passwords would a dictionary attack crack?
a. elasticity
b. el@ST1city
c. fred123
d. blueberry
It would crack elasticity and blueberry, but el@ST1city features numbers and characters not in a dictionary. Therefore, it will fail. It wouldn't crack fred123 either as it contains numbers.
a. Online mode: The attacker must use the same login interface as the user's application.
b. Offline mode: The attacker steals the password file first, and then tries to crack each user's password offline. They cannot be detected and so have unlimited attempts at cracking the password.
Which of the following passwords would a brute-force attack crack?
a. elasticity@abc123
b. el@ST1city
c. fred12redrafg
d. blueberryicecream12345
It would crack them all – eventually.
Tip
Setting account lockout at a low value will prevent a brute-force attack.
a. Using the most common passwords
b. A low number of characters (fewer than seven characters)
c. Simple passwords such as 123456 or abcdef
d. Default passwords for devices
These are very easy to guess using a password cracker. Password is the most common password to be used. The following list shows some of the most common passwords over the years:
- 123456
- Password
- 123456789
- qwerty
- letmein
- iloveyou
- abc123
- football
In this section, we will look at different types of physical attacks. We will first look at USB devices and cables, followed by card cloning, also known as skimming:
a. Tainted Training Data for Machine Learning: Instead of the machine being programmed to carry out work, it can be tainted and taught to ignore certain attacks. Machine learning is used here to program the device not to detect some forms of attack.
b. Security of Machine Learning Algorithms: Machine learning can help the cybersecurity team identify patterns and thereby help identify attacks. They can analyze malicious patterns in encrypted data to help identify attacks, rather than decrypt the data.
On-path attacks are interception attacks where the attacker places themselves between two entities, normally a web browser and a web server. They normally modify the communications to either collect information or impersonate the other entity. The following section lists different types of on-path attacks:
Figure 9.4 – On-path – MITM
Example: A hacker is imitating the conversations of two parties to gain access to funds. The attacker intercepts a public key and with that, can put in their own credentials to trick the people on both sides into believing that they are talking to each other in a secure environment. While online shopping from home or a mobile device, victims think that they are buying goods from a legitimate source, but instead their money is being stolen.
Exam tip
A POODLE attack is an MITM downgrade attack using SSL 3.0 in CBC mode.
In this section, we will look at different types of network attacks:
Tip
A DoS network attack comes from a single IP address, whereas a DDoS network attack emanates from multiple IP addresses.
a. Network: A DDoS network attack is where a botnet is set up to flood a victim's system with an enormous amount of traffic so that it is taken down. Refer to Figure 9.5. If a stateful firewall were to be used to prevent a network DDoS attack, it would prevent the traffic from entering your network:
Figure 9.5 – DDoS attack
b. Application: This is where the DDoS tries to flood a particular application, and the number of packets is known as requests per second (rps). This is where specially crafted packets are sent to the application so that it cannot cope with the volume.
c. OT: This can be the hardware or software that controls devices used in video surveillance. In the past, these devices worked in an air-gapped environment as CCTV, but nowadays there are interconnected video surveillance solutions and these are now being targeted by a DDoS attack so that they fail and leave a company vulnerable.
Exam tip
Kerberos prevents replay attacks as it uses updated sequence numbers and timestamps.
Figure 9.6 – Zero-day exploit
It takes two or more days for a solution to prevent it. No anti-virus program, SIEM, NIDS, or NIPS will be able to stop a zero-day attack. This is because vendors don't have the ability to detect it that day itself. Vendors will be waiting for an update.
The only way to detect a zero-day exploit is when you have previously taken a baseline of your computer, and then you can check the changes since the baseline; this will identify a zero-day exploit. If you have no previous baseline, then you will not detect it.
Important note
A zero-day virus cannot be traced or discovered by any security device, as it may take up to 5 days before a patch or update is released. It can be detected by comparing baselines.
Example: John, an administrator, leaves his laptop unattended when his boss urgently asks him to go into their office. Mary, who is a normal user, goes into John's laptop, clicks on the shortcut to the directory service, and makes herself a member of the administrator's group. When John comes back, he does not realize anything has happened, as his laptop seems the same as when he left it.
Programming attacks use scripts or overload the characters or integers expected. Let's look at these in turn:
print "<html>"
print "Latest comment:" print database.latestComment print "</html>"
The attacker could alter the comment to have HTML tags for a script, as follows:
<html>
Latest comment:
<script> (Javascript code is placed here) </script>
</html>
When the user loads the page into the browser, it will now launch the JavaScript and then the attack will be successful. Here are some examples using JavaScript.
Example 1: JavaScript – Creating a Money Variable: JavaScript can use the var command, which means variable. An example would be to set a variable for money, and then allocate it a value of 300.00. As you can see, we used var for the variable and then use money as its label. In the next row, we use the money variable and give it a value of 300.00:
<script type="text/javascript">
<!——
var money; money = 300.00;
//-->
</script>
Example 2: JavaScript – Setting the Day of the Month: We will use JavaScript to set the day of the month. You will notice the JavaScript code between <html> tags: <script> to start the script and <\script> to end the script. The var command is very common in JavaScript:
<!DOCTYPE html>
<html>
<body>
<p>Click the button to display the date after changing the day of the month. </p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var d = new Date(); d.setDate (15);
document.getElementById("demo").innerHTML = d;
}
</script>
</body>
</html>
An XSS attack can be identified by looking for the var command and for a variable with <html> tags <script> and </script>. Scripts with var are likely to be JavaScript. This is a very popular exam topic.
Example: Equivalent XML Payload:
<?xmlversion="1.0"encoding="UTF-8"?><root><query>a'%3E%3Cscript%3Ealert(‚123')%3C/script%3E</query></root>8
If you look at line two from '%3E%3Cscript% through to script%3E<, data is inserted into the XML script similar to XSS. You can prevent an XML injection attack by using input validation.
Figure 9.7 – Buffer overflow
In the example here, we are going to set up a buffer to be a maximum of 64 characters, and then we are going to use strcpy to copy strings of data. A string of data is used to represent a number of text characters. The problem that arises is that strcpy cannot limit the size of characters being copied. In the example here, if the string of data is longer than 64 characters, then a buffer overflow will occur:
int fun (char data [256]) {
int I
char tmp [64]; strcpy (tmp, data);
}
The buffer overflow could cause a memory leak, where the application consumes all available memory.
A stored procedure is a pre-written SQL script that might ask you for a list of all customers who have purchased items over $1,000 in the last 7 days. When this is written, it is saved as a stored procedure called ABC. When I run the ABC stored procedure, it will give me all of the information I require, and an attacker won't be able to modify the script inside. This is the best way to stop a SQL injection attack. The other way is to use input validation, which is not as effective.
Exam tip
strcpy could create a buffer overflow as it cannot limit the amount of characters.
Example: In the following example, a query is constructed to validate a user's credentials for the purpose of logging in:
String filter = "(&(USER = " + user_name + ") (PASSWORD = " + user_password + "))";
To log in, a user would provide their user credentials and this filter above would be used to validate your credentials. An attacker would create specially crafted input for the variable username, such as Ian Neil (&), and any value for the password. The finished query will become (&(USER = ianneil)(&))(PASSWORD = pass)).
Only the first portion of this query is processed by the LDAP server (&(USER = ianneil)(&), which always evaluates to true, allowing the attacker to gain access to the system without needing to provide valid user credentials.
If I want to see what services are running on a computer, I can run the get-service command, which will show me all of the services running. See Figure 9.8:
Figure 9.8 – The get-service command
If we only want to find the Windows services, we can use the get-service -name win* command. See Figure 9.9:
Figure 9.9 – The filter get-service command
We can filter the first command by inserting a pipe and then using a where statement. We can use the following commands: -lt for less than; -gt for greater than; -eq for equals; and -ne for not equals.
In the next example, if we want to see the services that are stopped, we could use get-service | Where-object {$_. status -eq stopped}, instead of using -eq stopped, you could use -ne running. The $ is a variable, and then we use the Status column header. Refer to the following Figure 9.10:
Figure 9.10 – Services stopped
PowerShell has many different modules that can be used for remote access as well as for use by attackers. These attacks have been on the increase. It has been used for the following attacks:
a. Injecting malware directly into memory
b. Used to run macros
c. Lateral movement attacks
Please read the following article on these attacks: https://securityintelligence.com/an-increase-in-powershell-attacks-observations-from-ibm-x-force-iris/.
We should ensure that we use the following command to stop someone running a PowerShell command on a server or desktop:
Set-ExecutionPolicy Restricted
We should use the latest version of PowerShell as this is the most secure.
In this section, we will look at attacks where a hacker hijacks either a device, cookie, or piece of software. Let's look at these in turn:
Tip
Input validation could prevent SQL injection, buffer overflow, and integer overflow attacks.
Tip
A stored procedure could prevent a SQL injection attack as it is a pre-written script that is executed and cannot be altered when executed.
Device drivers allow an operating system such as Windows to talk to hardware devices such as printers. Sophisticated attackers may dive deep into device drivers and manipulate them so that they undermine the security on your computer. They could also take control of the audio and video of the computer, stop your anti-virus software from running, or your data could be exposed to someone else. There are two main driver manipulation techniques, and these are as follows:
There are a variety of cryptographic attacks, and we will now look at these in turn. You need to thoroughly know these for the Security+ exam. We will start with the birthday attack and finish with key stretching:
Now it's time to check your knowledge. Answer the questions, and then check your answers, which can be found in the Assessments section at the end of the book:
As a security professional, you need to understand that identifying and managing risks can help keep your company environment safe from various types of attacks. We will look at the importance of policies and regulatory frameworks for reducing the risk of successful attacks. We will look at different threats, vulnerabilities, and the roles that different threat actors play.
This chapter is broken down into the following sections:
Risk is the probability that an event will happen – risk can also bring profit. For example, if you place a bet in roulette at a casino, then you could win money. It is, however, more likely that risk will result in financial loss. Companies will adopt a risk management strategy to reduce the risk they are exposed to; however, they may not be able to eliminate risk completely. In IT, new technology comes out every day and poses new risks to businesses, and therefore risk management is ever-evolving. The main components of risk management are assets, risks, threats, and vulnerabilities. Let's look at each of these, starting with assets:
For example, if you had 1 kg of trash and you placed it outside your front door at night, you would be certain that in the morning it would still be there; however, if the asset was 1 kg of 24-carat gold and you left it outside your house at night, it would probably not be there in the morning.
Risk management processes and concepts need to be in place so that we can reduce the attack surface that's available for attackers. The first stage in risk assessment is to identify and classify the assets. How expensive or important the assets are will determine the amount that will be spent on protecting them. Let's now look at the different risk types.
Exam Tip
The first stage in risk assessment is to classify the asset. The classification will tell us how an asset is to be treated and handled.
Risk types can be broken down into six categories. Let's now look at each of these in turn, starting with external risks:
For example, say a contract is awarded to us to build a row of houses. Water, gas, electricity, and roads may be contracted out to other agencies. As you can see, many different parties would be involved, and we could be attacked by anyone working in the supply chain.
Exam Tip
IP theft can lose you patents, secrets, and copyright material, and these can be taken to a country where you cannot mount a legal challenge. From there, they can manufacture your products.
In a risk treatment, the risk owner, who is the best person to classify an asset, looks at each individual risk; they (the risk owner) will then decide what action is best to reduce the risk to the company. The risk will then be included in the company's risk register so that it can be monitored. New risks should be recorded in the risk register immediately and the risk register should be reviewed every 6 months, because risks change as frequently as technology changes. Let's look at risk management strategies, starting with risk acceptance:
Risk analysis is the use of techniques to analyze risks so that you have an overall picture of the risks that your company may face. Let's look at each of these in turn, starting with the risk register:
Exam Tip
Insurance of any kind, whether it is for a car or for cybersecurity, is risk transference.
Figure 10.1 – Risk Register
a. Qualitative Risk Analysis: A qualitative risk analysis is where the risk is identified as a high, medium, or low risk.
b. Quantitative Risk Analysis: A quantitative risk analysis is where you look at the high qualitative risks and give them a numeric value so that you can associate them with a cost for the risk. This is calculated by multiplying the probability with the impact of the risk. Sometimes probability is known as likelihood.
For example, say we are going to grade a risk and its probability from 1 to 9, with 1 being low and 9 being high. If we look at the impact of losing a mail server, the qualitative risk analysis would say that it is high, but the probability of losing it would be low:
Figure 10.2 – Quantitative Risk
Figure 10.3 – Risk Matrix
The areas in red would cause severe damage to the company, where pink would still mean a high risk. The lighter pink and green would mean a medium risk. The darker green and the very dark green would mean a low risk. This is a good way to present a risk analysis to senior management.
Exam Tip
Qualitative risk is about the severity of the risk – is it high, medium, or low?Quantitative risk is about a numerical value gained by multiplying probability (likelihood) with impact.
The following concepts can be used to calculate the actual loss of equipment throughout the year and may be used to determine whether we need to take out additional insurance against the loss of equipment:
For example, say a multinational corporation loses 300 laptops annually, and these laptops are valued at $850; would they take out an insurance policy to cover the costs of replacement if the insurance premiums were $21,250 monthly? The answer is no, because the cost of replacing them is the same as the cost of the insurance. They would take a risk on not losing 300 laptops next year. The calculations are as follows:
a. ALE: SLE x ARO
b. ALE: $850 x 300 = $225,000
c. Monthly cost: $225,000/12 = $21,250
Exam Tip
ALE = SLE x ARO ARO = ALE/SLE SLE = ALE/ARO
There are different types of disasters that pose a risk to companies. Let's look at these, starting with environmental threats:
Business Impact Analysis (BIA) is the process of looking into disasters and calculating the loss of sales, regulatory fines, and the purchase of new equipment. BIA looks at financial loss following a disaster. Let's look at the concepts of BIA, starting with the single point of failure:
Exam Tip
The most important factor that an auditor will look at when assessing BIA is the single point of failure. They will also take the RPO and RTO into consideration.
For example, what would be the mission-essential functions of a newspaper, and what would be its critical systems? Newspapers generate revenue not only via sales but more importantly by selling advertisement space in the paper. The mission-essential function would be the program that creates the advertisements, and the critical systems would be the server that the program resides upon, the database for processing payments, and the systems used to print the newspapers.
Exam Tip
When purchasing a new system, the MTBF measures the reliability of the system. You might also seek a system with a low MTTR, so that it is reliable and can be repaired quickly.
In the next section, we will look at threat actors, vectors, and intelligence concepts.
Let's look at threat actors, vectors, and intelligence concepts, starting with threat assessments.
A threat assessment helps a company classify its assets and then looks at the vulnerabilities of that asset. It will look at all of the threats the company may face, the probability of the threat happening, and the potential loss should the threat be successful.
A threat actor is another name for a hacker or attacker who is likely to attack your company; they all have different attributes. They will investigate your company from the outside, looking for details on social media and search engines. Security companies provide an open source intelligence test and inform you of your vulnerabilities in terms of threat actors. Let's now look at threat actor types:
a. Black Hat: The black hat hacker has no information because they are not authorized by the company.
b. Gray Hat: The gray hat hacker is provided with limited information from the company as they might be participating in a bug bounty program.
c. White Hat: The white hat hacker is a former black hat hacker who is employed by a company to test applications for flaws and vulnerabilities before their release. They have all of the information that they need, including the source code.
Exam Tip
A gray hat hacker may not be employed by you but depends on a bug bounty program to get paid.
Exam Tip
Shadow IT is where someone plugs an unauthorized device into your network, leaving it vulnerable to attack. Criminal syndicates will threaten you and their motivation is financial gain.
There are a few different types of attack vectors. Let's look at each of them in turn, starting with direct access:
Exam Tip
The supply chain attack has become a major threat to companies. External agencies performing maintenance on the supply chain may even place an exploit when carrying out said maintenance.
Over the past 5 years, there has been an increase in cybercrime, and because of that, several threat intelligence sources have emerged so that companies can protect themselves against attacks. Let's look at some of these resources; we will start with Open Source Intelligence (OSINT):
Figure 10.4 – Critical Infrastructure Sectors
The United States Department of Homeland Security wrote a critical infrastructure guide in October 2016. This was a threat assessment framework to help protect critical industry sectors.
Exam Tip
The dark web depends on TOR software to avoid detection.
For example, say one of the participants in the AIS shares information on the malicious IP addresses and email addresses of an attacker; this will help prevent a second attack by this attacker as the awareness of the other participants about the attacker and their methods has been increased.
Figure 10.5 – Bitdefender Threat Map
Exam Tip
STIX and TAXII distribute CTI updates over HTTP.
There are various other threat intelligence sources; let's look at some of them, starting first with vendor websites:
In the next section, we will look at the importance of policies for organizational security.
Security policies are a good way to protect your environment against cybercriminals. Not having policies in place would mean that we would leave ourselves at the mercy of cybercriminals. Let's look at the policies that help keep our environments safe, starting with personnel policies, as personnel may be subjected to many types of social engineering attacks.
Most cybercrime vulnerabilities relate to social engineering attacks carried out on employees. Therefore, we will put many policies in place to reduce the attack surface. Let's look at some of these policies, starting with on-boarding:
For example, members of an IT team can make any changes they like to a network firewall; this represents a huge risk to the network. An auditor could recommend that each time a firewall rule is changed, it needs to be authorized by the Change Advisory Board, and that two people should be responsible for checking the changes to the firewall. With two people being responsible for making the changes, any errors should be eliminated. This is an example of the separation of duties.
As another example, when I first got married, my wife and I opened a joint bank account that only my wages were paid into. My wife spent money from this account even though she had her own account. I paid in; my wife withdrew – a true separation of duties. Nowadays, I have my own account!
Exam Tip
Separation of duties can prevent financial fraud as whoever collects money cannot pay it out. This prevents someone from completing a whole transaction.
Exam Tip
If you install pirated software onto a company computer, then you are in violation of the AUP.
Due to the increase in the number and sophistication of different types of attacks, companies must provide a diverse range of user security training and regular seminars. User training is vital to reducing the risk of being exploited by cybercriminals, and we are going to look at different types of user training here. Let's start by looking at Capture the Flag:
Exam Tip
Capture the Flag exercises help to train both red and blue team members, as each time they capture the flag, they move up one level in their training.
Companies use a vast amount of third parties either for software or to provide a service, and since we do not control those third parties, we need to carry out risk assessments that look at the way we interact with those companies. Let's look at each of the interactions in turn, starting with supply chain management:
Exam Tip
An SLA lays down how quickly a supplier should respond to an incident such as a failed printer. It is measured using metrics.
Data is one of the most important assets that a company has, and it is important to ensure that policies are in place to ensure that it is classified, handled, stored, and disposed of in accordance with regulations such as GDPR or HIPAA. Let's look at the data aspects we need to consider, starting with classification:
It is vital that credentials are kept safe to prevent unauthorized access to systems; therefore, it is vital that policies are in place to prevent vulnerabilities and unauthorized access. Let's look at the policies we need to put in place, starting with personnel-related policies:
Organizational policies need to be in place to deal with changes in technology, risk, or security to maintain a secure working environment. Let's look at some of these policies, starting with change management:
Regulations, standards, and legislation are put in place to ensure that compliance has been achieved, and most are legally enforceable. From these regulations and standards, we derive our policies to ensure compliance and prevent crime; if companies do not abide by these regulations, they will be fined. There are other industry frameworks that are only best practice and are not legally enforceable, but vendors will not support any product that has not been set up according to such best practices. In this section, we are going to look at regulations, standards, and legislation followed by a look at key frameworks, benchmarks, and secure configuration guides. Let's start with General Data Protection Regulation (GDPR):
Exam Tip
GDPR deals with the handing of data while maintaining the privacy and rights of an individual.
Several key frameworks have been designed, mostly by not-for-profit organizations, to help reduce the risk created by ever-increasing cybercrime levels and the adoption of the cloud by companies. Let's start with Center for Internet Security (CIS):
a. 27001 – Security techniques for Information Security Management Systems: https://www.iso.org/standard/54534.html.
b. 27002 – Code of Practice for Information Security Controls. The aim of this standard is to improve the management of information: https://www.iso.org/standard/54533.html.
c. 27701 – An extension to 27001/27002 for Privacy Information Management – Requirements and Guidelines: https://www.iso.org/standard/71670.html.
d. 31000 – About managing risk for company organizations and management in general; information can be found on its website: https://www.iso.org/standard/65694.html.
a. SOC Type 2 Reports: These are reports on the internal controls of the security, processing, and handling of users' data to ensure that it is kept confidential and that privacy is maintained. There are two types: type 1 is to do with the suitability of the design of controls, and type 2 is to do with the effectiveness of the controls.
The distribution of these reports is restricted as they provide lots of details on the company that has been audited.
b. SOC Type 3 Reports: These are general-use reports, and they are less detailed and so can be freely distributed. More information on SOC reports can be found at https://www.aicpa.org/interestareas/frc/assuranceadvisoryservices/serviceorganization-smanagement.html.
Exam Tip
SSAE is an audit standard for SOC reports. SOC type 1 reports measure your security, and SOC type 2 reports are about data management. These have restricted access and are mandatory for every cloud provider.
a. CSA CCM: This is designed to provide a guide on security principles for cloud vendors and potential cloud customers to assess the overall risk of a cloud provider: https://cloudsecurityalliance.org/research/working-groups/cloud-controls-matrix/.
b. CSA Reference Architecture: The Reference Architecture contains best security practices for CSPs. Its website states its mission as being "to promote research, development, and education of best practice and methodologies around a reference architecture for a secure and trusted cloud." It looks at different topics, such as security and risk, presentation services, application services, information services, IT Operation and Support (ITOS), and Business Operation and Support Services (BOSS).
Exam Tip
CSA CCM helps potential customers measure the overall risk of a CSP.
Every company faces the challenge of protecting its servers and computers from an ever-increasing amount of cybersecurity threats. There are many different types of servers, such as web servers, email servers, and database servers, and each of them has different configurations and services, so the baselines are different for each type of server. Vendors and manufacturers will provide platform/vendor guides so that their products can be configured as per their own best practices, ensuring that they perform as best they can. Let's look at various types, starting with platform-specific guides:
In the next section, we will look at the different privacy and sensitive data concepts.
It is vital that private and sensitive data is labeled and handled correctly, as doing otherwise would adversely affect a company's reputation and could lead to a regulatory fine. Let's look at concepts relating to data, starting with the consequences of a data breach.
If a company suffers a data breach, there can be several repercussions. Let's look at some of them, starting with reputation damage:
Exam Tip
If a company suffers a data breach and that data is used for identity theft, the company could be sued by the individual affected.
There are national laws and regulations that are laid down on how data breaches should be reported and who they should be reported to. A data breach is normally where data has been stolen or there has been an accidental breach; this means that the policies currently in place are not effective. If someone accesses a file or database server, we need to find the account used so that we can remove it to prevent further breaches. Let's now look at the action we need to take once a breach has been discovered, starting with escalation:
There are various types of data and we need to have an appreciation of each type and its characteristics; let's start with different data classifications.
The first stage of risk management is the classification of the asset, which determines how we handle, access, store, and destroy data. We are now going to look at the different classifications of data so that we know how to handle the data. Let's start by looking at public data:
Exam Tip
When a government contract ends, the contractor needs to dispose of government data in accordance with the original contract. They cannot just destroy the data.
We are going to look at techniques that enhance the storage of PII information, making it impossible to be stolen. Let's look at these techniques, starting with data minimization:
**** **** **** 3545
Exam Tip
Data masking is when only partial data is left in a data field. For example, a credit card could be shown as **** **** **** 1234. Tokenization is better than encryption as it replaces data with a token that is connected to a remote location where the original data is held.
There are different roles and responsibilities for dealing with data, ranging from the owners who create the data to those that store and control it. Let's look at each of these roles and what areas they are responsible for. We will start with data owners:
Exam Tip
The DPO ensures that data is handled, stored, used, and disposed of according to national law and regulatory frameworks.
The information life cycle comprises the life cycle of data, from data creation to data destruction; see Figure 6:
Figure 10.6 – Information life cycle
Let's look at each of these stages:
Exam Tip
The data owner classifies data, the steward labels it, the custodian stores and backs it up, and the administrator gives access to it.
This is where you evaluate the risk of collecting large amounts of data and look at tools that would reduce that risk.
For example, say you are working in a hospital, where consent needs to be provided by patients to allow doctors to operate on them. You might collect 1,000 of these forms a week and might decide to use a SharePoint server to store them so that they are centrally located and not lost through clerical errors.
This is an agreement between the collector of data and the individual whose data is being collected; it outlines the purpose that the data is collected for.
Obtaining consent means that if I allow you to collect my personal data, you can only use it for the purpose that it was intended.
For example, say I have given you my email and my personal cell phone number to set up my account so that I can purchase goods. It is then illegal to send those details to your marketing department so that they can target me.
Now it's time to check your knowledge. Answer the questions, then check your answers, found in the Assessment section at the end of the book:
One of the main tasks that the cybersecurity team deals with is the management of applications used within the company, to ensure that they have no vulnerabilities and have been hardened. In this chapter, you will learn to deploy and manage applications effectively and select the appropriate development life cycle. You will learn about secure coding techniques, quality control, and testing. Let's begin by looking at implementing hosts and ensuring that they are secure before rolling them out.
In this chapter, we will cover the following topics:
Within an organization, we use laptops, desktops, servers, and mobile devices such as tablets that can be used externally in unsecured environments such as hotels and airports. We therefore need to harden endpoints and their Operating System (OS) to ensure that they are as secure as we can possibly make them. There are various aspects that we need to look at, depending on the functionality of the device and where it is used. Let's look at all of the aspects that we need to take into consideration, starting with a system booting up.
When hosts are booting up, we need to ensure that they are protected as much as possible. We rely on them for being able to boot up securely before they are fully operational, and all of their protections are in place. We will now look at the UEFI and boot attestation:
Example: Your company is a multinational company that requires an OS that can be used by both desktops and laptops and can provide both secure booting and attestation. You would most likely use Microsoft Windows 10, which can provide secure booting and BitLocker to carry out system attestation.
It is important that the endpoints are protected from an attack. Let's look at each of the endpoint protections in turn, starting with anti-virus:
Example: I have a file called new business contacts and I want to ensure that it cannot be stolen. It does not have a pattern match. However, I can use the DLP solution, select the file, and a pattern match will be assigned to the file. When someone tries to email the file, it will be blocked by the DLP system.
Figure 11.1 – Host-based firewall
The firewall acts as an additional layer of protection to the computer by controlling the traffic coming into it.
It is very important that we keep databases safe as they may contain PII information about individuals or credit card information. Let's look at what we can do to keep our database as secure as possible, starting with stored procedures:
Figure 11.2 – Tokenization
If you need to employ the service of a payment gateway, these are the e-commerce application service providers that can process direct debit or credit card payments. Two examples are Visa and Barclaycard, and information pertaining to these can be found here. There are many more providers besides:
- Visa: Information can be found at https://www.visa.co.uk/dam/VCOM/regional/na/us/partner-with-us/documents/token-service%20-provider-product-factsheet-from-visa.pdf.
- Barclaycard: Information can be found at https://www.barclaycard.co.uk/business/news-and-insights/tokenisation.
These payment gateway providers store the credit card details securely and generate a random token. Tokenization can help companies be Payment Card Industry Data Security Standard (PCI DSS)-compliant. They have the ability to replace protected health information, e-PHI, Non-Public Personal Information (NPPI), and ensure that health organizations are in compliance with Health Insurance Portability and Accountability Act (HIPAA) regulations.
Figure 11.3 – Hash index
In the preceding diagram, you can see that the hash value is stored in a data bucket, which is a memory location where records are stored. A data bucket is known as a unit of storage.
In today's world, we are all interconnected and use an ever-increasing amount of applications that can be targeted by attackers. Therefore, as a cybersecurity professional, we need to ensure that we harden these applications to prevent attacks. Let's look at the types of protection that we can put in place, starting with input validation:
Example: Have you ever completed a web form quickly and maybe put your zip code into another field? This results in an error in the form and it fails to process the submit button. The web form then has a list at the top, in red, of the incorrect parameters, with a red star next to each of them. Once you have corrected the entries, the form will accept them and submit.
<session-config>
<cookie-config>
<secure> 'true' </secure>
</cookie-config>
</secure-config>
function requestHandler(req, res) {
res.setHeader('Strict-Transport-Security','max-age=31536000; includeSubDomains; preload');
}
This means that HSTS ensures that the browser will ignore all HTTP connections.
We need to ensure that we harden both the devices running the applications and the applications themselves against an ever-increasing cybercrime threat. In this section, we are going to look at different types of hardening techniques, which, when they are implemented, will keep our devices and applications safe. We are going to start by looking at open ports and services:
Figure 11.4 – Netstat
Applications use a service to run and when you first install an OS, there are a lot of services running by default, some of which you may never use. For example, the telnet service will allow remote access to your computer in clear text, so we would need to disable those services. In a Windows computer, if you type services.msc in the run command, you can see which services are running and then just disable those that you are not using.
Figure 11.5 – Registry
The Docker tool allows you to isolate applications into a separate space called containers. The registry can now be isolated into a separate container, making it more secure.
FDE is used on computer systems to encrypt the whole hard drive as it holds data at rest. FDE uses X509 certificates to encrypt the full disk, but needs a TPM chip on the motherboard to store the keys. Microsoft's BitLocker is an example of this, and if it thinks the drive has been tampered with it, locks the drive and a 48-character key is then required to unlock it. Let's look at aspects of FDE, starting with the TPM chip:
The OPAL storage specification is the industry standard for self-encrypting drives. This is a hardware solution. Therefore, they outperform other encryptions as they are software solutions. They don't have the same vulnerabilities as software and therefore are more secure. The SEDs are Solid State Drives (SSDs) and are purchased already set to encrypt data at rest. The encryption keys are stored on the hard drive controller. Therefore, they are immune to a cold boot attack and are compatible with all OSes. The drives have a security mechanism allowing the drive to be locked in order to prevent unauthorized users from accessing the data. Only the computer user and the vendor can decrypt the drives.
Hardware Security Module (HSM)
An HSM is similar to TPM chips, except that it is removable. The Key Escrow uses an HSM to store and manage private keys, but smaller ones can be used for computers.
Sandboxing is where we can install an application in a virtual machine environment isolated from our network so that we can patch, test, and ensure that it is secure before putting it into a production environment. In a Linux environment, this is known as Chroot Jail.
Now that we have an idea of host and application security, let's understand the security implications of embedded and specialist systems.
An embedded system has its own software built into the device hardware. Some are programmable and some are not. Embedded systems are found in consumer products used for health monitoring, automotive, medical, and household products. Some examples follow in the next section.
IoT comprises small devices, such as ATMs, small robots, and wearable technologies, that can use an IP address and connect to internet-capable devices. We must ensure that we change the default usernames and passwords for these devices to prevent someone from hacking them. From a security point of view, supporting IoT items is a nightmare because of the diversity of the devices. Most users of IoT devices are not aware that they have default username and passwords, and so they are vulnerable to attack. You should change the default settings immediately after purchase. Let's look at some of these devices in the following diagram:
Figure 11.6 – IoT devices
The devices shown in the preceding diagram have been explained in detail in the following points:
Example: An Alexa stores all conversations that take place in its vicinity. Therefore, if you don't delete the voice history on a regular basis, an attacker can gain access to those conversations. To prevent this, you should say Alexa, delete what I say today. You need to watch where you place the device as it has a camera. You can turn the camera off by simply saying, Alexa, turn off the camera. You change the wake-up word in case you have a friend called Alexis and this also prevents other people giving commands to your device.
Figure 11.7 – A smart building system
As these devices are connected to the main control unit and all have an internet capability, they could be attacked from the internet. The attacker could tamper with the systems so that it provides false positive information, or they could launch a denial-of-service attack. They could use selective forwarding that would filter out messages or they could eavesdrop and carry out man-in-the-middle attacks.
RTOS are more reliable than desktops or servers as they are normally used for real-time applications since they process data immediately, thereby preventing buffering and buffer overflows. If a task or process does not complete within a certain time, the process will fail. RTOS could be used for military systems or where robots are being used in production to ensure that processes are completed quickly.
MFPs are an all-in-one device consisting of at least two of the following – printer, scanner, fax, or photocopier. The weakness of each of these is that they all have a network interface and could be attacked through that interface. Any default setting or passwords must be changed.
Surveillance systems can check cameras, speak to those on the camera, automate lights, and set alarms, and this can all be done from a smart phone. Surveillance systems now tend to be networked and are used for security of a business or your home and the footage can be used in evidence for legal purposes. They could be attacked from the internet and the attacker could steal the information that they contain. Therefore, the default username and passwords must be changed immediately.
Example 1: You are at work when the surveillance systems alerts you that someone has rung your door bell. You can now see the person who has picked up a parcel from your porch, you can shout at them to drop the parcel, and can send the footage to the police.
Example 2: The police are dealing with a riot. The police are dressed in riot gear and there are police vehicles equipped with camera systems. These will be used to record the event in real time. The footage can be sent back to an incident control room, in real time, where the police can see whether any of the rioters are on their internal police systems.
An (SoC) is an integrated circuit on a microchip that connects the functionality of a computer on a small microchip. Life support devices use SoC.
HVAC is very important for server rooms and for server farms that are located in data centers as they regulate the temperature by using hot and cold aisles, as shown in Figure 11.8:
Figure 11.8 – HVAC
The cold aisle is where the cold air comes in and that faces the front of the servers. The rear of the servers face one another. They push hot air out into the hot aisles, and this is allowed to escape through a chimney. This way, the temperature can be regulated, and this ensures the availability of the IT systems. Critical systems could fail if the temperature gets too hot, and the security teams will know whether offices are occupied according to the HVAC system usage register.
Specialized devices are more expensive bespoke devices that provide a unique purpose. For example, there are man overboard devices that detect someone falling into the water. We are going to look at these in the following points, starting with medical devices:
Figure 11.9 – Defibrillator
An embedded system is both hardware and software combined in a single device. Some such devices will have updates, but some have no update mechanism, making them vulnerable to attack. Examples of embedded systems include the following:
Example: If you have built your own microcontroller and you want to change it, but it does not have enough processing power to change it, then you are stuck. However, if you had built your processor inside an FPGA and you had sufficient resources, you could increase your processor power and that would allow you to perhaps put in a finite impulse response (FIR) filter between two pins and achieve your aim.
SCADA systems are automated control systems that can be used for water, oil, or gas refineries, or industrial and manufacturing facilities, where there are multiple phases of production. The architecture of a SCADA system can be seen in the following diagram:
Figure 11.10 – SCADA system
The security of the SCADA system is paramount. A network firewall prevents unauthorized access to the network, and then an NIPS is used as an additional layer. If further segmentation is required, VLANs could be used internally. This is no different to protecting a corporate network.
Example: Iran had a uranium enrichment facility that was a SCADA system, but it suffered an attack from the Stuxnet virus that attacked the centrifuges. The Stuxnet virus was discovered in 2007, but many believe it could have been there in 2005. Uranium enrichment is an example of using the SCADA methodology in a production environment.
Several types of control systems and instrumentation used for industrial process control are generally encompassed as the Industrial Control System (ICS). They are used for water, telecommunications, health, chemicals and pharmaceuticals, water supply, and treatment.
In today's world, there are various different connection methods for mobile devices, and we need to be able to identify the best selection for a given scenario. Let's look at these by first looking at cellular:
There are many constraints associated with embedded devices, due to their size. Most devices, such as Zigbee and Arduino, are battery-operated and even cell phones such as the iPhone have a battery that lasts about 7 hours. Most embedded systems have a smaller processor. They may be 8- or 16-bit, compared to a laptop, which has a 64-bit processor. They are therefore restricted in terms of their compute time. Other limitations are as follows:
Now that we have understood the security implications, we will look at secure application development, deployment, and automation in the next section.
There are two main models of the Software Development Life Cycle (SDLC), the first being an older version that is called Waterfall, where each stage is completed before the next stage commences. This is known as a cascade model. The newer, faster, and more flexible model is called Agile, which is similar to Scrum, where several stages of development can occur simultaneously. Agile is customer focused, where each part of the project is called a sprint, so if I have three stages, then there are three sprints and the project concludes when all the sprints are complete.
Before applications can be used in a production environment, we must ensure that they are as secure as possible so that we mitigate the risk of being attacked by an outside agency. We are going to look at these in turn, starting with the software diversity.
A compiler takes code and converts it into binary machine language. Software diversity is where a developer can take code and obfuscate it with a compiler so that an attacker cannot reverse engineer the code, allowing them to find vulnerabilities in the code. An Application Programming Interface (API) is created to allow systems to be programmed to talk to one another. Using a complier to obfuscate API methods will make it harder for attackers to reverse engineer the code.
Elasticity is the process of increasing resources when they are needed. The cloud is a pay-as-you-go model where your resources can be increased at the drop of a hat.
This is where an application can take more users than originally planned with little or no increase in cost.
When we are designing an application, we need a secure environment for development, testing, and staging before moving the application into production. This environment is shown in Figure 11.11:
Figure 11.11 – Environment
Let's look at each of these in turn:
Automation is where processes are set up to carry out tasks automatically with the need for human intervention, using either scripts or a graphical user interface. Scripts are precompiled instructions that are automatically launched when the script is activated. This leads to fewer errors than carrying out tasks manually, where humans make mistakes. Let's now look at other aspects of the SDLC:
The concept of application provisioning is the life cycle of designing, preparing, creating, and managing the applications, and ensuring that there are no flaws in the security before release. Deprovisioning is when the application meets its end of life and we remove the application and either migrate the data to the new system or dispose of it, ensuring that we do so in accordance with local regulations, such as HIPAA, GDPR, or the Data Protection Act 1998.
We measure application integrity to ensure that the application performs as it should do and conforms to data industry standards and regulations. Before the application is written, a third-party coding expert should carry out regression testing to ensure that there are no flaws in the code. The application itself is measured to ensure that it does what it is meant to do. We test that the security features are safe and that no vulnerabilities exist. Anything found out of the ordinary should be addressed quickly.
Although most people who work in networking or security are not application developers, CompTIA has introduced secure coding into the syllabus. This section needs to be understood, so it is written in the simplest format we could think of:
Example: Two guys buy tickets for the Super Bowl final, and when they arrive at the stadium, they find that they have been allocated the same seat. That's a great profit for those selling the ticket, but a bad deal for those purchasing the ticket.
a. Is it alphabetical?
b. Is it numerical?
c. Is it a certain format, such as a zip code or telephone number?
d. What are the minimum and maximum numbers of characters?
If the data is not input in the correct format, it will not be accepted. Input validation on web pages lists errors in red at the top of the page with the incorrect entries. This prevents SQL injection, integer overflow, and buffer overflow attacks.
Example 1: Exclusive OR (XOR) is a binary operand from Boolean algebra. This operand will compare two bits and will produce one bit in return, two bits that are equal to 0, and two bits that are equal to 1. This is the opposite to binary. For example, we are going to use the word tread in ASCII format and then we are going to insert a key using the word hello so that we can complete an XOR operation. Refer to the following diagram:
Figure 11.12 – XOR
From the preceding XOR, you can see that the data has been obscured.
Example 2: ROT 13 is a variation of the Caesar cipher. As there are 26 letters in the alphabet, we are rotating the letters 13 times. The key to ROT 13 would be as follows:
Figure 11.13 – ROT 13
When receiving the message GVZR SBE GRN, we would apply ROT 13, but instead of going forward 13 places to decipher, we would simply go back 13 places, and the message would be TIME FOR TEA.
Example: Microsoft has the Windows 10 SDK, which provides the latest headers, libraries, metadata, and tools for building Windows 10 apps. Further information can be found at https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/.
a. Server-Side – Known As the Backend: Server-side validation is where the user's input is sent to the server, where it is validated and then the response is sent back to the client. Programming languages such as C# and .NET are server-side.
b. Client-Side – Known As the Frontend: Client-side validation is done locally on the client so there is no network traffic. Script languages such as JavaScript, VBScript, or HTML5 attributes are used for this type of validation on the browser side.
Client-side validation is much quicker, but an attacker can exploit the JavaScript and bypass the client side. Server-side validation takes much longer and can use input validation to check that the input is valid and to stop the attacker in their tracks.
The Open Web Application Security Project (OWASP) is an international not-for-profit organization that provides an up-to-date list of the most recent web application security concerns. They rely on donations to exist. Their mission statement is to improve software security through open source initiatives and community education. They provide the following resources:
They run seminars all over the world for the security of web, cloud, mobile devices, applications, and software development and maintenance.
Now it's time to check your knowledge. Answer the questions, and then check your answers, which can be found in the Assessments section at the end of the book:
To protect businesses against disasters, it is vital that we have solid incident response plans and procedures. There are many different types of incidents a company will face, for example, dealing with a flood is totally different to dealing with the failure of a server's hardware. They will have many plans in place, one for each incident, and it is vital that employees know their role in the plan in order for it to be effective. The plan must be exercised at least on an annual basis to be effective. Let's look at each of these in turn, beginning with the incident response procedures.
This chapter will deal with incident response and will be divided into the following elements:
Before we start making incident response plans, we need to have a process in place, and the process we are going to use is as shown in Figure 12.1:
Figure 12.1 – Incident response process
The incident response process must be carried out in order, starting with stage 1, which is the preparation phase. Let's look at these stages in order:
Example: A domain controller is infected with a virus. The first stage is containment, where we take it off the network. The next stage is eradication, where we remove the virus and patch the server. The last stage is recovery, where the clean server is put back online. After the incident has been dealt with and we are back up and running, we carry out lessons learned, where we look at how the domain controller got the virus in the first place and prevent it from happening again.
There are three types of exercises that you can carry out to ensure that your company is ready for any disaster. These are structured walk-throughs, tabletop exercises, and simulations. Let's look at all three of them:
There have been different attack frameworks developed to help cybersecurity teams to better prepare themselves for cyber attacks. We are going to look at three different models, so let's start with the MITRE ATT&CK Framework.
Mitre is a US Government-sponsored company whose aim is to help prevent cyber attacks. They developed an online framework that can be used by the general public and they have many matrices. They give information about adversaries and their attack methods. They use the acronym ATT&CK to help you understand better the attack vectors used by the attackers. If you go on to the Mitre website (https://attack.mitre.org), you will find a huge spreadsheet that you can use to find information on adversaries, their attack methods, and how to mitigate these attacks. This aids everyone from cybersecurity teams to threat hunters, so let's look at each of these in turn. Let's look at the breakdown of the acronym:
More information on drive-by compromise can be found at the following link: https://attack.mitre.org/techniques/T1189/.
Lockhead Martin originally developed the kill chain, a military model to identify the steps an enemy would take to attack you. It was then adapted to become the cyber kill chain, a framework to aid cybersecurity teams in terms of becoming more aware of potential cyber attacks (https://www.lockheedmartin.com/en-us/capabilities/cyber/cyber-kill-chain.html). Refer to Figure 12.2:
Figure 12.2 – Cyber Kill Chain
The idea behind that was to give cybersecurity teams an awareness so that they could identify and prevent attacks at an early stage. For example, we could create a security awareness program, warning employees against phishing, and also to report unusual calls from outside agencies. The attacker might then be stopped at the reconnaissance phase.
This model is a framework for gathering intelligence on network intrusion attacks. This comprises four key elements: adversary, capabilities, infrastructure, and victims, and these are interconnected:
Figure 12.3 – Diamond Model of Intrusion Analysis
This model was used by the intelligence community until it was declassified in 2013. More information can be found at https://apps.dtic.mil/sti/pdfs/ADA586960.pdf. A breakdown of the preceding model follows:
Example: If we look at the Stuxnet virus, we know the capabilities were four zero-day viruses targeting the Siemens Industrial Control System (ICS). Secondly, we know that the infrastructure used was USB sticks, and that the victim was the Iran Nuclear Enrichment Facility. All of this information has been discovered a piece at a time and then when we have this information, we now search for an adversary. The attack is very sophisticated. Therefore, we can narrow down the search for an adversary to someone who is well funded and capable of this sophisticated attack. You can see from this example how we can narrow down who the adversary is. Siemens, China, India, the US, and Israel were all considered. The hardest part of the diamond is to find the adversary.
We can combine the Diamond model for every step of the kill chain to detect adversaries. We can also use the MITRE ATT&CK model to find other information in the Diamond model.
Let's look at other aspects that are important in terms of a successful incident response.
When we have an incident, there are five groups of stakeholders that we need to inform and manage. These are creditors, directors, employees, governmental bodies, and the shareholders who are the owners of the business. We notify the stakeholders and we remind them that their responsibility is to ensure that the press do not have knowledge of the incident as this could severely affect your company's reputation. Knowledge of the incident may be common knowledge maybe a month after it has been dealt with.
This is the medium for informing all stakeholders of the incident where we would use encryption such as PGP or S/MIME to ensure that the event does not become public knowledge. A list of contacts should be maintained that includes the government, police, customers, suppliers, and internal staff.
Disasters range from natural disasters, such as hurricanes and floods, to hardware failure, malicious insider attacks, and the accidental deletion of data. The main aim of a disaster recovery plan is getting the company back up and running so that it can generate income. We need to identify the most critical assets and ensure that they are up and running first. We will run disaster recovery exercises periodically to gain experience of executing the plan. As technology frequently changes, we need to update the disaster recovery plan to facilitate the changes.
This does what it says on the tin. Keep the business up and running no matter what disasters are on the horizon. We need to complete a business impact analysis to identify a single point of failure so that we can build in some redundancy. We should have vendor diversity built into our BCP. We need to focus on the Recovery Point Objective (RPO), so that we can identify how long we can operate without our data and the time in which we have to complete disaster recovery and return to an operational state. Let's look at the four phases of the BCP plan:
COOP was developed by the United States federal government. This was their version of a Business Continuity Plan (BCP). It looks at each type of disaster and puts processes in place for the government so that they can work with limited resources, providing critical services until the incident has been mitigated.
When an incident occurs, it is important to get an incident response team together to deal with the incident, which is made up of members in the following roles:
Each member of the incident response team needs to understand their roles and responsibilities within the team to make the team effective.
Retention Policies
We need to first of all classify the data that we may require following a disaster. We need to create a data retention policy for all PII and sensitive information as well as unclassified data. For legal and compliance reasons, you may need to keep certain data for different periods of time; for example, some financial data needs to be retained for 6 years, whereas medical data may need to be kept for 20-30 years, depending on the type. A data retention policy ensures that legal and compliance issues are addressed.
In the next section, we will learn how to utilize data sources to support investigations.
There are many different types of data sources that cybersecurity teams can utilize to gain more knowledge and a clear understanding of how much damage has been done and the extent of the incident. Let's look at the different types of data sources that we can search to support investigations, starting with a vulnerability scan output.
The vulnerability scanner can identify various vulnerabilities, such as missing patches, open ports, services that should not be running, and weak passwords. This will help you avoid attacks such as SQL injection, buffer overflows, denial of service, and other type of malicious attacks.
Security Information Event Management (SIEM) dashboards are very useful to the security operations centers as they provide information in real time. Let's look at the types of data that could be found on a SIEM dashboard, staring with sensors:
Log files play a massive part in providing evidence for investigations. There are many different types of log files. Let's look at each of these in turn and identify the type of information from each of these log files. We will start with network log files:
a. 100 series, request received; an example would be 102 processing request.
b. 200 series, successful login attempt.
c. 300 series, more action needed to complete the request.
d. 400 series, client-side error; an example would be 403, where you are forbidden access, or 404 file not found.
e. 500 series, server-side error, failure to carry out a request; examples would be 500 internal server error, 502 bad gateway, where an upstream proxy returns an invalid response, or 503 service is unavailable.
The following log managers perform the same basic functions. Let's look at each of them in turn:
Journald collects and stores log data in binary format, and journalctl is able to query and display these logs in a readable format. It is used in a Linux environment.
This is an open source log management tool that helps identify security risks in a Linux/Unix environment.
These can be used to understand your network traffic flow. They can monitor changes in traffic patterns and identify devices on your network that are causing bottlenecks and could detect broadcast storms and potential denial-of-service attacks.
This is data that provides information about other data. Let's look at the different types of metadata, starting with email:
Example: A German politician filed a lawsuit against T-Mobile for the release of his cell phone metadata that they had gathered from his phone. He received 35,830 records – 6 months' usage. He gave this data to ZEIT Online and they could identify his daily movements, phone calls, text messages, and internet usage.
The following products can be used for network monitoring. Let's look at this in turn, starting with NetFlow:
Example: IPFIX can be used to identify data traveling through a switch and this can be used for billing purposes. It can take IP Flow information and both format the data and forward it to a collector.
A protocol analyzer such as Wireshark can capture data traveling across the network. Law enforcement has been used to replay commands to network devices and allowed to capture and replay video traffic.
In the next section, we will learn to apply mitigation techniques or controls to secure an environment.
Should we find that we have a vulnerability, we need to take action to mitigate the risk, so let's look at some of the techniques or controls that we can use. We might have to reconfigure the endpoint security solutions. We are going to look at applications.
We can use application whitelisting where the approved applications are listed. This means that if an application is not listed, it cannot be launched. Some devices such as pf-sense have Allowed Lists.
We can blacklist applications that are deemed dangerous, such as Kali Linux. If it is on the blacklist, it is totally banned and cannot be placed on the whitelist. Some devices such as pf-sense firewall have Block Lists.
If we find a device has been infected with a virus, we can remove it from the network by quarantining it. We can also use Network Access Control (NAC) so that devices that are not patched or are vulnerable are placed in a quarantine network where a remediation server applies patches to the system before it is allowed back on to the network.
As new attacks emerge and new technologies are implemented, we may have to make some configuration changes to secure our environment. Let's look at devices, starting with a firewall:
We may have to air gap research and development endpoints to isolate them from the network to protect them against a network-based attack.
If the security team finds that an endpoint has been compromised and may be infected by a virus, they will contain it so as to stop the malware spreading.
We might have to use storage segmentation or containerization to keep personal and business data separate on a mobile device. We may have to segment devices that have become vulnerable, such as an unpatched printer where there are no updates.
Orchestrations are the process of running multiple automations to perform complex tasks. Automations are the process of scripting a single activity. These systems are used to collect threat-related data from multiple sources and use playbooks and runbooks. Let's look at each of these in turn:
In the next section, we will learn to implement cybersecurity resilience.
It is important that companies have redundancy or fault tolerance built in so that they are protected from cyber attacks.
Redundancy is the process of when one part of a system fails but we have the ability to keep the system running. It could also be referred to as fault tolerance. Let's begin by looking at the different types of redundancy that companies could deploy. We will start with disks and then move on to geographical dispersal.
There is a need for the disk setup on servers to provide redundancy, sometimes known as fault tolerance. In simple terms, this means that if one or more disks fail, the data is still available. There are different Redundant Array of Independent Disks (RAID) levels, so let's look at each of these in turn, starting with RAID 0:
Figure 12.4 – RAID 0
This is known as a stripe set, as the data is written across Disks 1-3 in 64 KB stripes. Should one disk fail, then all of the data will be lost, so RAID 0 does not provide fault tolerance or redundancy. The benefit of RAID 0 is its faster read access, so it may be used for the proxy server's cache.
Figure 12.5 – RAID 1
RAID 1 is fault tolerant, and so should Disk 1 fail, you would break the mirror and then activate Disk 2. At a later stage, we will add another disk and then re-establish the mirror set.
Figure 12.6 – RAID 5
Example: The following diagram (Figure 12.7) represents a RAID 5 set where we are using a mathematical equation to represent the disk set so that you can see the impact of losing one disk and then losing two disks:
Figure 12.7 – RAID 5 as a mathematical equation
Each of the disks has a numerical value. For example, if Disk 3 fails, the equation would be (7 +? = 10) and the answer would be 3. If we lose a second disk, Disk 1, the equation would then be (? + ? = 10) and you could not work it out. The same happens if you lose two disks; parity cannot recreate the missing data.
Figure 12.8 – RAID 6
A RAID 5 disk set can afford to lose one disk and the data will still be available as it has single parity. The good thing about a RAID 6 set is that it can lose two disks and still be redundant as it has double parity.
Figure 12.9 – RAID 10
From this diagram, you can see a RAID 1 on the left and then it is striped, meaning you could lose an entire dataset.
This practice has been adopted by the business community for years, but governmental bodies have been slower to adopt this practice. We use hot and warm sites that are in different regions and also use different power suppliers. Data is replicated between different regions within the same country to ensure that even if there is a natural disaster or power outage within one of the regions, they can still keep operating. As soon as records are created, they are replicated to the other hot sites chosen. This ensures that there is a redundant set of data and resiliency against disasters. Warm sites have their data delivered by courier. Cold sites cannot be used as they contain no data.
There is a need to make our network more resilient and, from the preceding disk multipath, you can see that when using a SAN, we use multiple paths between the host and the SAN storage. Let's now look at other types of network storage, starting with network card teaming:
Power is the most critical resource for any computer system and it is important that we have redundancy. Let's look at the different types, starting with the Uninterruptible Power Supply (UPS).
Replication is a method for the immediate transfer of data and virtual machines within a network. Let's first of all look at a Storage Area Network (SAN) and then virtual machines:
a. Host Bus Adapters (HBAs): The cheapest form of redundancy for a SAN is to use two HBAs with each node. This will give you two separate paths to them.
b. SAN Fabric: A SAN fabric is a collection of servers, storage, switches, and other devices. We could use two SAN fabrics, Fabric 1 and Fabric 2. These two fabrics are separate. We could have the SAN nodes connecting one HBA to Fabric 1 and the other HBA to Fabric 2 to provide redundancy.
In this chapter, we have looked at on-premises redundancy using RAID and we could also consider hosting a backup of our environment in the cloud. We could replicate data in the cloud so that if we have a disaster, we could switch quickly to the cloud. All we would need is internet connectivity.
Backing up our data has always been a good method of data redundancy, so let's look at each of these in turn, starting with the full backup:
Example: We will compare the different types of backup. We will start the backup every day, but will suffer data loss on the Friday, and we will see for how many tapes we need to recover our data. Our full backup will be 50 GB of data, and every day, we will produce 5 GB of data. You can see this from the following table. How many tapes are needed for each type of backup to recover your data?
Figure 12.10 – Backup examples
It is very important that we dispose of data in the most secure manner to ensure that it cannot be stolen. We are going to look at sanitizing data on paper followed by data on media.
When we are disposing of data, the best way of doing this, in order, is as follows:
When disposing of data that is stored on media such as a hard drive or DVD/CD ROM, the best ways to dispose of the data are as follows:
All of the above will render the media unusable. If you want to reuse the media, you need to choose wiping or formatting as the method of sanitization.
Exam tip
If you want to reuse a hard drive, then you need to sanitize it by either wiping or formatting it.
Non-persistence is when the computer system becomes corrupt, and you can roll it back to a former state. Let's look at each of these in turn, starting with revert to known state:
Example: In a Windows environment, when you successfully log in, all of the computer's settings are saved in a clone set (duplicate). Should the operating system not boot up, we restart the computer and invoke the last known configuration.
High availability could involve using clustering between servers or perhaps having a backup data center, as shown here in Figure 12.11:
Figure 12.11 – Data center high availability
In Figure 12.11, you can see a backup database for the storage farm. Scalability is where you can add additional nodes to the solution.
Once a disaster has happened, it is important that we look at the services necessary for getting a company back up and running. We would rank them as critical, essential, or non-essential, and we would work on getting the most crucial service up and running first. We would start with power, then our network infrastructure and critical servers, and then restore data before going back online.
Companies need to use diversity within their organization so that they can be prepared for any disasters. Let's look at diversity in vendors.
We need to purchase the same technologies from different vendors just in case one of the businesses either goes out of business or faces failure. An example of this would be purchasing broadband from two different companies. This is because it is a critical area of a business and should one provider suffer a disaster, then the other would provide the service.
Now it's time to check your knowledge. Answer the questions, and then check your answers, which can be found in the Assessments section at the end of the book:
This section has two mock exams with full explanations that will help you understand whether ready you are to take the test. The sample exam questions and answers will give you all the confidence you need to prepare for the exam.
This section comprises the following chapters:
a. Wildcard
b. Domain
c. Self-signed
d. SAN
a. OSINT
b. Public/private information sharing centers
c. Closed/proprietary
d. Threat maps
a. Nmap
b. Head
c. Logger
d. Tail
a. Dimitri
b. The harvester
c. Curl
d. Logger
a. Curl
b. Telnet
c. Nmap
d. netcat (nc)
a. Log analysis
b. Risk mitigation
c. Security administration
d. Threat hunting
a. Legacy
b. End of life
c. End of service
d. Retired
a. Kerberos
b. OAuth
c. Single sign-on
d. SAML
a. GDPR
b. HIPAA
c. PCI DSS
d. All of the above
a. TLS
b. SSL
c. FDE
d. Remote wipe
e. Screen locks
f. Cable locks
a. You will use DAC, with the owner of the data giving access.
b. You will use MAC, with the custodian of the data giving access.
c. You will use DAC, with the security administrator giving access.
d. You will use MAC, with the security administrator giving access.
a. Ask the key escrow to store his private key.
b. Ensure that the website uses a valid SAN certificate.
c. Update the root certificate into the client computer's trusted root certificate authority's store.
d. Verify whether the certificate on the server has expired.
a. Certificate stapling
b. Certificate pinning
c. OCSP
d. Key escrow
a. Brute force
b. Active reconnaissance
c. Pivoting
d. Passing point
Reply from 192.0.0.1: bytes=45000 time<1ms TTL=128
Reply from 192.0.0.1: bytes=45000 time<1ms TTL=128
Reply from 192.0.0.1: bytes=45000 time<1ms TTL=128
Reply from 192.0.0.1: bytes=45000 time<1ms TTL=128
What type of attack has been detected?
a. Integer overflow
b. Buffer overflow
c. XSS
d. SQL injection
a. Continuous validation
c. Continuous integration
d. Continuous development
e. Automated courses of action
f. Continuous development
a. SOC 4 reports
b. SOC 1 reports
c. SOC 2 reports
d. SOC 3 reports
a. Tokenization
b. Obfuscation
c. Data masking
d. Encryption
a. IPSec in tunnel mode
b. IPSec in split-tunnel mode
c. IPSec in transport mode
d. IPSec in full-tunnel mode
a. CSA reference architecture
b. CSA CCM
c. NIST
d. CASB
a. Risk mitigation techniques
b. Risk descriptions, the owner, and the mitigation strategies
c. The annual risk audit report
d. All of the above
a. The audit recommendation has been ignored.
b. The company disagreed with the audit recommendation.
c. The vendor is not producing any more patches as it is end of life.
d. There is no interface for patching.
a. RTO
b. A single point of failure
c. SLA
d. RPO
e. MTTR
a. NIDS
b. Nmap
c. ipconfig
d. netstat
e. Nbtstat
f. Autopsy
a. Software as a Service (SaaS)
b. Infrastructure as a Service (IaaS)
c. Monitoring as a Service (MaaS)
d. Platform as a Service (PaaS)
a. RAID 0
b. RAID 1
c. RAID 2
d. RAID 5
e. RAID 6
a. Data custodian
b. Privacy officer
c. Data controller
d. Data steward
a. Secure boot
b. Swap/page file
c. USB flash drive
d. ROM
e. RAM
a. Sandboxing
b. End-of-life systems
c. Resource exhaustion
d. System sprawl
a. Code review
b. Static code review
c. Regression testing
d. Dynamic code review
a. Hashing
b. Degaussing
c. Low-level formatting
d. Shredding
a. Spear phishing
b. Replay
c. MITM
d. DoS
a. Acceptable downtime
b. Return to operational state
c. Measure of reliability
d. Average time to repair
a. Certificate pinning
b. Input validation
c. Certificate stapling
d. Kerberos
a. Steganography
b. Fuzzing
c. Sandboxing
d. Containerization
a. TOTP
b. Federation Services
c. Smart card
d. SSO
e. SOAP
f. SAML
a. Whaling
b. Vishing
c. Phishing
d. Spear phishing
a. Hashing
b. Job rotation
c. Separation of duties
d. Mandatory vacations
e. Encryption
a. Switch
b. Router
c. Hub
d. Repeater
a. To prevent theft
b. To prevent tailgating
c. To prevent unauthorized personnel from gaining access to the data center
d. To allow faster access to the facility
a. Full trust
b. Bridge trust
c. Web of trust
d. Zero trust
a. Right-to-audit clause
b. Access token
c. Volatile evidence
d. Search warrant
a. Turning off host-based firewalls on laptops
b. Installing antivirus software on a new laptop
c. Insuring your car against fire and theft
d. Outsourcing your IT to another company
e. Deciding not to jump into the Grand Canyon
a. Tokenization
b. Data retention policy
c. Data masking
d. Data minimization
e. Anonymization
a. GDPR
b. Terms of agreement
c. Privacy notice
d. Impact assessment
a. Virus
b. RAT
c. Worm
d. Logic bomb
e. Polymorphic virus
a. Obfuscation
b. Nonce
c. Data masking
d. Salting
a. Software auditing
b. Quality assurance
c. Code signing
d. Staging
e. Development
f. Testing
a. Remove the PLCs from the manufacturing infrastructure.
b. Produce their own updated PLCs for the firmware.
c. Set up a SIEM system for real-time monitoring of the SCADA system.
d. Place the PLCs in a VLAN.
a. IPsec in tunnel mode
b. IPsec in split-tunnel mode
c. IPsec in transport mode
d. IPsec in full-tunnel mode
Concept: A self-signed certificate is the cheapest certificate for internally facing servers.
Concept: Closed/proprietary threat intelligence is funded by the company producing the report. More money would have been spent on creating the report and it will provide more accurate information as this information will be sold on to other companies.
Concept: The logger command allows you to insert comments into a log file.
Concept: The harvester is written in Python and allows you to search and collate the email addresses of a company on search engines such as Google.
Concept: Telnet, curl, Dimitri, nmap, and nc can all be used for banner grabbing.
Concept: When a new security update has been released, threat hunting is the process of searching current and historical logs for the symptoms of an attack.
Concept: If it is end-of-life, the vendor will not produce any updates, but will sell the limited spare parts that they still have. With end-of-service, the vendor stops everything – no spare parts, nothing.
Concept: Third-party authentication is federation services that use SAML.
Concept: Payment Card Industry Data Security Standard (PCI DSS) deals with card payments.
Concept: Data at rest is protected by FDE and access to the mobile telephone can be protected by screen locks and strong passwords.
Concept: MAC is used as the access method for classified data and the security administrator is responsible for giving users access to the data once the person has been vetted and access is justified.
Concept: A certificate needs to be valid and trusted by the computer.
Concept: Only CRL and OCSP can provide certificate validation. Normally, if the CRL is going slow, you would implement an OCSP. In this case, if you remove the CRL, you need to implement an OCSP.
Concept: Pivoting involves using a weak host to launch an attack further in the network. In virtualization, it is called VM Escape.
Concept: This shows 45,000 bytes of data. It should have been 32 bytes. It is too much data, therefore a buffer overflow.
Concept: Continuous monitoring detects system failure and any security breaches.
Concept: SOC 2 reports produce a very detailed report on the internal controls of a company relating to security, data processing, and the handling of user's data to ensure it is confidential and privacy is maintained.
Concept: Tokenization replaces data with a token that links to a payment provider who holds the data. This is better than encryption as it is stateless, whereas with encryption the keys are held locally.
Concept: IPSec in tunnel mode is used externally on a VPN where both the header and the payload are encrypted.
Concept: Cloud Security Alliance Cloud Controls Matrix (CCM): This is designed to provide a security principles guide for cloud vendors and potential cloud customers to assess the overall risk of a cloud provider.
Concept: The risk register lists the risks, each risk has an owner, and the owner will decide to accept, mitigate, transfer, or avoid the risk.
Concept: An end-of-life system is no longer supported by the vendor and no patches will be made.
Concept: When a disaster hits, the amount of time a company can operate without access to its data is called the Recovery Point Objective (RPO).
Concept: Nmap is used to create an inventory and can tell what operating system a host has and what services it is running. Netstat can tell which services are running through its port number.
Concept: IaaS provides bare-metal hardware. Then, you need to install the software, configure it, and patch it.
Concept: RAID 6 uses a minimum of four disks, uses double parity, and can lose two disks.
Concept: The data controller is responsible for ensuring that all data that is collected, and its storage, is legal and follows the compliance regulations. The data controller is responsible for investigations into data breaches.
Concept: Always collect the volatile evidence before stopping a cyber-attack in order to detect the source. Volatile memory evaporates if the power is switched off. RAM is volatile and the swap/page file is where applications run when RAM is full.
Concept: End-of-life systems are no longer operational or supported by the vendor.
Concept: Regression testing is part of program development, and in larger companies is done by code-testing specialists.
Concept: You can shred a whole hard drive down until it looks like powder—let someone try to put that back together again.
Concept: DDoS and DoS attack the availability of IT systems, as they both aim to take them down.
Concept: The RTO means that the system is now back up and running. This can also be known as the return to operational state.
Concept: Certificate pinning prevents SSL M-I-M attacks.
Concept: Sandboxing is where we put an application in an isolated virtual machine to test patches, or maybe just because the application is too dangerous to run on our network.
Concept: SAML is an XML-based type of authentication used in federation services; TOTP is also XML-based.
Concept: The intended attack was vishing, and because he left a voicemail the actual attack was vishing, as leaving a voicemail is a vishing attack.
Concept: Separation of duties prevents one person from authorizing the whole transaction, and also prevents fraud. The CA signs the X509 certificates.
Concept: A router gives you access to the internet; on a computer, it is known as the default gateway.
Concept: A mantrap provides a safe and controlled environment in the data center as it allows you to control access.
Concept: Cloud providers use a zero-trust model where everybody needs to prove their identity.
Concept: To obtain the volatile evidence from a cloud provider, you will need a right to audit clause.
Concept: Risk mitigation involves reducing the risk of an attack or event. These are basically technical controls.
Concept: Data minimization is the process of collecting only the necessary data for a purpose and then retaining it only for a period required by compliance.
Concept: A privacy notice obtains consent to collect my personal data and only use it for the purpose that it was intended.
Concept: A polymorphic virus mutates, therefore the hash value will change.
Concept: Salting appends a random value to a password before it is hashed
Concept: Staging is where the software is tested with real data and the quality assurance of the product should have been tested and assured prior to moving the software from staging into production.
Concept: You can place the vulnerable PLCs into a VLAN to segment them from the network.
Concept: IPSec in transport mode is used server to server internally where only the payload is encrypted.
a. WPA2-PSK
b. EAP-TLS
c. PEAP
d. PAP
a. Isolate the web server by disconnecting it from the network to prevent further damage.
b. Disconnect all external active connections to ensure that any attack is stopped.
c. Run a packet sniffer to capture the network traffic to identify the attacker.
d. Take a screenshot of the damage done to the website and report the incident to the police.
a. PEM certificate
b. Wildcard certificate
c. Subject Alternative Name (SAN) certificate
d. Root certificate
a. Cold site
b. Warm site
c. Hot site
d. Off site
a. Make a system image of the laptop.
b. Place it in a polythene bag and seal it.
c. Hash the data so that data integrity is assured.
d. Ask for proof of ownership of the laptop.
a. Netstat
b. Port scanning
c. Nmap
d. The harvester
a. The devices' default configurations had not been changed.
b. Their houses had been broken into and hidden cameras were installed.
c. The victims' wireless networks were broadcasting beyond the boundaries of their homes.
d. The manufacturers of the devices installed hidden devices, allowing them to film.
a. Create a VLAN on the switch and put the corporate admin team in the VLAN.
b. Install a router in the LAN and place the corporate admin team in the new subnet.
c. Create a NAT from the firewall and put the corporate machines in that network.
d. Install a proxy server.
What type of attack did the SIEM system discover:
a. Password history
b. Password spraying
c. RAT
d. Dictionary attack
a. PAP
b. TACACS+
c. NTLM
d. RADIUS
a. It provides a consistent baseline for all new machines.
b. It ensures that all machines are patched.
c. It reduces the number of vulnerabilities.
d. It allows a non-technical person to roll out the images.
a. Kerberos
b. SAML
c. OAuth 2.0
d. Federation Services
a. Malicious insider
b. BYOD
c. Shadow IT
d. Competitor
- Prevent using the same password within 12 password changes.
- Ensure that users cannot change the password more than once a day.
- Prevent weak passwords or simple passwords, such as 123456 or password, from being used.
Select the options that you will need to fulfill all of these goals:
a. Enforce password history
b. Minimum password length
c. Passwords must meet complexity requirements
d. Minimum password age
e. Maximum password length
a. Tethering
b. Sideloading
c. Slipstreaming
d. Jailbreaking or rooting
e. Degaussing
a. SSAE
b. NIST
c. PCI DSS
d. GDPR
e. ISO 31000
a. Obfuscation
b. Salting
c. XOR
d. ROT 13
a. WPA2-Enterprise
b. TKIP
c. WPS
d. PSK
e. CCMP
a. It identifies vulnerabilities.
b. It identifies new network hosts.
c. It identifies viruses.
d. It identifies new traffic patterns.
e. It identifies new web servers.
a. Install a proxy server.
b. Install a SQL injection.
c. Input validation on forms.
d. Install a web application firewall.
a. VM escape
b. VM sprawl
c. System sprawl
d. VM containerization
a. Pass-the-hash
b. Man-in-the-middle
c. Zero-day virus
d. Smurf attacks
a. Palm reader
b. Signature verification
c. Thumb scanner
d. Gait
e. Iris scanner
a. Jailbreaking
b. Sandboxing
c. Bluesnarfing
d. Chroot jail
e. Fuzzing
a. SSAE
b. NIST
c. PCI DSS
d. GDPR
e. ISO 31000
a. It will improve the server's performance.
b. To prevent a man-in-the-middle attack.
c. To prevent a pass-the-hash attack.
d. To prevent a poodle attack.
a. Create a change management document to ensure that the receptionists are more vigilant to people coming in out of hours.
b. Enforce time-based access restrictions so that nobody can access the IT systems during summer breaks.
c. Enforce separation of duties to ensure that any document that is destroyed has been witnessed by a second person.
d. Enforce mandatory vacations to prevent him coming in during the recess.
a. High FAR
b. Low FRR
c. Low FAR
d. Low CER
e. High CER
f. High FRR
- Security logs
- DNS logs
- Firewall logs
- NIPS logs
- NIDS logs
What is the first action that you need to take before collating these logs?
a. Apply time normalization to these logs.
b. Copy them into a worm drive so that they cannot be tampered with.
c. Sort out the sequence of events by site.
a. MD5
b. 3DES
c. SHA1
d. Blowfish
a. Continuous validation
b. Continuous monitoring
c. Continuous integration
d. Continuous development
e. Automated courses of action
a. Cross-site scripting
b. Man-in-the-middle
c. Cross-site forgery attack
d. SQL injection
a. Smart card
b. Kerberos
c. WPS
d. TOTP
a. Heat map
b. Checking wireless channels
c. Site survey
d. Low-power directional antennas
a. Email the people involved and ask them to delete the X509 from their desktop immediately.
b. Carry out certificate pinning to prevent the CA from being compromised.
c. Revoke the root CA X509 so it is added to the CRL.
d. Revoke the X509 so it is added to the CRL.
a. CER
b. FAR
c. FRR
d. CVE
a. Creating a list of approved applications
b. Listing network connections
c. Creating a diagram about network connections and hosts
d. A list of approved applications
a. WPA2 PSK
b. WPA
c. WPA2 CCMP
d. WPA2 TKIP
a. Federation Services
b. EAP-TLS
c. Kerberos
d. RADIUS Federation
a. A criminal syndicate
b. A competitor
c. A script kiddie
d. A nation state
a. Reliability.
b. Regulatory compliance.
c. It is a best practice in your industry.
d. Resilience.
a. SNMP V 3
c. SCP
d. SFTP
a. There was a zero-day virus.
b. False negatives.
c. False positives.
d. The wrong filter was used to audit.
a. A budget laptop at $1,300 each
b. A budget laptop at $1,200 each
c. A budget laptop at $1,000 each
d. A budget laptop at $1,001 each
a. MTTR
b. MTBF
c. MTTF
d. RPO
a. VLAN
b. PVC
c. Air gap
d. Containment
a. Outsourcing your IT support
b. Purchasing anti-virus software
c. Identifying and classifying the asset
d. Purchasing cybersecurity insurance
a. Single sign-on (SSO)
b. Kerberos
c. SAML
d. Secure Shell
**** **** **** 3456
What has the administrator come across?
a. Tokenization
b. Obfuscation
c. Data masking
d. XOR
a. Containment
b. Eradication
c. Recovery
d. Lessons learned
Concept: EAP-TLS is a secure wireless authentication protocol, as it uses certificates. An X509 certificate is installed on the endpoint. This is the most secure EAP standard.
Concept: The first stage in any attack is to capture the volatile evidence. In this incident, you would capture the network traffic to identify the source of the attack.
Concept: A wildcard certificate can be used on multiple servers, normally those that are internet facing.
Concept: The hot site should be up and running with data that has been replicated.
Concept: The first step is to create a system image or, if it is a hard drive, create a forensic copy.
Concept: A Network mapper (Nmap) can identify new hosts on the network, identify what services are running, and identify what operating systems are installed. It can also be used for banner grabbing.
Concept: IoT home-based automated devices should have the default configurations of the username and password changed. Most users do not realize that these passwords exist.
Concept: A NAT hides the internal network from external users.
Concept: Password spraying is where an attacker obtains a list of employees and then tries common passwords against each account.
Concept: AAA servers are used for centralized authentication as they provide authentication, authorization, and accounting. They can record all log-ins and log-outs in a database.
Concept: When you build an image, all of the applications will have the same settings and updates and therefore will be consistent. A baseline consists of the applications that are installed at the current time.
Concept: OAuth 2.0 is the industry-standard protocol for authorization. It is used by OpenID Connect, where people can be authenticated using their Facebook or Google account.
Concept: A shadow IT threat is where someone connects their device to a private network without permission.
Concept: The password history is the number of passwords that you need to remember before you can reuse them. Password complexity requires users to use three of the four following characters in the password: lowercase, uppercase, numbers, and special characters not used in programming. A minimum password age set to 1 means that you can change the password only once a day, preventing password rotation until you get back to the original password.
Concept: Sideloading involves loading third-party applications onto an unlocked mobile Phone. Jailbreaking (iOS), or rooting (Android), is where the phone has been unlocked, removing the vendor's restrictions on the mobile phone.
Concept: GDPR is a framework for data protection law ensuring the privacy rights of individuals. It deals with data privacy and data sharing.
Concept: Salting appends random characters to a password before it is hashed. As the passwords are then longer, brute-force attacks need more processing and computation resources to crack them.
Concept: CCMP uses AES for encryption and is the strongest wireless security.
Concept: A NIDS uses sensors and collectors to identify changes to the network.
Concept: Input validation prevents buffer-overflow attacks, integer-overflow attacks, and SQL injection by restricting the input to a certain format.
Concept: VM escape can be used for a lateral attack on the virtual host or the other virtual machines.
Concept: A zero-day virus is a newly released virus, and no monitoring system can detect it until it receives an update in about 7 days' time. There are no patches for it either.
Concept: Facial recognition is something you use for authentication. b and d are both something you do – you have a unique signature, and your gait is how you walk.
Concept: Sandboxing and chroot jail (Linux version) allow you to isolate an application inside a virtual guest machine.
Concept: Payment Card Industry Data Security Standard (PCI DSS) lays out the regulations for the handling and storage of financial information.
Concept: Disabling NTLM or enabling Kerberos will prevent pass-the-hash attacks. Kerberos is the best of the two as passwords are held in an encrypted database.
Concept: Time-based access restrictions would have prevented someone from accessing the system during the holidays.
Concept: When the FAR and FRR are equal, this is known as the CER. A system with a low CER is the best choice as it has very few errors.
Concept: We need to install an NTP server to synchronize the time of all of the servers so that the events can be put into a sequence of events.
Concept: Hashing proves data integrity. SHA1 and MD5 are both hashing algorithms.
Concept: Continuous Integration is where code from multiple sources is integrated together.
Concept: Cross-Site Scripting (XSS) uses HTML tags or JavaScript.
Concept: A smart card is "something you have," inserting the card into the reader is "something you do," and then when you insert the PIN, it is "something that you know."
Concept: A site survey should be carried out prior to installing a wireless network as it maps out all of the items that would interfere with a wireless connection. A heat map shows the coverage with blue/green areas showing poor connectivity and red showing great connectivity.
Concept: Once a certificate has been compromised, it should immediately be revoked so it is added to the CRL.
Concept: Unauthorized users are allowed. Look at the middle initial in FAR – it is A for allow.
Concept: Footprinting maps out network topology including active hosts.
Concept: WPA2 is the most secure and TKIP is backward compatible. WPA also works with legacy but is not the best choice.
Concept: Kerberos issues tickets for authentication, and each change has a different Updated Sequence Number (USN) and timestamps. It prevents both replay and pass-the-hash attacks.
Concept: The R&D department creates a lot of the company's trade secrets; therefore, a competitor would steal them to beat you to the marketplace. If they damaged your production line, it would prevent you from getting a product to market.
Concept: Vendor diversity involves getting a service from two different providers at the same time. Vendor diversity provides reliability and resilience. For example, if broadband from one provider fails, then the second provider's broadband should still be up and running.
Concept: Secure Shell (SSH) is used for secure remote access and credentials are protected.
Concept: If we are using the wrong configuration for the SIEM server, we will get poor monitoring, resulting in false positives. This would also happen if you scanned the wrong type of host.
Concept:
SLE = ALE/ARO
ALE = 12 x 10,000 = $120,000
ARO = 12 X 10 = 120 laptops a year
Single loss expectancy = $120,000/120 = $1000
Explanation: The cost of losing the laptops is $120,000, the same as purchasing the insurance. You should not take out the insurance in the hope that next year you may lose fewer laptops, as a record number of laptops has already been lost.
Concept: Mean Time Between Failures (MTBF) is the measure of the number of failures. If I purchased a car and it broke down every day for the next week, I would take it back, as it would be unreliable.
Concept: An airgap isolates a computer from the network as it has no physical or wireless connections. The only way to extract data is by removable media.
Concept: Risk transference is where you transfer the responsibility of the risk to a third party, purchasing insurance of any kind and outsourcing your IT are examples.
Concept: Federation services is a third-party-to-third-party authentication method that uses SAML, an XML-based method for authentication. SAML passes credentials to the Identity Provider (IdP).
Concept: Data masking masks all or some of the data held in a field.
Concept: Removing viruses and turning off services are carried out at the eradication phase.
a. Unauthorized access
b. Loss of computers or data
c. Loss of availability
d. Malware attack
e. DDoS attack
f. Power failure
g. Natural disasters, such as floods, tornadoes, hurricanes, and fires
h. Cybersecurity incidents
a. Incident response manager: A top-level manager takes charge.
b. Security analyst: Provides technical support for the incident.
c. IT auditor: Checks that the company is compliant.
d. Risk analyst: Evaluates all aspects of risk.
e. HR: Sometimes, employees are involved in the incident.
f. Legal: Gives advice and makes decisions on legal issues.
g. Public relations: Deals with the press to reduce the impact on the company's reputation.
If you enjoyed this book, you may be interested in these other books by Packt:
Implementing and Administering Cisco Solutions: 200-301 CCNA Exam Guide
Glen D. Singh
ISBN: 978-1-80020-809-4
Practical Cybersecurity Architecture
Ed Moyle, Diana Kelley
ISBN: 978-1-83898-992-7
Please share your thoughts on this book with others by leaving a review on the site that you bought it from. If you purchased the book from Amazon, please leave us an honest review on this book's Amazon page. This is vital so that other potential readers can see and use your unbiased opinion to make purchasing decisions, we can understand what our customers think about our products, and our authors can see your feedback on the title that they have worked with Packt to create. It will only take a few minutes of your time, but is valuable to other potential customers, our authors, and Packt. Thank you!