Web security 2012


Published on

- 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

Published in: Education, Technology
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Web security 2012

  1. 1. HackersCrackers Script Kiddies //By Mohamed R. Elabnody // elabnody@msn.com www.elabnody.net Actors 3rd May, 2012
  2. 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 • Problems2 Web Security www.elabnody.net
  3. 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. 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 peoples 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. 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. 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
  7. 7. Information Security at Work Awareness7 Web Security www.elabnody.net
  8. 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 revenue8 Web Security www.elabnody.net
  9. 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. 10. Zone-H statistics • Why did you deface this website? http://www.zone-h.org10 Web Security www.elabnody.net
  11. 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 Outsiders11 Web Security www.elabnody.net
  12. 12. Attacks Organizational Attacks Common Social Engineering Types of Viruses, Trojan Horses, and Worm Attacks Denial of Service (DoS) Accidental Breaches in Security12 Web Security www.elabnody.net
  13. 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 exploit13 Web Security www.elabnody.net
  14. 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 code14 Web Security www.elabnody.net
  15. 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
  16. 16. Information Security Threat Awareness16 Web Security www.elabnody.net
  17. 17. 17 Web Security www.elabnody.net
  18. 18. Web Security Approaches Encryption and Other Security Tools
  19. 19. Web Security Approaches • Web Security Threats … Integrity Confidentiality Denial of Service Authentication19 Web Security www.elabnody.net
  20. 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 traffic20 Web Security www.elabnody.net
  21. 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 server21 Web Security www.elabnody.net
  22. 22. Web Security Approaches22 Web Security www.elabnody.net
  23. 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 53123 Web Security www.elabnody.net
  24. 24. 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
  25. 25. How Does SSL/TLS Work?26 Web Security www.elabnody.net
  26. 26. 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 servers private key – After the connection has been established, all communication between the browser and Web server is secure27 Web Security www.elabnody.net
  27. 27. 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 layers28 Web Security www.elabnody.net
  28. 28. 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 exchanges29 Web Security www.elabnody.net
  29. 29. SSL Architecture Manages SSL ExchangesThe SSLRecordProtocol SSL SSL change SSL alertprovides basic Handshake cipher spec HTTP protocolsecurity protocol protocolservices to Basicvarious higher- SSL record protocol Securitylayer Servicesprotocols. TCP IP Figure 2. SSL Protocol Stack Cryptography and Network Security Principles and Practices, 4th Edition,30 Web Security Page 532 www.elabnody.net
  30. 30. 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
  31. 31. 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
  32. 32. SSL Record Protocol Operation Message Message Blocks OptionalMAC: 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 OperationCryptography and Network Security Principles and Practices, 4th Edition, Page 53433 Web Security www.elabnody.net
  33. 33. 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
  34. 34. 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 53535 Web Security www.elabnody.net
  35. 35. Handshake Protocol Message Types36 Web Security www.elabnody.net
  36. 36. 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 437 Web Security www.elabnody.net
  37. 37. Handshake Protocol38 Web Security www.elabnody.net
  38. 38. Handshake Protocol • Authenticate each other and negotiate cryptographic parameters (encryption and MAC algorithms, cryptographic keys, …) – Phase 1: establish security capabilities – Phase 2: server authentication and key exchange – Phase 3: client authentication and key exchange – Phase 4: finish39 Web Security www.elabnody.net
  39. 39. An SSL Session 1. Negotiation of cryptographic parameters //Two computers probably don’t know each other’s capabilities.// 2. Key Agreement. //C & S generate shared secret key.// 3. Authentication (client authenticates server). 4. Confidentiality and integrity. //private messages exchanged between C & S.//40 Web Security www.elabnody.net
  40. 40. https://ssl.trustwave.com/support/support-how-ssl-works.php41 Web Security www.elabnody.net
  41. 41. 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,55542 Web Security www.elabnody.net
  42. 42. 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,22243 Web Security www.elabnody.net
  43. 43. 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
  44. 44. 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
  45. 45. 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
  46. 46. 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
  47. 47. 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
  48. 48. 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
  49. 49. What is HTTPS50 Web Security www.elabnody.net
  50. 50. Secure Electronic Transactions
  51. 51. 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 Criteria52 Web Security www.elabnody.net
  52. 52. 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
  53. 53. SET Overview • Key Features of SET: – Confidentiality of information – Integrity of data – Cardholder account authentication – Merchant authentication54 Web Security www.elabnody.net
  54. 54. SET Participants55 Web Security www.elabnody.net
  55. 55. 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
  56. 56. 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
  57. 57. 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
  58. 58. 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
  59. 59. 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 Algorithm60 Web Security www.elabnody.net
  60. 60. Dual Signature DS  EKRc [ H ( H ( PI ) || H(OI))]61 Web Security www.elabnody.net
  61. 61. 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
  62. 62. 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
  63. 63. Payment Processing64 Web Security www.elabnody.net
  64. 64. Payment Processing • Look at three steps: 2. 1. 3. Payment Purchase request Payment capture authorization65 Web Security www.elabnody.net
  65. 65. [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 request66 Web Security www.elabnody.net
  66. 66. Cardholder sends Purchase Payment Processing Request67 Web Security www.elabnody.net
  67. 67. [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 issuer68 Web Security www.elabnody.net
  68. 68. [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 response69 Web Security www.elabnody.net
  69. 69. 70 Web Security www.elabnody.net
  70. 70. 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 software71 Web Security www.elabnody.net
  71. 71. 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
  72. 72. Dont we all wish it was this easy!!!73 Web Security www.elabnody.net
  73. 73. 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
  74. 74. 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
  75. 75. 12 Steps to IT Security76 Web Security www.elabnody.net
  76. 76. 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
  77. 77. • 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 Protocol78 Web Security www.elabnody.net
  78. 78. Mohamed R. Elabnody www.elabnody.net elabnody@msn.com 3rd May, 2012