10 Web Application Security 20110827
10 Web Application Security 20110827
Security
DMZ
HTTP
request
IIOP
T9
etc.
Cleartext or
SSL
transport
Web
client:
IE,
Mozilla,
etc.
HTTP reply
(HTML,
JavaScript,
VBScript,
etc.)
AJP
Apache
IIS
Netscape
etc.
DB
Web app
Web app
App
server
(optional)
Web
server
Servlet
engine
J2EE
server
ColdFusio
n
Oracle
Internal
network
Protected
network
Web app
Web app
Perl
C++
CGI
Java
ASP
PHP
etc.
DB
ADO
ODB
C
JDB
C
etc.
Oracl
e
SQL
Serv
er
Basic Web
Technology
URLs
Protocol
Hostname
Port
Path
Query
Fragment
HTTP Request
Method
File
HTTP version
Headers
Blank line
Data none for GET
HTTP Response
HTTP version
Status code
Reason phrase
Headers
HTTP/1.0 200 OK
Date: Sun, 21 Apr 1996 02:20:42 GMT
Server: Microsoft-Internet-Information-Server/5.0
Connection: keep-alive
Content-Type: text/html
Last-Modified: Thu, 18 Apr 1996 17:39:05 GMT
Content-Length: 2543
<HTML> Some data... blah, blah, blah </HTML>
Data
SSL
SSL Handshake
Developer error:
14
Cookies
Used
Browser
Server
HTTP Header:
Set-cookie: NAME=VALUE ;
domain = (who can read) ;
expires = (when expires) ;
If expires=NULL:
this session only
secure = (only over SSL)
Browser
GET
Cookie: NAME = VALUE
Server
Cookie authentication
Browser
Web Server
POST login.cgi
Username & pwd
Set-cookie: auth=val
GET restricted.html
Cookie: auth=val
If YES,
restricted.html
Auth server
Validate user
auth=val
Store val
restricted.html
auth=val
YES/NO
Check val
Ref: http://www.w3c.org/
DOMImplementation
NodeList
DOMException
Node
Fundamental Interface
Document
CharacterData
Comment
Attr
Text
Element
DocumentType
Notation
Entity
EntityReference
ProcessingInstruction
Extended Interface
CDATASection
DOM
Output
Examples
Properties:
document.alinkColor
document.URL
document.forms[ ]
document.links[ ]
document.anchors[ ]
Methods:
document.write(document.referrer)
Window
document
frames[]
History
Location
navigator (type and version of browser)
OWASP project
OWASP
project (http://www.owasp.org)
Open Web Application Security Project
Minimum standards for web application
security
International membership
Interesting project:
OWASP Top 10
Unvalidated input
Broken access control
Broken authentication and session management
Cross site scripting
Buffer overflows
Injection flaws
Improper error handling
Insecure storage
Denial of service
Insecure configuration management
Hidden Field
(View Source)
Tag HIDDEN
Cookie Poisoning
Cookie
S
ession
cookie
Session ID
[GM05].
29
Picture-in-picture attacks
[JSTB07]
Trivially
spoofable
<a href=http://www.paypal.com/
onclick=this.href = http://www.evil.com/;>
PayPal</a>
script
Cookie XSS
Forceful Browsing
/client
/client/client1/data
Path Traversal (../../../)
NIDS
SSL NIDS
Database Server
SQL Injection
www.test.com/cgi-bin/productdesc.asp?category=10;
SQL
v_cat = request("category") #v_cat=10;
sqlstr="SELECT description FROM product WHERE
category='" & v_cat & "'"
set rs=conn.execute(sqlstr)
Database
SQL Injection
SQL Injection
www.test.com/cgi-bin/productdesc.asp?category=10
UNION SELECT name,pwd FROM admins;--
SQL
Database
Invalid
Java Script Injection
javascript:alert(document.cookie);
javascript:void(document.cookie="authorizatio
n=true");
Error Handling
Error message
Debug
HTTP Header
Client Web Server
Paros Porxy
TemperData Plugin
Mozila Firefox HTTP
Header
Network Architecture
Secure Web Application
Vulnerability Scanner
Penetration Testing
IPS Monitor
Application Proxy Firewall
Secure Coding
Secure Coding
input & output validation
SSL
HTML forms
Cookies
HTTP REFERER Header
POST & GET method
logout (logout
mechanism)
Error Handling
HTML forms
Hidden element
SSL
Method Get Method Post
Cookies
2 (Persist , Non-Persist)
3
User Authentication
State Management
Saving user preference
Cookie
Cookies Plaintext
Cookies
Cookies
Cookies
Cookies
Token ID
Cookies Timeout Cookies
Authentication
header
User-Agent , Acce
logout mechanism
Cookies
Cookies
session
session
Error Handling
Error Handling Error
Description
Error Description
Error Desciption
NMAP
NESSUS
OpenVAS
SQLmap
Penetration Testing
Hacker