Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Web Application Security

Web Application Security

Slides of PHPReboot meetup on 13th February, 2016 on Web Application Security.
Video recording of session will also be uploaded. Please check comments of http://www.meetup.com/PHPReboot/events/228005833/ for link of YouTube video of session.

Kapil Sharma

February 13, 2016
Tweet

More Decks by Kapil Sharma

Other Decks in Technology

Transcript

  1. 2 phpreboot.github.io, phpreboot.com Kapil Sharma Introduction Kapil Sharma Technical Architect

    Ansh Systems Pvt. Ltd. 11+ Years experience in Web App Development Twitter: kapilsharmainfo Facebook: kapilsharmainfo Linkedin: kapilsharmainfo github: kapilsharma Blog: blog.kapilsharma.info Slides: speakerdeck.com/ kapilsharma
  2. 5 phpreboot.github.io, phpreboot.com Kapil Sharma Why Me? Small Apps Few

    Users No Money Transaction No thing Confidential Then why will someone hack my website?
  3. 8 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP Top 10 OWASP Project

    Awareness document for web application security Represent top 10 web application security flaws
  4. 9 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP Top 10 SQL Injection

    (OS) Command Injection LDAP Injection Script/File Injection Happens when we use data sent from outside Never Trust User Input Golden Rule Injection
  5. 10 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP Top 10 Injection sql

    = "SELECT * FROM user WHERE user_id=" + userId; $sql = 'SELECT * FROM user WHERE user_id=' . $userId; userid = 10 OR 1=1 SELECT * FROM user WHERE user_id = '1' OR 1=1
  6. 11 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP Top 10 Injection Securing

    Injection Never trust user input Defence in Depth Know your data Prepared Statements Stored Procedures User ORM Libraries
  7. 12 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP Top 10 Injection Broken

    Authentication & Session Mgmt Custom Auth/Session Mgmt. Password not hashed in database Exposed Session ID (in URL) No Wrong password limit (Brute Force) Allowing weak passwords No session timeout Session Hijacking/Fixation Avoid Remember me
  8. phpreboot.github.io, phpreboot.com Kapil Sharma 13 http:// web.com/
 <script>doc ument.cooki e=“sessioni

    d=abcd”</ script? http:// web.com/ <meta http- equiv=Set- Cookiecontent =“sessionid=a bcd"> Session Hijacking
  9. 14 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP Top 10 Cross Site

    Scripting (XSS) Broken Authentication & Session Mgmt Injection Attacker inject Client side script Victim visit the page Script executes
  10. Filter Input - Escape Output 15 phpreboot.github.io, phpreboot.com Kapil Sharma

    OWASP Top 10 Cross Site Scripting (XSS) Broken Authentication & Session Mgmt Injection
  11. 16 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP Top 10 Insecure Direct

    Object Reference Cross Site Scripting (XSS) Broken Authentication & Session Mgmt Injection When: Dev expose internal object <select name=“choosecreditcard”> </select> <option value=“35">XXXXXXXXXXXX6002</option> <option value="19">XXXXXXXXXXXX1101</option> Validation & Authorization
  12. 17 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP Top 10 Security Misconfiguration

    Insecure Direct Object Reference Cross Site Scripting (XSS) Broken Authentication & Session Mgmt Injection Vulnerable if Out of date software Unnecessary services enabled Default Account/PW enabled Security Settings Stack Trace
  13. Injection Broken Authentication & Session Mgmt Cross Site Scripting (XSS)

    Insecure Direct Object Reference Security Misconfiguration Sensitive Data Exposure 18 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP Top 10
  14. Sensitive Data Exposure 19 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP Top

    10 Banking Information Credit card numbers Account numbers Health information Personal Info (DOB, SSN) User account/passwords Middle man
  15. 20 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP Top 10 Missing Function

    Level Access Control Sensitive Data Exposure Security Misconfiguration Insecure Direct Object Reference Cross Site Scripting (XSS) Broken Authentication & Session Mgmt Injection Having multiple roles Access Control List
  16. Injection Broken Authentication & Session Mgmt Cross Site Scripting (XSS)

    Insecure Direct Object Reference Security Misconfiguration Sensitive Data Exposure Missing Function Level Access Control Cross Site Request Forgery 21 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP Top 10
  17. Cross Site Request Forgery 23 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP

    Top 10 XSS: Hacker trick user as server CSFR: Hacker trick server as valid user
  18. Cross Site Request Forgery 24 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP

    Top 10 User login to my bank.com Open hacker.site in another tab <h1>Hi innocent user</h1> Check image below <img src=“www.bank.com/transfer? to=hacker&amount =1000&remark=hacked" />
  19. 25 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP Top 10 Components with

    known Vulnerabilities Cross Site Request Forgery (CSRF) Missing Function Level Access Control Sensitive Data Exposure Security Misconfiguration Insecure Direct Object Reference Cross Site Scripting (XSS) Broken Authentication & Session Mgmt Injection
  20. 26 phpreboot.github.io, phpreboot.com Kapil Sharma ` Components with known Vulnerabilities

    Cross Site Request Forgery (CSRF) Missing Function Level Access Control Sensitive Data Exposure Security Misconfigur Insecure Direct Obje Cross Site Scripting Broken Authenticatio Injection X.Y.Z Major Minor Patch https://security.sensiolabs.org OWASP Top 10
  21. Unvalidated Redirect & Forwards 27 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP

    Top 10 Components with known Vulnerabilities Cross Site Request Forgery (CSRF) Missing Function Level Access Control Sensitive Data Exposure Security Misconfiguration Insecure Direct Object Reference Cross Site Scripting (XSS) Broken Authentication & Session Mgmt Injection
  22. Unvalidated Redirect & Forwards 28 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP

    Top 10 https://example.com/redirect? http://hacker.com http://example.com/boringpage? fwd=admin.php Avoid Redirect & Forward If used, don’t include parameter If included, validate them
  23. Unvalidated Redirect & Forwards 29 phpreboot.github.io, phpreboot.com Kapil Sharma OWASP

    Top 10 Components with known Vulnerabilities Cross Site Request Forgery (CSRF) Missing Function Level Access Control Sensitive Data Exposure Security Misconfiguration Insecure Direct Object Reference Cross Site Scripting (XSS) Broken Authentication & Session Mgmt Injection