SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Information System SecurityInformation System Security
Lectures 7 and 8Lectures 7 and 8
Web SecurityWeb Security
22
ReferencesReferences
[1] Google Code for Educator: Sample Course Content, Web[1] Google Code for Educator: Sample Course Content, Web
Security.Security.
http://code.google.com/edu/content/submissions/web_secuhttp://code.google.com/edu/content/submissions/web_secu
..
[2][2] Network security, The complete ReferenceNetwork security, The complete Reference. R. Bragg, M.. R. Bragg, M.
Rhodes-Ousley, K. Strassberg. McGraw-Hill Osborne,Rhodes-Ousley, K. Strassberg. McGraw-Hill Osborne,
2004.2004.
33
OutlineOutline
1.1. Web SystemWeb System
2.2. Web System SecurityWeb System Security
3.3. Simple Web ServerSimple Web Server
4.4. Web Server SecurityWeb Server Security
5.5. Web Browser SecurityWeb Browser Security
6.6. Web Application SecurityWeb Application Security
7.7. Communication SecurityCommunication Security
44
1. Web System1. Web System
 Generic web application work flow diagram:Generic web application work flow diagram:
55
Web SystemWeb System
Web
Browser
HTML forms,
Java, Cookies,
JavaScript,
VBScript,
Plug-ins, etc.
http request
Web
Server
Web
Application
CGI, Java
Servlets,
ASP, SSI,
J2EE, PHP,
etc.
Web
Server
Resources
Applications
http reply
http/SSL/
TCP/IP
66
2. Web System Security2. Web System Security
1.1. Web Server SecurityWeb Server Security
2.2. Web Browser SecurityWeb Browser Security
3.3. Web Application SecurityWeb Application Security
4.4. Channel SecurityChannel Security
77
3. Simple Web Server3. Simple Web Server **
 To illustrate what can go wrong if we do not design for securityTo illustrate what can go wrong if we do not design for security
in our web applications from the start, consider a simple webin our web applications from the start, consider a simple web
server implemented in Java.server implemented in Java.
 All this program does is serve documents using HTTP.All this program does is serve documents using HTTP.
 We will walkthrough the code in the following slides.We will walkthrough the code in the following slides.
 This web server only supports simple HTTP GET requests.This web server only supports simple HTTP GET requests.
** Slides 7-17 taken from [1]Slides 7-17 taken from [1]
88
Some Preliminaries…Some Preliminaries…
 ((HHyperyperTTextext TTransferransfer PProtocol): The communications protocolrotocol): The communications protocol
used to connect to servers on the Web.used to connect to servers on the Web.
 Its primary function is to establish a connection with a WebIts primary function is to establish a connection with a Web
server and transmit HTML pages to the client browser or anyserver and transmit HTML pages to the client browser or any
other files required by an HTTP application.other files required by an HTTP application.
 http is stateless (ie, request/reply)http is stateless (ie, request/reply)
 Addresses of Web sites begin with anAddresses of Web sites begin with an http://http:// prefix.prefix.
99
Some Preliminaries…Some Preliminaries…
 A typical HTTP request that a browser makes to a webA typical HTTP request that a browser makes to a web
