Security
Security
Three trends
1) Connectivity
Inter networked
Include SCADA (supervisory control and data
acquisition systems)
Automated attacks
2) Extensibility
Mobile code – functionality evolves
incrementally
Web/Os Extensibility
3) Complexity
XP is at least 40 M lines of code 2
Add to that use of unsafe languages (C/C++)
Bigger problem today .. And growing
3
SOLUTION …
THREE PILLARS OF SECURITY
4
Risk Analysis and Management Framework
Risks
} Analysis
5
TERMINOLOGY
The meanings of terms in this area is not universally
agreed. We will use the following
Threat: Harm that can happen to an asset
Impact: A measure of the seriousness of a threat
Attack: A threatening event
Attacker: The agent causing an attack (not
necessarily human)
Vulnerability: a weakness in the system that makes an
attack more likely to succeed
Risk: a quantified measure of the likelihood of a threat
being realised
6
TERMINOLOGY …
Risk
Analysis involves the identification and
assessment of the levels of risk, calculated from
the
� Values of assets
� Threats to the assets
� Their vulnerabilities and likelihood of exploitation
8
WHAT IS RISK?
We just started integrating the software and we
found out that COTS* products A and B just
can’t talk to each other.
We’ve got too much tied into A and B to change
Our best solution is to build wrappers around A
and B to get them to talk via CORBA.
This will take 3 months and $300K
It will also delay integration and delivery by at
least 3 months
Is this RISK?
13
Cont.…
q Risk Assessment: The initial steps of risk management.
1) Analyzing the value of assets to the business,
2) Identifying threats to those assets, and
3) Evaluating how vulnerable each asset is to those threats.
q Risk Assessment can be quantitative (based on numerical) or
qualitative.
q The Business Continuity Management Process involves reducing risks
to an acceptable level and planning for the recovery of business
processes.
14
Cont.…
15
Cont.….
The ITSCM process includes:
q Agreement on the scope of the ITSCM process and the policies adopted.
q Business Impact Analysis (BIA) to quantify the impact loss of IT service would
have on the business.
q Risk Analysis: the risk identification and risk assessment to identify potential
threats to continuity and the likelihood of the threats becoming a reality.
q This also includes taking measures to manage the identified threats where this
can be cost-justified.
q Production of the overall ITSCM strategy. This can be produced following the
two steps identified above and is likely to include elements of risk reduction as
well as a selection of appropriate and comprehensive recovery options.
q Production of an ITSCM plan, which again must be integrated with the overall
BCM plans.
16
q Testing of the plans.
q Ongoing operation and maintenance of the plans
Cont.…
A standard methodology, such as the Management of
Risk (M_o_R), should be used to assess and manage
risks within an organization.
17
Cont..
q M_o_R principles: these principles are essential for the
development of good risk management practice and are
derived from corporate governance principles.
q M_o_R approach: an organization’s approach to these
principles needs to be agreed upon and defined within the
following living documents:
q Risk Management Policy
q Process Guide
q Plans
q Risk registers 18
q Issue Logs
Cont..
q M_o_R Processes: the following four main steps
describe the inputs, outputs and activities that ensure
that risks are controlled:
q Identify the threats and opportunities within an activity
that could impact the ability to reach its objective.
q Assess: the understanding of the net effect of the
identified threats and opportunities associated with an
activity when aggregated together
q Plan: to prepare a specific management response that
will reduce the threats and maximize the opportunities.19
q Implement: the planned risk management actions
monitor their effectiveness and take corrective action
where responses do not match expectations.
q Embedding and reviewing M_o_R: having put the
principles, approach, and processes in place, they
need to be continually reviewed and improved to
ensure they remain effective.
q Communication: having the appropriate
communication activities in place to ensure that
everyone is kept up-to-date with changes in threats,
opportunities and any other aspects of 20
risk
management.
RISK EQUATION
Risk = Vulnerability x Threat x Impact
*Probability
Vulnerability = An error or a weakness in the
design, implementation, or operation of a system.
impact.
RISK TYPES
Strategic – Goals of the Organization
Operational – Processes that Achieve Goals
Compliance – Laws and Regulations
Reputational – Public Image
Technical risk: Includes problem with languages, project size, project
functionality .
Management risk: It includes lack of management experience
and lack of planing.
Financial risk: Includes cash flow, capital and budget issues.
Project Risks: affect project schedule or resources.
Product Risks: affect product quality or performance of software.
22
Personnel risk: Includes staffing lags, experience and training
problems.
HOW CAN RISK MANAGEMENT
HELP YOU DEAL WITH RISKS?
Strategies:
Buying information
Risk avoidance
Risk transfer
Risk reduction
Risk acceptance
23
RISK MANAGEMENT STRATEGIES:
Buying Inform
integration of A and B.
S(L)
27
DAY ONE TEMPTATIONS TO AVOID -
I It’s too early to think about risks. We
need to:
Finalize the requirements
� Maximize our piece of the pie
barn
DAY ONE TEMPTATIONS TO AVOID - II
We don’t have time to think about the risks. We
need to:
Get some code running right away
Business
Context
5
Carry out fixes
And validate
23
STAGE 1:
UNDERSTAND BUSINESS
CONTEXT
Risk management
� Occurs in a business context
� Affected by business motivation
Key activity of an analyst
� Extract and describe business goals – clearly
Increasing revenue; reducing dev cost; meeting SLAs;
generating high return on investment (ROI)
� Set priorities
� Understand circumstances
Bottomline – answer the question
� who cares?
32
STAGE 2: IDENTIFY THE
BUSINESS &
TECHNICAL RISKS
Business risks have impact
Severity of risks
� Should be capture in financial or project management
terms
Key is –
33
� tie technical risks to business context
ØFor example, a technical risk may give rise to
Øthe system behaving in an unexpected way,
Øviolating its own design structures, or failing to perform
as required.
Øthe process of building software may offer too many
opportunities for mistakes in design or implementation.
ØTechnical risks involve impacts such as
ØUnexpected system crashes,
ØAvoidance of controls
ØUnauthorized data modification or disclosure
ØNeedless rework of artifacts during development.
34
STAGE 3: SYNTHESIZE AND RANK THE
RISKS
Risk metrics
� Risk likelihood
� Risk impact
35
ØIn this stage the critical "Who cares?" question can be answered.
ØSynthesis and prioritization should be driven to answer questions
such as:
Ø"What shall we do first given the current risk situation?"
Ø"What is the best allocation of resources, in terms of risk
mitigation activities?“
Ø The prioritization process must take into account
Øwhich business goals are the most important to the organization,
Øwhich goals are immediately threatened,
Øhow likely technical risks are to manifest themselves in a way that
impacts the business.
ØAll the risks and their appropriate weighting for resolution. 36
ØTypical risk metrics include risk likelihood, risk impact and risk
STAGE 4: RISK MITIGATION STRATEGY
Develop a coherent strategy
� For mitigating risks
� In cost effective manner; account for
Cost Implementation time
Completeness Impact
Likelihood of success
effectiveness.
RESPONSES TO
RISK
Responses to risk
Avoid it completely by withdrawing from an activity
39
SECURITY MEASURES
Reduce vulnerability
� Reduce likelihood of attempt
Imagine that an adversary wants to deliberately disrupt your systems. Or perhaps a well
intentioned engineer with a privileged account makes a far-reaching change by mistake.
Since you understand your systems well, and they’re designed for the least privilege and
recovery, the impact to your environment is limited.
When investigating and performing incident response, you can identify the root cause of
the issues and take appropriate action.
Security isn't a one-time effort. You must implement this guidance on a recurring basis.
CHAPTER TWO
SECURITY DESIGN PRINCIPLES
§ Developing an infrastructure that’s considerably secure is not an easy task with the ever-
increasing sophistication of hackers.
§ If you are to consider yourself an information security expert, however, you need to be aware
of the tenets of a secure system.
§ These principles should guide the security of our architecture, design choices, and
operational processes.
§ Secure design principle promotes the concept of defense in depth, in which multiple
layers of security complementing each other are used in order to increase the
overall security.
THE THREE PILLARS OF SOFTWARE SECURITY
However, security risks crop up throughout the SDLC thus, an overall approach to risk
management as a philosophy is also important.
§ Safe proxies are among the set of tools we use to achieve these principles.
§ Access
§ Authorization
It's an approach to culture, automation, and platform design that integrates security as a shared
responsibility throughout the entire IT lifecycle.
If you want to take full advantage of the agility and responsiveness of a DevOps approach, IT security
must also play an integrated role in the full life cycle of your apps.
Effective DevOps ensures rapid and frequent development cycles(sometimes weeks or days), but
outdated security practices can undo even the most efficient DevOps initiatives.
Now, in the collaborative framework of DevOps, security is a shared responsibility integrated from end
to end.
CONT.…
It’s a mindset that is so important, it led some to coin the term
"DevSecOps" to emphasize the need to build a security foundation
into DevOps initiatives.
DevSecOps means thinking about application and infrastructure
security from the start. It also means automating some security gates
to keep the DevOps workflow from slowing down.
WHAT IS CONTAINER SECURITY?
Container security involves defining and adhering to build, deployment, and
runtime practices that protect a Linux container from the applications they
support to the infrastructure they rely on.
1
WORMS AND OTHER MALWARES
2
• Intruders can gain access to a network through software vulnerabilities, hardware
attacks, or
even through less high-tech methods, such as guessing usernames and
passwords.
• Intruders who gain access by modifying software or exploiting software vulnerabilities
are often
called threat
actors.
▪ When the threat actor gains access to the network, four types of threat
may arise:
✓ Information
theft
✓ Data loss and
manipulation
✓ Identity theft
✓ Disruption of
service
• Information theft is breaking into a computer to obtain confidential
information.
• Information can be used or sold for various purposes such as when someone is
stealing
proprietary information of an organization, like research and
development data.
• Data loss and manipulation is breaking into a computer to destroy or alter
data records.
• An example of data loss is a threat actor sending a virus that reformats a computer3
hard driv
• An example of data manipulation is breaking into a records
system
changetoinformation, such as the price of an
item
• Identity theft is a form of information theft where personal
information
is stolen for the purpose of taking over the identity of
someone.
• Using this information, a threat actor can obtain legal
documents,
apply for credit, and make unauthorized online
purchases.
• Identity theft is a growing problem costing billions of dollars per
year.
• Disruption of service is preventing legitimate users from
accessing
services to which they are
entitled.
• Examples include denial of service (DoS) attacks on servers,
network
devices, or network communications
links.
• Security threats from network intruders can come from both
internal
and external
sources.
4
4.1. EXTERNAL THREATS
5
4.2. INTERNAL THREATS
• Internal threats occur when someone has authorized access to the network
through a user
account or has physical access to the network equipment. Internal attackers
know the
• internal politics
They often knowand people.
what information is both valuable and vulnerable, and how to
get to it.
However, not all internal attacks are
intentional.
• In some cases, an internal threat can come from a trustworthy employee who
picks up a
virus or security threat while outside the company and unknowingly brings it
into the
• internal network.spend considerable resources defending against external
Most companies
attacks,however;
some of the most damaging incidents are the result of actions by trusted
internal users.
• Lost smartphones and removable storage devices, misplaced or stolen laptops,
and the
failure to properly remove data from devices before disposal are common ways
that user 6
4.3. Social Engineering attack
▪ One of the easiest ways for an intruder to gain access, whether internal or
external, is
by exploiting human
behavior.
▪ One of the more common methods of exploiting human weaknesses is
called social
engineering.
• In addition to social engineering, there are other types of attacks launched by malicious
software
which exploit the vulnerabilities in computer
software.
• Malware is the short name for malicious
software.
• Examples of malware attacks include viruses, worms, and Trojan
horses.
• They can also forward data and personal details from unsuspecting PC users to
criminals.
•• In many how
Imagine cases, they can
difficult replicate
it would themselves
be to and spread
recreate saved to other
files, such hosts
as game connected
files, to
license key
the
files,network.
photographs, and
videos.
• Sometimes these techniques are used in combination with social engineering to trick an
unsuspecting
user into executing the
attack. 9
4.4.1. TYPES OF MALWARE
• Viruses A virus is a program that spreads by modifying other
programs
or files.
• A virus cannot start by itself; it needs to be activated. When
activated,
virus maya do nothing more than replicate itself and
spread.
• Though simple, even this type of virus is dangerous as it can
quickly
use all available memory and bring a system to a
halt.
• A more serious virus may be programmed to delete or corrupt
specific
files before
spreading.
• Viruses can be transmitted via email, downloaded files, and
instant
messages, or via CD or USB
devices.
10
• Worms: A worm is similar to a virus, but unlike a virus, it does not need to
attach
itself to an existing
program.
• A worm uses the network to send copies of itself to any
connected hosts.
• Worms can run independently and spread quickly. They do not necessarily
require
activation or human
intervention.
• Self-spreading network worms can have a much greater impact than a single
virus
canand
infect large parts of the internet
quickly.
Trojan Horses
• A Trojan horse is a program that is written to appear like a legitimate
program,
when in fact it is an attack
tool.
• It can not replicate itself. A Trojan horse relies upon its legitimate
appearance
to deceive the victim into initiating the
program.
• It may be relatively harmless or may contain code that can damage
the hard
drive content of the computer. Trojans can also create a back
door into a
system that then allows threat actors to gain access. 11
Spyware
• Not all attacks do damage or prevent legitimate users from having access to
resources.
• Many threats are designed to collect information about users which can be
used for
advertising, marketing, and research
purposes.
• These include spyware, tracking cookies, adware, and
popups.
• While these may not damage a computer, they invade privacy and can be
annoying.
• Spyware is any program that gathers personal information from your computer
without
your permission or
knowledge.
• This information is sent to advertisers or others on the internet and
can include
passwords and account
numbers.
• Spyware is usually installed unknowingly when downloading a file, installing
another
program, or clicking a
popup.
• It can slow down a computer and make changes to internal settings which
creates more
vulnerabilities for other
threats. 12
• In addition, spyware can be very difficult to
• This information is sent to advertisers or others on the internet and
can include
passwords and account
numbers.
• Spyware is usually installed unknowingly when downloading a file, installing
another
program, or clicking a
popup.
• It can slow down a computer and make changes to internal settings which
creates more
vulnerabilities for other
threats.
Tracking Cookies
▪ Cookies are a form of spyware but are not always bad.
▪ They are used to record information about an internet user when the user visits
websites.
▪ Cookies may be useful or desirable by allowing personalization and other
time-saving
techniques.
▪ Many websites require that cookies be enabled in order to allow the user to
connect.
13
Adware and Popups
systems.
• Some of the most effective security procedures are simple to
implement and extensive technical
do not require
knowledge.
• A username and password are two pieces of information that a user
needs toto a computer or
log on
application.
• When a threat actor knows one of these entries, the attacker
needs
crackonly to
or discover the other entry to gain access to the computer
system.
• It is important to change the default username for accounts
such as
administrator or guest, because these default usernames are widely
known.
• Whenever possible, change the default usernames of all users on
computers
network and
equipment.
• Most users select passwords that can be easily guessed or derived from
known
information about the user such as birthdays, pet names, or a favorite
sports team.
• It is important to view passwords as a key to valuable data and to make them
as as
secure
possible.
20
4.6. SECURITY TOOLS AND APPLICATIONS
• Internet security is a major concern around the world. Many tools are available to
network users
to protect the devices from attacks and to help remove malware from infected
machines.
21
4.7. SIGNS OF INFECTIONS
23
Antivirus Software
• Antivirus software can be used as both a preventive tool and as a reactive
tool.
• It prevents infection. It detects and removes viruses, worms, and Trojan
horses.
•• Antivirus software should
Antivirus software relies on
be known “virus
installed signatures”
on all computerstoconnected
find and prevent
to the new
viruses
from infecting the
network.
computer.
Some of the features that can be included in antivirus
programs are:
• Email checking - Scans incoming and outgoing emails, and identifies
spam and
suspicious
attachments.
• Resident dynamic scanning - Checks program files and documents when
they are
accessed.
• Scheduled scans - Virus scans can be scheduled to run at regular intervals and
check
specific drives or the entire
computer.
• Automatic Updates - Checks for and downloads known virus
characteristics
patterns. and
• Can be scheduled to check for updates on a regular
basis. 24
Antispam Software
• No one likes opening their email and being overwhelmed by
unwanted
messages.
• Spam is not only annoying; it can overload email servers and
potentially carry
viruses and other security
threats.
• Additionally, people who send spam may use links within the emails
tocontrol
take of a host by planting code on it in the form of a virus or a Trojan
horse.
• Antispam software protects hosts by identifying spam and
performing an as placing it into a junk folder or
action, such
deleting it.
• Spam filters can be loaded on individual devices, but can also be
loaded
emailon
servers.
• Antispam software does not recognize all spam, so it is important
toemail
open carefully.
25
Antispyware software
• Antispyware software detects and deletes spyware applications, as well as prevents future
installations from
occurring.
• Many antispyware applications also include detection and deletion of cookies and adware. Some
antivirus
packages include antispyware
functionality.
Popup blocker
Additional Safeguards
One of the most common types of spam forwarded is a
virus
warning.
• Although some virus warnings sent via email are true, a
number of them are hoaxes and do not really
large
• exist.
This type of spam can create problems because people
others of the impending disaster and so flood the email
warn
• system.
In addition, network administrators may overreact and
time investigating a problem that does not
waste
• exist.
Finally, many of these emails can actually
to the spread of viruses, worms, and Trojan
contribute
horses.
27
CONT..
28
Chapter Five
Crypto
Concepts
Outline
What is
cryptography?
Application of cryptography
Symmetric key
cryptography
Public Key Cryptography
Basic Security Properties (Revision)
Confidentiality: to prevent unauthorized
disclosure
of the
information
Integrity: to prevent or detect
unauthorized
modification of the
information
Authentication: to p rove the
person/computer
who she/it claims is to be (verify the identity of a
user)
Availa bility: to guarantee access to
information
Privacy: to prevent disclosure of
personal
informatio
nAccess control: The limitation and
controlthrough
access of identification and
authentication.
Problem 1:Secure communication
1. Substitution
techniques
▪ Letters of plain text are replaced by
letters or by numbers or
other
2. symbols.
Transposition
Techniques
▪ Performing some sort of permutation
on the
plaintext
letters.
A-Substitution Techniques
i) Spartan SCYTALE (c 500 B.C.)
Itwas used by the Spartan
Military
for encoding message sent
between
commanders.
ii) CEASAR Cipher
ii) CEASAR Cipher…
ii-CEASAR Algorithm
Example
ii-CEASAR’s Problem
C H Y B D
E F G I/J K
L P Q S T
U V W X Z
iii-Playfair Cipher …
The keyword is
monarchy.
The matrix is constructed by filling in
the
letters of the keyword (minus
duplicates)
from left to right and from top to
bottom,
and then filling in the remainder of
The letters I and J count as one
the
letter.
matrix with the remaining letters
in
iii-Playfair Cipher-Encryption
Plaintext is encrypted two letters at a
time
according to the following
rules:
1. Repeating plaintext letters that are in the same
pair are
separated with a filler letter, such as x, so that
balloon
2. Two plaintext letters that fall in the same row
M O N A R of would
the be treated as ba lx lo on.
C H Y B D matrix
the firstare each replaced
element of the by
rowthe letter tofollowing
circularly the
theF
E G I/J K right,
last. with
L P Q S T
U V W X Z ▪ For example, AR is encrypted as
RM. plaintext letters that fall in the same
3. Two
column are
each replaced by the letter beneath, with
the top
element of the column circularly following the last.
iii-Playfair Cipher-Encryption
M O N A R
C H Y B D
E F G I/J K
L P Q S T
U V W X Z
Example, MU is encrypted as
4. CM.
Otherwise, each plaintext letter in a
pair is
replaced by the letter that lies in its own
row
and theHScolumn
Example. becomesoccupied
BP and ea by the IM
becomes
other
(or
plaintext letter. wishes).
JM, as the encipherer
iii-Playfair Cipher …
On polyalphabetic ciphers we
need
▪ Number of alphabets used
Key for each
one
Cryptanalysis is harder since it is not
only a
matters to check how the frequency has
shifted
iv’-One-time Pad
A Vigenère cipher with a random key at least as
long
as the message so that the key need not be
repeated.
Probably
unbreakable
Why?
Ciphertext:“MEMATRHTGPRYETEFETEOAAT”
How to decrypt it?
A more complex scheme is to write the
message in a
rectangle, row by row, and read the message
off,
column by column but permute the order of
The order of the columns then becomes the key
to the
the
algorithm.
columns.
For example:
key=4312567
The transposition cipher can be made
significantly more secure by performing
more
than one stageofofprevious
Transposition transposition.
output
(TTNAAPTMTSUO AOD WCOI X KNLYPETZ) with
the same key
4-Modern Cryptography
i.Feistel Cipher
ii.Simplified DES(S-DES)
iii.DES: Data Encryption Standard.
iv-3DES
Shannon theory
Confusion (K C)
▪ Confusion makes the relation between the key
and the
ciphertext as complex as
▪ possible.
Ideally, every letter in the key influences every
letter
the of
ciphertext
block.
▪ Replacing every letter with the one next to it on the
typewriter
keyboard is a simple example of confusion by
substitution.
▪ Good confusion can only be achieved when each
character of the ciphertext depends on several
parts of
the key, and this dependence appears to be
▪ random to do not offer much confusion
Ciphers that
theas
(such observer.
Vigenère cipher) are vulnerable to frequency
analysis.
Shannon theory
Diffusion (M C)
▪ A fixed transformation can show good encryption
atfirst
the iterations but it can fail in the long
▪ run.
Diffusion refers to the property that the
statistics
structure of the plaintext is dissipated into long
▪ range
In contrast to confusion, diffusion spreads the
statistics
of a singleofplaintext
influence the ciphertext.
letter over many ciphertext
▪ letters.
In terms of the frequency statistics of letters,
digrams,
etc in the plaintext, diffusion randomly spreads
▪ them
This means that much more ciphertexts are
across
needed several characters
to
do a meaningful statisticalinattack
the ciphertext.
on the
cipher.
Shannon theory
Unconditional security
▪ Unconditionally secure systems can not be
broken
even if all possible keys could be tried within
short
time.
Modern symmetric key
cryptography
Modern symmetric key
cryptography
Product Cipher
SP-Network
Stream Ciphers and Block
Ciphers
Stream cipher is one that encrypts a digital
stream one bit or one byte at a
data
time.
E.g. Vigenère cipher and theVernam
cipher.
Block cipher is one in which a block of
plaintext
is treated as a whole and used to produce a
ciphertext
▪ Typically, block
a blockofsize
equal length.
of 64 or 128 bits is
used.
▪ E.g. Feistel cipher and
DES
Block Cipher
A block cipher operates on a block of n bits
and it
produces a ciphertext block of n
bits.
There are possible different
2n blocks. plaintext/ciphertext
The encryption must be reversible. i.e.
decryption to
be possible each plaintext must produce a
unique
Such a transformation is called reversible, or
ciphertext block. (one-to-one correspondence)
nonsingular.
The following examples illustrate nonsingular
and
singular transformations for n=2.
Fundamental of Software security
1
Overview
Computers today are used not only in the home and office,
but in a countless of crucial and sensitive applications.
we rely on computers in our day today lives !
“The most secure computers are those not connected to the Internet and
shielded from any interference”
Security
3
Computer and Network
• Security…
Network security on the other hand deals with provisions
and policies adopted to prevent and monitor unauthorized
access, misuse, modification, or denial of the computer
network and network-accessible resources.
Not Sufficient!!
4
Sources of risks/ who are attacker ?
o Vandals (Hackers, crackers) driven by intellectual
challenge.
o Insiders: employees or customers seeking revenge or gain
informal benefits
o Natural disasters: flooding, fire, storms, earthquake…
o Criminals seeking financial gain.
o Organized crime seeking gain or hiding criminal activities.
o Organized terrorist groups or nation states trying to
influence national policy.
o Foreign agents seeking information (spying) for economic,
political, or military purposes.
o Tactical countermeasures intended to disrupt military
capability.
o Large organized terrorist groups
o Cyber attacks
Vulnerabilities
Types of Vulnerabilities
vulnerability is a point where a system is susceptible to attack.
• use fiber
• Human vulnerabilities (Ex. Insiders)
– the greatest vulnerability of all 8
• Don't forget, one of the most dangerous insiders may simply be lazy
or untrained.
13
Countermeasures
• Authentication Password, cards, biometrics
• Encryption
• Auditing/inspect the quality of the system
• Administrative procedures
• Standards
)
surveillance equipment and cameras, and other physical security necessities
• Laws
• Backups
Control
Removing or reducing a vulnerability
You control a vulnerability to prevent an attack and block a threat.
14
9
Security and privacy
criteria
�Properties of Security?
� Confidentiality (Privacy)
� Integrity
� No repudiation
� Availability (Denial of Service)
156
Security Attacks
• Categories of Attacks
18
Attacks…
• Categories of Attacks/Threats
Source
Destination
Normal flow of information
Attack
Interruption Interception
Modification Fabrication 19
Security attack
• The attacks types
can also be classified by the following criteria.
– Passive or active,
– Internal or external,
– At different protocol layers.
Passive vs. active attacks
• A passive attack attempt to learn or make use of the
information without changing the content of the message
and disrupting the operation of the communication.
• Examples of passive attacks are:
-- Eavesdropping : is commonly applied to discover the
contents of confidential communication. In particular,
eavesdropping is often used to intercept personal
communication (e.g., email or instant messages) or
authentication credentials. 20
Security attack
types
Examples of passive attacks are:
21
Security attack
types…
• Active attack attempts to interrupt, modify, delete, or
fabricate messages or information thereby disrupting
normal operation of the network.
• Some examples of active attacks include:
22
Passive
• Passive attacks Attacks
do not affect system resources
– Eavesdropping, monitoring
• By means of encryption 23
Passive Attacks (1)
Eavesdropping
24
Passive Attacks (2)
Traffic Analysis
25
Active
•
Attacks
Active attacks try to alter system resources or affect their operation
• Four categories
– Modification of messages
• Difficult to prevent
26
– The goal is to detect and recover
Active Attacks (1)
Masquerade
27
Active Attacks (2)
Replay
28
Active Attacks (3)
Modification of Messages
29
Active Attacks (4)
Denial of Service
30
Security attack
types…
Internal vs. External attacks
31
Network Protocol & Security
Network protocols are a set of rules and conventions
that govern how data is transmitted and received over a
network.
171
TCP/IP Protocol Suite
It is the foundation of modern networking. It consists of several
layers, each with its own set of protocols.
173
Cont.…
Network Layer (IP Layer) Attack: IP spoofing, DDoS attacks, or
routing attacks.
Countermeasure: Implement packet filtering, use Access Control Lists (ACLs), and
deploy intrusion detection and prevention systems (IDPS) to mitigate DDoS
attacks.
keys.
data unit that allows a recipient of the data unit to prove the source and
integrity of the data unit and protect against forgery (e.g., by the recipient).
• Data Integrity - A variety of mechanisms used to assure the integrity of a
routes for certain data and allows routing changes, especially when a
implement the same protocol in different systems (e.g., two TCP modules in two
data unit. It does not provide protection against the duplication or modification of
data units. This type of service supports applications like electronic mail, where
Security Testing
What is security testing?
▪ Security testing is an integral part of software testing, which is
used to
discover the weaknesses, risks, or threats in the software
application.
▪ And also help us to stop the nasty attack from the outsiders and make
sure the
security of our software
applications.
▪ The primary objective of security testing is to find all the potential
ambiguities
and vulnerabilities of the application so that the software does not stop
working.
CONT.….
If we perform security testing, then it helps us to identify
all the
possible security threats and also help the programmer to
fix
It is a testing procedure, which is used to define that the
those errors.
data
be will
safe and also continue the working process of the
software.
❑ Principle of Security testing
Availability
In this, the data must be retained by an official person, and
they also
guarantee that the data and statement services will be ready
to use
whenever we need it.
CONT..
Integrity
▪ In this, we will secure those data which have been changed by the unofficial
person.
▪ The primary objective of integrity is to permit the receiver to control the data
that is given by the system.
▪ The integrity systems regularly use some of the similar fundamental
approaches as confidentiality structures.
▪ Still, they generally include the data for the communication to create the
source of an algorithmic check rather than encrypting all of the
communication.
▪ And also verify that correct data is conveyed from one application to another.
CONT..
Authorization
▪ It is the process of defining that a client is permitted to perform an action and
also receive the services.
▪ The example of authorization is Access control
CONT.…
Confidentiality
▪ It is a security process that protracts the leak of the data from the outsider's
because it is the only way where we can make sure the security of our data.
Authentication
▪ The authentication process comprises confirming the individuality of a person,
tracing the source of a product that is necessary to allow access to the private
information or the system.
CONT.…
Non- repudiation
Security Scanning
▪ Security scanning can be done for both automation testing and manual
testing.
▪ This scanning will be used to find the vulnerability or unwanted file
modification in a web-based application, websites, network, or the file
system.
▪ After that, it will deliver the results which help us to decrease those
threats.
▪ Security scanning is needed for those systems, which depends on the
structure they use.
CONT..
Risk Assessment
▪ To moderate the risk of an application, we will go for risk assessment.
▪ In this, we will explore the security risk, which can be detected in the association.
▪ The risk can be further divided into three parts, and those are high, medium, and
low.
▪ The primary purpose of the risk assessment process is to assess the vulnerabilities and
control the significant threat.
Vulnerability Scanning
▪ It is an application that is used to determine and generates a list of all the systems
which contain the desktops, servers, laptops, virtual machines, printers, switches, and
firewalls related to a network.
▪ The vulnerability scanning can be performed over the automated application and also
identifies those software and systems which have acknowledged the security
vulnerabilities.
CONT..
Penetration testing
▪ Penetration testing is a security implementation where a cyber-security
professional tries to identify and exploit the weakness in the computer system.
▪ The primary objective of this testing is to simulate outbreaks and also finds the
loophole in the system and similarly save from the intruders who can take the
benefits.
Security Auditing
▪ Security auditing is a structured method for evaluating the security measures of
the organization.
▪ In this, we will do the inside review of the application and the control system for
the security faults.
CONT.…
Ethical hacking
▪ Ethical hacking is used to discover the weakness in the system and also helps
the organization to fix those security loopholes before the nasty hacker
exposes them.
▪ The ethical hacking will help us to increase the security position of the
association because sometimes the ethical hackers use the same tricks, tools,
and techniques that nasty hackers will use, but with the approval of the official
person.
▪ The objective of ethical hacking is to enhance security and to protect the
systems from malicious users' attacks.
CONT.….
Posture Assessment
▪ It is a combination of ethical hacking, risk assessments, and security scanning,
which helps us to display the complete security posture of an organization.
How we perform security testing
▪ The security testing is needed to be done in the initial stages of the software
development life cycle because if we perform security testing after the
software execution stage and the deployment stage of the SDLC, it will cost
us more.
▪ Now let us understand how we perform security testing parallel in each stage
of the software development life cycle(SDLC).
CONT.…
CONT.…
Client-side attacks
The client-side attack means that some illegitimate implementation of the external
code occurs in the web application.
And the data spoofing actions have occupied the place where the user believes
that the particular data acting on the web application is valid, and it does not come
from an external source.
CONT.…
Blind Tests
▪ The Companies offers penetration testers with little security details about
the device being exploited in a blind test, referred to as a black-box test.
▪ The aim is to find vulnerabilities that wouldn't ever be discovered
CONT.…
Wireshark
▪ Typically named as Ethereal 0.2.0, with 600 contributors,Wireshark is an award-
winning network mapper.
▪ You can catch and analyze data packets easily with this program.
▪ The tool is open-source and is compatible with Windows, Solaris, FreeBSD, and Linux,
among other frameworks.
Key Points
It offers both offline review and options for live-capture.
Its locating intermediate nodes help you to discover new characteristics, including the
protocol of the source and destination.
It includes the opportunity to inspect the smallest information in a network for
operations.
It contains optional coloring rules for fast, intuitive analysis and are added to the pack.
CONT..
Netsparkar
▪ A common automated application server for penetration testing is the
Netsparker vulnerability scanner.
▪ From cross-site request to SQL injection, the program can recognize anything
from it.
▪ This tool can be used by designers on blogs, web infrastructure, and web
services.
▪ The platform is efficient enough to simultaneously search anything from 500
to 1000 software applications.
▪ With attack tools, verification, and URL rewriting guidelines, you will be have
the ability to modify the security scan.
▪ In a read-only manner, Netsparker takes advantage of vulnerabilities spots
dynamically.
▪ Exploitation proof is made.The effect of vulnerabilities can be viewed instantly.
CONT.…
Key Points
It can search the web-based applications for 1000 + in less than a day!
For teamwork and easy discoverability of results, you can add several
teammates.
The Advanced scanning reduces the need for a small set up.
It can search for SQL and XSS bugs in software applications that are hackable.
You can create the Legal application of the web and reports of regulatory
requirements.
It has Proof-based screening technology to ensure precise identification.
CONT.…
SQLmap
▪ SQLmap is a Database SQL Injection Control Tool. It also enable MySQL
, SQLite, Sybase, DB2,Access, MSSQL, PostgreSQL database platforms.
SQLmap is open-source and streamlines the mechanism of manipulating the
application server and bugs for the Attack vector.
Key Points
This tool allows you to Detect exploits and monitor them.
It offers assistance for all aspects of injection: Union,Time, Stack, Error,
Boolean.
It executes a command-line interface and can be configured for Linux, Mac
OS, and Windows operating systems.
CONT.…
Wapiti
Wapiti is a security tool for programs that enables black-box testing. Checking
the black box tests web-based applications for possible exposures.
Websites are checked at the time of the black box testing procedure, and the
tested data is implanted to search for any failures in protection.
Key Points
With the help of command-line application interface, professionals may find
ease-ofusability.
Wapiti detects file exposure glitches, XSS Intrusion, Database transfusion, XXE
injection, Command Execution mitigation, and vulnerable .htaccess settings that
are easily evaded.
Chapter Six
Cross-Domain Security in Web
Applications
Abuse Case Development
Client State Manipulation
SQL Injection
Cross-Domain Security in Web
Applications
In computing, the same-origin policy is an important
concept
in the web application security
model.
Under the policy, a web browser permits scripts contained in
a first
web page to access data in a second web page, but only if
both web
An origin
pages is defined
have the as a. combination of U R I
same origin
scheme,
hostname, and port
number.
This policy prevents a malicious script on one page
from
obtaining access to sensitive data on another web page
through
that page's Document Object Model.
This mechanism bears a particular significance for modern web
applications that
extensively depend on H T T P cookies to maintain authenticated user
sessions, as
servers act based on the H T T P cookie information to reveal sensitive
information
A strict separation between content provided by unrelated sites
must be state-changing actions.
or take
maintained on the client-side to prevent the loss of data
confidentiality or
• The algorithm used to calculate the "origin" of a U R I is specified in R F C
integrity.
6454,
Section 4. For absolute U R I s , the origin is the triple {protocol, host,
port}.
If the U R I does not use a hierarchical element as a naming authority
(see R F C
3986, Section 3.2) or if the U R I is not an absolute U R I , then a globally
unique
Two resources
identifier are considered to be of the same origin if and only if all
is used.
these
values are exactly the
same.
U R L "http://www.example.com/dir/page.html".
Compared U R L Outcome Reason
http://www.example.com/dir/page2.html Success Same protocol, host and
port
http://www.example.com/dir2/other.htm Success Same protocol, host and
l port
http://username:password@www.example.com/dir2/other.ht Success
ml Same protocol, host and
port protocol and host
Same
http://www.example.com:81/dir/other.ht Failure
but
ml different port
https://www.example.com/dir/other.ht Failure Different
ml protocol
http://en.example.com/dir/other.ht Failure
ml Different host
Different host (exact
http://example.com/dir/other.ht Failure
match
ml required)
Different host (exact
http://v2.www.example.com/dir/other.ht Failure
match
ml required)
Port explicit. Depends on
Depends
implementation in
http://www.example.com:80/dir/other.ht browser.
ml
Alice is using our (“good”) web-application:
www.bank.com (assume user is logged in
w/
cookie)
At the same time (i.e. same browser session),
she’s
also visiting a “malicious” web- application:
www.evil.org
Malicious site can’t read info (due to same-origin
policy),
but can make write requests to our app!C a n still
cause
� in Alice’s case, attacker gained control of
damage
her
account with full read/write
access!
Who should worry about XSRF?
� apps withuser info, profiles (e.g.,
Facebook)
� apps that do financial transactions for
users
� any app that stores user data
� etc
1300
XSS
1200
1100
Buffer Overflow
1000 SQL Injection
900 PHP Include
800
DoS
700
600
500
400
300
200
100
0
2001 2006
1) Cross-Site Request F o r ge r y
Cross-Site Request Forgery (CSRF) is an attack that tricks the victim into
loading a page
that contains a malicious
request.
Itis malicious in the sense that it inherits the identity and privileges of the
victim to
perform an undesired function on the victim's behalf, like change the
victim's e-
mail address, home address, or password, or purchase something.
CSRF attacks generally target functions that cause a state change on the
server
but can also be used to access sensitive data.
For most sites, browsers will automatically include with such
requests any
credentials associated with the site, such as the user's session
cookie, basic
Therefore, if the
authorization
useris currently
credentials, authenticated
IPaddress, to the site,
Windows domain the site
will have
credentials,
no way to etc.
distinguish this from a legitimate user
request.
In this way, the attacker can make the victim perform actions
that they
didn't intend to, such as logout, purchase item, change
account
information, retrieve account information, or any other function
provided
by the vulnerable website.
A cross-site scripting attack exploits the trust a user
places
in a website, making it a common vector for phishing
and
related attacks. Cross-site scripting occurs in two
Reflected cross-site scripting (first order), which
basic
occurs
forms:
when an attacker can embed script in data
rendered
immediately to the victim as part of a G E T or
Stored cross-site scripting (second order), in which
POST
the
request.
attacker supplied script is retained in long-term
storage
before being rendered to the victim.
Reflected cross-site scripting tends to be easier to
detect and
exploit, though it requires more direct victim
interaction,
Stored cross-site
making the attackscripting is often more difficult to
less reliable.
detect
and exploit, though the attack is more reliable
because it
Most cross-site
typically scripting
occurs without any attacks attempt to
victim interaction.
hijack the
victim's session key and smuggle it out by embedding
it in
an image U R L , or similar link.
Cross-site scripting attacks are the most commonly
reported
Web security vulnerability
today.
There are various approaches to mitigate
cross-site
scripting attacks, including server or client
sanitization or
When handling
filtering, untrusted
"safe subset" data
scripting from other
languages, and so
domains,
forth. it is
important that proper diligence is exercised to
ensure that
the data provided is not used to execute a script
injection
D N S Rebinding is an attack on the insecure binding between
DNS
hostnames and network
addresses.
During a D N S rebinding attack, an attacker will manipulate
DNS
records for a site he controls (e.g., *.evil.com) such that at some
times
the hostname points at a server under his control, and at
others, the
In this way, the attacker is able to bypass the same-origin-
policy
hostname points at a victim server or device.
restriction because both the victim and the attacker have
the same
This attack(attechnique
hostname different can enable
points firewall circumvention,
in time).
because a
victim server behind an organizational firewall is reachable
by a
Strengthening the client's binding between a D N S
hostname
and the network address (e.g., pinning) has been
proposed as a
mitigation, but such a change may lead to
Servers can help mitigate the threat of D N S
application
rebinding by
compatibility problems (e.g., with C D N s , load-balancing,
etc).
using H T T P S and verifying the H O S T header on
inbound
Any security mechanism that relies upon multiple
requests.
requests
(e.g., request permission, then request resource)
must be
hardened against D N S rebinding to help mitigate a
Time of check/Time of Use (TOC/TOU) attacks occur
in
requests where principals or permissions have
changed
between the time of permission checking and the
time of
In the event of a D N S rebinding attack, the
actual
actual use of the permissions.
principal identity of the server may change,
enabling
permissions granted by one server (the attacker)
to be
In another form of TOC/TOU attack, consider the
following
case.
The client obtains permissions against a server, but the
server
subsequently is reconfigured to change permissions. The
cached
permissions may be illegally reused against the server
unless the
Any cross-domain approach that uses multiple
client rechecks permissions.
request
permission check and usage must weigh the
performance and
security implications of cached permissions.
Wildcarding attacks occur when
access
controls are set in error and allow
for
For example, if access control rules are
unintended
set to access.
* .com , any .com site can access the
resource.
While such an attack is clearly enabled
by a
configuration error by the service provider,
there
are numerous examples of this in the wild
today.
Such mistakes can occur when developers
switch
responsibilities, as sites are merged, due to
simple
typographical errors, and numerous other reasons.
As access-control rules become more complex,
the
likelihood of configuration errors increases. For
example,
major sites have suffered exploits in the past where
access
control rules were incorrectly set.
Abuse Cases
Development
� Use cases
Expected behaviour
Normal input
Functional requirements
� Abuse cases
Unexpected behavior
By Malicious agents
Derived from risk assessment
Developers should think evil
which leads to…
Defensive programming
Security is not a feature that can be added to a
system.
There is no “security” pull-down menu where security
can
Unfortunately,
be selected and many
magic software producers mistakenly
things happen.
rely
solely on plunking functional security features
and
mechanisms such as cryptography somewhere in
their
software and they assume that the security needs
are in
o The best, most cost-effective approach to software
security
incorporates thinking beyond normative features
and
incorporates that thinking throughout the development
process.
o Every time a new requirement, feature, or use case is
created,
someone should spend some time thinking about
o how
Professionals
that who know how features are attacked and
how to
feature might be unintentionally misused or
protect software should play an active role in this
intentionally
kind of
abused.
One of the goals of misuse cases is to decide
and
document a priority how software should
react to
The simplest, most practical method for creating
illegitimate use.
misuse
cases is usually through a process of
informed
To guide brainstorming, software security experts
brainstorming.
ask
many questions of a system’s designers to help
identify
the places where the system is likely to
The process of specifying abuse cases makes a designer very
clearly
differentiate appropriate use from inappropriate use, but to get
there, the
� How can
designer theask
must system distinguish
the right between good and bad
questions:
input?
�C a n it tell whether a request is coming from a
legitimate or a rogue application replaying
traffic?
All systems have more vulnerable places than the obvious front
doors, of
course, so
� where can a bad guy be
positioned?
� O n the wire? At a workstation? In the back
office?
� Any communication line between two endpoints or two
components?
Creating anti-
requirements
� Important to think about
Things that you don’t want your software to do
Requirements: security analysis + requirement
analysis
� Anti-requirements
Provide insight into how a malicious user,
attacker,
thrill seeker, competitor can abuse your system
Considered throughout the lifecycle
indicate what happens when a required
security
function is not
included
Creating an attack
model
� Based on known attacks and attack
types
� Do the following
Select attack patterns relevant to your system –
build
abuse case around the attack
patterns
Include anyone who can gain access to the
system
because threats must encompass all potential
sources
� Also need to model
attacker
Client State
▪
Manipulation
Web applications are often vulnerable to malicious
users.
▪ To protect them, programmers must be aware of
vulnerabilities and
countermeasure
s.
▪ To be secure, web applications should not trust clients and should
validate all
input received from
clients.
▪ HTTP is stateless, so web servers are not required to keep track of any
state or
information about their
clients.
▪ An example of a vulnerability is when a web server uses hidden
values in
HTML forms to store sensitive information, which can be easily
manipulated
by malicious clients.
Client-state manipulation
vulnerabilities
▪ The client state is used to store information in HTML
documents toback
transmitted be to the server at a subsequent
interaction.
▪ It can have several benefits, such as decreasing the load on the
server andthe need for a session state expiration
avoiding
mechanism.
▪ Cookies also provide a related
mechanism.
▪ Subverting application logic, where you can change a query to interfere with the
application's logic.
▪ UNION attacks, where you can retrieve data from different database tables.
• Retrieving hidden
data
Consider a shopping application that displays products in different categories. When the
user clicks
on the Gifts category, their browser requests the URL: This causes the application to make
an SQL
query to retrieve details of the relevant products from the database:
SELECT * FROM products WHERE category = 'Gifts' AND released = 1
This SQL query asks the database to return: all details (*) from the products table where
the
• The restriction released = 1 is being used to hide products that are not
category is Gifts and released is 1.
released.
▪ For unreleased products, presumably released = 0. The application doesn't
implement
any defenses against SQL injection attacks, so an attacker can construct an
attack like:
▪ This results in the SQL query: SELECT * FROM products WHERE category =
'Gifts'-
-' AND released =
1
▪ The key thing here is that the double-dash sequence -- is a
comment
indicator in SQL, and means that the rest of the query is
interpreted as a
This effectively removes the remainder of the query, so it no
▪ comment.
longer
includes AND released =
1.
▪ This means that all products are displayed, including unreleased
products.
Subverting application logic
▪ Consider an application that lets users log in with a username and password. If a user
submits
the username wiener and the password bluecheese, the application checks the
credentials by
performing
SELECT the following
* FROM SQL query:
users WHERE username = 'wiener' AND password =
'bluecheese‘
▪ If the query returns the details of a user, then the login is successful. Otherwise, it is
rejected.
Here, an attacker can log in as any user without a password simply by using the SQL
comment sequence – to remove the password check from the WHERE clause of the
query.