- Introduction to Web Security
- Why Is Security So Important?
- Web Security Considerations
- Web Security Approaches
- Secure Socket Layer (SSL) and Transport Layer Security (TLS)
- Secure Electronic Transaction (SET)
- Recommended Reading
- Problems
Transaction Management in Database Management System
Web Security Approaches Encryption Tools
1. Hackers
Crackers
Script
Kiddies
//By Mohamed R. Elabnody //
elabnody@msn.com
www.elabnody.net
Actors
3rd May, 2012
2. Outline
• Introduction to Web Security
• Why Is Security So Important?
• Web Security Considerations
• Web Security Approaches
• Secure Socket Layer (SSL) and
Transport Layer Security (TLS)
• Secure Electronic Transaction
(SET)
• Recommended Reading
• Problems
2 Web Security www.elabnody.net
3. Key Points
Secure socket layer (SSL) provides security services between TCP
and applications that use TCP. The Internet standard version is called
transport layer service (TLS).
SSL/TLS provides confidentiality using symmetric
encryption and message integrity using a message
authentication code.
SSL/TLS includes protocol mechanisms to enable two
TCP users to determine the security mechanisms and
services they will use.
Secure electronic transaction (SET)
is an open encryption and security specification designed to protect credit
card transactions on the Internet.
3 Web Security www.elabnody.net
4. Overview
• Why Be Concerned about Web Security?
– The increased use of the networks and the internet
helps users finish many tasks quickly and efficiently
and adds convenience to many people's lives.
However, there is downside, as well. As more and
more personal and business data is stored on
computer networks, the risk and consequences of
unauthorized computer access, theft, fraud, and
other types of computer crime increase; so do the
chances of data loss due to crime or employee
misconduct.
4 Web Security www.elabnody.net
5. Overview
• Web security may easily be split into three specific areas:
Client Access • there is the client. This is the machine from which the
user requests a web page. By typing a URL a
connection between the client and server is made. The
to Web Pages server returns the document and the user browser
displays the document.
• the Web Server. This is where the entire web
Server pages and resources are held. Similarly, the web
server may host databases or act as a middleware
to back-end databases.
• the connection between the server and client needs
Connection to be considered. In very few circumstances this
connection will be conducted over a trusted or
value added network.
5 Web Security www.elabnody.net
6. Introduction
• Virtually all businesses, most government agencies, and many
individuals now have Web sites. The number of individuals and
companies with Internet access is expanding rapidly and all of
these have graphical Web browsers. As a result, businesses are
enthusiastic about setting up facilities on the Web for electronic
commerce. But the reality is that the Internet and the Web are
extremely vulnerable to compromises of various sorts. As
businesses wake up to this reality, the demand for secure Web
services grows.
• In this session, we begin with a discussion of the general
requirements for Web security and then focus on two standardized
schemes that are becoming increasingly important as part of Web
commerce: SSL/TLS and SET.
6 Web Security www.elabnody.net
8. Why Is Security So
Important?
• Stolen intellectual property
• System downtime
• Lost productivity
• Damage to business reputation
• Lost consumer confidence
• Severe financial losses due to lost revenue
8 Web Security www.elabnody.net
9. War on the Internet
Oh, this is bad, but it is
not our business, Who
needs to get into war
anyway
We will only conduct our
e-business
That is it.
9 Web Security www.elabnody.net
10. Zone-H statistics
• Why did you deface this website?
http://www.zone-h.org
10 Web Security www.elabnody.net
11. Who Are Attackers?
Corporate
Headquarters
External
Internet
Attacker
Unauthorized access: gaining access to
a computer, network, file, or other
Internal
resource without permission; can be
Attacker committed by
Insiders Outsiders
11 Web Security www.elabnody.net
12. Attacks
Organizational Attacks
Common Social Engineering
Types of Viruses, Trojan Horses, and Worm
Attacks Denial of Service (DoS)
Accidental Breaches in Security
12 Web Security www.elabnody.net
13. How Do Attacks Occur?
Stages of Examples of attacker actions
attack
Footprint Runs a port scan on the firewall
Scanning Exploits an unpatched Web server
Gaining Access Creates an account with
administrator rights
Maintaining Uploads unlicensed software to the
Access Web server
Cover-up Erases the audit trail of the exploit
13 Web Security www.elabnody.net
14. Common Types of Vulnerabilities
Vulnerability Examples
Weak Passwords Employees use blank or default passwords
Unpatched software Patches are not updated
Security hotfixes are not applied
Miss configured Services have more privileges than required
Software Services run as the Local System account
Social engineering Help desk administrator resets a password
without verifying the identity of the caller
Weak security on Unused services and ports are not secured
Internet Connections Firewalls are used improperly
Unencrypted data Authentication packets are sent in clear text
transfer Important data is sent over the Internet in clear
text
Buffer overrun A trusted process runs untrusted code
14 Web Security www.elabnody.net
15. Web Security
Considerations
• The WEB is easily accessible worldwide.
//more vulnerability//
• Complex software hide many security
flaws.
• Users are not trained in computer security
and are not aware of the risks.
• A Web server can be exploited as a
launching pad into a corporation’s entire
computer complex.
15 Web Security www.elabnody.net
19. Web Security Approaches
• Web Security Threats …
Integrity
Confidentiality
Denial of Service
Authentication
19 Web Security www.elabnody.net
20. Web Security Approaches
• Web Security Threats
– Integrity: modification of a web page, message traffic, or user
data
– Confidentiality: eavesdropping of web traffic
– Denial of Service: bogus web requests, flooding web server
memory or queue
– Authentication: impersonation of legitimate users
– Location of the threats
• Web server
• Web client
• Network traffic
20 Web Security www.elabnody.net
21. Web Security Approaches
• Encryption: method of scrambling e-mail or files to
make them unreadable
• Secure Web servers: use encryption to protect
information transmitted via their Web pages
– Most common is SSL
– Look for a locked padlock on the status bar and https://
in the URL
– Only transmit credit card numbers and other sensitive
data via a secure Web server
21 Web Security www.elabnody.net
23. Web Security Approaches
Security facilities in the TCP/IP protocol stack
Transparent Application
to end users Above TCP Specific -SET
Embedded in package
illustrates this difference. One way to provide Web security is to use IP Security (Figure 1).
The advantage of using IPSec is that it is transparent to end users and applications and
Figure 1. Relative Location of Security Facilities in the TCP/IP
provides a general-purpose solution. Further, IPSec includes a filtering capability so that only
Protocol Stack
selected traffic need incur the overhead of IPSec processing.
Cryptography and Network Security Principles and Practices, 4th Edition, Page 531
23 Web Security www.elabnody.net
24.
25. Secure Socket Layer (SSL)
• Implements three cryptographic assurances:
Authentication Confidentiality Message integrity
• Also provides secure key exchange between a
browser (client) and server.
• Provides security parameters negotiation.
• Does not offer non-repudiation.
25 Web Security www.elabnody.net
27. How Does SSL/TLS Work?
– User browses to a secure Web server by
using HTTPS
– The browser generates a unique session
key and encrypts it by using the Web
server’s public key from its root certificate
– The session key is received by the Web
server and is decrypted by using the
server's private key
– After the connection has been established,
all communication between the browser
and Web server is secure
27 Web Security www.elabnody.net
28. Secure Socket Layer (SSL)
SSL Architecture:
• SSL runs on the top of TCP to provide reliable and secure end-to-
end service.
• Consists of two layers
28 Web Security www.elabnody.net
29. SSL Architecture
• Depends on TCP for end-to-end reliability
• Two layers of protocols:
– SSL Record Protocol - basic security services
to higher layers
– Three higher layer protocols - used in the
management of SSL exchanges
29 Web Security www.elabnody.net
30. SSL Architecture
Manages SSL Exchanges
The SSL
Record
Protocol SSL SSL change
SSL alert
provides basic Handshake cipher spec HTTP
protocol
security protocol protocol
services to Basic
various higher- SSL record protocol Security
layer Services
protocols.
TCP
IP
Figure 2. SSL Protocol Stack
Cryptography and Network Security Principles and Practices, 4th Edition,
30 Web Security Page 532
www.elabnody.net
31. SSL Architecture
• Two important SSL concepts:
– Connection: peer-to-peer relationships in the transport
layer. Every connection is associated with one session.
– Session: An association between a client and a
server created by the Handshake Protocol.
• Define a set of cryptographic security parameters,
which can be shared among multiple connections.
• Avoid the expensive negotiation of new security
parameters for each connection.
31 Web Security www.elabnody.net
32. SSL Record Protocol
• Provides two services for SSL
Connections:
1. Confidentiality: A shared secret key used for
conventional encryption of SSL payload.
2. Message Integrity: A shared secret key is
used to construct a message authentication
code.
32 Web Security www.elabnody.net
33. SSL Record Protocol
Operation
Message
Message Blocks
Optional
MAC: Message Authentication Code indicates the overall operation of the SSL Record Protocol. The
Record Protocol takes an application message to be transmitted,
fragments the data into manageable blocks, optionally
compresses the data, applies a MAC, encrypts, adds a header,
and transmits the resulting unit in a TCP segment. Received data
are decrypted, verified, decompressed, and reassembled and
then delivered to higher-level users.
Figure 3. SSL Record Protocol Operation
Cryptography and Network Security Principles and Practices, 4th Edition, Page 534
33 Web Security www.elabnody.net
34. SSL Record Protocol
• Record protocol takes an application
message and performs the following
operations:
– Fragmentation: block 0f 16k bytes or less)
– Compression: optional, must not increase
content length beyond 1024 bytes
– Add a MAC (a shared secret key is used)
– Encryption (symmetric encryption)
– Appends an SSL record header.
34 Web Security www.elabnody.net
35. SSL Record Format
• The final step of SSL Record Protocol processing is to pretend a
header, consisting of the following fields:
– Content Type (8 bits): Used
by higher layers to process
the enclosed fragment.
– Major Version (8 bits):
Indicates the major version of
SSL used.
– Minor Version (8 bits):
Indicates the minor version of
SSL used.
– Compressed length (16 bits):
The length of fragment in
bytes.
Cryptography and Network Security Principles and Practices, 4th Edition, Page 535
35 Web Security www.elabnody.net
37. Handshake Protocol
• The most complex part of
Phase 1
SSL.
• Allows the server and client
to
– authenticate each other.
Phase 2
– negotiate encryption, MAC
algorithm and cryptographic
keys.
Phase 3
• Used before any application
data are transmitted.
Phase 4
37 Web Security www.elabnody.net
42. Hello and Negotiate
Parameters
• Client sends server a plaintext message to suggest some
1 parameters for conversation:
Version:
SSL 3.1 if you can, else SSL 3.0
Key Exchange:
RSA if you can, else Diffie-Hellman
Secret Key Cipher Method:
TripleDES if you can, else DES
Message Digest:
MD5 if you can, else SHA-1
Random #: 777,666,555
42 Web Security www.elabnody.net
43. Hello and Negotiate
Parameters
• Server responds by its choice of parameters in a plaintext
1 message:
Version:
SSL 3.1
Key Exchange:
RSA
Secret Key Cipher Method:
TripleDES
Message Digest:
SHA-1
Random #: 444,333,222
43 Web Security www.elabnody.net
44. Hello and Negotiate
Parameters
• After responding to the hello message, the server sends
1 the client its digital certificate.
//A trusted CA signed this certificate.//
• The client uses the trusted CA’s public key to decrypt
the certificate and obtains server’s public key and
verifies the server.
44 Web Security www.elabnody.net
45. Key Agreement and Exchange
• The client generates a Client Server
48-byte random value DES secret Key DES secret Key
(called pre-master Secret key for Secret key for
secret), encrypts it with message message
server’s public RSA key, integrity integrity
and sends it to server.
Secret key to Secret key to
• The server decrypts this
initialize the initialize the
message and generates
six keys. 2 cipher. cipher.
45 Web Security www.elabnody.net
46. Key Agreement and
Exchange
• Generation of six shared secret keys:
<> Random values exchanged.
<> Pre-master secret.
<> Pseudo-random function generator. 2
Example:
PRF(pre-master secret, random1+ random2)
Computed repeatedly.
46 Web Security www.elabnody.net
47. Authentication
The client authenticates the server:
• The clients sends the server a message that
is encrypted with the generated secret keys.
//called the “finished handshake” message//
• The server responds with its own encrypted 3
finished handshake message.
<> The clients is now convinced that it is
communicating with right server.
//pre-master secret could only be decrypted with the
server’s private key.//
47 Web Security www.elabnody.net
48. Authentication
Does server need to authenticate the
client?
– In general yes, but in this situation it may
not be necessary:
• Reasons: 3
1. It is not necessary because it will be
done when the client gives his/her CC
number.
2. A client may not have information to
authenticate itself to the server.
3. It is time-consuming for server.
48 Web Security www.elabnody.net
49. Confidentiality and Integrity
4
• Client and server use the generated
secret keys for confidential data
transfer.
<> The client uses its secret key to generate
a HMAC for the message.
<> The client encrypts message data + HMAC
with its secret key and sends it to server.
<> The server decrypts the received
message with its secret key.
<> The server checks the integrity of the
message using HMAC.
49 Web Security www.elabnody.net
52. Secure Electronic
Transactions
• An open encryption and security specification.
• Designed to protect credit card transaction on the Internet.
• Companies involved:
– MasterCard, Visa, IBM, Microsoft, Netscape, RSA,
Terisa and Verisign
• Not a payment system.
• Set of security protocols and formats
(enables users to employ existing CC payment infrastructure
securely in an open environment).
RSA Rivest-Shamir-Adelman
CC Common Criteria
52 Web Security www.elabnody.net
53. SET Services
• Provides three services:
1. Provides a secure communication channel
among all parties involved in a transaction.
2. Provides trust by the use of X.509v3 digital
certificates.
3. Ensures privacy: information is only available
to involved parties.
53 Web Security www.elabnody.net
54. SET Overview
• Key Features of SET:
– Confidentiality of information
– Integrity of data
– Cardholder account authentication
– Merchant authentication
54 Web Security www.elabnody.net
56. Sequence of events for
transactions
1. The customer opens an account.
2. The customer receives a certificate.
(contains customer’s public key)
3. Merchants have their own certificates.
(Two certificates: one for signing messages and the other for key
exchange.)
4. The customer places an order.
5. The merchant is verified.
(merchant sends a copy of its certificate; the customer can verify it.)
6. The order and payment are sent.
>The payment information is encrypted in such a way that it can not be
read by the merchant.
> Customer’s certificate enables the merchant to verify the customer.
56 Web Security www.elabnody.net
57. Sequence of events for
transactions
7. The merchant requests payment authorization.
>Merchant sends the payment information to payment
gateway, requesting authorization.
8. The merchant confirms the order.
>Merchant sends confirmation to customer.
9. The merchant provides the goods or service.
>Merchant ships goods to customer.
10. The merchant requests payments.
>Merchant sends payment request to the payment
gateway, which handles payment processing.
57 Web Security www.elabnody.net
58. Dual Signature
• Objective: to link two messages that are
intended for two different recipients.
• Customer wants to send:
1. Order Information (OI) to merchant.
2. Payment information (PI) to bank.
>Customer wants to link these two items and
also wants to keep them separate.
58 Web Security www.elabnody.net
59. Dual Signature
>Merchant need not know about CC#.
>Bank need not know the details of
customer’s order.
>> However, these two items must be linked to
resolve any dispute.
>>Customer can prove that this payment was
intended for this order.
//protects customer and merchant.//
59 Web Security www.elabnody.net
60. Generation of Dual Sign.
• Customer takes the hash (SHA-1) of PI.
• Customer takes the hash of OI.
• Concatenates these two and takes hash of
the result.
• Customer signs the final hash with his
private key.
DS = EKRc[H(H(PI)||H(OI))]
SHA Secure Hash Algorithm
60 Web Security www.elabnody.net
61. Dual Signature
DS EKRc [ H ( H ( PI ) || H(OI))]
61 Web Security www.elabnody.net
62. Dual Signature
• Merchant has DS, OI, and PIMD.
>Merchant computers H(PIMD||H(OI)).
>Merchant decrypts DS using customer’s public
key.
>If both these items are equal, the merchant has
verified the DS.
//Merchant is never sent the PI//
62 Web Security www.elabnody.net
63. Dual Signature
• The bank has DS, PI, and OIMD.
>The bank computers H(H(PI)||OIMD).
>The bank decrypts DS using customer’s public
key.
>If both these items are equal, the merchant has
verified the DS.
//The bank is never sent the OI.//
63 Web Security www.elabnody.net
65. Payment Processing
• Look at three steps:
2.
1. 3.
Payment
Purchase request Payment capture
authorization
65 Web Security www.elabnody.net
66. [1]
Purchase Payment Processing
Request:
– Before purchase request, customer makes an order
– Initiate request: request certificate to the merchant
– Initiate response: merchant returns signed response and
his certificate and the payment gateway’s certificate
– Purchase request: cardholder sends a purchase request
which includes purchase-related info(PI, DS, OIMD) ,
order-related info (OI, DS, PIMD), and cardholder
certificate
– Purchase response: signed response from the merchant
for the purchase request
66 Web Security www.elabnody.net
68. [2]
Payment Payment Processing
authorization:
• Payment authorization ensures that the merchant will
receive payment.
• Authorization request message includes
– Purchase-related info: PI, DS, OIMD, and digital envelope
– Authorization-related info: authorization block (transaction ID
signed with merchant’s private key) and digital envelope
– Certificates: cardholder’s signature key certificate, merchant’s
signature key certificate, merchant’s key-exchange key
certificate
• The payment gateway authorizes the PI from the issuer
68 Web Security www.elabnody.net
69. [3]
Payment Payment Processing
capture :
• Authorization response message includes
– Authorization-related info: authorization block
and digital envelope
– Capture token info: signed and encrypted
token for payment, the digital envelope
• Payment capture using the capture token
– Capture request
– Capture response
69 Web Security www.elabnody.net
71. Creating a Security
Staying Current
– Use the Microsoft Baseline Security Analyzer
to check for nonsecure configuration and
detect missing patches
– Check the Microsoft Security Web page for tips
and news
http://www.microsoft.com/security
– Check for patches to any third-party software
71 Web Security www.elabnody.net
72. Creating a Security
Test Data: Authentication, Authorization, and
Implementation Data
– Authentication data
• Is authentication secure (clear text passwords)?
• Can passwords be guessed?
• Are accounts locked out after multiple failed logon
attempts?
– Authorization data
• Can a user get access to inappropriate data?
– Implementation data
• Are Web pages, error messages, or form data revealing
any implementation details?
72 Web Security www.elabnody.net
73. Don't we all wish it
was this easy!!!
73 Web Security www.elabnody.net
74. Problems
• Consider the following threats to Web security and describe
how each is countered by a particular feature of SSL.
– Brute-Force Cryptanalytic Attack: An exhaustive search of the key
space for a conventional encryption algorithm.
– Known-Plaintext Dictionary Attack: Many messages will contain
predictable plaintext, such as the HTTP GET command. An attacker
constructs a dictionary containing every possible encryption of the
known-plaintext message. When an encrypted message is intercepted,
the attacker takes the portion containing the encrypted known plaintext
and looks up the ciphertext in the dictionary. The ciphertext should
match against an entry that was encrypted with the same secret key. If
there are several matches, each of these can be tried against the full
ciphertext to determine the right one. This attack is especially effective
against small key sizes (e.g., 40-bit keys).
– Replay Attack: Earlier SSL handshake messages are replayed.
74 Web Security www.elabnody.net
75. Problems
• Consider the following threats to Web security and describe
how each is countered by a particular feature of SSL.
– Man-in-the-Middle Attack: An attacker interposes during key exchange,
acting as the client to the server and as the server to the client.
– Password Sniffing: Passwords in HTTP or other application traffic are
eavesdropped.
– IP Spoofing: Uses forged IP addresses to fool a host into accepting
bogus data.
– IP Hijacking: An active, authenticated connection between two hosts is
disrupted and the attacker takes the place of one of the hosts.
– SYN Flooding: An attacker sends TCP SYN messages to request a
connection but does not respond to the final message to establish the
connection fully. The attacked TCP module typically leaves the "half-
open connection" around for a few minutes. Repeated SYN messages
can clog the TCP module.
75 Web Security www.elabnody.net
76. 12 Steps to IT Security
76 Web Security www.elabnody.net
77. References
1) William Stallings (2005) “Cryptography and Network Security
Principles and Practices”, Fourth Edition, Publisher: Prentice Hall
2) Microsoft (2012) “Microsoft E-learning - Security” (online available)
http://www.microsoft.com/security/default.aspx . Retrieved Date
14th April, 2012.
3) Learn Security (2012) Foundations of Security: What Every
Programmer Needs To Know, (online available)
http://www.learnsecurity.com . Retrieved Date 14th April, 2012.
4) Department of Justice (2012) Computer Crime & Intellectual
Property Section, (online available)
http://www.usdoj.gov/criminal/cybercrime/ . Retrieved Date 14th
April, 2012.
77 Web Security www.elabnody.net
78. • 3DES: 3DES Triple Data Encryption Standard
• CC: Common Criteria
• DES: Data Encryption Standard
• DSS: Digital Signature Standard
• IETF: Internet Engineering Task Force
• MAC: Message Authentication Code
• MIME: Multipurpose Internet Mail Extension
• MD5: Message Digest, Version 5
• PGP: Pretty Good Privacy
• RSA: Rivest-Shamir-Adelman
• SET: Secure Electronic Transaction
• SHA: Secure Hash Algorithm
• SHS: Secure Hash Standard
• SSL: Secure Sockets Layer
• TCP: Transmission Control Protocol
• TLS: Transport Layer Security
• UDP: User Datagram Protocol
78 Web Security www.elabnody.net