VTU Network and Cyber Security Module-1 (15ec835, 17ec835)
VTU Network and Cyber Security Module-1 (15ec835, 17ec835)
VTU Network and Cyber Security Module-1 (15ec835, 17ec835)
(15EC835, 17EC835)
MODULE-1
MODULE-1
TEXT BOOK:
REFERENCE BOOKS:
MODULE - 1
The Internet is two way. Even unimportant systems like electronic publishing
systems, voice response, or fax-back are vulnerable to attacks on the Web
servers over the Internet.
The Web is increasingly serving as a platform 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, web servers are very easy to use and manage and web
content is easy to develop, the underlying software is extraordinarily complex.
This complex software may hide many potential security flaws and hence is more
vulnerable to a variety of security attacks.
A Web server can be exploited as a launching pad into the corporation’s or
agency’s entire computer 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 users’ common clients for Web-based services. Such users
are not always aware of the security risks.
Table 1 provides a summary of the types of security threats faced when using the
Web. One way to group these threats is in terms of passive and active attacks. Passive
attacks include eavesdropping on network traffic between browser and server and
gaining access to information on a Web site that is supposed to be restricted.
classify Web security threats is in terms of the location of the threat: Web server, Web
browser, and network traffic between browser and server.
Two important SSL concepts are the SSL session and the SSL connection, which
are defined in the specification as follows. DEC-2012[4M]
Master secret: 48-byte secret shared between the client and the server.
Is resumable: A flag indicating whether the session can be used to initiate new
connections.
Server and client random: Byte sequences that are chosen by the server and
client for each connection.
Server write MAC secret: The secret key used in MAC operations on data sent
by the server.
Client write MAC secret: The secret key used in MAC operations on data sent by
the client.
Server write key: The secret encryption key for data encrypted by the server
and decrypted by the client.
Client write key: The symmetric encryption key for data encrypted by the client
and decrypted by the server.
Initialization vectors: When a block cipher in CBC mode is used, an
initialization vector (IV) is maintained for each key. This field is first initialized
by the SSL Handshake Protocol.
Sequence numbers: Each party maintains separate sequence numbers for
transmitted and received messages for each connection. When a party sends or
receives a change cipher spec message, the appropriate sequence number is set
to zero. Sequence numbers may not exceed 264 - 1.
Add message authentication code: MAC calculated over the compressed data by
the following expression.
The Change Cipher Spec Protocol is one of the three SSL-specific protocols that
use the SSL Record Protocol, and it is the simplest.This protocol consists of a single
message (Figure 5(a)) of a single byte with the value 1.
The purpose of this message 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 used to convey SSL-related alerts to the peer entity.
Moreover, each message in this protocol consists of two bytes (Figure 5(b)).
The first byte takes the value warning (1) or fatal (2) to convey the severity of
the message.
If the level is fatal, SSL immediately terminates the connection.
Other connections on the same session may continue, but no new connections
established.
The second byte contains a code that indicates the specific alert.
First, we list those alerts that are always fatal (definitions from the SSL
specification):
Unexpected message: An inappropriate message was received.
Bad _ record _ mac: An incorrect MAC was received.
Decompression _ failure: The decompression function received improper
input (e.g., unable to decompress or decompress to greater than maximum
allowable length).
Handshake _ failure: Sender was unable to negotiate an acceptable set of
security parameters given the options available.
Illegal _ parameter: A field in a handshake message was out of range or
inconsistent with other fields.
The remaining alerts are the following.
Close _ notify: Notifies the recipient that the sender will not send any more
messages on this connection. Each party is required to send a close _ notify
alert before closing the write side of a connection.
This Handshake Protocol allows the server and client to authenticate each
other and to negotiate an encryption and MAC algorithm and cryptographic
keys.
Moreover, 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. All of these have the format shown in (Figure 5(c)).
A handshake message has the following format:
1. Type (1 byte): Indicates one of 10 messages of handshake protocol. Table
2 lists the defined message types
This phase is used 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 number which serves as the nonce.
Session ID: A variable-length session identifier. A nonzero value indicates that
the client wishes to update the parameters of an existing session. A zero value
indicates that the client wishes to establish a new connection on a new session.
Cipher Suite: This is a list that contains the cryptographic algorithms (key
exchange, encryption, and MAC) supported by the client, in decreasing order of
preference.
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
message, which contains the same parameters as the client _ hello message. The
parameters contain the values which client had sent to the server and the server
has chosen to use.
This phase provides authentication of the server to the client. o The server sends
its certificate (one or more) if it needs to be authenticated.
The server sends a server _ key _ exchange message which contains the list of
secret keys to be used for the subsequent data. The certificate _ request message is
sent next which includes two parameters: certificate _ type and certificate _
authorities.
Moreover, the final message in phase 2, and one that always required is the server _
done message, which sent by the server to indicate the end of the server hello and
associated messages.
After sending this message, the server will wait for a client response. This message
has no parameters.
The client verifies the server certificates and checks whether the server _ hello
parameters are acceptable.
Moreover, if all is satisfactory, the client sends a certificate message if the server
has requested a certificate. If no suitable certificate is available, the client sends a no
_ certificate alert.
Next is the client _ key _ exchange message which has the same parameters as the
server _key _ exchange message.
Similarly, the client may send a certificate _ verify message to provide explicit
verification of a client certificate.
The client encrypts all the previous messages and master secret with its private key.
Phase 4. Finish
The client sends a change _ Cipher _ spec message and copies the
pending Cipher Spec into the current Cipher Spec.
Moreover, the client then immediately sends the finished message under the
new algorithms, keys, and secrets.
The content of the finished message is the concatenation of two hash values:
MD5 (master _secret || pad2 || MD5 (handshake _messages || Sender || master
_secret || pad1))
SHA (master _secret || pad2 || SHA (handshake _messages || Sender || master
_secret || pad1))
The server sends its own change _ cipher _ spec message, transfers the pending
to the current Cipher Spec, and sends it finished
At this point, the handshake is complete and the client and server may begin to
exchange application-layer data.
Version Number
The one difference is in version values. For the current version of TLS, the major
version is 3 and the minor version is 3.
There are two differences between the SSLv3 and TLS MAC schemes:
The actual algorithm and the scope of the MAC calculation.
TLS makes use of the HMAC algorithm defined in RFC 2104.
HMAC is defined as
where
H = embedded hash function (for TLS, either MD5 or SHA-1)
K + = secret key padded with zeros on the left so that the result is equal to the block
length of the hash code (for MD5 and SHA-1, block length = 512 bits)
SSLv3 uses the same algorithm, except that the padding bytes are concatenated with
the secret key rather than being XORed with the secret key padded to the block
length.
Moreover, The level of security should be about the same in both cases.
For TLS, the MAC calculation encompasses the fields indicated in the following
expression:
MAC(MAC_write_secret,seq_num || TLSCompressed.type ||
TLSCompressed.version || TLSCompressed.length ||
TLSCompressed.fragment)
The MAC calculation covers all of the fields covered by the SSLv3 calculation, plus
the field version, which is the version of the protocol being employed.
PRF takes as input a secret value, an identifying label, and a seed value and produces an
output of arbitrary length.
TLS supports all of the alert codes defined in SSLv3 with the exception of no _
certificate.
A number of additional codes defined in TLS; of these, the following are always fatal.
Record _ overflow: A TLS record was received with a payload (cipher text)
whose length exceeds 214 + 2048 bytes, or the cipher text decrypted to a length
of greater than 214 + 1024 bytes.
Unknown _ ca: A valid certificate chain or partial chain was received, but the
certificate was not accepted because the CA certificate could not be located or
could not be matched with a known, trusted CA.
Access _ denied: A valid certificate was received, but when access control was
applied, the sender decided not to proceed with the negotiation.
Decode _ error: A message could not be decoded, because either a field was out
of its specified range or the length of the message was incorrect.
Protocol _version: The protocol version the client attempted to negotiate is
recognized but not supported.
Insufficient _ security: Returned instead of handshake _ failure when a
negotiation has failed specifically because the server requires ciphers more
secure than those supported by the client.
Unsupported _ extension: Sent by clients that receives an extended server hello
containing an extension not in the corresponding client hello.
Cipher Suites:
Moreover, there are several small differences between the cipher suites available
under SSLv3 and under TLS:
Key Exchange: TLS supports all of the key exchange techniques of SSLv3 with the
exception of Fortezza.
Symmetric Encryption Algorithms: TLS includes all of the symmetric encryption
algorithms found in SSLv3, with the exception of Fortezza.
In the TLS certificate _verify message, the MD5 and SHA-1 hashes are calculated only
over handshake _messages.
Recall that for SSLv3, the hash calculation also included the master secret and pads.
These extra fields were felt to add no additional security.
As with the finished message in SSLv3, the finished message in TLS is a hash based
on the shared master _secret, the previous handshake messages, and a label that
identifies client or server. The calculation is somewhat different. For TLS, we have
PRF (master secret, finished label, MD5 (handshake _ messages) ‖ SHA-1
(handshake _messages))
Where finished label is the string “client finished” for the client and “server finished”
for the server.
Cryptographic Computations
The pre _ master _secret for TLS is calculated in the same way as in SSLv3. As in
SSLv3, the master _secret in TLS is calculated as a hash function of the pre_ master
_secret and the two hello random numbers. The form of the TLS calculation is different
from that of SSLv3 and is defined as
Master _secret = PRF (pre _master _secret, "master secret", Client Hello .random ‖
Server Hello .random)
The algorithm is performed until 48 bytes of pseudorandom output are produced. The
calculation of the key block material (MAC secret keys, session encryption keys, and IVs)
is defined as
Key _block = PRF (master _secret, "key expansion", Security Parameters. Server _
random‖ Security Parameters. Client _random)
Until enough output has been generated. As with SSLv3, the key _block is a
function of the master _secret and the client and server random numbers, but for TLS,
the actual algorithm is different.
1111111111111111111111111111111111111111111111111111111111111111111
111111111111
Padding
In SSL, the padding added prior to encryption of user data is the minimum
amount required so that the total size of the data to be encrypted is a multiple of the
cipher’s block length. In TLS, the padding can be any amount that results in a total that
is a multiple of the cipher’s block length, up to a maximum of 255 bytes.
For example,
if the plaintext (or compressed text if compression is used) plus MAC plus
padding.
Length byte is 79 bytes long, then the padding length (in bytes) can be 1, 9,
17, and so on, up to 249.
A variable padding length may be used to frustrate attacks based on an
analysis of the lengths of exchanged messages.
4. HTTPS
HTTPS (HTTP over SSL) refers to the combination of HTTP and SSL to
implement secure communication between a Web browserand a Web server.
The HTTPS capability is built into all modern Web browsers.
Its use depends on the Web server supporting HTTPS communication.
For example, search engines do not support HTTPS.
The principal difference seen by a user of a Web browser is that URL (uniform
resource locator) addresses begin with https:// rather than http://.
A normal HTTP connection uses port 80.
If HTTPS is specified, port 443 is used, which invokes SSL.
When HTTPS is used, the following elements of the communication are
encrypted:
URL of the requested document
Contents of the document
Contents of browser forms (filled in by browser user)
Cookies sent from browser to server and from server to browser
Contents of HTTP header
HTTPS is documented in RFC 2818, HTTP over TLS. There is no fundamental
change in using HTTP over either SSL or TLS, and both implementations are
referred to as HTTPS.
For HTTPS, the agent acting as the HTTP client also acts as the TLS client.
The client initiates a connection to the server on the appropriate port and then
sends the TLS Client Hello to begin the TLS handshake.
When the TLS handshake has finished, the client may then initiate the first HTTP
request. All HTTP data is to be sent as TLS application data. Normal HTTP
behavior, including retained connections, should be followed.
There are three levels of awareness of a connection in HTTPS.
At the HTTP level, an HTTP client requests a connection to an HTTP server by
sending a connection request to the next lowest layer.
Typically, the next lowest layer is TCP, but it also may be TLS/SSL.
At the level of TLS, a session is established between a TLS client and a TLS
server. This session can support one or more connections at any time. As we
have seen, a TLS request to establish a connection begins with the
establishment of a TCP connection between the TCP entity on the client side
and the TCP entity on the server side.
An HTTP client or server can indicate the closing of a connection by including the
following line in an HTTP record: Connection: close. This indicates that the
connection will be closed after this record is delivered.
The closure of an HTTPS connection requires that TLS close the connection With
the peer TLS entity on the remote side, which will involve closing the underlying
TCP connection.
At the TLS level, the proper way to close a connection is for each side to use the
TLS alert protocol to send a close notify alert.
TLS implementations must initiate an exchange of closure alerts before closing a
connection.
A TLS implementation may, after sending a closure alert, close the connection
without waiting for the peer to send its closure alert, generating an “incomplete
close”.
HTTP clients also must be able to cope with a situation in which the underlying
TCP connection is terminated without a prior close notify alert and without a
Dept. of ECE, BGSIT, BG Nagara, Mandya Page 20
NETWORK AND CYBER SECURITY 15EC835, 17EC835
SSH is organized as three protocols that typically run on top of TCP ( above
Figure 8 ):
Transport Layer Protocol: Provides server authentication, data
confidentiality, and data integrity with forward secrecy. The transport layer
may optionally provide compression.
User Authentication Protocol: Authenticates the user to the server.
Connection Protocol: Multiplexes multiple logical communications channels
over a single, underlying SSH connection.
Figure (9) illustrates the sequence of events in the SSH Transport Layer Protocol.
First, the client establishes a TCP connection to the server. This is done via the TCP
protocol and is not part of the Transport Layer Protocol. Once the connection is
established, the client and server exchange data, Referred to as packets, in the data field
of a TCP segment. Each packet is in the following Format (Figure 10).
Packet length: Length of the packet in bytes, not including the packet length
and MAC fields.
Padding length: Length of the random padding field.
Payload: Useful contents of the packet. Prior to algorithm negotiation, this
field is uncompressed. If compression is negotiated, then in subsequent
packets, this field is compressed.
Random padding: Once an encryption algorithm has been negotiated, this
field is added. It contains random bytes of padding so that that total length of
the packet (excluding the MAC field) is a multiple of the cipher block size, or 8
bytes for a stream cipher.
As a result of these steps, the two sides now share a master key K. In addition,
the server has been authenticated to the client, because the server has used its
private key to sign its half of the Diffie-Hellman exchange. Finally, the hash value
H serves as a session identifier for this connection. Once computed, the session
identifier is not changed, even if the key exchange is performed again for this
connection to obtain fresh keys.
If the server either (1) rejects the authentication request or (2) accepts the
request but requires one or more additional authentication methods, the server sends a
message with the format:
Byte SSH_MSG_USERAUTH_FAILURE (51)
Name-list authentications that can continue
Boolean partial success
Where the name-list is a list of methods that may productively continue the
dialog.
If the server accepts authentication, it sends a single byte message: SSH_MSG_
USERAUTH_SUCCESS (52).
1. Public key: The details of this method depend on the public-key algorithm
chosen. In essence, the client sends a message to the server that contains the
client’s public key, with the message signed by the client’s private key. When the
server receives this message, it checks whether the supplied key is acceptable for
authentication and, if so, it checks whether the signature is correct.
2. Password: The client sends a message containing a plaintext password, which is
protected by encryption by the Transport Layer Protocol.
3. Host based: Authentication is performed on the client’s host rather than the
client itself. Thus, a host that supports multiple clients would provide
authentication for all its clients. This method works by having the client send a
signature created with the private key of the client host. Thus, rather than
directly verifying the user’s identity, the SSH server verifies the identity of the
client host—and then believes the host when it says the user has already
authenticated on the client side.
Above figure
Four channel types are recognized in the SSH Connection Protocol specification.
One of the most useful features of SSH is port forwarding. In essence, port
forwarding provides the ability to convert any insecure TCP connection into a
secure SSH connection. This is also referred to as SSH tunnelling. t.
A port is an identifier of a user of TCP.
So, any application that runs on top of TCP has a port number.
Incoming TCP traffic is delivered to the appropriate application on the basis of
the port number.
An application may employ multiple port numbers.
For example, for the Simple Mail Transfer Protocol, the server side generally
listens on port 25, so an incoming SMTP request uses TCP and addresses the data
to destination port 25. TCP recognizes that this is the SMTP server address and
routes the data to the SMTP server application.
a firewall, it will not accept an SSH request from your home computer.
However, from work you can set up an SSH tunnel using remote forwarding.
This involves the following steps.
1. From the work computer, set up an SSH connection to your home computer. The
firewall will allow this, because it is a protected outgoing connection.
2. Configure the SSH server to listen on a local port, say 22, and to deliver data
across the SSH connection addressed to remote port, say 2222.
3. You can now go to your home computer, and configure SSH to accept traffic on
port 2222.
4. You now have an SSH tunnel that can be used for remote logon to the work
server.
DEC-2010
1. Explain the various phases of SSL handshake protocol. (12M)
JUN/JULY-2017
1. Discuss security socket layer (SSL) record protocol in terms of fragmentation,
compression and encryption. (10M)
JUNE/JULY-2011
1. Explain the two SSL concepts with their parameters. (10M)
DEC-2011
1. With a diagram, explain handshake protocol action.(8M)
2. Explain SSL protocol stack. (4M)
JUNE-2012
1. Discuss SSL record protocol in terms of fragmentation, compression and
encryption.(10M)
DEC-2012
1. Explain SSL architecture with neat diagram. (10M)
2. What is the difference b/w SSL connection and SSL session? (04M)
JUNE/JULY-2013
1. List different types of threats and consequence when using the web. Also
countermeasures to be taken. (08M)
2. Elucidate SSL architecture. (08M)
JAN-2015
1. Explain the various phases of SSL handshake protocol. (10M)
DEC/JAN-2016
1. Explain the SSL architecture. (10M)