38
WEB SECURITY

WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

  • View
    230

  • Download
    0

Embed Size (px)

Citation preview

Page 1: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

WEB SECURITY

Page 2: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

WEB ATTACK TYPES

Page 3: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Buffer Overflows XML Injections Session Hijacking

Attacks

WEB Attack Types

Page 4: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Common Effects: DOS (Denial of Service), data corruption, malicious code execution.

An attacker can craft XML data causing the XML to call upon itself repetitively therefore constantly increasing in size. This causes a memory overflow, or trigger error messages which reveal information about the application.

A DOS attack can be caused by forcing a server to parse an abnormally long XML file, which in essence uses up much more resources then actually generating one, and can crash the application. Another type of attack consists of sending a block of data to an application, which is stored in a buffer of insufficient size. This block of data can then overwrite genuine data and cause a function return which gives control to the malicious code in the hacker’s data block.

Buffer Overflows

Page 5: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Common Effects: Command execution, data theft and deletion, schema poisoning.

SQL Injection is a high-risk exploit which may be performed using SOAP messages. If a server does not validate data correctly, a SOAP message can easily be used to create XML data which inserts a parameter into an SQL query and have the server execute it with the rights of the Web Service. SQL Injection is only one of the threats a server is exposed to if data is not validated.

Another such example is Schema Poisoning. A schema file is what an XML parser uses to understand the XML’s grammar and structure, and contains essential preprocessor instructions. An attacker may damage the XML schema or replace it with a modified one which would then allow the parser to process malicious SOAP messages and specially crafted XML files to inject OS commands on the server or database.

XML Injections

Page 6: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Common Effects: Obtaining of user privileges within application or network.

Session hijacking involves gaining illegal control of a legal user’s session state. It occurs when an attacker steals a valid session ID (valid session cookie), and uses it to gain that particular user’s privileges in the application. By intercepting or sniffing SOAP messages, an attacker can hijack a user’s session in the same ways as with normal web application attacks, however once a hacker is authenticated as a valid user he may perform more dangerous activities.

Session Hijacking

Page 7: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

WEB SECURITY

Page 8: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Web Security

Threats

Secure Naming

SSL – The Secure Sockets Layer

Mobile Code Security

Page 9: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Secure Naming

(a) Normal situation. (b) An attack based on breaking into DNS and modifying Bob's record.

Page 10: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Secure Naming (2)

How Trudy spoofs Alice's ISP.

Page 11: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Secure DNS

An example RRSet for bob.com. The KEY record is Bob's public key. The SIG record is the top-level com server's signed has of the A and KEY records to verify their authenticity.

Page 12: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Self-Certifying Names

A self-certifying URL containing a hash of server's name and public key.

Page 13: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

SSLSSL

Two protocol is dominant today for providing security Two protocol is dominant today for providing security at the transport layerat the transport layer

SSL ServicesSecurity ParametersSessions and ConnectionsFour ProtocolsTransport Layer Security

Topics discussed in this section:Topics discussed in this section:

Page 14: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Location of SSL and TLS in the Internet model

Page 15: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

SSL—The Secure Sockets Layer

Layers (and protocols) for a home user browsing with SSL.

Page 16: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

SSL (2)

A simplified version of the SSL connection establishment subprotocol.

Page 17: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

SSL (3)

Data transmission using SSL.

Page 18: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

SSL cipher suite list

Page 19: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

SSL cipher suite list (continued)

Page 20: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Cryptographic SecretsCryptographic Secrets

Client needs one key for message authenticationClient needs one key for message authentication Client needs one key for encryptionClient needs one key for encryption Client needs one Initiation Vector (IV) for block encryptionClient needs one Initiation Vector (IV) for block encryption

Server needs one key for message authenticationServer needs one key for message authentication Server needs one key for encryptionServer needs one key for encryption Server needs one Initiation Vector (IV) for block encryptionServer needs one Initiation Vector (IV) for block encryption

Page 21: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

The client and the server have six different cryptography secrets.

Note

Page 22: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Creation of cryptographic secrets in SSL

Page 23: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Cryptographic SecretsCryptographic Secrets

The client and server exchange two random numbers; one is The client and server exchange two random numbers; one is created by the client and the other by the server.created by the client and the other by the server.

The client and server exchange one premaster secret by using The client and server exchange one premaster secret by using one of the key-exchange algorithms we discussed previously.one of the key-exchange algorithms we discussed previously.

A 48-byte master secret is created from the premaster secret by A 48-byte master secret is created from the premaster secret by applying two hash functions (SHA-1 and MD5).applying two hash functions (SHA-1 and MD5).

The master secret is used to create variable-length secrets by The master secret is used to create variable-length secrets by applying the same set of hash functions and prepending with applying the same set of hash functions and prepending with different constants.different constants.

Page 24: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Question 1Question 1

What steps are involved in the SSL Record Protocol What steps are involved in the SSL Record Protocol Transmission?Transmission?

Page 25: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Answer 1Answer 1

What steps are involved in the SSL Record Protocol What steps are involved in the SSL Record Protocol Transmission?Transmission?

Answer: Answer: Fragmentation.Fragmentation.Compression.Compression.

Add MAC.Add MAC.Encrypt.Encrypt.

Append SSL record header.Append SSL record header.

