Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Module 1-NCS

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

B.N.M.

Institute of Technology
(Approved by AICTE, Affiliated to VTU, ISO 9001:2008 certified
and accredited as grade A Institution by NAAC)
Post box no. 7087, 27th cross, 12th Main,
Banashankari II Stage, Bengaluru- 560070, INDIA
Ph: 91-80- 26711780/81/82 Email: principal@bnmit.in, bnmitprincipal@gmail.com, www.bnmit.org

Department of Electronics and Communication Engineering


Question Bank for Module I: Transport Level Security

Course Name: Network and Cyber Security Subject Code: 17EC835

1. List different types of threats and consequence when using the web. Also countermeasures to
be taken.
2. Briefly explain various web traffic security approaches
3. Explain secure socket layer (SSL) protocol stack with a neat diagram and define the different
parameters used in session and connection states.
4. Discuss security socket layer (SSL) record protocol in terms of fragmentation, compression and
encryption.
5. Explain Change Cipher Spec, Alert Protocol and Handshake Protocols
6. Explain the alert signals used in alert protocols
7. Explain the various phases of SSL handshake protocol. / With a diagram, explain handshake
protocol action.
8. Briefly explain, TLS alert codes
9. Briefly explain HTTPS, connection initiation and connection closure in HTTPS.
10. With diagram explain SSH Protocol Stack
11. With diagram explain the steps involved in SSH Transport Layer Protocol Packet Exchanges
12. Explain SSH TLP packet format
13. Explain the steps involved in SSH User Authentication Protocol message Exchanges
14. Briefly explain the authentication methods used in SSH User Authentication Protocol
15. Explain the steps involving in Connection Protocol Message Exchange
16. Explain the different types of channels recognized in SSH connection Protocol specification
17. Explain Port forwarding in SSH protocol
1. List different types of threats and consequence when using the web. Also countermeasures
to be taken.

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. Active attacks include
impersonating another user, altering messages in transit between client and server, and altering
information on a Web site. Another way to classify Web security threats is in terms of the location
of the threat: Web server, Web browser, and network traffic between browser and server.

Table 1.1: A Comparison of Threats on the Web

2. Briefly explain various web traffic security approaches

Number of approaches are possible to providing Web security. The various approaches 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.

Figure 1.1 Relative Locations of Security Facilities in the TCP/IP Protocol Stack
Figure 1.1 illustrates the different approaches. One way to provide Web security is to use IP
security (IPsec) (Figure 1.1a).The advantage of using IPsec is that it is transparent to end users and
applications and provides a general-purpose solution. IPsec includes a filtering capability so that
only selected traffic need incur the overhead of IPsec processing.

Another relatively general-purpose solution is to implement security just above TCP (Figure 1.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. For example, Netscape and Microsoft Explorer browsers come
equipped with SSL, and most Web servers have implemented the protocol.

Application-specific security services are embedded within the particular application. Figure 1.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.

3. Explain secure socket layer (SSL) protocol stack with a neat diagram and define the
different parameters used in session and connection states.

Figure 1.2: SSL Protocol Stack


Secure Socket Layer is designed to make use of TCP to provide a reliable end-to-end secure
service. Moreover, Secure Socket Layer is not a single protocol but rather two layers of protocols,
as illustrated in above figure.

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 defined as
part of SSL: the Handshake Protocol, The Change Cipher Spec Protocol, and the Alert Protocol.
These SSL specific protocols are used in management of SSL exchanges.

SSL Concepts: Two important SSL concepts are the SSL session and the SSL connection, which
are defined in the specification as follows.

➢ Connection: A connection is a transport that provides a suitable type of service. For SSL, such
connections are peer-to-peer relationships. The connections are transient. Every connection
associated with one session.
➢ Session: An SSL session is an association between a client and a server. Sessions are created by
the Handshake Protocol. Sessions define a set of cryptographic security parameters which can
be shared among multiple connections. Sessions are used to avoid the expensive negotiation of
new security parameters for each connection.
Parameters used in session state:
➢ Session identifier: An arbitrary byte sequence chosen by the server to identify an active or
resumable session state.
➢ Peer certificate: An X509.v3 certificate of the peer. This element of the state may be null.
➢ Compression method: The algorithm used to compress data prior to encryption.
➢ Cipher spec: Specifies the bulk data encryption algorithm (such as null, AES, etc.) and a hash
algorithm (such as MD5 or SHA-1) used for MAC calculation. It also defines cryptographic
attributes such as the hash size.
➢ 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.
Parameters used in connection states:
➢ 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).

