vulnerability analysis part 2
play

Vulnerability Analysis Part 2 RK Shyamasundar IIT Bombay Outline - PowerPoint PPT Presentation

Vulnerability Analysis Part 2 RK Shyamasundar IIT Bombay Outline Software Security Web Application Security Buffer Overflow Web content security: SSL Buffer Overflow Phishing attacks mitigation techniques


  1. Vulnerability Analysis – Part 2 RK Shyamasundar IIT Bombay

  2. Outline • Software Security • Web Application Security – Buffer Overflow – Web content security: SSL – Buffer Overflow – Phishing attacks mitigation techniques – Side-channel attacks – Finding vulnerabilities – OWASP Top 10 (top 3) – Mitigation techniques – Best practices

  3. Recap: Security Properties Primary Secondary • Confidentiality • Scalability • Authentication • Cost • Freshness • Usability • Availability • Privacy • Non-repudiation • Trust anchor/hierarchy • Integrity • State availability: on/off-line A practitioner of Security Engineering should be juggling between above security properties and find an acceptable balance with well-documented risks/assumptions.

  4. HTTPS/SSL (Padlock & notion of Trust)

  5. HTTPS/SSL (Padlock & notion of Trust)

  6. Successful SSL = padlock

  7. Padlock = layman’s icon for session security*

  8. Getting into the details of a server certificate

  9. Leaf-CA

  10. Intermediate-CA

  11. Root-CA

  12. Certificate Details: Key’s Usage

  13. Certificate Details: Cert’s Usage

  14. Certificate Details: Cert Extension SAN

  15. Certificate Details: Cert Extension CRL, OCSP

  16. SSL Protocol

  17. SSL Protocol

  18. SSL Protocol

  19. Broken padlock = ?

  20. Interesting Read … (2 days ago) http://wrd.cm/2oEULr3

  21. DNS, SMTP, HTTP

  22. Security cannot be thought in isolation

  23. Attacks on SSL • CRIME attack [Qualys] • What is the problem? – The root cause of the problem is information leakage that occurs when data is compressed prior to encryption. If someone can repeatedly inject and mix arbitrary content with some sensitive and relatively predictable data, and observe the resulting encrypted stream, then she will be able to extract the unknown data from it.

  24. Information Leakage

  25. Other reading … • Side channel leaks in Web applications [S&P 2010] • Sidebuster [CCS 2010]

  26. Improper Configuration & Error Handling

  27. Data Leakage/Privacy/Credential Theft • http://www.mi.com/in/hdindex/choosePro/in dex.html?pro=IN_REDMI3S&_1475044200 • URL submission variables • https://account.xiaomi.com/pass/auth/sns/ho me?userId=1617339665

  28. Information leakage Type of webserver: incorrect configuration of webserver Attacker concentrates on a specific set of vulnerabilities!

  29. View Source: continue exploring This webserver type is different from the previous webserver What does this tell me? (there is either: directory mapping or NFS, or webserver proxy feature in place)

  30. Continue directory traversal

  31. Two webservers offering same content!

  32. Automate the process • Use open-source/professional tools • Limitation: known-vulnerabilities • 0-days: not covered

  33. How should a bank protect its data if everything is SSL ized?

  34. SSL Proxy References 1. https://blog.heckel.xyz/2013/08/04/use- sslsplit-to-transparently-sniff-tls-ssl- connections/ 2. https://blog.heckel.xyz/2013/07/01/how-to- use-mitmproxy-to-read-and-modify-https- traffic-of-your-phone/ 3. https://blog.heckel.xyz/2013/08/04/use- sslsplit-to-transparently-sniff-tls-ssl- connections/

  35. Nessus Vulnerability Scanner: Dashboard

  36. Nessus Vulnerability Scanner: Event Notification

  37. Payloads!

  38. Code injection attack • Code Injection is the general term for attack types which consist of injecting code that is then interpreted/executed by the application. • This type of attack exploits poor handling of untrusted data. These types of attacks are usually made possible due to a lack of proper input/output data validation, for example: – allowed characters (standard regular expressions classes or custom) – data format – amount of expected data

  39. Code injection attack • These types of vulnerabilities can range from very hard to find, to easy to find • If found, are usually moderately hard to exploit, depending of scenario • If successfully exploited, impact could cover loss of confidentiality, loss of integrity, loss of availability, and/or loss of accountability

  40. Input validation is necessary!

  41. Preventive Techniques • Despite best efforts of application developers to detect and rectify bugs/vulnerabilities it may not be guaranteed that application will be remain secure in future. • One may take help of application firewalls to reduce exposure of the application to unauthorized users – modSecurity (Apache) – AppSensor (OWASP)

  42. Growth of Threat: Growth in the tools available (2004!) 25,000 Categories: • Binder • Carding • Cracking Tool 20,000 • Flooder • Key Generator • Mail Bomber • Mailer • Misc Tool • Nuker 15,000 Hacker Tools • Packer • Password Cracker • Password Cracking Word List • Phreaking Tool • Port Scanner 10,000 • Probe Tool • Sniffer • Spoofer • Trojan • Trojan Creation Tool 5,000 • Virus Creation Tool • Virus Source • Virus Tutorial • War Dialer 0 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 0 0 0 0 0 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 Year Source: PestPatrol.com

  43. Application Security tollgates in SDLC Iterative approach Static Penetration Security Design analysis testing requirements Review (tools) Risk Risk-based analysis security tests Code Requirements Design Test plans Test Field and use cases results feedback Code Review

  44. References • https://www.metasploit.com/ • http://valgrind.org/ • https://www.coverity.com/ • http://www.arachni-scanner.com/ • http://www.openvas.org/ • http://www.tenable.com/ • https://www.rapid7.com/products/nexpose/ • https://en.wikipedia.org/wiki/Application_security • https://portswigger.net/burp/ • https://sourceforge.net/projects/paros/ • http://www.binaryanalysis.org/en/home • http://bitblaze.cs.berkeley.edu • https://www.veracode.com/products/static-analysis-sast/binary-code-analysis • http://angr.io/ • https://cyberpedia.in/manual-sql-injection-by-the-help-of-firebug/ • https://www.owasp.org/index.php/OWASP_AppSensor_Project • https://www.modsecurity.org/

  45. For the curious ones! • Availability of services vs Denial of Services – Akamai & “ Krebsonsecurity.com ” https://krebsonsecurity.com/2016/09/the- democratization-of-censorship/ • https://projectshield.withgoogle.com/public/

  46. Additional reading …

  47. Outline • Software Security • Web Application Security – Buffer Overflow – Web content security: SSL – Buffer Overflow – Phishing attacks mitigation techniques – Side-channel attacks – Finding vulnerabilities – OWASP Top 10 (top 3) – Mitigation techniques – Best practices

  48. OWASP top 10 Open Web Application Security Project Don’t stop at 10

  49. SQL Injection – Illustrated "SELECT * FROM Account Summary Account: accounts WHERE Account: Knowledge Mgmt Communication Administration Bus. Functions Legacy Systems Human Resrcs Application Layer Transactions E-Commerce Web Services SKU: acct=‘’ OR 1=1 -- Directories SKU: Databases Accounts Acct:5424-6066-2134-4334 Finance HTTP Billing DB Table SQL HTTP Acct:4128-7574-3921-0192 ’" response  query request Acct:5424-9383-2039-4029  APPLICATION    Acct:4128-0004-1234-0293  ATTACK Custom Code 1. Application presents a form to the attacker 2. Attacker sends an attack in the form data App Server 3. Application forwards attack to Web Server the database in a SQL query Network Layer Hardened OS 4. Database runs query containing attack and sends encrypted results back to application Firewall Firewall 5. Application decrypts data as normal and sends results to the user

  50. Avoiding SQL Injection Flaws Recommendations • Avoid the interpreter entirely, or • Use an interface that supports bind variables (e.g., prepared statements, or stored procedures), • Bind variables allow the interpreter to distinguish between code and data • Encode all user input before passing it to the interpreter • Always perform ‘white list’ input validation on all user supplied input • Always minimize database privileges to reduce the impact of a flaw References • For more details, read the https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet

  51. HTTP is a stateless protocol

Recommend


More recommend