PPT-Application Layer
PPT-Application Layer
Lecture 8– SSH,DNS 67
2
Module 2: Application layer
The Internet was originally designed to provide service to users around the world.
Since the application layer is the only layer that provides services to the Internet
user, it allows new application protocols to be easily added to the Internet, which
has been occurring during the lifetime of the Internet. When the Internet was
created, only a few application protocols were available to the users; today we
cannot give a number for these protocols because new ones are being added
constantly.
It should be clear that to use the Internet we need two application programs to
interact with each other: one running on a computer somewhere in the world, the
other running on another computer somewhere else in the world. The two
programs need to send messages to each other through the Internet infrastructure.
However, we have not discussed what the relationship should be between these
programs. Should both application programs be able to request services and
provide services, or should the application programs just do one or the other?
• Mixed Paradigm
Lecture No: 6
Client- Server Paradigm:
Application Programming Interface
2-2 CLIENT-SERVER PARADIGM
instructions for string manipulation, a set of instructions for input/ output access, and so on.
If we need a process to be able to communicate with another process, we need a new set of
instructions to tell the lowest four layers of the TCP/IP suite to open the connection, send
and receive data from the other end, and close the connection. A set of instructions of this
• UDP Protocol
• TCP Protocol
• SCTP Protocol
During the lifetime of the Internet, several application programs have been
developed. We do not have to redefine them, but we need to understand
what they do. For each application, we also need to know the options
available to us. The study of these applications can help us to create
customized applications in the future
24
2.3.1 World Wide Web and HTTP
In this section, we first introduce the World Wide Web (abbreviated WWW or
Web). We then discuss the Hyper Text Transfer Protocol (HTTP), the most
common client-server application program used in relation to the Web.
25
(continued)
26
Formats of the request and response messages
27
Table 2.1: Methods
28
Table 2.2: Request Header Names
29
Table 2.3: Response Header Names
30
2.3.2 FTP
File Transfer Protocol (FTP) is the standard protocol provided by TCP/IP for
copying a file from one host to another. Although transferring files from one
system to another seems simple and straightforward, some problems must be
dealt with first. For example, two systems may use different file name
conventions. Two systems may have different ways to represent data. All of
these problems have been solved by FTP in a very simple and elegant
approach.
31
(continued)
Control Connection
Data Connection
File Transfer
32
FTP
33
Some FTP commands
34
Some responses in FTP
35
2.3.3 Electronic Mail
Electronic mail (or e-mail) allows users to exchange messages. The nature of
this application, however, is different from other applications discussed so
far. In an application such as HTTP or FTP, the server program is running
all the time, waiting for a request from a client. When the request arrives, the
server provides the service. In the case of electronic mail, the situation is
different.
36
Continued
37
(continued)
• Architecture
• User Agent
Sending Mail
Receiving Mail
Addresses
Mailing List or Group List
38
(continued)
MIME
MIME Headers
• Web-Based Mail
Case I
Case II
• E-Mail Security
39
Message Transfer Agent: SMTP
Commands and Responses
Mail Transfer Phases
• Message Access Agent: POP and IMAP
POP3
IMAP4
40
Common scenario
41
Format of an e-mail
42
E-mail address
43
Protocols used in electronic mail
44
SMTP Commands
45
SMTP responses
46
SMTP responses
47
TELNET
48
(continued)
Options
User Interface
49
Local versus remote logging
50
Concept of NVT
51
Examples of interface commands
52
Thank You
Module 2: Application layer
Although Secure Shell (SSH) is a secure application program that can be used
today for several purposes such as remote logging and file transfer, it was originally
designed to replace TELNET. There are two versions of SSH: SSH-1 and SSH-2,
which are totally incompatible. The first version, SSH-1, is now deprecated because
of security flaws in it. In this section, we discuss only SSH-2
55
• Components
SSH Transport-Layer Protocol (SSH-TRANS)
SSH Authentication Protocol (SSH-AUTH)
SSH Connection Protocol (SSH-CONN)
• Applications
SSH for Remote Logging
SSH for File Transfer
• Port Forwarding
• Format of the SSH Packets
56
Components of SSH
57
Port Forwarding
58
SSH Packet Format
59
Domain Name System (DNS)
To identify an entity, TCP/IP protocols use the IP address, which uniquely identifies
the connection of a host to the Internet. However, people prefer to use names
instead of numeric addresses. Therefore, the Internet needs to have a directory
system that can map a name to an address. This is analogous to the telephone
network. A telephone network is designed to use telephone numbers, not names.
People can either keep a private file to map a name to the corresponding telephone
number or can call the telephone directory to do so.
60
• Name Space
Domain Name Space
Domain
Distribution of Name Space
Zone
Root Server
• DNS in the Internet
Generic Domains
Country Domains
61
Resolution
Recursive Resolution
iterative Resolution
Caching
• Resource Records
• DNS Messages
• Encapsulation
• Registrars
• DDNS
• Security of DNS
62
Purpose of DNS
63
Generic domains
64
Generic domain labels
65
Recursive resolution
66
Iterative resolution
67
DNS types
68
DNS message
69
Example
In UNIX and Windows, the nslookup utility can be used to retrieve address/name mapping.
The following shows how we can retrieve an address when the domain name is given.
70
Module 2: Application Layer
• Run-length Coding
• Dictionary Coding
Encoding
Decoding
• Huffman Coding
Huffman Tree
Coding Table
Encoding and Decoding
• Arithmetic Coding
Encoding
Decoding
Static versus Dynamic Arithmetic Coding
• Telnet
85 Lecture 2
SQL injection (SQLi)
86 Lecture 2
Lightweight Directory Access Protocol (LDAP)
injection
•LDAP is designed to query and update directory services,
such as a database like Microsoft Active Directory.
•LDAP uses both TCP and UDP port 389 and LDAP uses
port 636.
•In an LDAP injection attack, the attacker exploits the
vulnerabilities within a web application that constructs
LDAP messages or statements, which are based on the
user input.
•If the receiving application does not validate or sanitize
the user input, this increases the possibility of
manipulating LDAP messages.
87 Lecture 2
Cross-Site Request Forgery (CSRF)
88 Lecture 2
Session hijacking
89 Lecture 2
Cookie poisoning
90 Lecture 2
DNS
• Distributed Denial-of-Service (DDoS)
• Typosquatting
• Registrar hijacking
– If a hacker modifies the A record on a domain to redirect all
traffic to a compromised or malicious server, anyone who visits
the compromised domain will be redirected to the malicious
website.
• Cache poisoning
– The resolved data is stored within the local system in a cache
area. The attacker can compromise this temporary storage area
and manipulate any further resolution done by the local system.
•
91 Lecture 2
Thank You