Page 26: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Connection & Session Connection & Session

Connection: Connection: A connection is a transport (in the OSI layering A connection is a transport (in the OSI layering model definition) that provides a suitable type of service. A model definition) that provides a suitable type of service. A connection can be established and broken several times during connection can be established and broken several times during a session.a session. For SSL, such connections are peer-to-peer For SSL, such connections are peer-to-peer relationships. The connections are transient. Every connection is relationships. The connections are transient. Every connection is associated with one session.associated with one session.

Session: Session: An SSL session is an association between a client An SSL session is an association between a client and a server. A session between two systems is an association and a server. A session between two systems is an association that can last for a long time.that can last for a long time. Sessions are created by the Sessions are created by the Handshake Protocol. Sessions define a set of cryptographic Handshake Protocol. Sessions define a set of cryptographic security parameters, which can be shared among multiple security parameters, which can be shared among multiple connections. Sessions are used to avoid the expensive negotiation connections. Sessions are used to avoid the expensive negotiation of new security parameters for each connection.of new security parameters for each connection.

Page 27: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Question 2Question 2

What is the difference between a session and a connection in SSL?What is the difference between a session and a connection in SSL?

Page 28: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Answer 2Answer 2

What is the difference between a session and a connection in SSL?What is the difference between a session and a connection in SSL?

Answer: Answer: Connection: A connection is a transport (in the OSI layering Connection: A connection is a transport (in the OSI layering

model definition) that provides a suitable type of service. For SSL, model definition) that provides a suitable type of service. For SSL, such connections are peer-to-peer relationships. The connections such connections are peer-to-peer relationships. The connections

are transient. Every connection is associated with one session. are transient. Every connection is associated with one session.

Session: An SSL session is an association between a client and a Session: An SSL session is an association between a client and a server. Sessions are created by the Handshake Protocol. server. Sessions are created by the Handshake Protocol.

Sessions define a set of cryptographic security parameters, which Sessions define a set of cryptographic security parameters, which can be shared among multiple connections. Sessions are used to can be shared among multiple connections. Sessions are used to

avoid the expensive negotiation of new security parameters for avoid the expensive negotiation of new security parameters for each connection.each connection.

Page 29: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Four SSL protocols

Page 30: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Question 3Question 3

What protocols compromise SSL?What protocols compromise SSL?

Page 31: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Answer 3Answer 3

What protocols compromise SSL?What protocols compromise SSL?

Answer: Answer: SSL handshake protocol.SSL handshake protocol.

SSL change cipher spec protocol.SSL change cipher spec protocol.SSL alert protocol.SSL alert protocol.

SSL record protocol.SSL record protocol.

Page 32: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Four Protocols Four Protocols

Handshake Protocol: provides security parameters for the Handshake Protocol: provides security parameters for the Record Protocol. It establishes a cipher set and provides keys and Record Protocol. It establishes a cipher set and provides keys and security parameters. It also authenticates the server to the client security parameters. It also authenticates the server to the client and the client to the server (if needed), and to exchange and the client to the server (if needed), and to exchange information for building the cryptographic secrets. The information for building the cryptographic secrets. The handshaking is done in four phases, as shown in Figure.handshaking is done in four phases, as shown in Figure.

Page 33: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Handshake Protocol

Page 34: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Four Protocols Four Protocols

ChangedCipherSpec Protocol: is used for signaling the ChangedCipherSpec Protocol: is used for signaling the readiness of cryptographic secrets.readiness of cryptographic secrets.

Alert Protocol: is used to report abnormal conditions. Alert Protocol: is used to report abnormal conditions.

Record Protocol: caries message from the upper layer Record Protocol: caries message from the upper layer (Handshake Protocol, ChangeCipherSpec Protocol, Alert (Handshake Protocol, ChangeCipherSpec Protocol, Alert Protocol, or application). The message is fragmented and Protocol, or application). The message is fragmented and optionally compressed; a MAC is added to the compressed optionally compressed; a MAC is added to the compressed message by using the negotiated hash algorithm. The compressed message by using the negotiated hash algorithm. The compressed fragmented and the MAC are encrypted by using the negotiated fragmented and the MAC are encrypted by using the negotiated encryption algorithm. Finally, the SSL header is added to the encryption algorithm. Finally, the SSL header is added to the encrypted message. Figure shows this process at the sender. The encrypted message. Figure shows this process at the sender. The process at the receiver is reversed.process at the receiver is reversed.

Page 35: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Processing done by the Record Protocol

Page 36: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Question 4Question 4

What services are provided by the SSL Record Protocol?What services are provided by the SSL Record Protocol?

Page 37: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

Answer 4Answer 4

What services are provided by the SSL Record Protocol?What services are provided by the SSL Record Protocol?

Answer: Answer: Confidentiality: The Handshake Protocol defines a shared secret Confidentiality: The Handshake Protocol defines a shared secret

key that is used for conventional encryption of SSL payloads. key that is used for conventional encryption of SSL payloads.

Message Integrity: The Handshake Protocol also defines a shared Message Integrity: The Handshake Protocol also defines a shared secret key that is used to form a message authentication code secret key that is used to form a message authentication code

(MAC).(MAC).

Page 38: WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types

How Do You Want Protect Your Network System

Thank You