server:server:
Get / HTTP/1.0Get / HTTP/1.0
 When the server receives this request for filename / (whichWhen the server receives this request for filename / (which
means themeans the rootroot document on the web server), it attemptsdocument on the web server), it attempts
to load index.html. It sends back:to load index.html. It sends back:
HTTP/1.0 200 OKHTTP/1.0 200 OK
followed by the document contents.followed by the document contents.
1010
SimpleWebServer: main()SimpleWebServer: main()
/* This method is called when the program is run from the/* This method is called when the program is run from the
command line. */command line. */
public static void main (String argv[]) throws Exception {public static void main (String argv[]) throws Exception {
/* Create a SimpleWebServer object, and run it *//* Create a SimpleWebServer object, and run it */
SimpleWebServer sws = new SimpleWebServer();SimpleWebServer sws = new SimpleWebServer();
sws.run();sws.run();
}}
1111
SimpleWebServer ClassSimpleWebServer Class
public class SimpleWebServer {public class SimpleWebServer {
/* Run the HTTP server on this TCP port. *//* Run the HTTP server on this TCP port. */
private static final int PORT = 8080;private static final int PORT = 8080;
/* The socket used to process incoming connections/* The socket used to process incoming connections
from web clients */from web clients */
private static ServerSocket dServerSocket;private static ServerSocket dServerSocket;
public SimpleWebServer () throws Exception {public SimpleWebServer () throws Exception {
dServerSocket = new ServerSocket (PORT);dServerSocket = new ServerSocket (PORT);
}}
public void run() throws Exception {public void run() throws Exception {
while (true) {while (true) {
/* wait for a connection from a client *//* wait for a connection from a client */
Socket s = dServerSocket.accept();Socket s = dServerSocket.accept();
/* then process the client's request *//* then process the client's request */
processRequest(s);processRequest(s);
}}
}}
1212
SimpleWebServer: processRequest 1SimpleWebServer: processRequest 1
/* Reads the HTTP request from the client, and/* Reads the HTTP request from the client, and
responds with the file the user requested orresponds with the file the user requested or
a HTTP error code. */a HTTP error code. */
public void processRequest(Socket s) throwspublic void processRequest(Socket s) throws
Exception {Exception {
/* used to read data from the client *//* used to read data from the client */
BufferedReader br =BufferedReader br =
new BufferedReader (new InputStreamReadernew BufferedReader (new InputStreamReader
(s.getInputStream()));(s.getInputStream()));
/* used to write data to the client *//* used to write data to the client */
OutputStreamWriter osw =OutputStreamWriter osw =
new OutputStreamWriter (s.getOutputStream());new OutputStreamWriter (s.getOutputStream());
1313
SimpleWebServer: processRequest 2SimpleWebServer: processRequest 2
/* read the HTTP request from the client *//* read the HTTP request from the client */
String request = br.readLine();String request = br.readLine();
String command = null;String command = null;
String pathname = null;String pathname = null;
/* parse the HTTP request *//* parse the HTTP request */
StringTokenizer st =StringTokenizer st =
new StringTokenizer (request, " ");new StringTokenizer (request, " ");
command = st.nextToken();command = st.nextToken();
pathname = st.nextToken();pathname = st.nextToken();
1414
SimpleWebServer: processRequest 3SimpleWebServer: processRequest 3
if (command.equals("GET")) {if (command.equals("GET")) {
/* if the request is a GET/* if the request is a GET
try to respond with the filetry to respond with the file
the user is requesting */the user is requesting */
serveFile (osw,pathname);serveFile (osw,pathname);
}}
else {else {
/* if the request is a NOT a GET,/* if the request is a NOT a GET,
return an error saying this serverreturn an error saying this server
does not implement the requested command */does not implement the requested command */
osw.write ("HTTP/1.0 501 Notosw.write ("HTTP/1.0 501 Not
Implementednn");Implementednn");
}}
/* close the connection to the client *//* close the connection to the client */
osw.close();osw.close();
1515
SimpleWebServer:SimpleWebServer:
serveFile 1serveFile 1
public void serveFile (OutputStreamWriter osw,public void serveFile (OutputStreamWriter osw,
String pathname) throws Exception {String pathname) throws Exception {
FileReader fr=null;FileReader fr=null;
int c=-1;int c=-1;
StringBuffer sb = new StringBuffer();StringBuffer sb = new StringBuffer();
/* remove the initial slash at the beginning/* remove the initial slash at the beginning
of the pathname in the requestof the pathname in the request */*/
if (pathname.charAt(0)=='/')if (pathname.charAt(0)=='/')
pathname=pathname.substring(1);pathname=pathname.substring(1);
/* if there was no filename specified by the/* if there was no filename specified by the
client, serve the "index.html" file */client, serve the "index.html" file */
if (pathname.equals(""))if (pathname.equals(""))
pathname="index.html";pathname="index.html";
1616
SimpleWebServer:SimpleWebServer:
serveFile 2serveFile 2
/* try to open file specified by pathname *//* try to open file specified by pathname */
try {try {
fr = new FileReader (pathname);fr = new FileReader (pathname);
c = fr.read();c = fr.read();
}}
catch (Exception e) {catch (Exception e) {
/* if the file is not found,return the/* if the file is not found,return the
appropriate HTTP response code */appropriate HTTP response code */
osw.write ("HTTP/1.0 404 Not Foundnn");osw.write ("HTTP/1.0 404 Not Foundnn");
return;return;
}}
1717
SimpleWebServer:SimpleWebServer:
serveFile 3serveFile 3
/* if the requested file can be/* if the requested file can be
successfully opened and read, then returnsuccessfully opened and read, then return
an OK response code and send the contentsan OK response code and send the contents
of the file */of the file */
osw.write ("HTTP/1.0 200 OKnn");osw.write ("HTTP/1.0 200 OKnn");
while (c != -1) {while (c != -1) {
sb.append((char)c);sb.append((char)c);
c = fr.read();c = fr.read();
}}
osw.write (sb.toString());osw.write (sb.toString());
1818
SimpleWebServerSimpleWebServer
VulnerabilitiesVulnerabilities
 Can you identify any security vulnerabilities inCan you identify any security vulnerabilities in
SimpleWebServer? Or what can go wrong?SimpleWebServer? Or what can go wrong?
 Yes:Yes: Denial of Service (DoS):Denial of Service (DoS):
– An attacker makes a web server unavailable, butAn attacker makes a web server unavailable, but
– How?How?
 DoS on SimpleWebServer:DoS on SimpleWebServer:
– Just send a carriage return as the first message instead of a properlyJust send a carriage return as the first message instead of a properly
formatted GET message…formatted GET message…
– The web server crashesThe web server crashes
– Service to all subsequent clients is denied until the web server is restartedService to all subsequent clients is denied until the web server is restarted
1919
4. Web Server Security:4. Web Server Security:
OverviewOverview
 Consider the following HTML code:Consider the following HTML code:
<html><html>
<head><head>
<title> Hello world </title><title> Hello world </title>
</head></head>
</html></html>
 Attackers can try 2 strategies to penetrate the web server hostingAttackers can try 2 strategies to penetrate the web server hosting
this HTML code:this HTML code:
– Exploit web application insecurityExploit web application insecurity
 there no Exploit in this codethere no Exploit in this code
– Hacking web server itselfHacking web server itself
 See the SimpleWebServer : DoS attackSee the SimpleWebServer : DoS attack
2020
Web Server Security: Goals ofWeb Server Security: Goals of
server attacksserver attacks
1.1. Web site defacementWeb site defacement
– Corruption of the HTML code.Corruption of the HTML code.
– Example: Next slideExample: Next slide
1.1. Data CorruptionData Corruption
– Any data on the server can be deleted or modified.Any data on the server can be deleted or modified.
1.1. Data TheftData Theft
– eg, credit card number stolen from ecommerce site.eg, credit card number stolen from ecommerce site.
1.1. Denial of serviceDenial of service
– Clients are no more served.Clients are no more served.
2121
http://www.syria-news.com
2222
Web Server Security: Types ofWeb Server Security: Types of
attacksattacks
1.1. Directory traversalDirectory traversal
2.2. Script permissionsScript permissions
3.3. Directory BrowsingDirectory Browsing
4.4. Default samplesDefault samples
2323
Web Server Security: Types ofWeb Server Security: Types of
attacksattacks
1.1. Directory traversalDirectory traversal
– Is a method for accessing directories other than the allowed ones.Is a method for accessing directories other than the allowed ones.
– In Microsoft’s IIS, if the OS XP is installed on drive c: and adminstratorIn Microsoft’s IIS, if the OS XP is installed on drive c: and adminstrator
didn’t change the directory name, the default web site directory isdidn’t change the directory name, the default web site directory is
c:inetpubc:inetpub
– Attackers can read file they are not meant to. For exampleAttackers can read file they are not meant to. For example
 If the attacker tryIf the attacker try http://www.somesite.com/../autoexec.bathttp://www.somesite.com/../autoexec.bat then the server
may return the content of autoexec.bat.
2424
Web Server Security: Types ofWeb Server Security: Types of
attacksattacks
2.2. Script permissionsScript permissions
 In order to run server-side applications (eg, CGI, Perl, etc.),In order to run server-side applications (eg, CGI, Perl, etc.),
administrator must grant executable permission to the directory whereadministrator must grant executable permission to the directory where
these applications reside.these applications reside.
 What happens if the admin grand permissions to the wrong directory?What happens if the admin grand permissions to the wrong directory?
 Example: if the admin grants executable permission to c: then whatExample: if the admin grants executable permission to c: then what
happens if the attacker tryhappens if the attacker try
http://www.somesite.com/../Windows/system32/cmd.exe%20%2fc%20dirhttp://www.somesite.com/../Windows/system32/cmd.exe%20%2fc%20dir
2525
Web Server Security: Types ofWeb Server Security: Types of
attacksattacks
 The web server parse the request and executeThe web server parse the request and execute
../windows/system32/cmd.exe /c dir../windows/system32/cmd.exe /c dir
ie, listing all files in the current directory.ie, listing all files in the current directory.
– Attacker can execute commands that delete or modify files on the webAttacker can execute commands that delete or modify files on the web
server.server.
3.3. Directory BrowsingDirectory Browsing
 If Directory browsing is enabled attacker, can browse that directory andIf Directory browsing is enabled attacker, can browse that directory and
its subdirectories.its subdirectories.
 Knowledge of the existence of some file can help attacker launching anKnowledge of the existence of some file can help attacker launching an
attack.attack.
2626
Web Server ProtectionWeb Server Protection
1.1. Run web server service with Least privileges.Run web server service with Least privileges.
2.2. Install most recent security patches of server software.Install most recent security patches of server software.
3.3. Install most recent security patches of OS.Install most recent security patches of OS.
4.4. Secure other network services running on the same machine.Secure other network services running on the same machine.
5.5. Delete unneeded applications.Delete unneeded applications.
6.6. Grant script permissions only to isolated directory containingGrant script permissions only to isolated directory containing
the scripts in question.the scripts in question.
7.7. Maintain adequate logs and backups..Maintain adequate logs and backups..
8.8. Secure your web server using third-party security products:Secure your web server using third-party security products:
antiviruses, Firewalls, vulnerabilities scanners, input validation,antiviruses, Firewalls, vulnerabilities scanners, input validation,
etc.etc.
2727
5. Web browser Security5. Web browser Security
 Browser sends requests
– May reveal private information (in forms, cookies)
– Also sends other information that may be damaging:
 IP address
 OS
 Browser version/type, etc.
 Browser receives information, code
– May corrupt hosts by running unsafe code
– Information may exercise a bug in the browser allowing arbitrary
remote code execution.
2828
Web browser SecurityWeb browser Security
 Cookies
– Cookie mechanism
 Mobile code
– Java applet
– JavaScript
– VBScript
2929
Web browser Security:Web browser Security:
CookiesCookies
 HTTP is stateless. This causes problems in a lot of transactions that
need a concept of a “session”:
– A customer wants to purchase an item online.
– A customer logs onto their bank to pay bills
– Sites like Yahoo allow users to customize their view of the portal
– As the user jumps from web page to web page, the server can’t keep track
of whether it’s the same user, or another user requesting the same page
– Servers use cookies to keep track of their users.
 A cookie is a file created by an Internet site to store information on
your computer
– Once a cookie is saved on your computer, only the Web site that created
the cookie can read it.
– Example: google’s cookie
3030
Web browser Security:Web browser Security:
CookiesCookies
 PREF
ID=186f76e084b84d56:TM=1193982844:LM=1193982844:S=O8OM9
yhkCkr98Ej_
google.co.uk/
1536 //3081004544 // 30038711 //2452507808 // 29891852
*
 Problems
– Cookies maintain record of your browsing habits
 May include any information a web site knows about you
– Browser attacks could invade your “privacy”
– Stealing someone’s cookies may allow attacker to impersonate the victim:
 Session hijacking
3131
Web browser Security: MobileWeb browser Security: Mobile
CodeCode
 Mobile code runs on clients’ machine.Mobile code runs on clients’ machine.
 It’s an executable content (eg, applets).It’s an executable content (eg, applets).
 Things to do:Things to do:
– Protect machine from downloaded code.Protect machine from downloaded code.
– Needs protection from content providers.Needs protection from content providers.
 Normal users are asked to make security decisions /policies.Normal users are asked to make security decisions /policies.
Web
browser
Web
Server
executes
applet
Mobile Code
(eg, applet)
3232
6. Web application Security6. Web application Security
1.1. SQL injectionSQL injection
1.1. Common Gateway InterfaceCommon Gateway Interface
3333
SQL injectionSQL injection
 SQL (Structured Query Language) is a language thatSQL (Structured Query Language) is a language that
Communicates with DBs, Example:Communicates with DBs, Example:
– Select * from Users where username =’admin’ andSelect * from Users where username =’admin’ and
password = ‘somepasswd’password = ‘somepasswd’
– Looks for user whose username = admin and password = somepasswdLooks for user whose username = admin and password = somepasswd
 SQL injection is a technique to inject crafted SQL into user inputSQL injection is a technique to inject crafted SQL into user input
fields that are a part of web forms, can be used to:fields that are a part of web forms, can be used to:
– bypass custom login to a web site,bypass custom login to a web site,
– Log in to a web site, orLog in to a web site, or
– take over a sitetake over a site
3434
SQL injection: Simple loginSQL injection: Simple login
bypassingbypassing
 Consider the following web site’s login form:Consider the following web site’s login form:
……
<form action = “login.asp” method = “post”><form action = “login.asp” method = “post”>
<p> Username:<input type=text name= “username” /> </p><p> Username:<input type=text name= “username” /> </p>
<p> Password:<input type=password name= “password” /><p> Password:<input type=password name= “password” />
</p></p>
<p> <input type=submit name= “submit” value=”login” /><p> <input type=submit name= “submit” value=”login” />
</p></p>
</form></form>
……
– It’s a web page that requests 2 pieces of information from the user usernameIt’s a web page that requests 2 pieces of information from the user username
and password and it submits the information in the fields to login.asp (writtenand password and it submits the information in the fields to login.asp (written
in asp)in asp)
3535
SQL injection: Simple loginSQL injection: Simple login
bypassingbypassing
 The file login.asp:The file login.asp:
Dim adoConnectionDim adoConnection
SetSet
adoConnection=server.CreateObject(“ADODB.ConnectiadoConnection=server.CreateObject(“ADODB.Connecti
on”)on”)
……
Dim strLoginSQLDim strLoginSQL
strLoginSQL=”select * from users where username =”strLoginSQL=”select * from users where username =”
& Request.Form (“username”) & “ ‘ and password =’& Request.Form (“username”) & “ ‘ and password =’
“ & Request.Form(“password”) & “ ‘ ““ & Request.Form(“password”) & “ ‘ “
Dim adoResultDim adoResult
Set adoResult=adoConnection.Execute(strLoginSQL)Set adoResult=adoConnection.Execute(strLoginSQL)
If not adoResult.EOF ThenIf not adoResult.EOF Then
‘‘We are here all went okWe are here all went ok
ElseElse
‘‘Wrong loginWrong login
End IfEnd If
3636
SQL injection: Simple loginSQL injection: Simple login
bypassingbypassing
 If the user entersIf the user enters adminadmin as a username andas a username and adminpasswdadminpasswd, the, the
following sql command is constructed:following sql command is constructed:
Select * from users where username =’admin’ andSelect * from users where username =’admin’ and
password = ‘adminpasswd’password = ‘adminpasswd’
 The username and password are placed inside the SQL string,The username and password are placed inside the SQL string,
but without any checks:but without any checks:
– What happens if an attacker enter ‘a’ or “1”=“1” as a username and anyWhat happens if an attacker enter ‘a’ or “1”=“1” as a username and any
password?password?
– The resulting SQL string is:The resulting SQL string is:
Select * from users where username =Select * from users where username = ‘a’ or‘a’ or
“1”=“1” -- ’“1”=“1” -- ’ and password = ‘anypassword’and password = ‘anypassword’
– This code will return data because “1”=“1”This code will return data because “1”=“1”
– the attacker bypass the login.the attacker bypass the login.
3737
SQL injectionSQL injection
 Worse!Worse!
– The attacker can use built-in procedures to read or write files, or to invokeThe attacker can use built-in procedures to read or write files, or to invoke
programs in the database computerprograms in the database computer
– For example theFor example the xp_cmdshellxp_cmdshell stored procedure invokes shell commandsstored procedure invokes shell commands
on the server’s computer likeon the server’s computer like dir, copy, renamedir, copy, rename, etc., etc.
– From the last example, a hacker can enter some username as a username andFrom the last example, a hacker can enter some username as a username and
a’exec master..xp_cmdshell ‘dela’exec master..xp_cmdshell ‘del
c:winntsystem32*.dll’c:winntsystem32*.dll’ as a passwordas a password ..
 This will cause the database to delete all DLLs in the specified directory.This will cause the database to delete all DLLs in the specified directory.
3838
SQL injection: SolutionsSQL injection: Solutions
 Filter all input fields for apostrophes to prevent unauthorizedFilter all input fields for apostrophes to prevent unauthorized
loginslogins
 Filter all input fields for SQL commands likeFilter all input fields for SQL commands like insert,insert,
select, deleteselect, delete, and, and execexec to prevent server manipulationto prevent server manipulation
 Limit input field length (which will limit hackers’ options), andLimit input field length (which will limit hackers’ options), and
validate the input length with server-side scripts.validate the input length with server-side scripts.
 Place the database on a different computer than the web server.Place the database on a different computer than the web server.
– If the database is hacked, it’ll be harder to reach the web server.If the database is hacked, it’ll be harder to reach the web server.
 Limit the user privileges of the server-side scripts.Limit the user privileges of the server-side scripts.
 Delete all unneeded extended stored procedures to limit hackers’Delete all unneeded extended stored procedures to limit hackers’
possibilities.possibilities.
3939
Common Gateway InterfaceCommon Gateway Interface
 Common Gateway Interface (CGI)Common Gateway Interface (CGI)
– meta-language for translating URLs or HTML forms into executablemeta-language for translating URLs or HTML forms into executable
programs.programs.
 An attacker may exploit bugs in CGI scripts to gain unauthorized
access to files on the web server, or even to take control of the
host.
 CGI scripts can present security holes in two ways:
– they may intentionally or unintentionally leak information about the host
system that will help hackers break in.
– Scripts that process user input may be vulnerable to attacks in which the
remote user tricks them into executing commands (always remember:
“user input is evil”).
4040
7. Communication Security7. Communication Security
 VulnerabilitiesVulnerabilities
– Tapping or eavesdropping:Tapping or eavesdropping: occurs when a device is placed near or intooccurs when a device is placed near or into
the cabling.the cabling.
– Sniffing: usingSniffing: using Sniffers ( special programs) in order to eavesdrop on theSniffers ( special programs) in order to eavesdrop on the
network traffic.network traffic.
– IP spoofing:IP spoofing:
 An attacker can place any IP address as the source address of an IPAn attacker can place any IP address as the source address of an IP
datagram, so can be dangerous to base access control decisions ondatagram, so can be dangerous to base access control decisions on
raw IP addresses alone.raw IP addresses alone.
 An attacker may be able to replay, delay, reorder, modifiy or inject IPAn attacker may be able to replay, delay, reorder, modifiy or inject IP
datagrams.datagrams.
– DNS spoofing: DNS server is lured to translate names (eg,DNS spoofing: DNS server is lured to translate names (eg,
www.scs-net.orgwww.scs-net.org) into attackers’ IP addresses.) into attackers’ IP addresses.
 Communication Protection: SSLCommunication Protection: SSL
4141
SSLSSL
 Secure Sockets LayerSecure Sockets Layer (SSL) was developed (in 1994) by(SSL) was developed (in 1994) by
Netscape Corporation to provide security between web clientNetscape Corporation to provide security between web client
and server.and server.
 SSL designed to be under HTTP:SSL designed to be under HTTP:
– HTTP | SSL | TCPHTTP | SSL | TCP
 SSL permits:SSL permits:
– Authentication of peer entitiesAuthentication of peer entities
– Exchange of secret keysExchange of secret keys
– Use of exchanged keys to authenticate and encrypt transmitted dataUse of exchanged keys to authenticate and encrypt transmitted data
between communicating peer entities.between communicating peer entities.
4242
SSL ArchitectureSSL Architecture
 SSL consists of two sublayers:SSL consists of two sublayers:
– SSL Record Protocol: provide security services to higher-layer protocolsSSL Record Protocol: provide security services to higher-layer protocols
(in particular, HTTP) including SSL management protocols.(in particular, HTTP) including SSL management protocols.
– SSL Management protocols: Handshake, Cipher Change, and AlertSSL Management protocols: Handshake, Cipher Change, and Alert
ProtocolsProtocols
SSL Architecture
4343
SSL Record ProtocolSSL Record Protocol
 The SSL Record Protocol uses the keys derived from the HandshakeThe SSL Record Protocol uses the keys derived from the Handshake
Protocol’s master key to securely deliver data.Protocol’s master key to securely deliver data.
 Provides two security functions:Provides two security functions:
– Confidentiality and Message IntegrityConfidentiality and Message Integrity
Data
Compression
(optional)
Encrypt
Record protocol
Header
fragment fragment fragmentFragmentation
To be transmitted in a
TCP segment
MAC
4444
SSL Record ProtocolSSL Record Protocol
 Protected data : SSL Record protocol allows applicationProtected data : SSL Record protocol allows application
protocols above SSL to be secured.protocols above SSL to be secured.
 Fragmentation: messages are broken into blocksFragmentation: messages are broken into blocks
 Compression: optionalCompression: optional
– Compression algorithm is not specifiedCompression algorithm is not specified
 MAC: computed over compressed data.MAC: computed over compressed data.
– SSL MAC is similar to HMACSSL MAC is similar to HMAC
– MAC key is derived from the master key.MAC key is derived from the master key.
 Encryption may be stream or block mode.Encryption may be stream or block mode.
– Symmetric encryption is usedSymmetric encryption is used
– There are only a limited selection of ciphers and MAC algorithms thatThere are only a limited selection of ciphers and MAC algorithms that
are allowed (eg, DES, 3DES, IDEA, RC4, etc)are allowed (eg, DES, 3DES, IDEA, RC4, etc)
4545
SSL Handshake ProtocolSSL Handshake Protocol
 Used to allow the server and client toUsed to allow the server and client to
– authenticate each other using certificates,authenticate each other using certificates,
– negotiate encryption and MAC algorithms, andnegotiate encryption and MAC algorithms, and
– establish keys to be used to protect data sent in SSL Record.establish keys to be used to protect data sent in SSL Record.
 Used before any application data is transmitted.Used before any application data is transmitted.
4646
S-HTTPS-HTTP
 Secure HTTP (S-HTTP) is a superset of HTTP with securitySecure HTTP (S-HTTP) is a superset of HTTP with security
support.support.
 Created in 1994 by Enterprise Integration Technology (EIT)Created in 1994 by Enterprise Integration Technology (EIT)
 Adopted by IETF as RFC 2660.Adopted by IETF as RFC 2660.
 Allows message to be encapsulated in various ways (message-Allows message to be encapsulated in various ways (message-
oriented).oriented).
 Encapsulation for encryption, signing and MACEncapsulation for encryption, signing and MAC
 Not widely used (not supported by Internet explorer orNot widely used (not supported by Internet explorer or
Netscape)Netscape)

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Go for the would be network programmer
Go for the would be network programmerGo for the would be network programmer
Go for the would be network programmer
 
Socket System Calls
Socket System CallsSocket System Calls
Socket System Calls
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scripting
 
Fidl analysis
Fidl analysisFidl analysis
Fidl analysis
 
RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message Queue
 
Socket Programming
Socket ProgrammingSocket Programming
Socket Programming
 
Redis as a message queue
Redis as a message queueRedis as a message queue
Redis as a message queue
 
Lecture10
Lecture10Lecture10
Lecture10
 
Advanced Sockets Programming
Advanced Sockets ProgrammingAdvanced Sockets Programming
Advanced Sockets Programming
 
Network Sockets
Network SocketsNetwork Sockets
Network Sockets
 
tit
tittit
tit
 
4 sesame
4 sesame4 sesame
4 sesame
 
Ruby HTTP clients
Ruby HTTP clientsRuby HTTP clients
Ruby HTTP clients
 
Pycon - Python for ethical hackers
Pycon - Python for ethical hackers Pycon - Python for ethical hackers
Pycon - Python for ethical hackers
 
skipfish
skipfishskipfish
skipfish
 
Ppt of socket
Ppt of socketPpt of socket
Ppt of socket
 
Metodologias de Programação IV - Aula 4, Secção 1 - Suporte para cache no pro...
Metodologias de Programação IV - Aula 4, Secção 1 - Suporte para cache no pro...Metodologias de Programação IV - Aula 4, Secção 1 - Suporte para cache no pro...
Metodologias de Programação IV - Aula 4, Secção 1 - Suporte para cache no pro...
 
T2
T2T2
T2
 
Nodejs 프로그래밍 ch.3
Nodejs 프로그래밍 ch.3Nodejs 프로그래밍 ch.3
Nodejs 프로그래밍 ch.3
 
Socket programming-tutorial-sk
Socket programming-tutorial-skSocket programming-tutorial-sk
Socket programming-tutorial-sk
 

Andere mochten auch

UW-Madison Information Systems 365 -- Physical Security -- Lecture 9
UW-Madison Information Systems 365 -- Physical Security -- Lecture 9 UW-Madison Information Systems 365 -- Physical Security -- Lecture 9
UW-Madison Information Systems 365 -- Physical Security -- Lecture 9 Nicholas Davis
 
Information Security 365/765 Lecture 13 – Legal Regulations, Industry Compli...
Information Security 365/765 Lecture 13 – Legal Regulations,  Industry Compli...Information Security 365/765 Lecture 13 – Legal Regulations,  Industry Compli...
Information Security 365/765 Lecture 13 – Legal Regulations, Industry Compli...Nicholas Davis
 
Segurança em sistemas de informação
Segurança em sistemas de informaçãoSegurança em sistemas de informação
Segurança em sistemas de informaçãoClausia Antoneli
 
Word numeração de_páginas
Word numeração de_páginasWord numeração de_páginas
Word numeração de_páginasClausia Antoneli
 
Demystifying Professional Certifications
Demystifying Professional CertificationsDemystifying Professional Certifications
Demystifying Professional CertificationsNicholas Davis
 
Exam II Review Session Information Security 365/765
Exam II Review Session Information Security 365/765Exam II Review Session Information Security 365/765
Exam II Review Session Information Security 365/765Nicholas Davis
 
Seg da Informação e Comp Movel Novos Desafios
Seg da Informação e Comp Movel Novos DesafiosSeg da Informação e Comp Movel Novos Desafios
Seg da Informação e Comp Movel Novos DesafiosGilberto Sudre
 
Cyberwarfare focusing on higher education as a prime target
Cyberwarfare focusing on higher education as a prime targetCyberwarfare focusing on higher education as a prime target
Cyberwarfare focusing on higher education as a prime targetNicholas Davis
 
Managing the Threat of Trade Secret and Intellectual Property (IP) Theft in t...
Managing the Threat of Trade Secret and Intellectual Property (IP) Theft in t...Managing the Threat of Trade Secret and Intellectual Property (IP) Theft in t...
Managing the Threat of Trade Secret and Intellectual Property (IP) Theft in t...Nicholas Davis
 
Scary Halloween Cybersecurity Lecture -- The Deep Web
Scary Halloween Cybersecurity Lecture -- The Deep WebScary Halloween Cybersecurity Lecture -- The Deep Web
Scary Halloween Cybersecurity Lecture -- The Deep WebNicholas Davis
 
The IT Security Jungle of Higher Education
The IT Security Jungle of Higher EducationThe IT Security Jungle of Higher Education
The IT Security Jungle of Higher EducationNicholas Davis
 
Information Systems 365 Lecture Six -- Access Control
Information Systems 365 Lecture Six -- Access ControlInformation Systems 365 Lecture Six -- Access Control
Information Systems 365 Lecture Six -- Access ControlNicholas Davis
 
4 System For Information Security
4 System For Information Security4 System For Information Security
4 System For Information SecurityAna Meskovska
 
Anonymous Connections And Onion Routing
Anonymous Connections And Onion RoutingAnonymous Connections And Onion Routing
Anonymous Connections And Onion RoutingAli Habeeb
 

Andere mochten auch (20)

UW-Madison Information Systems 365 -- Physical Security -- Lecture 9
UW-Madison Information Systems 365 -- Physical Security -- Lecture 9 UW-Madison Information Systems 365 -- Physical Security -- Lecture 9
UW-Madison Information Systems 365 -- Physical Security -- Lecture 9
 
Information Security 365/765 Lecture 13 – Legal Regulations, Industry Compli...
Information Security 365/765 Lecture 13 – Legal Regulations,  Industry Compli...Information Security 365/765 Lecture 13 – Legal Regulations,  Industry Compli...
Information Security 365/765 Lecture 13 – Legal Regulations, Industry Compli...
 
Segurança em sistemas de informação
Segurança em sistemas de informaçãoSegurança em sistemas de informação
Segurança em sistemas de informação
 
Word numeração de_páginas
Word numeração de_páginasWord numeração de_páginas
Word numeração de_páginas
 
Web Security
Web SecurityWeb Security
Web Security
 
Demystifying Professional Certifications
Demystifying Professional CertificationsDemystifying Professional Certifications
Demystifying Professional Certifications
 
Exam II Review Session Information Security 365/765
Exam II Review Session Information Security 365/765Exam II Review Session Information Security 365/765
Exam II Review Session Information Security 365/765
 
The Deep Hidden Web
The Deep Hidden WebThe Deep Hidden Web
The Deep Hidden Web
 
Seg da Informação e Comp Movel Novos Desafios
Seg da Informação e Comp Movel Novos DesafiosSeg da Informação e Comp Movel Novos Desafios
Seg da Informação e Comp Movel Novos Desafios
 
Cyberwarfare focusing on higher education as a prime target
Cyberwarfare focusing on higher education as a prime targetCyberwarfare focusing on higher education as a prime target
Cyberwarfare focusing on higher education as a prime target
 
Managing the Threat of Trade Secret and Intellectual Property (IP) Theft in t...
Managing the Threat of Trade Secret and Intellectual Property (IP) Theft in t...Managing the Threat of Trade Secret and Intellectual Property (IP) Theft in t...
Managing the Threat of Trade Secret and Intellectual Property (IP) Theft in t...
 
Scary Halloween Cybersecurity Lecture -- The Deep Web
Scary Halloween Cybersecurity Lecture -- The Deep WebScary Halloween Cybersecurity Lecture -- The Deep Web
Scary Halloween Cybersecurity Lecture -- The Deep Web
 
The IT Security Jungle of Higher Education
The IT Security Jungle of Higher EducationThe IT Security Jungle of Higher Education
The IT Security Jungle of Higher Education
 
Information Systems 365 Lecture Six -- Access Control
Information Systems 365 Lecture Six -- Access ControlInformation Systems 365 Lecture Six -- Access Control
Information Systems 365 Lecture Six -- Access Control
 
Iss lecture 1
Iss lecture 1Iss lecture 1
Iss lecture 1
 
Iss lecture 6
Iss lecture 6Iss lecture 6
Iss lecture 6
 
4 System For Information Security
4 System For Information Security4 System For Information Security
4 System For Information Security
 
Iss lecture 5
Iss lecture 5Iss lecture 5
Iss lecture 5
 
Iss lecture 9
Iss lecture 9Iss lecture 9
Iss lecture 9
 
Anonymous Connections And Onion Routing
Anonymous Connections And Onion RoutingAnonymous Connections And Onion Routing
Anonymous Connections And Onion Routing
 

Ähnlich wie Iss letcure 7_8

WebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemonWebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemonGeert Van Pamel
 
16network Programming Servers
16network Programming Servers16network Programming Servers
16network Programming ServersAdil Jafri
 
Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)dantleech
 
2019 11-bgphp
2019 11-bgphp2019 11-bgphp
2019 11-bgphpdantleech
 
Networking & Socket Programming In Java
Networking & Socket Programming In JavaNetworking & Socket Programming In Java
Networking & Socket Programming In JavaAnkur Agrawal
 
Node.js System: The Approach
Node.js System: The ApproachNode.js System: The Approach
Node.js System: The ApproachHaci Murat Yaman
 
A language for the Internet: Why JavaScript and Node.js is right for Internet...
A language for the Internet: Why JavaScript and Node.js is right for Internet...A language for the Internet: Why JavaScript and Node.js is right for Internet...
A language for the Internet: Why JavaScript and Node.js is right for Internet...Tom Croucher
 
Jersey framework
Jersey frameworkJersey framework
Jersey frameworkknight1128
 
13 networking, mobile services, and authentication
13   networking, mobile services, and authentication13   networking, mobile services, and authentication
13 networking, mobile services, and authenticationWindowsPhoneRocks
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API07.pallav
 
Web Server and how we can design app in C#
Web Server and how we can design app  in C#Web Server and how we can design app  in C#
Web Server and how we can design app in C#caohansnnuedu
 
Socket Programming it-slideshares.blogspot.com
Socket  Programming it-slideshares.blogspot.comSocket  Programming it-slideshares.blogspot.com
Socket Programming it-slideshares.blogspot.comphanleson
 
[WSO2 Integration Summit Madrid 2019] Integration + Ballerina
[WSO2 Integration Summit Madrid 2019] Integration + Ballerina[WSO2 Integration Summit Madrid 2019] Integration + Ballerina
[WSO2 Integration Summit Madrid 2019] Integration + BallerinaWSO2
 
Networking and Data Access with Eqela
Networking and Data Access with EqelaNetworking and Data Access with Eqela
Networking and Data Access with Eqelajobandesther
 
Network Programming Clients
Network Programming ClientsNetwork Programming Clients
Network Programming ClientsAdil Jafri
 

Ähnlich wie Iss letcure 7_8 (20)

Web
WebWeb
Web
 
WebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemonWebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemon
 
16network Programming Servers
16network Programming Servers16network Programming Servers
16network Programming Servers
 
Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)
 
03 sockets
03 sockets03 sockets
03 sockets
 
Server Side? Swift
Server Side? SwiftServer Side? Swift
Server Side? Swift
 
2019 11-bgphp
2019 11-bgphp2019 11-bgphp
2019 11-bgphp
 
Networking & Socket Programming In Java
Networking & Socket Programming In JavaNetworking & Socket Programming In Java
Networking & Socket Programming In Java
 
Red5 - PHUG Workshops
Red5 - PHUG WorkshopsRed5 - PHUG Workshops
Red5 - PHUG Workshops
 
Node.js System: The Approach
Node.js System: The ApproachNode.js System: The Approach
Node.js System: The Approach
 
A language for the Internet: Why JavaScript and Node.js is right for Internet...
A language for the Internet: Why JavaScript and Node.js is right for Internet...A language for the Internet: Why JavaScript and Node.js is right for Internet...
A language for the Internet: Why JavaScript and Node.js is right for Internet...
 
Jersey framework
Jersey frameworkJersey framework
Jersey framework
 
13 networking, mobile services, and authentication
13   networking, mobile services, and authentication13   networking, mobile services, and authentication
13 networking, mobile services, and authentication
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 
Web Server and how we can design app in C#
Web Server and how we can design app  in C#Web Server and how we can design app  in C#
Web Server and how we can design app in C#
 
Socket Programming it-slideshares.blogspot.com
Socket  Programming it-slideshares.blogspot.comSocket  Programming it-slideshares.blogspot.com
Socket Programming it-slideshares.blogspot.com
 
AJAX Transport Layer
AJAX Transport LayerAJAX Transport Layer
AJAX Transport Layer
 
[WSO2 Integration Summit Madrid 2019] Integration + Ballerina
[WSO2 Integration Summit Madrid 2019] Integration + Ballerina[WSO2 Integration Summit Madrid 2019] Integration + Ballerina
[WSO2 Integration Summit Madrid 2019] Integration + Ballerina
 
Networking and Data Access with Eqela
Networking and Data Access with EqelaNetworking and Data Access with Eqela
Networking and Data Access with Eqela
 
Network Programming Clients
Network Programming ClientsNetwork Programming Clients
Network Programming Clients
 

Mehr von Ali Habeeb

Opinion Mining
Opinion MiningOpinion Mining
Opinion MiningAli Habeeb
 
Cloud Security
Cloud SecurityCloud Security
Cloud SecurityAli Habeeb
 
Data-Centric Routing Protocols in Wireless Sensor Network: A survey
Data-Centric Routing Protocols in Wireless Sensor Network: A surveyData-Centric Routing Protocols in Wireless Sensor Network: A survey
Data-Centric Routing Protocols in Wireless Sensor Network: A surveyAli Habeeb
 
Secure erasure code based distributed storage system with secure data forwarding
Secure erasure code based distributed storage system with secure data forwardingSecure erasure code based distributed storage system with secure data forwarding
Secure erasure code based distributed storage system with secure data forwardingAli Habeeb
 
Organizing User Search Histories
Organizing User Search HistoriesOrganizing User Search Histories
Organizing User Search HistoriesAli Habeeb
 
Detecting and Resolving Firewall Policy Anomalies
Detecting and Resolving Firewall Policy AnomaliesDetecting and Resolving Firewall Policy Anomalies
Detecting and Resolving Firewall Policy AnomaliesAli Habeeb
 
Bit Torrent Protocol
Bit Torrent ProtocolBit Torrent Protocol
Bit Torrent ProtocolAli Habeeb
 
A study of Data Quality and Analytics
A study of Data Quality and AnalyticsA study of Data Quality and Analytics
A study of Data Quality and AnalyticsAli Habeeb
 
Adhoc and Sensor Networks - Chapter 10
Adhoc and Sensor Networks - Chapter 10Adhoc and Sensor Networks - Chapter 10
Adhoc and Sensor Networks - Chapter 10Ali Habeeb
 
Adhoc and Sensor Networks - Chapter 09
Adhoc and Sensor Networks - Chapter 09Adhoc and Sensor Networks - Chapter 09
Adhoc and Sensor Networks - Chapter 09Ali Habeeb
 
Adhoc and Sensor Networks - Chapter 08
Adhoc and Sensor Networks - Chapter 08Adhoc and Sensor Networks - Chapter 08
Adhoc and Sensor Networks - Chapter 08Ali Habeeb
 
Adhoc and Sensor Networks - Chapter 07
Adhoc and Sensor Networks - Chapter 07Adhoc and Sensor Networks - Chapter 07
Adhoc and Sensor Networks - Chapter 07Ali Habeeb
 
Adhoc and Sensor Networks - Chapter 06
Adhoc and Sensor Networks - Chapter 06Adhoc and Sensor Networks - Chapter 06
Adhoc and Sensor Networks - Chapter 06Ali Habeeb
 
Adhoc and Sensor Networks - Chapter 05
Adhoc and Sensor Networks - Chapter 05Adhoc and Sensor Networks - Chapter 05
Adhoc and Sensor Networks - Chapter 05Ali Habeeb
 
Adhoc and Sensor Networks - Chapter 04
Adhoc and Sensor Networks - Chapter 04Adhoc and Sensor Networks - Chapter 04
Adhoc and Sensor Networks - Chapter 04Ali Habeeb
 
Adhoc and Sensor Networks - Chapter 03
Adhoc and Sensor Networks - Chapter 03Adhoc and Sensor Networks - Chapter 03
Adhoc and Sensor Networks - Chapter 03Ali Habeeb
 
Adhoc and Sensor Networks - Chapter 02
Adhoc and Sensor Networks - Chapter 02Adhoc and Sensor Networks - Chapter 02
Adhoc and Sensor Networks - Chapter 02Ali Habeeb
 

Mehr von Ali Habeeb (20)

Opinion Mining
Opinion MiningOpinion Mining
Opinion Mining
 
WAP
WAPWAP
WAP
 
USB 3.0
USB 3.0USB 3.0
USB 3.0
 
Blue Eyes
Blue EyesBlue Eyes
Blue Eyes
 
Cloud Security
Cloud SecurityCloud Security
Cloud Security
 
Data-Centric Routing Protocols in Wireless Sensor Network: A survey
Data-Centric Routing Protocols in Wireless Sensor Network: A surveyData-Centric Routing Protocols in Wireless Sensor Network: A survey
Data-Centric Routing Protocols in Wireless Sensor Network: A survey
 
Secure erasure code based distributed storage system with secure data forwarding
Secure erasure code based distributed storage system with secure data forwardingSecure erasure code based distributed storage system with secure data forwarding
Secure erasure code based distributed storage system with secure data forwarding
 
Organizing User Search Histories
Organizing User Search HistoriesOrganizing User Search Histories
Organizing User Search Histories
 
Detecting and Resolving Firewall Policy Anomalies
Detecting and Resolving Firewall Policy AnomaliesDetecting and Resolving Firewall Policy Anomalies
Detecting and Resolving Firewall Policy Anomalies
 
Bit Torrent Protocol
Bit Torrent ProtocolBit Torrent Protocol
Bit Torrent Protocol
 
A study of Data Quality and Analytics
A study of Data Quality and AnalyticsA study of Data Quality and Analytics
A study of Data Quality and Analytics
 
Adhoc and Sensor Networks - Chapter 10
Adhoc and Sensor Networks - Chapter 10Adhoc and Sensor Networks - Chapter 10
Adhoc and Sensor Networks - Chapter 10
 
Adhoc and Sensor Networks - Chapter 09
Adhoc and Sensor Networks - Chapter 09Adhoc and Sensor Networks - Chapter 09
Adhoc and Sensor Networks - Chapter 09
 
Adhoc and Sensor Networks - Chapter 08
Adhoc and Sensor Networks - Chapter 08Adhoc and Sensor Networks - Chapter 08
Adhoc and Sensor Networks - Chapter 08
 
Adhoc and Sensor Networks - Chapter 07
Adhoc and Sensor Networks - Chapter 07Adhoc and Sensor Networks - Chapter 07
Adhoc and Sensor Networks - Chapter 07
 
Adhoc and Sensor Networks - Chapter 06
Adhoc and Sensor Networks - Chapter 06Adhoc and Sensor Networks - Chapter 06
Adhoc and Sensor Networks - Chapter 06
 
Adhoc and Sensor Networks - Chapter 05
Adhoc and Sensor Networks - Chapter 05Adhoc and Sensor Networks - Chapter 05
Adhoc and Sensor Networks - Chapter 05
 
Adhoc and Sensor Networks - Chapter 04
Adhoc and Sensor Networks - Chapter 04Adhoc and Sensor Networks - Chapter 04
Adhoc and Sensor Networks - Chapter 04
 
Adhoc and Sensor Networks - Chapter 03
Adhoc and Sensor Networks - Chapter 03Adhoc and Sensor Networks - Chapter 03
Adhoc and Sensor Networks - Chapter 03
 
Adhoc and Sensor Networks - Chapter 02
Adhoc and Sensor Networks - Chapter 02Adhoc and Sensor Networks - Chapter 02
Adhoc and Sensor Networks - Chapter 02
 

Kürzlich hochgeladen

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 

Kürzlich hochgeladen (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 

Iss letcure 7_8

  • 1. Information System SecurityInformation System Security Lectures 7 and 8Lectures 7 and 8 Web SecurityWeb Security
  • 2. 22 ReferencesReferences [1] Google Code for Educator: Sample Course Content, Web[1] Google Code for Educator: Sample Course Content, Web Security.Security. http://code.google.com/edu/content/submissions/web_secuhttp://code.google.com/edu/content/submissions/web_secu .. [2][2] Network security, The complete ReferenceNetwork security, The complete Reference. R. Bragg, M.. R. Bragg, M. Rhodes-Ousley, K. Strassberg. McGraw-Hill Osborne,Rhodes-Ousley, K. Strassberg. McGraw-Hill Osborne, 2004.2004.
  • 3. 33 OutlineOutline 1.1. Web SystemWeb System 2.2. Web System SecurityWeb System Security 3.3. Simple Web ServerSimple Web Server 4.4. Web Server SecurityWeb Server Security 5.5. Web Browser SecurityWeb Browser Security 6.6. Web Application SecurityWeb Application Security 7.7. Communication SecurityCommunication Security
  • 4. 44 1. Web System1. Web System  Generic web application work flow diagram:Generic web application work flow diagram:
  • 5. 55 Web SystemWeb System Web Browser HTML forms, Java, Cookies, JavaScript, VBScript, Plug-ins, etc. http request Web Server Web Application CGI, Java Servlets, ASP, SSI, J2EE, PHP, etc. Web Server Resources Applications http reply http/SSL/ TCP/IP
  • 6. 66 2. Web System Security2. Web System Security 1.1. Web Server SecurityWeb Server Security 2.2. Web Browser SecurityWeb Browser Security 3.3. Web Application SecurityWeb Application Security 4.4. Channel SecurityChannel Security
  • 7. 77 3. Simple Web Server3. Simple Web Server **  To illustrate what can go wrong if we do not design for securityTo illustrate what can go wrong if we do not design for security in our web applications from the start, consider a simple webin our web applications from the start, consider a simple web server implemented in Java.server implemented in Java.  All this program does is serve documents using HTTP.All this program does is serve documents using HTTP.  We will walkthrough the code in the following slides.We will walkthrough the code in the following slides.  This web server only supports simple HTTP GET requests.This web server only supports simple HTTP GET requests. ** Slides 7-17 taken from [1]Slides 7-17 taken from [1]
  • 8. 88 Some Preliminaries…Some Preliminaries…  ((HHyperyperTTextext TTransferransfer PProtocol): The communications protocolrotocol): The communications protocol used to connect to servers on the Web.used to connect to servers on the Web.  Its primary function is to establish a connection with a WebIts primary function is to establish a connection with a Web server and transmit HTML pages to the client browser or anyserver and transmit HTML pages to the client browser or any other files required by an HTTP application.other files required by an HTTP application.  http is stateless (ie, request/reply)http is stateless (ie, request/reply)  Addresses of Web sites begin with anAddresses of Web sites begin with an http://http:// prefix.prefix.
  • 9. 99 Some Preliminaries…Some Preliminaries…  A typical HTTP request that a browser makes to a webA typical HTTP request that a browser makes to a web server:server: Get / HTTP/1.0Get / HTTP/1.0  When the server receives this request for filename / (whichWhen the server receives this request for filename / (which means themeans the rootroot document on the web server), it attemptsdocument on the web server), it attempts to load index.html. It sends back:to load index.html. It sends back: HTTP/1.0 200 OKHTTP/1.0 200 OK followed by the document contents.followed by the document contents.
  • 10. 1010 SimpleWebServer: main()SimpleWebServer: main() /* This method is called when the program is run from the/* This method is called when the program is run from the command line. */command line. */ public static void main (String argv[]) throws Exception {public static void main (String argv[]) throws Exception { /* Create a SimpleWebServer object, and run it *//* Create a SimpleWebServer object, and run it */ SimpleWebServer sws = new SimpleWebServer();SimpleWebServer sws = new SimpleWebServer(); sws.run();sws.run(); }}
  • 11. 1111 SimpleWebServer ClassSimpleWebServer Class public class SimpleWebServer {public class SimpleWebServer { /* Run the HTTP server on this TCP port. *//* Run the HTTP server on this TCP port. */ private static final int PORT = 8080;private static final int PORT = 8080; /* The socket used to process incoming connections/* The socket used to process incoming connections from web clients */from web clients */ private static ServerSocket dServerSocket;private static ServerSocket dServerSocket; public SimpleWebServer () throws Exception {public SimpleWebServer () throws Exception { dServerSocket = new ServerSocket (PORT);dServerSocket = new ServerSocket (PORT); }} public void run() throws Exception {public void run() throws Exception { while (true) {while (true) { /* wait for a connection from a client *//* wait for a connection from a client */ Socket s = dServerSocket.accept();Socket s = dServerSocket.accept(); /* then process the client's request *//* then process the client's request */ processRequest(s);processRequest(s); }} }}
  • 12. 1212 SimpleWebServer: processRequest 1SimpleWebServer: processRequest 1 /* Reads the HTTP request from the client, and/* Reads the HTTP request from the client, and responds with the file the user requested orresponds with the file the user requested or a HTTP error code. */a HTTP error code. */ public void processRequest(Socket s) throwspublic void processRequest(Socket s) throws Exception {Exception { /* used to read data from the client *//* used to read data from the client */ BufferedReader br =BufferedReader br = new BufferedReader (new InputStreamReadernew BufferedReader (new InputStreamReader (s.getInputStream()));(s.getInputStream())); /* used to write data to the client *//* used to write data to the client */ OutputStreamWriter osw =OutputStreamWriter osw = new OutputStreamWriter (s.getOutputStream());new OutputStreamWriter (s.getOutputStream());
  • 13. 1313 SimpleWebServer: processRequest 2SimpleWebServer: processRequest 2 /* read the HTTP request from the client *//* read the HTTP request from the client */ String request = br.readLine();String request = br.readLine(); String command = null;String command = null; String pathname = null;String pathname = null; /* parse the HTTP request *//* parse the HTTP request */ StringTokenizer st =StringTokenizer st = new StringTokenizer (request, " ");new StringTokenizer (request, " "); command = st.nextToken();command = st.nextToken(); pathname = st.nextToken();pathname = st.nextToken();
  • 14. 1414 SimpleWebServer: processRequest 3SimpleWebServer: processRequest 3 if (command.equals("GET")) {if (command.equals("GET")) { /* if the request is a GET/* if the request is a GET try to respond with the filetry to respond with the file the user is requesting */the user is requesting */ serveFile (osw,pathname);serveFile (osw,pathname); }} else {else { /* if the request is a NOT a GET,/* if the request is a NOT a GET, return an error saying this serverreturn an error saying this server does not implement the requested command */does not implement the requested command */ osw.write ("HTTP/1.0 501 Notosw.write ("HTTP/1.0 501 Not Implementednn");Implementednn"); }} /* close the connection to the client *//* close the connection to the client */ osw.close();osw.close();
  • 15. 1515 SimpleWebServer:SimpleWebServer: serveFile 1serveFile 1 public void serveFile (OutputStreamWriter osw,public void serveFile (OutputStreamWriter osw, String pathname) throws Exception {String pathname) throws Exception { FileReader fr=null;FileReader fr=null; int c=-1;int c=-1; StringBuffer sb = new StringBuffer();StringBuffer sb = new StringBuffer(); /* remove the initial slash at the beginning/* remove the initial slash at the beginning of the pathname in the requestof the pathname in the request */*/ if (pathname.charAt(0)=='/')if (pathname.charAt(0)=='/') pathname=pathname.substring(1);pathname=pathname.substring(1); /* if there was no filename specified by the/* if there was no filename specified by the client, serve the "index.html" file */client, serve the "index.html" file */ if (pathname.equals(""))if (pathname.equals("")) pathname="index.html";pathname="index.html";
  • 16. 1616 SimpleWebServer:SimpleWebServer: serveFile 2serveFile 2 /* try to open file specified by pathname *//* try to open file specified by pathname */ try {try { fr = new FileReader (pathname);fr = new FileReader (pathname); c = fr.read();c = fr.read(); }} catch (Exception e) {catch (Exception e) { /* if the file is not found,return the/* if the file is not found,return the appropriate HTTP response code */appropriate HTTP response code */ osw.write ("HTTP/1.0 404 Not Foundnn");osw.write ("HTTP/1.0 404 Not Foundnn"); return;return; }}
  • 17. 1717 SimpleWebServer:SimpleWebServer: serveFile 3serveFile 3 /* if the requested file can be/* if the requested file can be successfully opened and read, then returnsuccessfully opened and read, then return an OK response code and send the contentsan OK response code and send the contents of the file */of the file */ osw.write ("HTTP/1.0 200 OKnn");osw.write ("HTTP/1.0 200 OKnn"); while (c != -1) {while (c != -1) { sb.append((char)c);sb.append((char)c); c = fr.read();c = fr.read(); }} osw.write (sb.toString());osw.write (sb.toString());
  • 18. 1818 SimpleWebServerSimpleWebServer VulnerabilitiesVulnerabilities  Can you identify any security vulnerabilities inCan you identify any security vulnerabilities in SimpleWebServer? Or what can go wrong?SimpleWebServer? Or what can go wrong?  Yes:Yes: Denial of Service (DoS):Denial of Service (DoS): – An attacker makes a web server unavailable, butAn attacker makes a web server unavailable, but – How?How?  DoS on SimpleWebServer:DoS on SimpleWebServer: – Just send a carriage return as the first message instead of a properlyJust send a carriage return as the first message instead of a properly formatted GET message…formatted GET message… – The web server crashesThe web server crashes – Service to all subsequent clients is denied until the web server is restartedService to all subsequent clients is denied until the web server is restarted
  • 19. 1919 4. Web Server Security:4. Web Server Security: OverviewOverview  Consider the following HTML code:Consider the following HTML code: <html><html> <head><head> <title> Hello world </title><title> Hello world </title> </head></head> </html></html>  Attackers can try 2 strategies to penetrate the web server hostingAttackers can try 2 strategies to penetrate the web server hosting this HTML code:this HTML code: – Exploit web application insecurityExploit web application insecurity  there no Exploit in this codethere no Exploit in this code – Hacking web server itselfHacking web server itself  See the SimpleWebServer : DoS attackSee the SimpleWebServer : DoS attack
  • 20. 2020 Web Server Security: Goals ofWeb Server Security: Goals of server attacksserver attacks 1.1. Web site defacementWeb site defacement – Corruption of the HTML code.Corruption of the HTML code. – Example: Next slideExample: Next slide 1.1. Data CorruptionData Corruption – Any data on the server can be deleted or modified.Any data on the server can be deleted or modified. 1.1. Data TheftData Theft – eg, credit card number stolen from ecommerce site.eg, credit card number stolen from ecommerce site. 1.1. Denial of serviceDenial of service – Clients are no more served.Clients are no more served.
  • 22. 2222 Web Server Security: Types ofWeb Server Security: Types of attacksattacks 1.1. Directory traversalDirectory traversal 2.2. Script permissionsScript permissions 3.3. Directory BrowsingDirectory Browsing 4.4. Default samplesDefault samples
  • 23. 2323 Web Server Security: Types ofWeb Server Security: Types of attacksattacks 1.1. Directory traversalDirectory traversal – Is a method for accessing directories other than the allowed ones.Is a method for accessing directories other than the allowed ones. – In Microsoft’s IIS, if the OS XP is installed on drive c: and adminstratorIn Microsoft’s IIS, if the OS XP is installed on drive c: and adminstrator didn’t change the directory name, the default web site directory isdidn’t change the directory name, the default web site directory is c:inetpubc:inetpub – Attackers can read file they are not meant to. For exampleAttackers can read file they are not meant to. For example  If the attacker tryIf the attacker try http://www.somesite.com/../autoexec.bathttp://www.somesite.com/../autoexec.bat then the server may return the content of autoexec.bat.
  • 24. 2424 Web Server Security: Types ofWeb Server Security: Types of attacksattacks 2.2. Script permissionsScript permissions  In order to run server-side applications (eg, CGI, Perl, etc.),In order to run server-side applications (eg, CGI, Perl, etc.), administrator must grant executable permission to the directory whereadministrator must grant executable permission to the directory where these applications reside.these applications reside.  What happens if the admin grand permissions to the wrong directory?What happens if the admin grand permissions to the wrong directory?  Example: if the admin grants executable permission to c: then whatExample: if the admin grants executable permission to c: then what happens if the attacker tryhappens if the attacker try http://www.somesite.com/../Windows/system32/cmd.exe%20%2fc%20dirhttp://www.somesite.com/../Windows/system32/cmd.exe%20%2fc%20dir
  • 25. 2525 Web Server Security: Types ofWeb Server Security: Types of attacksattacks  The web server parse the request and executeThe web server parse the request and execute ../windows/system32/cmd.exe /c dir../windows/system32/cmd.exe /c dir ie, listing all files in the current directory.ie, listing all files in the current directory. – Attacker can execute commands that delete or modify files on the webAttacker can execute commands that delete or modify files on the web server.server. 3.3. Directory BrowsingDirectory Browsing  If Directory browsing is enabled attacker, can browse that directory andIf Directory browsing is enabled attacker, can browse that directory and its subdirectories.its subdirectories.  Knowledge of the existence of some file can help attacker launching anKnowledge of the existence of some file can help attacker launching an attack.attack.
  • 26. 2626 Web Server ProtectionWeb Server Protection 1.1. Run web server service with Least privileges.Run web server service with Least privileges. 2.2. Install most recent security patches of server software.Install most recent security patches of server software. 3.3. Install most recent security patches of OS.Install most recent security patches of OS. 4.4. Secure other network services running on the same machine.Secure other network services running on the same machine. 5.5. Delete unneeded applications.Delete unneeded applications. 6.6. Grant script permissions only to isolated directory containingGrant script permissions only to isolated directory containing the scripts in question.the scripts in question. 7.7. Maintain adequate logs and backups..Maintain adequate logs and backups.. 8.8. Secure your web server using third-party security products:Secure your web server using third-party security products: antiviruses, Firewalls, vulnerabilities scanners, input validation,antiviruses, Firewalls, vulnerabilities scanners, input validation, etc.etc.
  • 27. 2727 5. Web browser Security5. Web browser Security  Browser sends requests – May reveal private information (in forms, cookies) – Also sends other information that may be damaging:  IP address  OS  Browser version/type, etc.  Browser receives information, code – May corrupt hosts by running unsafe code – Information may exercise a bug in the browser allowing arbitrary remote code execution.
  • 28. 2828 Web browser SecurityWeb browser Security  Cookies – Cookie mechanism  Mobile code – Java applet – JavaScript – VBScript
  • 29. 2929 Web browser Security:Web browser Security: CookiesCookies  HTTP is stateless. This causes problems in a lot of transactions that need a concept of a “session”: – A customer wants to purchase an item online. – A customer logs onto their bank to pay bills – Sites like Yahoo allow users to customize their view of the portal – As the user jumps from web page to web page, the server can’t keep track of whether it’s the same user, or another user requesting the same page – Servers use cookies to keep track of their users.  A cookie is a file created by an Internet site to store information on your computer – Once a cookie is saved on your computer, only the Web site that created the cookie can read it. – Example: google’s cookie
  • 30. 3030 Web browser Security:Web browser Security: CookiesCookies  PREF ID=186f76e084b84d56:TM=1193982844:LM=1193982844:S=O8OM9 yhkCkr98Ej_ google.co.uk/ 1536 //3081004544 // 30038711 //2452507808 // 29891852 *  Problems – Cookies maintain record of your browsing habits  May include any information a web site knows about you – Browser attacks could invade your “privacy” – Stealing someone’s cookies may allow attacker to impersonate the victim:  Session hijacking
  • 31. 3131 Web browser Security: MobileWeb browser Security: Mobile CodeCode  Mobile code runs on clients’ machine.Mobile code runs on clients’ machine.  It’s an executable content (eg, applets).It’s an executable content (eg, applets).  Things to do:Things to do: – Protect machine from downloaded code.Protect machine from downloaded code. – Needs protection from content providers.Needs protection from content providers.  Normal users are asked to make security decisions /policies.Normal users are asked to make security decisions /policies. Web browser Web Server executes applet Mobile Code (eg, applet)
  • 32. 3232 6. Web application Security6. Web application Security 1.1. SQL injectionSQL injection 1.1. Common Gateway InterfaceCommon Gateway Interface
  • 33. 3333 SQL injectionSQL injection  SQL (Structured Query Language) is a language thatSQL (Structured Query Language) is a language that Communicates with DBs, Example:Communicates with DBs, Example: – Select * from Users where username =’admin’ andSelect * from Users where username =’admin’ and password = ‘somepasswd’password = ‘somepasswd’ – Looks for user whose username = admin and password = somepasswdLooks for user whose username = admin and password = somepasswd  SQL injection is a technique to inject crafted SQL into user inputSQL injection is a technique to inject crafted SQL into user input fields that are a part of web forms, can be used to:fields that are a part of web forms, can be used to: – bypass custom login to a web site,bypass custom login to a web site, – Log in to a web site, orLog in to a web site, or – take over a sitetake over a site
  • 34. 3434 SQL injection: Simple loginSQL injection: Simple login bypassingbypassing  Consider the following web site’s login form:Consider the following web site’s login form: …… <form action = “login.asp” method = “post”><form action = “login.asp” method = “post”> <p> Username:<input type=text name= “username” /> </p><p> Username:<input type=text name= “username” /> </p> <p> Password:<input type=password name= “password” /><p> Password:<input type=password name= “password” /> </p></p> <p> <input type=submit name= “submit” value=”login” /><p> <input type=submit name= “submit” value=”login” /> </p></p> </form></form> …… – It’s a web page that requests 2 pieces of information from the user usernameIt’s a web page that requests 2 pieces of information from the user username and password and it submits the information in the fields to login.asp (writtenand password and it submits the information in the fields to login.asp (written in asp)in asp)
  • 35. 3535 SQL injection: Simple loginSQL injection: Simple login bypassingbypassing  The file login.asp:The file login.asp: Dim adoConnectionDim adoConnection SetSet adoConnection=server.CreateObject(“ADODB.ConnectiadoConnection=server.CreateObject(“ADODB.Connecti on”)on”) …… Dim strLoginSQLDim strLoginSQL strLoginSQL=”select * from users where username =”strLoginSQL=”select * from users where username =” & Request.Form (“username”) & “ ‘ and password =’& Request.Form (“username”) & “ ‘ and password =’ “ & Request.Form(“password”) & “ ‘ ““ & Request.Form(“password”) & “ ‘ “ Dim adoResultDim adoResult Set adoResult=adoConnection.Execute(strLoginSQL)Set adoResult=adoConnection.Execute(strLoginSQL) If not adoResult.EOF ThenIf not adoResult.EOF Then ‘‘We are here all went okWe are here all went ok ElseElse ‘‘Wrong loginWrong login End IfEnd If
  • 36. 3636 SQL injection: Simple loginSQL injection: Simple login bypassingbypassing  If the user entersIf the user enters adminadmin as a username andas a username and adminpasswdadminpasswd, the, the following sql command is constructed:following sql command is constructed: Select * from users where username =’admin’ andSelect * from users where username =’admin’ and password = ‘adminpasswd’password = ‘adminpasswd’  The username and password are placed inside the SQL string,The username and password are placed inside the SQL string, but without any checks:but without any checks: – What happens if an attacker enter ‘a’ or “1”=“1” as a username and anyWhat happens if an attacker enter ‘a’ or “1”=“1” as a username and any password?password? – The resulting SQL string is:The resulting SQL string is: Select * from users where username =Select * from users where username = ‘a’ or‘a’ or “1”=“1” -- ’“1”=“1” -- ’ and password = ‘anypassword’and password = ‘anypassword’ – This code will return data because “1”=“1”This code will return data because “1”=“1” – the attacker bypass the login.the attacker bypass the login.
  • 37. 3737 SQL injectionSQL injection  Worse!Worse! – The attacker can use built-in procedures to read or write files, or to invokeThe attacker can use built-in procedures to read or write files, or to invoke programs in the database computerprograms in the database computer – For example theFor example the xp_cmdshellxp_cmdshell stored procedure invokes shell commandsstored procedure invokes shell commands on the server’s computer likeon the server’s computer like dir, copy, renamedir, copy, rename, etc., etc. – From the last example, a hacker can enter some username as a username andFrom the last example, a hacker can enter some username as a username and a’exec master..xp_cmdshell ‘dela’exec master..xp_cmdshell ‘del c:winntsystem32*.dll’c:winntsystem32*.dll’ as a passwordas a password ..  This will cause the database to delete all DLLs in the specified directory.This will cause the database to delete all DLLs in the specified directory.
  • 38. 3838 SQL injection: SolutionsSQL injection: Solutions  Filter all input fields for apostrophes to prevent unauthorizedFilter all input fields for apostrophes to prevent unauthorized loginslogins  Filter all input fields for SQL commands likeFilter all input fields for SQL commands like insert,insert, select, deleteselect, delete, and, and execexec to prevent server manipulationto prevent server manipulation  Limit input field length (which will limit hackers’ options), andLimit input field length (which will limit hackers’ options), and validate the input length with server-side scripts.validate the input length with server-side scripts.  Place the database on a different computer than the web server.Place the database on a different computer than the web server. – If the database is hacked, it’ll be harder to reach the web server.If the database is hacked, it’ll be harder to reach the web server.  Limit the user privileges of the server-side scripts.Limit the user privileges of the server-side scripts.  Delete all unneeded extended stored procedures to limit hackers’Delete all unneeded extended stored procedures to limit hackers’ possibilities.possibilities.
  • 39. 3939 Common Gateway InterfaceCommon Gateway Interface  Common Gateway Interface (CGI)Common Gateway Interface (CGI) – meta-language for translating URLs or HTML forms into executablemeta-language for translating URLs or HTML forms into executable programs.programs.  An attacker may exploit bugs in CGI scripts to gain unauthorized access to files on the web server, or even to take control of the host.  CGI scripts can present security holes in two ways: – they may intentionally or unintentionally leak information about the host system that will help hackers break in. – Scripts that process user input may be vulnerable to attacks in which the remote user tricks them into executing commands (always remember: “user input is evil”).
  • 40. 4040 7. Communication Security7. Communication Security  VulnerabilitiesVulnerabilities – Tapping or eavesdropping:Tapping or eavesdropping: occurs when a device is placed near or intooccurs when a device is placed near or into the cabling.the cabling. – Sniffing: usingSniffing: using Sniffers ( special programs) in order to eavesdrop on theSniffers ( special programs) in order to eavesdrop on the network traffic.network traffic. – IP spoofing:IP spoofing:  An attacker can place any IP address as the source address of an IPAn attacker can place any IP address as the source address of an IP datagram, so can be dangerous to base access control decisions ondatagram, so can be dangerous to base access control decisions on raw IP addresses alone.raw IP addresses alone.  An attacker may be able to replay, delay, reorder, modifiy or inject IPAn attacker may be able to replay, delay, reorder, modifiy or inject IP datagrams.datagrams. – DNS spoofing: DNS server is lured to translate names (eg,DNS spoofing: DNS server is lured to translate names (eg, www.scs-net.orgwww.scs-net.org) into attackers’ IP addresses.) into attackers’ IP addresses.  Communication Protection: SSLCommunication Protection: SSL
  • 41. 4141 SSLSSL  Secure Sockets LayerSecure Sockets Layer (SSL) was developed (in 1994) by(SSL) was developed (in 1994) by Netscape Corporation to provide security between web clientNetscape Corporation to provide security between web client and server.and server.  SSL designed to be under HTTP:SSL designed to be under HTTP: – HTTP | SSL | TCPHTTP | SSL | TCP  SSL permits:SSL permits: – Authentication of peer entitiesAuthentication of peer entities – Exchange of secret keysExchange of secret keys – Use of exchanged keys to authenticate and encrypt transmitted dataUse of exchanged keys to authenticate and encrypt transmitted data between communicating peer entities.between communicating peer entities.
  • 42. 4242 SSL ArchitectureSSL Architecture  SSL consists of two sublayers:SSL consists of two sublayers: – SSL Record Protocol: provide security services to higher-layer protocolsSSL Record Protocol: provide security services to higher-layer protocols (in particular, HTTP) including SSL management protocols.(in particular, HTTP) including SSL management protocols. – SSL Management protocols: Handshake, Cipher Change, and AlertSSL Management protocols: Handshake, Cipher Change, and Alert ProtocolsProtocols SSL Architecture
  • 43. 4343 SSL Record ProtocolSSL Record Protocol  The SSL Record Protocol uses the keys derived from the HandshakeThe SSL Record Protocol uses the keys derived from the Handshake Protocol’s master key to securely deliver data.Protocol’s master key to securely deliver data.  Provides two security functions:Provides two security functions: – Confidentiality and Message IntegrityConfidentiality and Message Integrity Data Compression (optional) Encrypt Record protocol Header fragment fragment fragmentFragmentation To be transmitted in a TCP segment MAC
  • 44. 4444 SSL Record ProtocolSSL Record Protocol  Protected data : SSL Record protocol allows applicationProtected data : SSL Record protocol allows application protocols above SSL to be secured.protocols above SSL to be secured.  Fragmentation: messages are broken into blocksFragmentation: messages are broken into blocks  Compression: optionalCompression: optional – Compression algorithm is not specifiedCompression algorithm is not specified  MAC: computed over compressed data.MAC: computed over compressed data. – SSL MAC is similar to HMACSSL MAC is similar to HMAC – MAC key is derived from the master key.MAC key is derived from the master key.  Encryption may be stream or block mode.Encryption may be stream or block mode. – Symmetric encryption is usedSymmetric encryption is used – There are only a limited selection of ciphers and MAC algorithms thatThere are only a limited selection of ciphers and MAC algorithms that are allowed (eg, DES, 3DES, IDEA, RC4, etc)are allowed (eg, DES, 3DES, IDEA, RC4, etc)
  • 45. 4545 SSL Handshake ProtocolSSL Handshake Protocol  Used to allow the server and client toUsed to allow the server and client to – authenticate each other using certificates,authenticate each other using certificates, – negotiate encryption and MAC algorithms, andnegotiate encryption and MAC algorithms, and – establish keys to be used to protect data sent in SSL Record.establish keys to be used to protect data sent in SSL Record.  Used before any application data is transmitted.Used before any application data is transmitted.
  • 46. 4646 S-HTTPS-HTTP  Secure HTTP (S-HTTP) is a superset of HTTP with securitySecure HTTP (S-HTTP) is a superset of HTTP with security support.support.  Created in 1994 by Enterprise Integration Technology (EIT)Created in 1994 by Enterprise Integration Technology (EIT)  Adopted by IETF as RFC 2660.Adopted by IETF as RFC 2660.  Allows message to be encapsulated in various ways (message-Allows message to be encapsulated in various ways (message- oriented).oriented).  Encapsulation for encryption, signing and MACEncapsulation for encryption, signing and MAC  Not widely used (not supported by Internet explorer orNot widely used (not supported by Internet explorer or Netscape)Netscape)

Hinweis der Redaktion

  1. In its most basic example of a web application, a straight HTML request in which a user: instructs a web browser to contact a web server using the HTTP protocol, and ask it for a specific HTML document which the server returns to be displayed by the web browser.
  2. Here is the SimpleWebServer object. First we initialize a variable that holds the port number the web server should listen to for connections from clients. Then we initialize a ServerSocket. Socket: The method of directing data to the appropriate application in a TCP/IP network. The combination of the IP address of the station and a port number make up a socket. Think of this like an electrical socket. A web server and a web client both have a “virtual” power strip with many sockets on it. A web client can talk to a server by selecting one of its sockets, and then selecting a server socket and plugging a virtual wire into each end. The run() method has an infinite loop waiting for a connection from a client. The call to ServerSocket accept() returns a socket object that corresponds to a unique socket on the server. This allows the server to communicate with the client. Once the communication is established, the client’s request is processed.
  3. processRequest() takes the client socket as input. It uses this socket to create BufferedReader and OutputStreamWriter objects. Once these communication objects are created, the method attempts to read a line of input from the client using the BufferedReader. We expect this line of input to be an HTTP GET request (as discussed earlier).
  4. The StringTokenizer object is used to break up the request into its constituent parts: GET, the pathname to the file the client would like to download.
  5. The StringTokenizer object is used to break up the request into its constituent parts: GET, the pathname to the file the client would like to download. If the command is a “GET”, we call the serveFile() method, else we issue an error. Then we close the connection to the client.
  6. The first “if” removes the initial slash at the beginning of the pathname, and the second “if” sets the file to be downloaded = index.html, if another file was not specified.
  7. Now the method attempts to open the file and read it into the web server’s memory. If the FileReader object is unable to open the file and read a byte from it, it issues an error message.
  8. If the file was successfully opened, send the HTTP/1.0 200 OK message and then the method enters a while loop that reads bytes from the file and appends them to a StringBuffer, until the end of the file is reached. Then this StringBuffer is sent to the client.
  9. This script takes the entered username and passwords and places them into a SQL command that selects data from the users table based on the username and password. If the login is valid, the database will return the user’s record. If not, it will return an empty record.
  10. This sql command means find a row in the table users where the username is admin and the password is somepasswd The – stands for a code remark: every thing that follows will be disregarded. The attack was made possible because the programmer didn’t filter the apostrophe (‘) inside the user input fields, which allowed the hacker to break the sql syntax and enter a custom code.