600 likes | 699 Views
Web Application Security training. Agenda. Introduction OWASP: a quick review Common vulnerabilities and solutions (Hacking demos) Best practices. Agenda. Introduction OWASP: a quick review Common vulnerabilities and solutions (Hacking demos) Best practices. Introduction.
E N D
Web Application Security training
Agenda • Introduction • OWASP: a quick review • Common vulnerabilities and solutions (Hacking demos) • Best practices
Agenda • Introduction • OWASP: a quick review • Common vulnerabilities and solutions (Hacking demos) • Best practices
Introduction • Whatis application security? • Definition : "Information security is a process to protect data against unauthorized access, use, dissemination, destruction or modification. “ (Wikipedia)
Introduction Extended definition: Software Part integrated in Information Systems that manage:● The information security● The integrity of I.S.● Confidentiality of IS..
Introduction What is at stake?● S.I. = business core ● S.I. = data set (sensitive data) Consequences if:● Data Theft (sale to a competitor)● Data Violation (deletion / modification)● Degradation of services
Introduction • Web application source code, independent of languages and platforms, is a major source for vulnerabilities.
Agenda • Introduction • OWASP: a quick review • Common vulnerabilities and solutions (Hacking demos) • Best practices
OWASP(1/2) • What is OWASP? • OWASP= Open Web Application Security Project • A standard for performing application-level security verifications. • A Guide : document provides detailed guidance on web application security
Agenda • Introduction • PCI DSS : a quick review for developers • Common vulnerabilities and solutions (Hacking demos) • Best practices
Common vulnerabilitiesA1 : SQL Injection (login bypass example) POST http://www.mysite.com/login.asp HTTP/1.1 login=admin&pwd=' or 1=1-- POST http://www.mysite.com/login.asp HTTP/1.1 login=admin&pwd=Ultra-s3cur3-p@ssw0rd! 1 select * fromuserswherelogin ='admin'AND password='' or 1=1--' select * fromuserswherelogin ='admin'AND password='Ultra-s3cur3-p@ssw0rd!' 3 HTTP Request SQL Query ID | LOGIN | ROLE1 | admin | superuser SQL Answer 4 Firewall Firewall Workstation / Browser Web Server Web App Web App Database Server 80 / 443 Web App Web App HTTP Response <html> <%if (sqlResults.isEmpty()){%> <h1>Access Denied</h1> <%}else{%> <h1>Hello user<%=login%></h1> <%}%> </html> 6 HTTP/1.x 200 OK Content-Type: text/html Content-Length: 2000 <html> <h1>Hello user admin</h1> </html> Http Request Parsing 2 5 Server page
Demo : Sql injection Common vulnerabilitiesA1 : SQL Injection (demos)
Solution (2/2) Common vulnerabilitiesA1 : Injection
Demo :Solution Common vulnerabilitiesA1 : Injection
Common vulnerabilitiesA2 : Cross-Site Scripting (identity theft example) • /editObject.asp?id=100&newTitle=<javascript>alert(document.cookie)</script> Database Server Web Server /showObject.asp?id=100 Hacker Web Server Storage <html><body> <h1>Article 100</h1> <javascript> alert(document.cookie) </script> </body></html> /cookie.cgi?SESSIONID=002E42EF3CBRA29F3
Demo : XSS Attack Common vulnerabilities A2 : XSS(demos)
Demo : Solution Common vulnerabilities A2 : XSS(demos)
Common vulnerabilitiesA3 :Broken Authentication and Session management
Demo Common vulnerabilitiesA3 :Broken Authentication and Session management
Common vulnerabilitiesA4 : Insecure Direct Object References
Common vulnerabilitiesA4 : Insecure Direct Object References • Parameter tampering : authorization bypass example /listMyAccounts.asp /account.asp?id=12 /account.asp?id=15 Database Server Web Server "select * from account where owner="+session(userid) select * from account where id=15 ID | ACCOUNT | BALANCE 15 | bill gates| 999 999 999 € ID | ACCOUNT | BALANCE 12 | check| 1 000 € 30 |saving| 20 000 € <html><body> <h1>List of accounts</h1> <a href=/account.asp?id=12>Check</a> <a href=/account.asp?id=30>Saving</a> </body></html> <html><body> <h1>Bill gates private account</h1> […] </body></html>
Demo Common vulnerabilitiesA4 : Insecure Direct Object References
Common vulnerabilitiesA5 : Cross Site Request Forgery (CSRF)
Common vulnerabilitiesA5 : Cross Site Request Forgery (CSRF) When the customer read this news An authenticated connection is done to his bank web site https://bank.com/transfert.asp?Montant=2500&compteDestination=25302252232552 One fraudulent transfert have been proceed (du to the CSRF vulnerability) bank.com Blog.net • Hackers have create a malicious news on Blog.net • It contains the following link • <imgsrc=“https://bank.com/transfert.asp?Montant=2500&compteDestination=25302252232552 ”> A customer is connected to his bank web site and To another (already hacked) web site (blog.net)
Demo Common vulnerabilitiesA5 : Cross Site Request Forgery (CSRF)
Common vulnerabilitiesA5 : Cross Site Request Forgery (CSRF)
Common vulnerabilitiesA5 : Cross Site Request Forgery (CSRF)
Demo • Solution Common vulnerabilitiesA5 : Cross Site Request Forgery (CSRF)
Demo • Access to jsp pages Common vulnerabilitiesA6 – Security Misconfiguration (ex)
Common vulnerabilitiesA7 – Failure to Restrict URL Access • Attacker notices the URL indicates his role /user/getAccounts • He modifies it to another directory (role) /admin/getAccounts, or /manager/getAccounts • Attacker views more accounts than just their own
Finance Transactions Accounts Administration Communication Knowledge Mgmt E-Commerce Bus. Functions Custom Code Common vulnerabilitiesA8 – Insecure Cryptographic Storage Victim enters credit card number in form 1 Log files Malicious insider steals 4 million credit card numbers 4 2 Error handler logs CC details because merchant gateway is unavailable 3 Logs are accessible to all members of IT staff for debugging purposes
Demo • Solution Common vulnerabilitiesA8 – Insecure Cryptographic Storage
Common vulnerabilitiesA9 – Insufficient Transport Layer Protection
Common vulnerabilitiesA9 – Insufficient Transport Layer Protection illustration External Victim Backend Systems Custom Code Employees 2 1 External attacker steals credentials and data off network Internal attacker steals credentials and data from internal network External Attacker Internal Attacker
Common vulnerabilitiesA10 – Unvalidated Redirects and Forwards
Common vulnerabilitiesA10 – Unvalidated Redirects and Forwards
Agenda • Introduction • PCI DSS : a quick review for developers • Common vulnerabilities and solutions (Hacking demos) • Best practices
Best practicesSecurity principles (1/10) INPUT IS EVIL • It’s better to consider that users or external systems that communicate with your application may be someday harmful for your application • E.g.: • A user that tries to input unexpected data in a form • A partner’s system, with privileged access to one of your applications, that is compromised by a hacker or worm and tries to attack your network VALIDATE, VALIDATE, VALIDATE !!!