4. Discuss security socket layer (SSL) record protocol in terms of fragmentation,


compression and encryption.

The SSL record protocol provides two services for SSL connections Confidentiality and Message
Integrity. Figure 1.3 indicates the overall operation of SSL Record Protocol. The Record Protocol
takes an application message to be transmitted, fragments the data into manageable blocks,
optionally compresses the data, applies a MAC, encrypts, adds a header, and transmits the resulting
unit in a TCP segment.

The first step is Fragmentation. Each upper-layer message fragmented into blocks of 214 bytes
(16384 bytes) or less. Next Compression is optionally applied. 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

hash (MAC_write_secret || pad_2 ||


hash (MAC_write_secret || pad_1 || seq _ num ||
SSL Compressed. type || SSL Compressed. length ||
SSL Compressed. fragment))
Where
|| Concatenation.
MAC_write_secret Shared secret key
Hash Cryptographic hash algorithm.
pad_1 The byte 0x36 (0011 0110) repeated 48 times (384 bits) for MD5 and 40
times (320 Bits) for SHA-1.
pad_2 The byte 0x5C (0101 1100) repeated 48 Times for MD5 and 40 times for
SHA-1
seq _ num The sequence number for this message
SSL Compressed The higher-level protocol used to process this fragment
.type
SSL Compressed. The length of the compressed fragment.
Length
SSL Compressed. The compressed fragment or plain text (if compression =not used).
Fragment

Figure 1.3: SSL Record Protocol Operation


Next the compressed message plus the MAC are encrypted using symmetric encryption.
Encryption may not increase the content length by more than 1024 bytes, so that the total length
may not increase 214+2048. The following encryption algorithms are permitted:
Block Cipher Stream cipher
Key
Algorithm Key size Algorithm
size
AES 128,256 RC4-40 40
IDEA 128 RC4-128 128
RC2-40 40
DES-40 40
DES 56
3DES 168
Fortezza 80
For stream encryption, the compressed message plus the MAC are encrypted. Note that MAC is
computed before encryption takes place and that the MAC is 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 length of padding. The
total amount of padding is the smallest amount such that the total size of data to be encrypted is a
multiple of the cipher’s block length.

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 .

5. Explain Change Cipher Spec, Alert Protocol and Handshake Protocols

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 1.4a),
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.

Figure 1.4: Change Cipher Spec Protocol and Alert protocols

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. Each message in this protocol consists of two bytes (Figure 1.4b). 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 on this session may be established. 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. All of these have the format shown in Figure 1.5. Each message has
three fields:

Figure 1.5: Handshake Protocol

➢ Type (1 byte): Indicates one of 10 messages.


➢ Length (3 bytes): The length of the message in bytes.
➢ Content ( bytes): The parameters associated with this message

6. Explain the alert signals used in alert protocols


➢ 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.
➢ 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.
➢ no_certificate: May be sent in response to a certificate request if no appropriate certificate
is available.
➢ bad_certificate: A received certificate was corrupt (e.g., contained a signature that did not
verify).
➢ unsupported_certificate: The type of the received certificate is not supported.
➢ certificate_revoked: A certificate has been revoked by its signer.
➢ certificate_expired: A certificate has expired.
➢ certificate_unknown: Some other unspecified issue arose in processing the certificate,
rendering it unacceptable.
7. Explain the various phases of SSL handshake protocol
OR
With a diagram, explain handshake protocol action.

Figure 1.6 below shows the initial exchange needed to establish a logical connection between
client and server. There are four phases of SSL handshake protocol.
Phase 1: Establish Security Capabilities
Phase 2: Server Authentication and Key Exchange
Phase 3: Client Authentication and Key Exchange
Phase 4: Finish

Phase 1: Establish Security Capabilities:


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.

Figure 1.6: Handshake Protocol Action


Phase 2: Server Authentication and Key Exchange:
This phase provides authentication of the server to the client. 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.
Phase 3: Client Authentication and Key Exchange:
This phase provides client authentication to the server.
➢ 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:
This phase completes the setting up of a secure connection.
➢ 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
➢ 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.

