Cns 5
Cns 5
Cns 5
UNIT –V
The World Wide Web is fundamentally a client/server application running over the
Internet and TCP/IP intranets. As such, the security tools and approaches discussed so far in this
book are relevant to the issue of Web security. But the Web presents new challenges not generally
appreciated in the context of computer and network security.
The Internet is two-way. The Web is vulnerable to attacks on the Web servers over
the Internet.
The Web is increasingly serving as a highly visible outlet for corporate and product
information and as the platform for business transactions. Reputations can be
damaged and money can be lost if the Web servers are subverted.
Although Web browsers are very easy to use, Web servers are relatively easy to
configure and manage, and Web content is increasingly easy to develop, the
underlying software is extraordinarily complex.
Once the Web server is subverted, an attacker may be able to gain access to data
and systems not part of the Web itself but connected to the server at the local site.
Casual and untrained (in security matters) users are common clients for Web-based
services. Such users are not necessarily aware of the security risks that exist and do
not have the tools or knowledge to take effective countermeasures.
A number of approaches to providing Web security are possible. The various approaches
that have been considered are similar in the services they provide and, to some extent, in the
mechanisms that they use, but they differ with respect to their scope of applicability and their
relative location within the TCP/IP protocol stack. Stallings Figure 16.1 illustrates this difference.
1
cse405 Chapter 16
One way to provide Web security is to use IP Security (Figure 16.1a). The advantage of
using IPSec is that it is transparent to end users and applications and provides a general-purpose
solution. Further, IPSec includes a filtering capability so only selected traffic need incur the IPSec
processing overhead.
Another relatively general-purpose solution is to implement security just above TCP (Figure
16.1b). The foremost example of this approach is the Secure Sockets Layer (SSL) and the follow-on
Internet standard known as Transport Layer Security (TLS). At this level, there are two
implementation choices. For full generality, SSL (or TLS) could be provided as part of the
underlying protocol suite and therefore be transparent to applications. Alternatively, SSL can be
embedded in specific packages, e.g. both the Netscape and Microsoft Explorer browsers come with
SSL, & most Web servers have implemented it.
Application-specific security services are embedded within the particular application.
Figure 16.1c shows examples of this architecture. The advantage of this approach is that the service
can be tailored to the specific needs of a given application.
SSL probably most widely used Web security mechanism, and it is implemented at the
Transport layer
SSL is designed to make use of TCP to provide a reliable end-to-end secure service. N
etscape originated SSL. Version 3 of the protocol was designed with public
2
cse405 Chapter 16
review and input from industry and was published as an Internet draft document. Subsequently,
when a consensus was reached to submit the protocol for Internet standardization, the TLS
working group was formed within IETF to develop a common standard. This first published
version of TLS can be viewed as essentially an SSLv3.1 and is very close to and backward
compatible with SSLv3. SSL is not a single protocol but rather two layers of protocol, as shown next.
SSL Architecture:
SSL is designed to make use of TCP to provide a reliable end-to-end secure service.
SSL is not a single protocol but rather two layers of protocols, as illustrated in Figure 16.2.
The SSL Record Protocol provides basic security services to various higher-layer protocols.
In particular, the Hypertext Transfer Protocol (HTTP), which provides the transfer service for Web
client/server interaction, can operate on top of SSL.
Three higher-layer protocols are also defined as part of SSL: the Handshake Protocol,
Change Cipher Spec Protocol, and Alert Protocol. These SSL-specific protocols are used in the
management of SSL exchanges.
Two important SSL concepts are the SSL connection and the SSL session:
3
cse405 Chapter 16
Between any pair of parties (applications such as HTTP on client and server), there may be
multiple secure connections. In theory, there may also be multiple simultaneous sessions between
parties, but this feature is not used in practice.
Once a session is established, there is a current operating state for both read and write (i.e.,
receive and send). In addition, during the Handshake Protocol, pending read and write states are
created. Upon successful conclusion of the Handshake Protocol, the pending states become the
current states. A session state and a connection state are defined by sets of parameters, see
textbook for details.
• Confidentiality: The Handshake Protocol defines a shared secret key that is used for
conventional encryption of SSL payloads. The message is compressed before being
concatenated with the MAC and encrypted, with a range of ciphers being supported as
shown.
4
cse405 Chapter 16
• Message Integrity: The Handshake Protocol also defines a shared secret key that is
used to form a message authentication code (MAC), which is similar to HMAC
Figure 17.3 shows the overall operation of the SSL Record Protocol. The Record Protocol
takes an application message to be transmitted, fragments the data into manageable blocks,
optionally compresses the data, computes and appends a MAC (using a hash very similar to
HMAC), encrypts (using one of the symmetric algorithms listed on the previous slide), adds a
header (with details of the SSL content type, major/minor version, and compressed length), and
transmits the resulting unit in a TCP segment. Received data are decrypted, verified, decompressed,
and reassembled and then delivered to higher-layer applications.
The first step is fragmentation. Each upper-layer message is fragmented into blocks
14
of 2 bytes (16384 bytes) or less. Next, compression is optionally applied.
5
cse405 Chapter 16
Compression must be lossless and may not increase the content length by more than 1024 bytes.
The next step in processing is to compute a message authentication code over the
compressed data. For this purpose, a shared secret key is used. The calculation is defined as
Next, the compressed message plus the MAC are encrypted using symmetric encryption.
For stream encryption, the compressed message plus the MAC are encrypted. Note that the
MAC is computed before encryption takes place and that the MAC is then encrypted along with the
plaintext or compressed plaintext.
For block encryption, padding may be added after the MAC prior to encryption. The padding
is in the form of a number of padding bytes followed by a one-byte indication of the length of the
padding.
6
cse405 Chapter 16
The final step of SSL Record Protocol processing is to prepare a header consisting of the following
fields:
• Content Type (8 bits): The higher-layer protocol used to process the enclosed
fragment.
• Major Version (8 bits): Indicates major version of SSL in use. For SSLv3, the value is 3.
• Minor Version (8 bits): Indicates minor version in use. For SSLv3, the value is 0.
• Compressed Length (16 bits): The length in bytes of the plaintext fragment (or
compressed fragment if compression is used).The maximum value is 214 +2048.
The Change Cipher Spec Protocol is one of the three SSL-specific protocols that use the SSL
Record Protocol, and it is the simplest, consisting of a single message (shown in Stallings Figure
16.5a), which consists of a single byte with the value 1. The sole purpose of this message is to cause
the pending state to be copied into the current state, which updates the cipher suite to be used on
this connection.
The Alert Protocol is used to convey SSL-related alerts to the peer entity. As with other
applications that use SSL, alert messages are compressed and encrypted, as specified by the current
state.
7
cse405 Chapter 16
Each message in this protocol consists of two bytes (as shown in Stallings Figure 16.5b), the
first takes the value warning(1) or fatal(2) to convey the severity of the message. The second byte
contains a code that indicates the specific alert.
The most complex part of SSL is the Handshake Protocol. This protocol allows the server
and client to authenticate each other and to negotiate an encryption and MAC algorithm and
cryptographic keys to be used to protect data sent in an SSL record. The Handshake Protocol is used
before any application data is transmitted. The Handshake Protocol consists of a series of messages
exchanged by client and server, which have the format shown in Stallings Figure 16.5c, and which
can be viewed in 4 phases:
8
cse405 Chapter 16
9
cse405 Chapter 16
This phase is used by the client to initiate a logical connection and to establish the security
capabilities that will be associated with it.
• The exchange is initiated by the client, which sends a client_hello message with
the following parameters:
• Version: The highest SSL version understood by the client.
• • Random: A client-generated random structure consisting of a 32-bit timestamp
and 28 bytes generated by a secure random number generator. These values serve
as nonces and are used during key exchange to prevent replay attacks
• Session ID: A variable-length session identifier. A nonzero value indicates that the
client wishes to update the parameters of an existing connection or to create a new
connection on this session. A zero value indicates that the client wishes to establish
a new connection on a new session.
• CipherSuite: This is a list that contains the combinations of cryptographic algorithms
supported by the client, in decreasing order of preference. Each element of the list
(each cipher suite) defines both a key exchange algorithm and a CipherSpec; these
are discussed subsequently.
• Compression Method: This is a list of the compression methods the client supports.
After sending the client_hello message, the client waits for the server_hello
The first element of the CipherSuite parameter is the key exchange method (i.e., the means
by which the cryptographic keys for conventional encryption and MAC are exchanged).The
following key exchange methods is supported.
• RSA: The secret key is encrypted with the receiver’s RSA public key.
10
cse405 Chapter 16
authority (CA). That is, the public-key certificate contains the Diffie-Hellman public-key parameters.
11
cse405 Chapter 16
• If the server has requested a certificate, the client begins this phase by
sending a certificate message. If no suitable certificate is available, the
client sends a no_certificate alert instead.
• Next is the client_key_exchange message, which must be sent in this phase.
• Finally, in this phase, the client may send a certificate_verify message to
provide explicit verification of a client certificate. This message is only sent
following any client certificate that has signing capability (i.e., all
certificates except those containing fixed Diffie-Hellman parameters).
Phase 4. Finish:
• This phase completes the setting up of a secure connection.
• The client sends a change_cipher_spec message and copies the pending
CipherSpec into the current CipherSpec.
• The client then immediately sends the finished message under the new
algorithms, keys, and secrets.
• The finished message verifies that the key exchange and authentication
processes were successful.
• At this point the handshake is complete and the client and server may
begin to exchange application layer data.
12
cse405 Chapter 16
Cardholder certificates
Merchant certificates
Authority certificates
These certificates are issued by trusted third parties and are used to
establish a secure connection between the cardholder, the merchant,
the payment gateway, and the card issuer.
2. Merchant
A merchant is an entity that sells goods or services to cardholders. To
accept online payments, merchants must establish a relationship with
an acquirer. This allows them to process payment transactions from
customers securely.
3. Issuer
An issuer is a financial organisation, such as a bank, that provides
payment cards to cardholders. Issuers are responsible for managing
the debt incurred by the cardholder.
4. Acquirer 14
cse405 Chapter 16
5. Payment Gateway
A payment gateway intermediates between SET and card payment
networks. It facilitates communication between merchants and
acquirers for payment authorisation, ensuring secure and efficient
online transactions.
6. Certification Authority
A certification authority is a trusted entity providing public-key
certificates to cardholders, payment gateways and merchants. These
certificates ensure the security and authenticity of all the participants
involved in the SET process.
3. Merchant Certificate
cse405 Chapter 16
4. Placing an Order
Browse through the merchant’s website and select the items you wish
to buy. This creates a record of your order on the merchant’s site.
5. Merchant Verification
To assure authenticity, merchants send you their digital certificates,
along with the order details. This helps you identify valid and
authorised merchants.
9. Order Confirmation
16
cse405 Chapter 16
Firewall
Types of Firewalls
There are multiple types of firewalls based on their traffic filtering methods, structure,
and functionality. A few of the types of firewalls are:
Packet Filtering
A packet filtering firewall controls data flow to and from a network. It allows or blocks
the data transfer based on the packet's source address, the destination address of
the packet, the application protocols to transfer the data, and so on.
This type of firewall protects the network by filtering messages at the application
layer. For a specific application, a proxy firewall serves as the gateway from one 19
network to another.
cse405 Chapter 16
Stateful Inspection
Such a firewall permits or blocks network traffic based on state, port, and protocol.
Here, it decides filtering based on administrator-defined rules and context.
Next-Generation Firewall
Threat-Focused NGFW
These firewalls provide advanced threat detection and mitigation. With network and
endpoint event correlation, they may detect evasive or suspicious behavior.
Firewall Work
As mentioned previously, firewalls filter the network traffic within a private network. It
analyses which traffic should be allowed or restricted based on a set of rules. Think
of the firewall like a gatekeeper at your computer’s entry point which only allows
trusted sources, or IP addresses, to enter your network.
A firewall welcomes only those incoming traffic that has been configured to accept. It
distinguishes between good and malicious traffic and either allows or blocks specific
data packets on pre-established security rules.
These rules are based on several aspects indicated by the packet data, like their
source, destination, content, and so on. They block traffic coming from suspicious
sources to prevent cyberattacks.
For example, the image depicted below shows how a firewall allows good traffic to 20
pass to the user’s private network.
cse405 Chapter 16
However, in the example below, the firewall blocks malicious traffic from entering the private
network, thereby protecting the user’s network from being susceptible to a cyberattack.
This way, a firewall carries out quick assessments to detect malware and other
suspicious activities.
There are different types of firewalls to read data packets at different network levels.
Now, you will move on to the next section of this tutorial and understand the different
types of firewalls.
Various
Various types:
cse405 Chapter 16
File Virus:
This type of virus infects the system by appending itself to the end of a
file. It changes the start of a program so that the control jumps to its
code. After the execution of its code, the control returns back to the
main program. Its execution is not even noticed. It is also called
a Parasitic virus because it leaves no file intact but also leaves the
host functional.
Macro Virus:
Unlike most viruses which are written in a low-level language(like C or
assembly language), these are written in a high-level language like
Visual Basic. These viruses are triggered when a program capable of
executing a macro is run. For example, the macro viruses can be
contained in spreadsheet files.
22
cse405 Chapter 16
Polymorphic Virus:
A virus signature is a pattern that can identify a virus(a series of bytes
that make up virus code). So in order to avoid detection by antivirus a
polymorphic virus changes each time it is installed. The functionality of
the virus remains the same but its signature is changed.
Encrypted Virus:
In order to avoid detection by antivirus, this type of virus exists in
encrypted form. It carries a decryption algorithm along with it. So the
virus first decrypts and then executes.
Stealth Virus:
It is a very tricky virus as it changes the code that can be used to
detect it. Hence, the detection of viruses becomes very difficult. For
example, it can change the read system call such that whenever the
user asks to read a code modified by a virus, the original form of code
is shown rather than infected code.
Browser Hijacker:
As the name suggests this virus is coded to target the user’s
browser and can alter the browser settings. It is also called the
browser redirect virus because it redirects your browser to other
malicious sites that can harm your computer system.
Intruders
an outsider or an insider.
1. Select the target using IP lookup tools such as NSLookup, Dig, and
others.
2. Map network for accessible services using tools such as NMAP.
3. Identify potentially vulnerable services (in this case, pcAnywhere).
4. Brute force (guess) pcAnywhere password.
5. Install remote administration tool called DameWare.
6. Wait for administrator to log on and capture his password.
7. Use that password to access remainder of network.
Intrusion Techniques
INTRUSION DETECTION
Audit Records
detection system
Architecture for
Distributed Intrusion
Detection
Passwords are the keys to our online existence. If our passwords fall into
30
the wrong hands, it may create havoc. Password management involves
cse405 Chapter 16
Let’s see what are the most frequent password errors that help
hackers get access to our accounts:
Combination of uppercase,
A random password is difficult
Complexity lowercase letters, numbers
to compromise.
and symbols
32
5. Authentication Techniques
cse405 Chapter 16
Let’s consider that a user wants to access an application using SSO. The
application sends a request to the SSO server to authenticate the user.
Upon validating the credentials, the SSO server confirms the authentication
and grants access to the application.
The key components of the password management tool are shown in the
figure below:
A virus can do anything that other programs do. The only difference is that it
attaches itself to another program and executes secretly when the host program
is run. Once a virus is executing, it can perform any function, such as erasing
files and programs.
37
cse405 Chapter 16
VIRUS COUNTERMEASURES
The ideal solution to the threat of viruses is prevention: Do not allow a virus to
get into the system in the first place, or block the ability of a virus to modify
any files
containing executable code or macros. This goal is, in general, impossible to ac
hieve,
although prevention can reduce the number of successful viral attacks. The nex
t best approach is to be able to do the following:
• Detection: Once the infection has occurred, determine that it has occurred
and locate the virus.
the virus from all infected systems so that the virus cannot spread further.
identifies four generations of antivirus software:
41