Unit - 1 (CS)
Unit - 1 (CS)
1 INTRODUCTION
UNIT
You cannot avoid the existence of security threats but can sure be aware and
stay alert. Various cyber security standards have been developed to protect
the information and data of the people and it also provides certain measures
through which people can seek redressal when they have been attacked by
any sort of cyber security threat. If you wish to become a cyber security
professional, start by enrolling yourself in IT Security classes and gain insights
about how cyber security works.
UNIT - I 1
[CYBER SECURITY]
These are generally used for preventing computer software because the
computer hardware is already protected in some sort of locker or safe place.
so the computer software is vulnerable and needs protection which these
computer security systems offer. These complex security tactics and practices
are hard to break and prevent hackers from getting their hands on critical
information. These systems are developed for preventing the vulnerable and
critical information and data that if exposed, will cause huge losses to a single
entity or a company as a whole.
You may have come across questions like 'what is computer security, explain'
or 'what is the importance of computer security?' Computer security is
important because it makes sure that your information and data are safe. It
may be related to your business, health, or personal information. Computer
security provides the features of availability, integrity, and confidentiality for
the computer system. The following are the reasons why computer security is
considered important:
UNIT - I 2
[CYBER SECURITY]
To prevent yourself from cyber threats, make sure that you protect your
personal information and data. The issue with Information Technology is a big
one that is still prevailing which is responsible for protecting your personal
information and critical data.
You must keep your information and data safe and you can do that by
implementing the below-mentioned steps:
Data help means stealing any critical and sensitive information such as
account passwords, bank account details, health-related information,
personal information, important documents that are stored in the computer
systems and its servers, and so on.
Data theft can happen for multiple reasons that can be stated as follows:
UNIT - I 3
[CYBER SECURITY]
Computer viruses and malware can be very annoying at times and computer
security can help you to prevent your system from these unwanted visitors. A
computer virus or malware can delete your important data and corrupt the
sensitive information that is stored in your computer system. It can also harm
your hard disk as it can spread from one computer to another with the help of
email programming.
So you must protect your computer system from computer viruses and
malware. You can do so why following these simple steps:
Now you know how to explain computer security and what its importance is.
UNIT - I 4
[CYBER SECURITY]
Threats to computer security are the potential rests that can cause
dysfunctioning of your computer system and can harm the sensitive
information and data that are stored in your computer. As technology is ever-
increasing, Cyber crimes are also increasing with the number of hackers pacing
in the market.
The major types of computer security threats, issues, and vulnerabilities are
stated as follows:
1. Viruses
2. Computer Worm
A computer worm also has a similar process of replicating itself just like a
computer virus. It does not need human interaction for replicating from one
UNIT - I 5
[CYBER SECURITY]
computer system to another. A computer worm can corrupt the files in your
computer system and can use all the storage space in your hard disc by
continuously replicating itself. It also slows down the speed of the computer
system and can create malfunctioning for the computer resources.
3. Phishing
Phishing is a cyber crime that mainly exists in the form of a text message, e-
mail, telecommunication, or any other form of communication to the user for
that matter. It is an attempt by hackers to gain personal information about the
users by showing their false legitimacy. They try to see personal information
such as account passwords, OTP, bank details, etc. through which they can
trick the user and make them a victim of a phishing attack.
4. Botnet
The presence and functioning of a Botnet are also similar to that of a computer
virus in a way that the hackers install it in the computer system of the user
without their knowledge. It can replicate itself and transfer from one
computer system to another and the affected computers are called 'zombie
computers. The zombie computers are not safe for storing any sensitive
information on data because that can anyway be corrupted or completely
deleted. The infected computer, which has turned out to be a Botnet now,
performs malicious activities with unauthorized access at a large scale like
DDoS.
5. Rootkit
UNIT - I 6
[CYBER SECURITY]
about its existence. Generally, hackers use rootkits for changing the system
configurations so that they can easily execute and go through the files on the
remote computer.
6. Keylogger
You may often think 'what is computer security and its types?' Here are some
of the major types of computer security practices and tactics that are followed
by users and organizations to protect their sensitive data, Software, and
hardware. The different types of computer security are very important to
protect the data stored in electronic systems and networks.
1. Application Security
UNIT - I 7
[CYBER SECURITY]
your computer system to fight against SQL breaches and denial of service
attacks.
Some of the major application tools techniques are used for installing the
application security feature, such as software encryption, antivirus, firewall,
etc. and these help your system to build a wall against cyber attacks.
2. Information Security
Information security is commonly known as the CIA triad and this model is
used for protecting the integrity, availability, and confidentiality of
organizational data so that productivity is maintained.
3. Network Security
There are various network security methods and components that help
computer networks to be safe and secure. These are stated as follows:
Application security
Anti-virus software
Behavioral analysis
Firewall
UNIT - I 8
[CYBER SECURITY]
Email security
Web security
Wireless security
Network access control
Network segmentation
Virtual private network
4. Endpoint Security
5. Internet Security
Internet security is the most recent type of computer security that has reached
a boom period in recent times. It is a method for creating a perfect set of rules
and actions to prevent any unauthorized use or harm to computer systems
that are directly connected to the internet.
It is the newest branch of computer security that specifically deals with the
risks and threats that comes with the internet which is enumerated as follows:
Hacking
Computer viruses
Malware
Denial of service attacks
As you can see computer security protects the hardware and software of a
computer system. If you want to know more about computer security in detail
UNIT - I 9
[CYBER SECURITY]
and become a cyber security professional then take the best Ethical Hacking
course online and know all about cyber security threats and protection
measures.
Whether you use your computer for your personal work or your professional
job, make sure it is free from security threats. A broad range of threats is
considered when it comes to computer security. As an active user, it is your
responsibility that you take essential measures for ensuring the security of
your computer system.
Here are some of the easy steps by which you can ensure the security of your
computer system:
Always keep your computer system and software updated to its latest
version.
If you are suspicious about having any malfunction in your system then do
check it thoroughly.
Install a protective firewall in your computer system.
Adjust your browser settings and remove the risks of malware.
Install good antivirus software in your system.
Set a password and protection lock to secure your device.
Make sure that you encrypt your data so that any man cannot get the
hang of the information.
Use a VPN for additional production of your device.
Do not click emails or links sent to you by unknown members.
Ignore the pop-ups and do not click on them.
Perform regular system backups and scans.
THREATS
Cybersecurity threats are acts performed by individuals with harmful intent,
whose goal is to steal data, cause damage to or disrupt computing systems.
Common categories of cyber threats include malware, social engineering, man
in the middle (MitM) attacks, denial of service (DoS), and injection attacks—we
describe each of these categories in more detail below.
UNIT - I 10
[CYBER SECURITY]
Cyber threats can originate from a variety of sources, from hostile nation states
and terrorist groups, to individual hackers, to trusted individuals like employees
or contractors, who abuse their privileges to perform malicious acts.
Malware Attacks
UNIT - I 12
[CYBER SECURITY]
Social engineering involves tricking users into providing an entry point for
malware. The victim provides sensitive information or unwittingly installs
malware on their device, because the attacker poses as a legitimate actor.
Supply chain attacks are a new type of threat to software developers and
vendors. Its purpose is to infect legitimate applications and distribute malware
via source code, build processes or software update mechanisms.
UNIT - I 13
[CYBER SECURITY]
Man-in-the-Middle Attack
UNIT - I 14
[CYBER SECURITY]
Denial-of-Service Attack
A Denial-of-Service (DoS) attack overloads the target system with a large volume
of traffic, hindering the ability of the system to function normally. An attack
involving multiple devices is known as a distributed denial-of-service (DDoS)
attack.
UNIT - I 15
[CYBER SECURITY]
Injection Attacks
SQL injection—an attacker enters an SQL query into an end user input
channel, such as a web form or comment field. A vulnerable application
will send the attacker’s data to the database, and will execute any SQL
commands that have been injected into the query. Most web applications
use databases based on Structured Query Language (SQL), making them
vulnerable to SQL injection. A new variant on this attack is NoSQL attacks,
targeted against databases that do not use a relational data structure.
Code injection—an attacker can inject code into an application if it is
vulnerable. The web server executes the malicious code as if it were part
of the application.
OS command injection—an attacker can exploit a command injection
vulnerability to input commands for the operating system to execute. This
allows the attack to exfiltrate OS data or take over the system.
LDAP injection—an attacker inputs characters to alter Lightweight
Directory Access Protocol (LDAP) queries. A system is vulnerable if it uses
unsanitized LDAP queries. These attacks are very severe because LDAP
servers may store user accounts and credentials for an entire
organization.
XML eXternal Entities (XXE) Injection—an attack is carried out using
specially-constructed XML documents. This differs from other attack
vectors because it exploits inherent vulnerabilities in legacy XML parsers
rather than unvalidated user inputs. XML documents can be used to
traverse paths, execute code remotely and execute server-side request
forgery (SSRF).
UNIT - I 16
[CYBER SECURITY]
UNIT - I 17
[CYBER SECURITY]
Imperva can help you defend your organizations against cybersecurity threats
that affect applications and your sensitive business data.
UNIT - I 18
[CYBER SECURITY]
API Security – Automated API protection ensures your API endpoints are
protected as they are published, shielding your applications from exploitation.
Advanced Bot Protection – Prevent business logic attacks from all access points
– websites, mobile apps and APIs. Gain seamless visibility and control over bot
traffic to stop online fraud through account takeover or competitive price
scraping.
DDoS Protection – Block attack traffic at the edge to ensure business continuity
with guaranteed uptime and no performance impact. Secure your on premises
or cloud-based assets – whether you’re hosted in AWS, Microsoft Azure, or
Google Public Cloud.
Attack Analytics – Ensures complete visibility with machine learning and domain
expertise across the application security stack to reveal patterns in the noise and
detect application attacks, enabling you to isolate and prevent attack
campaigns.
At the data level, Imperva protects all cloud-based data stores to ensure
compliance and preserve the agility and cost benefits you get from your cloud
investments:
UNIT - I 19
[CYBER SECURITY]
Cloud Data Security – Simplify securing your cloud databases to catch up and
keep up with DevOps. Imperva’s solution enables cloud-managed services users
to rapidly gain visibility and control of cloud data.
HARM
The negative consequence of an actualized threat is harm; we protect ourselves
against threats in order to reduce or eliminate harm. We have already described
many examples of computer harm: a stolen computer, modified or lost file,
revealed private letter, or denied access to data. These events cause harm that
we want to avoid.
In their 2010 global Internet threat report, security firm Symantec surveyed the
kinds of goods and services offered for sale on underground web pages. The
item most frequently offered in both 2009 and 2008 was credit card numbers,
UNIT - I 20
[CYBER SECURITY]
The value of many assets can change over time, so the degree of harm (and
therefore the severity of a threat) can change, too. With unlimited time, money,
and capability, we might try to protect against all kinds of harm. But because our
resources are limited, we must prioritize our protection, safeguarding only
against serious threats and the ones we can control. Choosing the threats we try
to mitigate involves a process called risk management, and it includes weighing
the seriousness of a threat against our ability to protect.
In real life we make decisions every day about the best way to provide our
security. For example, although we may choose to live in an area that is not
prone to earthquakes, we cannot entirely eliminate earthquake risk. Some
choices are conscious, such as deciding not to walk down a dark alley in an
unsafe neighborhood; other times our subconscious guides us, from experience
UNIT - I 21
[CYBER SECURITY]
A basic model of risk management involves a user’s calculating the value of all
assets, determining the amount of harm from all possible threats, computing
the costs of protection, selecting safeguards (that is, controls or
countermeasures) based on the degree of risk and on limited resources, and
applying the safeguards to optimize harm averted. This approach to risk
management is a logical and sensible approach to protection, but it has
significant drawbacks. In reality, it is difficult to assess the value of each asset;
as we have seen, value can change depending on context, timing, and a host of
other characteristics. Even harder is determining the impact of all possible
threats. The range of possible threats is effectively limitless, and it is difficult (if
not impossible in some situations) to know the short- and long-term impacts of
an action. For instance, Sidebar 1-3 describes a study of the impact of security
breaches over time on corporate finances, showing that a threat must be
evaluated over time, not just at a single instance.
It was long assumed that security breaches would be bad for business: that
customers, fearful of losing their data, would veer away from insecure
businesses and toward more secure ones. But empirical studies suggest that the
picture is more complicated. Early studies of the effects of security breaches,
such as that of Campbell [CAM03], examined the effects of breaches on stock
price. They found that a breach’s impact could depend on the nature of the
breach itself; the effects were higher when the breach involved unauthorized
access to confidential data. Cavusoglu et al. [CAV04] discovered that a breach
affects the value not only of the company experiencing the breach but also of
security enterprises: On average, the breached firms lost 2.1 percent of market
value within two days of the breach’s disclosure, but security
developers’ market value actually increased 1.36 percent.
UNIT - I 22
[CYBER SECURITY]
Ko and Dorantes compared two groups of companies: one set (the treatment
group) with data breaches, and the other (the control group) without a breach
but matched for size and industry. Their findings were striking. Contrary to what
you might suppose, the breached firms had no decrease in performance for the
quarters following the breach, but their return on assets decreased in the third
quarter. The comparison of treatment with control companies revealed that the
control firms generally outperformed the breached firms. However, the
breached firms outperformed the control firms in the fourth quarter.
These results are consonant with the results of other researchers who conclude
that there is minimal long-term economic impact from a security breach. There
are many reasons why this is so. For example, customers may think that all
competing firms have the same vulnerabilities and threats, so changing to
another vendor does not reduce the risk. Another possible explanation may be
a perception that a breached company has better security since the breach
forces the company to strengthen controls and thus reduce the likelihood of
similar breaches. Yet another explanation may simply be the customers’ short
attention span; as time passes, customers forget about the breach and return to
business as usual.
All these studies have limitations, including small sample sizes and lack of
sufficient data. But they clearly demonstrate the difficulties of quantifying and
UNIT - I 23
[CYBER SECURITY]
verifying the impacts of security risks, and point out a difference between short-
and long-term effects.
Paul Slovic’s work on risk addresses the particular difficulties with extreme
events. He points out that evaluating risk in such cases can be a political
endeavor as much as a scientific one. He notes that we tend to let values,
process, power, and trust influence our risk analysis [SLO99].
contrast, if people experience similar outcomes and their likelihood, their feeling
of dread diminishes and they can actually underestimate rare events. In other
words, if the impact of a rare event is high (high dread), then people focus on
the impact, regardless of the likelihood. But if the impact of a rare event is small,
then they pay attention to the likelihood.
Let us look more carefully at the nature of a security threat. We have seen that
one aspect—its potential harm—is the amount of damage it can cause; this
aspect is the impact component of the risk. We also consider the magnitude of
the threat’s likelihood. A likely threat is not just one that someone might want
to pull off but rather one that could actually occur. Some people might
daydream about getting rich by robbing a bank; most, however, would reject
that idea because of its difficulty (if not its immorality or risk). One aspect of
likelihood is feasibility: Is it even possible to accomplish the attack? If the answer
is no, then the likelihood is zero, and therefore so is the risk. So a good place to
start in assessing risk is to look at whether the proposed action is feasible. Three
factors determine feasibility, as we describe next.
Spending for security is based on the impact and likelihood of potential harm—
both of which are nearly impossible to measure precisely.
Method–Opportunity–Motive
A malicious attacker must have three things to ensure success: method,
opportunity, and motive, depicted in Figure 1-11. Roughly speaking, method is
the how; opportunity, the when; and motive, the why of an attack. Deny the
attacker any of those three and the attack will not succeed. Let us examine these
properties individually.
Method
By method we mean the skills, knowledge, tools, and other things with which to
perpetrate the attack. Think of comic figures that want to do something, for
example, to steal valuable jewelry, but the characters are so inept that their
every move is doomed to fail. These people lack the capability or method to
succeed, in part because there are no classes in jewel theft or books on burglary
for dummies.
Anyone can find plenty of courses and books about computing, however.
Knowledge of specific models of computer systems is widely available in
bookstores and on the Internet. Mass-market systems (such as the Microsoft or
Apple or Unix operating systems) are readily available for purchase, as are
UNIT - I 25
[CYBER SECURITY]
Opportunity
Opportunity is the time and access to execute an attack. You hear that a
fabulous apartment has just become available, so you rush to the rental agent,
only to find someone else rented it five minutes earlier. You missed your
opportunity.
Motive
Finally, an attacker must have a motive or reason to want to attack. You
probably have ample opportunity and ability to throw a rock through your
neighbor’s window, but you do not. Why not? Because you have no reason to
want to harm your neighbor: You lack motive.
We have already described some of the motives for computer crime: money,
fame, self-esteem, politics, terror. It is often difficult to determine motive for an
attack. Some places are “attractive targets,” meaning they are very appealing to
attackers. Popular targets include law enforcement and defense department
UNIT - I 26
[CYBER SECURITY]
Method, opportunity, and motive are all necessary for an attack to succeed;
deny any of these and the attack will fail.
VULNERABILITIES
A vulnerability in security refers to a weakness or opportunity in an information
system that cybercriminals can exploit and gain unauthorized access to a
computer system. Vulnerabilities weaken systems and open the door to
malicious attacks.
UNIT - I 27
[CYBER SECURITY]
A threat is a potentially dangerous event that has not occurred but has the
potential to cause damage if it does. Exploits are how threats become attacks,
and vulnerabilities are how exploits gain access to targeted systems.
Examples and Common Types of Vulnerabilities in Security
The four main types of vulnerabilities in information security are network
vulnerabilities, operating system vulnerabilities, process (or
procedural) vulnerabilities, and human vulnerabilities.
UNIT - I 28
[CYBER SECURITY]
The timeframe for disclosing known vulnerabilities in security can vary between
researchers, vendors, and cybersecurity advocacy organizations.
The Cybersecurity and Infrastructure Security Agency (CISA) provides guidelines
for the remediation and public disclosure of newly identified cybersecurity
vulnerabilities. Their recommendations vary based on variables like whether a
vulnerability is severe, activ exploitation of the vulnerability, or if there are
serious and likely threats.
Risks, on the other hand, are potentials for loss or damage when a threat
exploits a vulnerability.
UNIT - I 29
[CYBER SECURITY]
1. Human error – When end users fall victim to phishing and other social
engineering tactics, they become one of the biggest causes of
vulnerabilities in security.
2. Software bugs – These are flaws in a code that cybercriminals can use
to gain unauthorized access to hardware, software, data, or other
assets in an organization’s network. sensitive data and perform
unauthorized actions, which are considered unethical or illegal.
UNIT - I 30
[CYBER SECURITY]
CONTROLS
UNIT - I 31
[CYBER SECURITY]
"There are many different ways to apply controls based on the nature of what
you're trying to protect," said Joseph MacMillan, author of Infosec Strategies
and Best Practices and cybersecurity global black belt at Microsoft. "What is the
nature of the threat you're trying to protect against? Is it a malicious actor? Or
is it a storm?"
I know you probably have experience with choosing and implementing controls,
and I don't want this section to end up being half of the entire book, just droning
on and on about different types of controls or all of the great vendors out there
who want to sell you a silver bullet to fix all of your issues. I'm going to go into
many different controls and ideologies in the following chapters, anyway.
UNIT - I 32
[CYBER SECURITY]
There are so many specific controls, there's just no way we can go into each of
them in this chapter. Beyond the Annex A controls from ISO 27001, further
expansion on controls and the categories of controls can be found in the links
on this page: NIST SP 800-53 Rev 5
(https://csrc.nist.gov/publications/detail/sp/800-53/rev-5/final), including
control mappings between the ISO 27001 standard, and NIST SP 800-53.
What I can cover are the types of controls that you'll be able to categorize and
apply as mitigation against risk, depending on the threat and vertical:
UNIT - I 33
[CYBER SECURITY]
Generally, the order in which you would like to place your controls for adequate
defense in depth is the following:
A concept to keep in mind, especially in the era of the cloud, SaaS, PaaS, IaaS,
third-party solutions, and all other forms of "somebody else's computer" is to
UNIT - I 34
[CYBER SECURITY]
ensure that Service-Level Agreements (SLAs) are clearly defined, and have
agreements for maximum allowable downtime, as well as penalties for failing to
deliver on those agreements. This is an example of a compensating control.
As a consumer of third-party solutions, you'll want to fight for SLAs that reflect
your risk appetite. Simultaneously, you'll also want to consider the idea that by
chaining those assets together, you are creating a higher level of risk to
availability. If just one of the services isn't online, and you can't perform a task,
that's a loss of availability. If you're a vendor of cloud services, you need to
consider your availability and what can be offered to your customers
realistically, and what is required from a commercial perspective.
AUTHENTICATION
Authentication is used by a server when the server needs to know exactly
who is accessing their information or site.
Authentication is used by a client when the client needs to know that the
server is system it claims to be.
In authentication, the user or computer has to prove its identity to the
server or client.
Usually, authentication by a server entails the use of a user name and
password. Other ways to authenticate can be through cards, retina scans,
voice recognition, and fingerprints.
Authentication by a client usually involves the server giving a certificate
to the client in which a trusted third party such as Verisign or Thawte
states that the server belongs to the entity (such as a bank) that the client
expects it to.
Authentication does not determine what tasks the individual can do or
what files the individual can see. Authentication merely identifies and
verifies who the person or system is.
ACCESS CONTROL
Access control is a data security process that enables organizations to manage
who is authorized to access corporate data and resources. Secure access control
uses policies that verify users are who they claim to be and ensures appropriate
control access levels are granted to users.
UNIT - I 35
[CYBER SECURITY]
For example, an email service or online bank account can require users to
provide two-factor authentication (2FA), which is typically a combination of
something they know (such as a password), something they possess (such as a
token), or something they are (like a biometric verification). This information
can also be verified through a 2FA mobile app or a thumbprint scan on a
smartphone.
3. Access
Once a user has completed the authentication and authorization steps, their
identity will be verified. This grants them access to the resource they are
attempting to log in to.
4. Manage
Organizations can manage their access control system by adding and removing
the authentication and authorization of their users and systems. Managing
these systems can become complex in modern IT environments that comprise
cloud services and on-premises systems.
5. Audit
UNIT - I 36
[CYBER SECURITY]
Organizations can enforce the principle of least privilege through the access
control audit process. This enables them to gather data around user activity and
analyze that information to discover potential access violations.
How Does Access Control Work?
Access control is used to verify the identity of users attempting to log in to digital
resources. But it is also used to grant access to physical buildings and physical
devices.
Physical Access Control
verifying the user’s identity to provide an extra layer of security that the user is
who they claim to be.
Importance of Access Control in Regulatory Compliance
The Payment Card Industry Data Security Standard (PCI DSS) is a security
standard that protects the payment card ecosystem. An access control system
is crucial to permitting or denying transactions and ensuring the identity of
users.
HIPAA
The Health Insurance Portability and Accountability Act (HIPAA) was created to
protect patient health data from being disclosed without their consent. Access
control is vital to limiting access to authorized users, ensuring people cannot
access data that is beyond their privilege level, and preventing data breaches.
SOC 2
DAC models allow the data owner to decide access control by assigning access
rights to rules that users specify. When a user is granted access to a system, they
can then provide access to other users as they see fit.
3. Mandatory Access Control (MAC)
MAC places strict policies on individual users and the data, resources, and
systems they want to access. The policies are managed by an organization’s
administrator. Users are not able to alter, revoke, or set permissions.
4. Role-Based Access Control (RBAC)
RBAC creates permissions based on groups of users, roles that users hold, and
actions that users take. Users are able to perform any action enabled to their
role and cannot change the access control level they are assigned.
5. Break-glass Access Control
A rule-based approach sees a system admin define rules that govern access to
corporate resources. These rules are typically built around conditions, such as
the location or time of day that users access resources.
What Are Some Methods for Implementing Access Control?
One of the most common methods for implementing access controls is to use
VPNs. This enables users to securely access resources remotely, which is crucial
when people work away from the physical office. Companies can use VPNs to
provide secure access to their networks when employees are based in various
locations around the world. While this is ideal for security reasons, it can result
in some performance issues, such as latency.
CRYPTOGRAPHY
Cryptography refers to the technique or practice of securing data and
communications. While today it’s used almost exclusively in a technological
context, the practice of cryptography dates back well before the digital age. The
UNIT - I 39
[CYBER SECURITY]
Navajo code talkers developed a code using the Navajo language to send secret
messages during World War II. Today, cryptography is used to keep sensitive
material, such as private passwords, secure online. Cybersecurity experts use
cryptography to design algorithms, ciphers, and other security measures that
codify and protect company and customer data.
UNIT - I 40
[CYBER SECURITY]
Python
For several years now, Python has been a dominant language in cybersecurity.
It is a server-side scripting language, so the resulting script doesn’t need
compiling by coders. It’s a general-purpose language that is used in many — if
not most — cybersecurity situation.
With Python, you’re able to automate tasks and perform malware analysis. Plus
an extensive third-party library of scripts is readily accessible, meaning help is
right around the corner. Code readability, clear and easy syntax, and a vast
number of libraries are some of the aspects that make it popular.
UNIT - I 41
[CYBER SECURITY]
You need to build tools and scripts in this role to protect web pages from security
threats. To examine the root of the issues, you can also employ data, logs, and
artifacts.
As a side note: The chart above shows the relative popularity based on how
many GitHub pulls are made per year for that language. This chart and all the
charts below are based on data from GitHut 2.0, created by littleark.
Golang
UNIT - I 42
[CYBER SECURITY]
JavaScript
It’s one of the finest programming languages for cybersecurity you can master.
JavaScript is for you if you want to capture cookies, exploit event handlers,
and carry out cross-site scripting.
NodeJS, ReactJS, jQuery — these are all JavaScript libraries.
This also implies that, due to the widespread use of the language,
applications and systems using it are prominent targets.
JavaScript lets programmers use any code while users visit a website,
strengthening that site’s functionality. On the other hand, it may produce
malicious functionality hidden from the visitor. If the web site is compromised,
malicious codes may be used to run a program.
If you’re a JavaScript expert, you can ensure that any site is safe enough to
reduce or even remove Cross-Site Scripting (XSS) attacks.
UNIT - I 43
[CYBER SECURITY]
Lint is a code analysis tool intended for programs that are written in C. Different
versions have emerged since its inception. Both cybersecurity experts and
hackers may use Lint to identify programming errors, and find bugs that risk
computer network security.
C++
C++ was adapted from the C coding language, but has several distinct features.
like Flawfinder that scans C++ lets cyber experts easily recognize security flaws
in code. These tools describe existing vulnerabilities, their severity, and their
effects on an application by using an integrated database that includes the
language function’s possible risks.
SQL
SQL (Structured Query Language) is a domain-specific programming language. It
highly popular and is used to parse data in large databases. With businesses
becoming more data-driven, SQL is the most demanded database management
programming language.
Most websites use SQL for their data management activities like
Relational Database Management System (RDBS).
It deals with numerous database systems.
Consequently, it is also recognized as the most straightforward language
for handling a database.
You’ll need to have at least a basic knowledge of SQL if you want to comprehend
the activity of the attacker and avoid SQL injection as well as other database-
related attacks.
Assembly
UNIT - I 45
[CYBER SECURITY]
PowerShell
UNIT - I 46
[CYBER SECURITY]
Ruby
Java
Java is one of the first languages to be used in the design of many major
operating systems, like Solaris, Linux, macOS, and Microsoft Windows. Since it
UNIT - I 47
[CYBER SECURITY]
drives both modern and legacy web servers, it is extensively used in all
industries.
PHP
UNIT - I 48
[CYBER SECURITY]
You could use RIPS if you’re a PHP developer working with security
vulnerabilities.
As a PHP security-focused developer, you can write server-side web
application logic.
You can handle back-end resources and data sharing between servers and
their consumers using PHP
You can also use your PHP knowledge to eliminate any vulnerabilities in
your code.
It’s also worth noting that PHP is used by businesses as a language on the server-
side that works with HTML, helping websites work properly. To make website
updates easier, web designers use PHP to connect databases with web pages.
Shell scripting
Shell scripting incorporates several of the same commands that you may already
use in your operating system’s terminal sessions and lets developers create
automated scripts for various routine activities.
You’ll want to master some Linux script languages like Bash if you’re using Linux
or macOS. If you’re a Windows pro, immerse yourself in PowerShell.
UNIT - I 49
[CYBER SECURITY]
Flatiron School’s Cybersecurity Prep Work. Learners who want to dive into
cybersecurity fundamentals like virtualization functions can get started with this
free prep work.
UNIT - I 50
[CYBER SECURITY]
Level Effect. This course focuses on security and is paired with practical
applications and use cases. Develop the skills needed to secure cybersecurity job
roles or advance your career with new strategies, techniques, and processes.
Buffer Overflows
A buffer overflow is the computing equivalent of trying to pour two liters of
water into a one-liter pitcher: Some water is going to spill out and make a mess.
And in computing, what a mess these errors have made!
Definition
A buffer (or array or string) is a space in which data can be held. A buffer resides
in memory. Because memory is finite, a buffer's capacity is finite. For this reason,
in many programming languages the programmer must declare the buffer's
maximum size so that the compiler can set aside that amount of space.
UNIT - I 51
[CYBER SECURITY]
Let us look at an example to see how buffer overflows can happen. Suppose a C
language program contains the declaration:
char sample[10];
The compiler sets aside 10 bytes to store this buffer, one byte for each of the
ten elements of the array, sample[0] through sample[9]. Now we execute the
statement:
sample[10] = 'A';
The subscript is out of bounds (that is, it does not fall between 0 and 9), so we
have a problem. The nicest outcome (from a security perspective) is for the
compiler to detect the problem and mark the error during compilation.
However, if the statement were
sample[i] = 'A';
we could not identify the problem until i was set during execution to a too-big
subscript. It would be useful if, during execution, the system produced an error
message warning of a subscript out of bounds. Unfortunately, in some
languages, buffer sizes do not have to be predefined, so there is no way to detect
an out-of-bounds error. More importantly, the code needed to check each
subscript against its potential maximum value takes time and space during
execution, and the resources are applied to catch a problem that occurs
relatively infrequently. Even if the compiler were careful in analyzing the buffer
declaration and use, this same problem can be caused with pointers, for which
there is no reasonable way to define a proper limit. Thus, some compilers do not
generate the code to check for exceeding bounds.
Let us examine this problem more closely. It is important to recognize that the
potential overflow causes a serious problem only in some instances. The
UNIT - I 52
[CYBER SECURITY]
All program and data elements are in memory during execution, sharing space
with the operating system, other code, and resident routines. So there are four
cases to consider in deciding where the 'B' goes, as shown in Figure 3-1. If the
extra character overflows into the user's data space, it simply overwrites an
existing variable value (or it may be written into an as-yet unused location),
perhaps affecting the program's result, but affecting no other program or data.
In the second case, the 'B' goes into the user's program area. If it
overlays an already executed instruction (which will not be
executed again), the user should perceive no effect. If it overlays an instruction
that is not yet executed, the machine will try to execute an instruction with
operation code 0x42, the internal code for the character 'B'. If there is no
instruction with operation code 0x42, the system will halt on an illegal
instruction exception. Otherwise, the machine will use subsequent bytes as if
they were the rest of the instruction, with success or failure depending on the
meaning of the contents. Again, only the user is likely to experience an effect.
The most interesting cases occur when the system owns the space immediately
after the array that overflows. Spilling over into system data or code areas
produces similar results to those for the user's space: computing with a faulty
value or trying to execute an improper operation.
Security Implication
Let us suppose that a malicious person understands the damage that can be
done by a buffer overflow; that is, we are dealing with more than simply a
normal, errant programmer. The malicious programmer looks at the four cases
illustrated in Figure 3-1 and thinks deviously about the last two: What data
values could the attacker insert just after the buffer so as to cause mischief or
damage, and what planned instruction codes could the system be forced to
UNIT - I 53
[CYBER SECURITY]
execute? There are many possible answers, some of which are more malevolent
than others. Here, we present two buffer overflow attacks that are used
frequently. (See [ALE96] for more details.) First, the attacker may replace code
in the system space. Remember that every program is invoked by the operating
system and that the operating system may run with higher privileges than those
of a regular program. Thus, if the attacker can gain control by masquerading as
the operating system, the attacker can execute many commands in a powerful
role. Therefore, by replacing a few instructions right after returning from his or
her own procedure, the attacker can get control back from the operating
system, possibly with raised privileges. If the buffer overflows into system code
space, the attacker merely inserts overflow data that correspond to the machine
code for instructions.
On the other hand, the attacker may make use of the stack pointer or the return
register. Subprocedures calls are handled with a stack, a data structure in which
the most recent item inserted is the next one removed (last arrived, first served).
This structure works well because procedure calls can be nested, with each
return causing control to transfer back to the immediately preceding routine at
its point of execution. Each time a procedure is called, its parameters, the return
address (the address immediately after its call), and other local values are
pushed onto a stack. An old stack pointer is also pushed onto the stack, and a
stack pointer register is reloaded with the address of these new values. Then,
control is transferred to the subprocedure.
UNIT - I 54
[CYBER SECURITY]
An alternative style of buffer overflow occurs when parameter values are passed
into a routine, especially when the parameters are passed to a web server on
the Inter-net. Parameters are passed in the URL line, with a syntax similar
to http://www.somesite.com/subpage/userinput&parm1=(808)555-
1212&parm2=2004Jan01
In this example, the page userinput receives two parameters, parm1 with value
(808)555-1212 (perhaps a U.S. telephone number) and parm2 with value
2004Jan01 (perhaps a date). The web browser on the caller's machine will
accept values from a user who probably completes fields on a form. The browser
encodes those values and transmits them back to the server's web site.
The attacker might question what the server would do with a really long
telephone number, say, one with 500 or 1000 digits. But, you say, no telephone
in the world has such a telephone number; that is probably exactly what the
developer thought, so the developer may have allocated 15 or 20 bytes for an
expected maximum length telephone number. Will the program crash with 500
digits? And if it crashes, can it be made to crash in a predictable and usable way?
(For the answer to this question, see Litchfield's investigation of the
Microsoft dialer program [LIT99].) Passing a very long string to a web server is a
slight variation on the classic buffer overflow, but no less effective.
Incomplete Mediation
Incomplete mediation is another security problem that has been with us for
decades. Attackers are exploiting it to cause security problems.
Definition
Consider the example of the previous section:
http://www.somesite.com/subpage/userinput&parm1=(808)555-
1212&parm2=2004Jan01
UNIT - I 55
[CYBER SECURITY]
The two parameters look like a telephone number and a date. Probably the
client's (user's) web browser enters those two values in their specified format
for easy processing on the server's side. What would happen if parm2 were
submitted as 1800Jan01? Or 1800Feb30? Or 2048Min32? Or 1Aardvark2Many?
Something would likely fail. As with buffer overflows, one possibility is that the
system would fail catastrophically, with a routine's failing on a data type error
as it tried to handle a month named "Min" or even a year (like 1800) which was
out of range. Another possibility is that the receiving program would continue
to execute but would generate a very wrong result. (For example, imagine the
amount of interest due today on a billing error with a start date of 1 Jan 1800.)
Then again, the processing server might have a default condition, deciding to
treat 1Aardvark2Many as 3 July 1947. The possibilities are endless.
One way to address the potential problems is to try to anticipate them. For
instance, the programmer in the examples above may have written code to
check for correctness on the client's side (that is, the user's browser). The client
program can search for and screen out errors. Or, to prevent the use of
nonsense data, the program can restrict choices only to valid ones. For example,
the program supplying the parameters might have solicited them by using a
drop-down box or choice list from which only the twelve conventional months
would have been possible choices. Similarly, the year could have been tested to
ensure that the value was between 1995 and 2005, and date numbers would
have to have been appropriate for the months in which they occur (no 30th of
February, for example). Using these verification techniques, the programmer
may have felt well insulated from the possible problems a careless or malicious
user could cause.
However, the program is still vulnerable. By packing the result into the return
URL, the programmer left these data fields in a place accessible to (and
changeable by) the user. In particular, the user could edit the URL line, change
any parameter values, and resend the line. On the server side, there is no way
for the server to tell if the response line came from the client's browser or as a
result of the user's editing the URL directly. We say in this case that the data
values are not completely mediated: The sensitive data (namely, the parameter
values) are in an exposed, uncontrolled condition.
Security Implication
UNIT - I 56
[CYBER SECURITY]
Incomplete mediation is easy to exploit, but it has been exercised less often than
buffer overflows. Nevertheless, unchecked data values represent a serious
potential vulnerability.
To demonstrate this flaw's security implications, we use a real example; only the
name of the vendor has been changed to protect the guilty. Things, Inc., was a
very large, international vendor of consumer products, called Objects. The
company was ready to sell its Objects through a web site, using what appeared
to be a standard e-commerce application. The management at Things decided
to let some of its in-house developers produce the web site so that its customers
could order Objects directly from the web.
To accompany the web site, Things developed a complete price list of its Objects,
including pictures, descriptions, and drop-down menus for size, shape, color,
scent, and any other properties. For example, a customer on the web could
choose to buy 20 of part number 555A Objects. If the price of one such part were
$10, the web server would correctly compute the price of the 20 parts to be
$200. Then the customer could decide whether to have the Objects shipped by
boat, by ground transportation, or sent electronically. If the customer were to
choose boat delivery, the customer's web browser would complete a form with
parameters like these:
http://www.things.com/order/final&custID=101&part=555A
&qy=20&price=10&ship=boat&shipcost=5&total=205
So far, so good; everything in the parameter passage looks correct. But this
procedure leaves the parameter statement open for malicious tampering.
Things should not need to pass the price of the items back to itself as an input
parameter; presumably Things knows how much its Objects cost, and they are
unlikely to change dramatically since the time the price was quoted a few
screens earlier.
http://www.things.com/order/final&custID=101&part=555A
&qy=20&price=1&ship=boat&shipcost=5&total=25
Surprise! It worked. The attacker could have ordered Objects from Things in any
quantity at any price. And yes, this code was running on the web site for a while
before the problem was detected. From a security perspective, the most serious
concern about this flaw was the length of time that it could have run undetected.
UNIT - I 57
[CYBER SECURITY]
Had the whole world suddenly made a rush to Things's web site and bought
Objects at a fraction of their price, Things probably would have noticed. But
Things is large enough that it would never have detected a few customers a day
choosing prices that were similar to (but smaller than) the real price, say 30
percent off. The e-commerce division would have shown a slightly smaller profit
than other divisions, but the difference probably would not have been enough
to raise anyone's eyebrows; the vulnerability could have gone unnoticed for
years. Fortunately Things hired a consultant to do a routine review of its code,
and the consultant found the error quickly.
This web program design flaw is easy to imagine in other web settings. Those of
us interested in security must ask ourselves how many similar problems are
there in running code today? And how will those vulnerabilities ever be found?
Definition
Access control is a fundamental part of computer security; we want to make
sure that only those who should access an object are allowed that access. (We
explore the access control mechanisms in operating systems in greater detail in
Chapter 4.) Every requested access must be governed by an access policy stating
who is allowed access to what; then the request must be mediated by an access
policy enforcement agent. But an incomplete mediation problem occurs when
access is not checked universally. The time-of-check to time-of-use (TOCTTOU)
flaw concerns mediation that is performed with a "bait and switch" in the
middle. It is also known as a serialization or synchronization flaw.
UNIT - I 58
[CYBER SECURITY]
the security was checked (counting the bills) and the access (exchanging the
sculpture for the bills), a condition changed: what was checked is no longer valid
when the object (that is, the sculpture) is accessed.
To carry out this authorization sequence, the access control mediator would
have to look up the file name (and the user identity and any other relevant
parameters) in tables. The mediator could compare the names in the table to
the file name in the data structure to determine whether access is appropriate.
More likely, the mediator would copy the file name into its own local storage
area and compare from there. Comparing from the copy leaves the data
structure in the user's area, under the user's control.
It is at this point that the incomplete mediation flaw can be exploited. While the
mediator is checking access rights for the file my_file, the user could change the
file name descriptor to your_file, the value shown in Figure 3-3. Having read the
work ticket once, the mediator would not be expected to reread the ticket
before approving it; the mediator would approve the access and send the now-
modified descriptor to the file handler.
UNIT - I 59
[CYBER SECURITY]
Security Implication
The security implication here is pretty clear: Checking one action and performing
another is an example of ineffective access control. We must be wary whenever
there is a time lag, making sure that there is no way to corrupt the check's results
during that interval.
Fortunately, there are ways to prevent exploitation of the time lag. One way to
do so is to use digital signatures and certificates. As described in Chapter 2, a
digital signature is a sequence of bits applied with public key cryptography, so
that many people—using a public key—can verify the authenticity of the bits,
but only one person—using the corresponding private key—could have created
them. In this case, the time of check is when the person signs, and the time of
use is when anyone verifies the signature.
Suppose the signer's private key is disclosed some time before its time of use. In
that case, we do not know for sure that the signer did indeed "sign" the digital
signature; it might have been a malicious attacker acting with the private key of
the signer. To counter this vulnerability, a public key cryptographic
infrastructure includes a mechanism called a key revocation list, for reporting a
revoked public key—one that had been disclosed, was feared disclosed or lost,
became inoperative, or for any other reason should no longer be taken as valid.
The recipient must check the key revocation list before accepting a digital
signature as valid.
UNIT - I 60
[CYBER SECURITY]
The most common form of malicious code is the computer virus, which infects a
computer by attaching itself to another program and then propagating when
that program is executed. Another common form is the worm, which makes
copies of itself, spreading through connected systems and consuming resources
on affected computers.
COUNTERMEASURES
In IT systems, multiple countermeasures may be applied for enhanced security.
Protective countermeasures may be in the form of hardware or software.
Examples include:
UNIT - I 61