8. Briefly explain, TLS alert codes


TLS supports all of the alert codes defined in SSLv3 with the exception of no_certificate.
Number of additional codes are defined in TLS; of these, the following are always fatal.
➢ record_overflow: A TLS record was received with a payload (ciphertext) whose length
exceeds 2 14 +2048 bytes, or the ciphertext decrypted to a length of greater than 2 14 +2048
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 receive an extended server hello containing
an extension not in the corresponding client hello.
➢ internal_error: An internal error unrelated to the peer or the correctness of the protocol
makes it impossible to continue.
➢ decrypt_error: A handshake cryptographic operation failed, including being unable to
verify a signature, decrypt a key exchange, or validate a finished message.
➢ user_canceled: This handshake is being cancelled for some reason unrelated to a protocol
failure.
➢ no_renegotiation: Sent by a client in response to a hello request or by the server in
response to a client hello after initial handshaking. Either of these messages would normally
result in renegotiation, but this alert indicates that the sender is not able to renegotiate. This
message is always a warning.

9. Briefly explain HTTPS, connection initiation and connection closure in HTTPS.


HTTPS (HTTP over SSL) refers to the combination of HTTP and SSL to implement secure
communication between a Web browser and 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
Connection Initiation: 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.
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
Connection Closure: 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 Connection: close indicator. Such a situation could be due to a
programming error on the server or a communication error that causes the TCP connection to
drop.

10. With diagram explain SSH Protocol Stack

Figure 1.7: SSH Protocol Stack

SSH is organized as three protocols as shown in figure 1.7, that typically run on top of TCP
➢ Transport Layer Protocol: Provides server authentication, data confidentiality, and data
integrity with forward secrecy (i.e., if a key is compromised during one session, the
knowledge does not affect the security of earlier sessions).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.

11. With diagram explain the steps involved in SSH Transport Layer Protocol Packet
Exchanges

Figure 1.8 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.
➢ The first step in packet exchange is identification string exchange, begins with the client
sending a packet with an identification string of the form:

SSH-protoversion-softwareversion SP comments CR LF
Where SP, CR, and LF are space character, carriage return, and line feed, respectively.
➢ Next is algorithm negotiation. Each side sends an SSH_MSG_KEXINIT containing lists of
supported algorithms in the order of preference to the sender. There is one list for each type of
cryptographic algorithm. The algorithms include key exchange, encryption, MAC algorithm,
and compression algorithm.

Figure 1.8: SSH Transport Layer Protocol Packet Exchanges

➢ The next step is key exchange. The specification allows for alternative methods of key
exchange, but at present, only two versions of Diffie-Hellman key exchange are specified.
Both versions are defined in RFC 2409 and require only one packet in each direction.
➢ The end of key exchange is signaled by the exchange of SSH_MSG_NEWKEYS packets
➢ The final step is service request. The client sends an SSH_MSG_ SERVICE_REQUEST
packet to request either the User Authentication or the Connection Protocol. Subsequent to
this, all data is exchanged as the payload of an SSH Transport Layer packet, protected by
encryption and MAC.
12. Explain SSH TLP packet format
Each SSH packet is in the following format
➢ 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.
➢ Message authentication code (MAC): If message authentication has been negotiated, this
field contains the MAC value. The MAC value is computed over the entire packet plus a
sequence number, excluding the MAC field. The sequence number is an implicit 32-bit packet
sequence that is initialized to sequence number is an implicit 32-bit packet sequence that is
initialized to zero for the first packet and incremented for every packet. The sequence number
is not included in the packet sent over the TCP connection.

Figure 1.9: SSH Transport Layer Protocol Packet Formation

13. Explain the steps involved in SSH User Authentication Protocol message Exchanges

The message exchange involves the following steps.


1. The client sends a SSH_MSG_USERAUTH_REQUEST with a requested method of none.
2. The server checks to determine if the user name is valid. If not, the server returns
SSH_MSG_USERAUTH_FAILURE with the partial success value of false. If the user name
is valid, the server proceeds to step 3.
3. The server returns SSH_MSG_USERAUTH_FAILURE with a list of one or more
authentication methods to be used.
4. The client selects one of the acceptable authentication methods and sends a
SSH_MSG_USERAUTH_REQUEST with that method name and the required method-
specific fields. At this point, there may be a sequence of exchanges to perform the method.
5. If the authentication succeeds and more authentication methods are required, the server
proceeds to step 3, using a partial success value of true. If the authentication fails, the server
proceeds to step 3, using a partial success value of false.
6. When all required authentication methods succeed, the server sends a
SSH_MSG_USERAUTH_SUCCESS message, and the Authentication Protocol is over.

14. Briefly explain the authentication methods used in SSH User Authentication Protocol
In SSH User Authentication Protocol the server may require one or more of the following
authentication methods.
➢ Publickey: 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.
➢ Password: The client sends a message containing a plaintext password, which is protected
by encryption by the Transport Layer Protocol.
➢ Hostbased: 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.
15. Explain the steps involving in Connection Protocol Message Exchange
The SSH connection protocol runs on the top of the SSH transport layer protocol and assumes
that a secure authentication connection is in use. All types of communication using SSH, such
as terminal session, are supported using separate channels. Either side may open a channel. The
life of a channel progresses through three stages: Opening a channel, data transfer and closing a
channel.

When either side wishes to open a new channel, it allocates a local number for the channel and
then sends a message of form:
Byte SSH_MSG_CHANNEL_OPEN
String channel type
Uint32 sender channel
Unit32 initial window size
Unit32 maximum packet size

Where uint32 means unsigned 32 bit integer. The channel type identifies the application of this
channel. The sender channel is local channel number. The initial window size specifies how
many bytes of channel data can be sent to the sender of this message without adjusting the
window.
If the remote side is able to open the channel, it returns SSH_MSG_CHANNEL_OPEN_
CONFIRMATION message, which include the sender channel number, the recipient channel
number and window packet size values for incoming traffic. Otherwise, the remote side returns
a SSH_MSG_CHANNEL_OPEN_FAILURE message with a reason code indicating the reasin
for failure.

Ones the channel is open, data transfer is performed using SSH_MAG_CHANNEL_DATA


message, which includes the recipient channel number and block of data. These messages in
both direction, may continue as long as the channel is open.

When either side wishes to close channel, it sends SSH_MSG_CLOSE_CHANNEL message,


which includes the recipient channel number.

Figure 1.10 : Connection Protocol Message Exchange

16. Explain the different types of channels recognized in SSH connection Protocol
specification
➢ session: The remote execution of a program. The program may be a shell, an application
such as file transfer or e-mail, a system command, or some built-in subsystem. Once a
session channel is opened, subsequent requests are used to start the remote program.
➢ x11: This refers to the X Window System, a computer software system and network
protocol that provides a graphical user interface (GUI) for networked computers.X allows
applications to run on a network server but to be displayed on a desktop machine.
➢ forwarded-tcpip: This is remote port forwarding, as explained in the next subsection.
➢ direct-tcpip: This is local port forwarding, as explained in the next subsection.
17. Explain Port forwarding in SSH protocol.
Figure 1.11 illustrates the basic concept behind port forwarding. Here the client application is
identified by port number x and a server application by a port number. At some point, the client
application invokes the local TCP entry and requests a connection to the remote server on y. the
local TCP entry negotiates a TCP connection with remote TCP entry, such that the connection links
local port x to remote port y.

Figure 1.11: SSH transport layer packet exchange

To secure this connection, SSH is configured so that the SSH Transport layer protocol establishes a
TCP connection between SSH client and server entries with TCP port number A and b,
respectively. A secure SSH channel is established over this TCP connection. Traffic from the client
at port x is redirected to local SSH entity and travels through the tunnel where the remote SSH
entity delivers the data to the server application on port . Traffic in the other direction is similarly
redirected.

SSH supports two types of port forwarding: local forwarding and remote forwarding. Local
forwarding allows the client to set up a “hijacker” process. This will intercept selected application-
level traffic and redirect it from an unsecured TCP connection to a secure SSH tunnel. SSH is
configured to listen on selected ports. SSH grabs all traffic using a selected port and sends it
through an SSH tunnel. On the other end, the SSH server sends the incoming traffic to the
destination port dictated by the client application.

With remote forwarding, the user’s SSH client acts on the server’s behalf. The client receives
traffic with a given destination port number, places the traffic on the correct port and sends it to the
destination the user chooses.
18

You might also like