SlideShare uma empresa Scribd logo
1 de 32
Copyright 2008 © The OWASP Foundation
Permission is granted to copy, distribute and/or modify this document
under the terms of the OWASP License.
The OWASP Foundation
OWASP
http://www.owasp.org
Input Validation
Vulnerabilities, Encoded Attack
Vectors and Mitigations
Marco Morana &
Scott Nusbaum
Cincinnati Chapter
OWASP 2
Agenda
1. Input Validation Attacks: Cause, Exploits, Threats
2. Attack Vectors: Definitions, Elements, Types (traditional old
and new Web 2.0)
3. Engineering Attack Vectors: Canonical Representation,
Encoding, Double Encoding and Filter Evasions
4. Cheat Sheets: XSS, SQL Injection
5. Input Validation Attacks: Encoded Exploit Examples
6. How to find IV vulnerabilities: Web application security
Assessments
7. How to protect from IV attack vectors
8. Input Validation Attack Defenses In Practice: Structs
Validators, Encoding Rules
9. Input Validation Attack Vectors: Mitigation Strategies
10. Q&A
OWASP 3
Input Validation Attacks: Cause, Exploits, Threats
Cause: Failure to properly validate data at the entry
and exit points of the application
Exploit: Injection of malicious input such as scripts,
commands, code that can be interpreted by
different targets:
Browser: XSS, XFS, HTML-Splitting
Data repositories: SQL Injection, LDAP injection
Server side file processing: XML, XPATH
Application/Server/O.S. :File uploads, Buffer Overflow
Threats: Phishing, Information Disclosure (e.g.
PII), Data Alteration/Destruction,
Denial/Degradation Of service, Financial
Loss/Fraud, Reputation Loss
OWASP 4
Code Injection Attack Example
From: www.technicalinfo.net/papers/Phishing.html
OWASP 5
SQL Injection Attack Example
3
Attacker Enters Malicious Inputs such as:
http://www.bank.com/index.php?id= 1 UNION ALL SELECT
creditCardNumber,1,1, FROM CreditCardTable
Attacker enters SQL
fragments into a web page
that uses input in a query
1
Attacker obtain other customers credit card
numbers
Custom Code
Accounts
Finance
Administration
Transactions
Communication
Knowledge
Mgmt
E-Commerce
Bus.Functions
Database
2
Application sends modified query to database
such as SELECT Name, Phone, Address
FROM Users WHERE Id=1 UNION ALL
SELECT creditCardNumber 1,1 FROM
CreditCardTable, which executes it
From OWASP Testing Guide 2.0 UNION QUERY SQL Injection:
http://www.owasp.org/index.php/Testing_for_SQL_Injection
OWASP 6
Malicious File Upload Vulnerability Example
1) Malicious user passes the following
information in the cmd parameter:
cmd=%3B+mkdir+hackerDirectory
2) The parameter from the request is used for
command line process
String fromRequest =
request.getParameter("cmd");
Process process =
runtime.exec("cmd.exe /C" +
fromRequest);
3) Final command executed is:
cmd.exe /C “dir; mkdir hackerDirectory”
OWASP 7
Client Side Validation Flaws Example
http://www.coolcart.com/jewelrystore.html
The price charged for the
“Two Stone Feather
Ring” is now 99 cents
OWASP 8
Attack Vectors Definitions
An attack vector is a path or means by which a
hacker can gain access to a computer or
network server in order to deliver a payload or
malicious outcome
Attack vectors are routes or methods used to
get into computer systems, usually for nefarious
purposes. They take advantage of known weak
spots to gain entry. Many attack vectors take
advantage of the human element in the system,
because that's often the weakest link.
From SecuritySearch.com Definitions :http://searchsecurity.techtarget.com/dictionary/definition/1005812/attack-vector.html
OWASP 9
Understanding Attack Vectors
Don't confuse attack vectors with payload
Attack vectors: malicious email, attachments, worms,
web pages, downloads, deception (aka social
engineering), hackers
Payloads: viruses, spyware, trojans, malicious
scripting/executables
Example: The attack vector with a payload consisting in
a script to capture sensitive information (e.g. cookie
stored on the browser) in an alert
http://server/cgi-
bin/testcgi.exe?<SCRIPT>alert(“Cookie”+document.cookie)</SC
RIPT>
OWASP 10
Traditional Vector Based Attack Types
Buffer overflows attacks
Code injection attack: also known as "code poisoning
attack“ examples:
Cookie poisoning attack
HTML injection, such as HTML injection in IE7 via infected DLL
Include file injection attack
Server side PHP, ASP injection attacks
Schema poisoning attack
Script injection (e.g., cross-site scripting) attack
Shell injection attack
SQL injection attack (also known as SQL code poisoning)
XML poisoning attack
From: ITtoolbox Wiki http://it.toolbox.com/wiki/index.php/Attack_vector
OWASP 11
New Web 2.0 Attack Vectors
Cross-site scripting in AJAX
XML Poisoning
Malicious AJAX code execution
RSS Atom Injection
WSDL scanning and enumeration
Client validation in AJAX routines
Web service routing issues
Parameter manipulation with SOAP
XPATH injection in SOAP message
RIA thick client binary vector
FromTop 10 Web 2.0 Attack Vectors http://www.net-security.org/article.php?id=949&p=4
OWASP 12
The Engineering Of Attack Vectors
Discovery: Identify first order injection user input entry
points and second-order injection( attack resources
directly), fingerprint application server/technology
Probe for Common Vulnerabilities: Scanning tools, manual
attack vectors (e.g. to reflect script, force exception)
Conduct the attacks by exploit vulnerabilities to deliver
attack vectors
Trial and error analysis to break input validation defenses:
 Input=>Output==XSS
 Input=>Query (SQL, LDAP) ==(SQL, LDAP) injection
 Input=>Malicious Code== Code injection
 Input=>XML doc == XML injection
 Input=>OS command==OS command injection
 Input=> Fixed buffer or format string== overflow
OWASP 13
Canonicalization and Encoding
Fact: filtering out bad input is not easy as it sounds (i.e. more
than just ASCII characters)
Canonicalization (c14n): ensuring that all data is represented
in a standard common form (i.e. all ways to encode data)
URL Encoding Attack Examples:
 <and> %3c and %3e (used in XSS)
 : %3a (used in XSS with javascript: )
 ‘ %27, -- %2D%2D, ; %3B (used in SQL injections)
 ../ %2E%2E%2F (used in directory transversal, file upload)
 ` %60 (used in command injections)
 /0 (null) %00 (used in NULL strings)
URL Encoding Tool:
Napkin: http://www.0x90.org/releases/napkin/
OWASP 14
HTML Encoding And XSS
Browsers and servers encoding is carried out automatically
Via browser settings (View Menu Encoding you can set UTF-8,
UNICODE UTF-7, User defined)
Via HTML web pages meta tags you can declare the encoding to be
used: <head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8">
...</head>
By enforcing encoding on web pages you make sure the
browser interprets any special characters as data and markup
and non script to be executed for XSS for example:
< becomes &lt;
 > becomes &gt;
 & becomes &amp;
" becomes &quot
OWASP 15
Double Encoding And Filter Evasion
Problem: Attacker can try three potential encodings
for back-slash character “”
0x5C( ASCII) %5c (UTF-8), %c0%af(UNICODE UTF-7)
Attack vector: http://www.example.com/app
..%c0%af..%c0af../winnt/system32/cmd.exe?/c+dir to
perform a dir command
Solution: patch to filter all encodings (e.g. MS IIS4
and IIS5)
Attacker filter evasion: double encoding
(1) hex encode the “” => %5C
(2) encode the “%” portion = %25
Yields double encoded  as %255c
OWASP 16
Attack Vectors And Filter Evasion: XSS
The application server side validation filters:
http://[server]/[path]/[file].asp?id=70-305zzz
<script>alert();</script>
Attacker Encodes Javascript with addition of a
new STYLE attribute on the element which can
contain a Dynamic Property
Attacker deliver attack vector that Internet
Explorer will execute:
http://[server]/[path]/[file].asp?id=70-
305zzz+"+style="background-position-
x:expression0028006500760061006C00280061
006C00650072007400280027pwn3d00270029
00290029
From XSS-Focused Attack Surface Reduction http://blogs.msdn.com/dross/archive/2008/03/10/xss-focused-attack-surface-reduction.aspx
OWASP 17
Attack Vectors Cheat Sheets: OWASP Cal9000
http://www.digilantesecurity.com/CAL9000/index.html
based on Rober Hansen (Rsnake) http://ha.ckers.org/xss.html
http://www.owasp.org/index.php/Category:OWASP_CAL9000_Project
file:///C:/Citi/OWASP/Encoding/CAL9000/CAL9000/CAL9000.html#top
OWASP 18
SQL Injection Cheat Sheet
http://ha.ckers.org/sqlinjection/
OWASP 19
Input Validation Vulnerabilities: Encoded Attack
Vector Exploit Examples
OWASP 20
How to Find IV Vulnerabilities: Web Application
Security Assessments
Automated
Vulnerability
Scanning
Automated
Static Code
Analysis
Manual
Penetration
Testing
Manual
Code
Review
OWASP 21
How to Find Input Validation Flaws: Application
Threat Modeling
https://www.owasp.org/index.php/Application_Threat_Modeling
OWASP 22
How to Find Input Validation Flaws: Secure
Architecture Reviews
Validation must be performed on every tier and
when crossing trust boundaries
OWASP 23
How to protect web applications from IV attack
vectors
 Web Server Mitigations: Apache Web Server Modules (e.g. mod
rewrite, mod security), SunONE’s NSAPI, Microsoft’s ISAPI
 Source code validators that use regular expressions for input
validation/sanitization and output (HTML, URL) encoding
 J2EE world the struts framework commons validators
 http://www.owasp.org/index.php/Struts
 http://www.owasp.org/index.php/Data_Validation_(Code_Review
 .NET framework validations implementations for XSS:
 http://msdn.microsoft.com/en-us/library/ms998274.aspx
 .NET framework validation strategies for SQL:
 http://msdn.microsoft.com/en-us/library/ms998271.aspx
 Secure APIs Validators/Encoders
 .NET Anti XSS Libraries
 http://msdn.microsoft.com/en-us/security/aa973814.aspx
 OWASP ESAPI, AntiSamy Encoding Libraries
 http://www.owasp.org/index.php/ESAPI
 http://www.owasp.org/index.php/AntiSamy
 http://www.owasp.org/index.php/Category:OWASP_Encoding_Project
OWASP 24
Input Validation Attack Defenses Example In Practice:
Structs Validators, Encoding Rules
OWASP 25
Where to Validate?
http://www.secologic.org/downloads/web/070509_secologic-short-guide-to-input-validation.pdf
OWASP 26
How to validate
Source: Design Guidelines for Secure Web Applications http://msdn.microsoft.com/en-us/library/aa302420.aspx
OWASP 27
Accept known good
This strategy is also known as "whitelist" or "positive"
validation. The idea is that you should check that the
data is one of a set of tightly constrained known good
values. Any data that doesn't match should be rejected.
Data should be:
Strongly typed at all times
Length checked and fields length minimized
Range checked if a numeric
Unsigned unless required to be signed
Syntax or grammar should be checked prior to first use or
inspection
If you expect a postcode, validate for a postcode (type, length
and syntax):
Example: Regex(“^[A-za-z0-9]{16}$”)
OWASP 28
Reject Known Bad
This strategy, also known as "negative" or
"blacklist" validation that is if you don't expect to
see characters such as %3f or JavaScript or similar,
reject strings containing them.
Example:
public String removeJavascript(String
input) { Pattern p =
Pattern.compile("javascript",
CASE_INSENSITIVE); p.matcher(input);
return (!p.matches()) ? input : ''; }
Problem
Maintenance ( up to 90 regular expressions, see the CSS
Cheat Sheet in the Development Guide 2.0)
Subjectible to Filter evasion
OWASP 29
Sanitize
Eliminate or translate characters (such as to
HTML entities or to remove quotes) in an effort
to make the input "safe". Like blacklists, this
approach requires maintenance and is usually
incomplete.
Example:
Remove special characters:
' " ` ; * % _ =&|*?~<>^()[]{}$nr
public String quoteApostrophe(String
input) { if (input != null) return
input.replaceAll("[']", "&rsquo;");
else return null; }
OWASP 30
Include Integrity Checks (Server Side Business
Validations)
What: Ensure that the data has not been tampered with
(e.g. client-server) and is the same as before
Where: Integrity checks must be included wherever data
passes from a trusted to a less trusted boundary
What: The type of integrity control (checksum, HMAC,
encryption, digital signature) should be directly related
to the risk of the data transiting the trust boundary.
Example:
The account select option parameter ("payee_id") is read by the
code, and compared to an already-known list.
 if (account.hasPayee(
session.getParameter("payee_id") )) {
backend.performTransfer(
session.getParameter("payee_id") ); }
OWASP 31
Q U E S T I O N S
A N S W E R S
OWASP 32
Book References
References and Further Reading
OWASP Guide 2.0: A guide to building secure web
applications and web services
OWASP Testing Guide v2
OWASP Code Review vs1.0
Mike Andrews, J. A Whittaker: How to break Web
Software
Mike Shema, Hack Notes; Web Security
Tom Gallagher et al, Microsoft Press, Hunting Security
Bugs
David LeBlanc, Microsoft Press, Writing Secure Code
2nd ed)

Mais conteúdo relacionado

Mais procurados

Beyaz Şapkalı Hacker CEH Eğitimi - Bölüm 10, 11, 12
Beyaz Şapkalı Hacker CEH Eğitimi - Bölüm 10, 11, 12Beyaz Şapkalı Hacker CEH Eğitimi - Bölüm 10, 11, 12
Beyaz Şapkalı Hacker CEH Eğitimi - Bölüm 10, 11, 12BGA Cyber Security
 
Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016bugcrowd
 
WAF ASM / Advance WAF - Brute force lior rotkovitch f5 sirt v5 clean
WAF ASM / Advance WAF - Brute force   lior rotkovitch  f5 sirt v5 cleanWAF ASM / Advance WAF - Brute force   lior rotkovitch  f5 sirt v5 clean
WAF ASM / Advance WAF - Brute force lior rotkovitch f5 sirt v5 cleanLior Rotkovitch
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Codingbilcorry
 
Penetration testing web application web application (in) security
Penetration testing web application web application (in) securityPenetration testing web application web application (in) security
Penetration testing web application web application (in) securityNahidul Kibria
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingAnurag Srivastava
 
A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...Noppadol Songsakaew
 
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016Frans Rosén
 
Web Application Penetration Testing
Web Application Penetration Testing Web Application Penetration Testing
Web Application Penetration Testing Priyanka Aash
 
Recon and Bug Bounties - What a great love story!
Recon and Bug Bounties - What a great love story!Recon and Bug Bounties - What a great love story!
Recon and Bug Bounties - What a great love story!Abhijeth D
 
Introduction to burp suite
Introduction to burp suiteIntroduction to burp suite
Introduction to burp suiteUtkarsh Bhargava
 
Lior rotkovitch ASM WAF unified learning – building policy with asm v12
Lior rotkovitch   ASM WAF  unified learning – building policy with asm v12Lior rotkovitch   ASM WAF  unified learning – building policy with asm v12
Lior rotkovitch ASM WAF unified learning – building policy with asm v12Lior Rotkovitch
 
Cross Site Request Forgery Vulnerabilities
Cross Site Request Forgery VulnerabilitiesCross Site Request Forgery Vulnerabilities
Cross Site Request Forgery VulnerabilitiesMarco Morana
 
Top 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesTop 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesCarol McDonald
 
Attacking thru HTTP Host header
Attacking thru HTTP Host headerAttacking thru HTTP Host header
Attacking thru HTTP Host headerSergey Belov
 
Ossec Lightning
Ossec LightningOssec Lightning
Ossec Lightningwremes
 

Mais procurados (20)

Security testing
Security testingSecurity testing
Security testing
 
Beyaz Şapkalı Hacker CEH Eğitimi - Bölüm 10, 11, 12
Beyaz Şapkalı Hacker CEH Eğitimi - Bölüm 10, 11, 12Beyaz Şapkalı Hacker CEH Eğitimi - Bölüm 10, 11, 12
Beyaz Şapkalı Hacker CEH Eğitimi - Bölüm 10, 11, 12
 
Bug bounty recon.pdf
Bug bounty recon.pdfBug bounty recon.pdf
Bug bounty recon.pdf
 
Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016
 
WAF ASM / Advance WAF - Brute force lior rotkovitch f5 sirt v5 clean
WAF ASM / Advance WAF - Brute force   lior rotkovitch  f5 sirt v5 cleanWAF ASM / Advance WAF - Brute force   lior rotkovitch  f5 sirt v5 clean
WAF ASM / Advance WAF - Brute force lior rotkovitch f5 sirt v5 clean
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Coding
 
Penetration testing web application web application (in) security
Penetration testing web application web application (in) securityPenetration testing web application web application (in) security
Penetration testing web application web application (in) security
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration Testing
 
A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...
 
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
 
Web Application Penetration Testing
Web Application Penetration Testing Web Application Penetration Testing
Web Application Penetration Testing
 
Recon and Bug Bounties - What a great love story!
Recon and Bug Bounties - What a great love story!Recon and Bug Bounties - What a great love story!
Recon and Bug Bounties - What a great love story!
 
Introduction to burp suite
Introduction to burp suiteIntroduction to burp suite
Introduction to burp suite
 
Lior rotkovitch ASM WAF unified learning – building policy with asm v12
Lior rotkovitch   ASM WAF  unified learning – building policy with asm v12Lior rotkovitch   ASM WAF  unified learning – building policy with asm v12
Lior rotkovitch ASM WAF unified learning – building policy with asm v12
 
Cross Site Request Forgery Vulnerabilities
Cross Site Request Forgery VulnerabilitiesCross Site Request Forgery Vulnerabilities
Cross Site Request Forgery Vulnerabilities
 
Api security-testing
Api security-testingApi security-testing
Api security-testing
 
Top 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesTop 10 Web Security Vulnerabilities
Top 10 Web Security Vulnerabilities
 
Attacking thru HTTP Host header
Attacking thru HTTP Host headerAttacking thru HTTP Host header
Attacking thru HTTP Host header
 
Ossec Lightning
Ossec LightningOssec Lightning
Ossec Lightning
 
Web Cache Poisoning
Web Cache PoisoningWeb Cache Poisoning
Web Cache Poisoning
 

Semelhante a Encoded Attacks And Countermeasures

OWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root CausesOWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root CausesMarco Morana
 
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSEWEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSEAjith Kp
 
Attackers Vs Programmers
Attackers Vs ProgrammersAttackers Vs Programmers
Attackers Vs Programmersrobin_bene
 
Prevoty NYC Java SIG 20150730
Prevoty NYC Java SIG 20150730Prevoty NYC Java SIG 20150730
Prevoty NYC Java SIG 20150730chadtindel
 
Penetration Testing Basics
Penetration Testing BasicsPenetration Testing Basics
Penetration Testing BasicsRick Wanner
 
SQL Server Security - Attack
SQL Server Security - Attack SQL Server Security - Attack
SQL Server Security - Attack webhostingguy
 
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSEWEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSEAjith Kp
 
MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter...
MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter...MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter...
MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter...Quek Lilian
 
Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008abhijitapatil
 
Secure SDLC for Software
Secure SDLC for Software Secure SDLC for Software
Secure SDLC for Software Shreeraj Shah
 
XSS: From alert(1) to crypto mining malware
XSS: From alert(1) to crypto mining malwareXSS: From alert(1) to crypto mining malware
XSS: From alert(1) to crypto mining malwareOmer Meshar
 
Java EE Web Security By Example: Frank Kim
Java EE Web Security By Example: Frank KimJava EE Web Security By Example: Frank Kim
Java EE Web Security By Example: Frank Kimjaxconf
 
Altitude SF 2017: Security at the edge
Altitude SF 2017: Security at the edgeAltitude SF 2017: Security at the edge
Altitude SF 2017: Security at the edgeFastly
 

Semelhante a Encoded Attacks And Countermeasures (20)

OWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root CausesOWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root Causes
 
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSEWEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
 
Attackers Vs Programmers
Attackers Vs ProgrammersAttackers Vs Programmers
Attackers Vs Programmers
 
WebApps_Lecture_15.ppt
WebApps_Lecture_15.pptWebApps_Lecture_15.ppt
WebApps_Lecture_15.ppt
 
ieee
ieeeieee
ieee
 
Prevoty NYC Java SIG 20150730
Prevoty NYC Java SIG 20150730Prevoty NYC Java SIG 20150730
Prevoty NYC Java SIG 20150730
 
Commix
Commix Commix
Commix
 
Penetration Testing Basics
Penetration Testing BasicsPenetration Testing Basics
Penetration Testing Basics
 
SQL Server Security - Attack
SQL Server Security - Attack SQL Server Security - Attack
SQL Server Security - Attack
 
Web Security
Web SecurityWeb Security
Web Security
 
Real web-attack-scenario
Real web-attack-scenarioReal web-attack-scenario
Real web-attack-scenario
 
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSEWEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
 
Sembang2 Keselamatan It 2004
Sembang2 Keselamatan It 2004Sembang2 Keselamatan It 2004
Sembang2 Keselamatan It 2004
 
MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter...
MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter...MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter...
MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter...
 
Attques web
Attques webAttques web
Attques web
 
Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008
 
Secure SDLC for Software
Secure SDLC for Software Secure SDLC for Software
Secure SDLC for Software
 
XSS: From alert(1) to crypto mining malware
XSS: From alert(1) to crypto mining malwareXSS: From alert(1) to crypto mining malware
XSS: From alert(1) to crypto mining malware
 
Java EE Web Security By Example: Frank Kim
Java EE Web Security By Example: Frank KimJava EE Web Security By Example: Frank Kim
Java EE Web Security By Example: Frank Kim
 
Altitude SF 2017: Security at the edge
Altitude SF 2017: Security at the edgeAltitude SF 2017: Security at the edge
Altitude SF 2017: Security at the edge
 

Mais de Marco Morana

Is talent shortage ws marco morana
Is talent shortage ws marco moranaIs talent shortage ws marco morana
Is talent shortage ws marco moranaMarco Morana
 
Isaca conference threat_modeling_marco_morana_short.pdf
Isaca conference threat_modeling_marco_morana_short.pdfIsaca conference threat_modeling_marco_morana_short.pdf
Isaca conference threat_modeling_marco_morana_short.pdfMarco Morana
 
Owasp atlanta-ciso-guidevs1
Owasp atlanta-ciso-guidevs1Owasp atlanta-ciso-guidevs1
Owasp atlanta-ciso-guidevs1Marco Morana
 
Owasp e crime-london-2012-final
Owasp e crime-london-2012-finalOwasp e crime-london-2012-final
Owasp e crime-london-2012-finalMarco Morana
 
Security And Privacy Cagliari 2012
Security And Privacy Cagliari 2012Security And Privacy Cagliari 2012
Security And Privacy Cagliari 2012Marco Morana
 
Presentation sso design_security
Presentation sso design_securityPresentation sso design_security
Presentation sso design_securityMarco Morana
 
Owasp security summit_2012_milanovs_final
Owasp security summit_2012_milanovs_finalOwasp security summit_2012_milanovs_final
Owasp security summit_2012_milanovs_finalMarco Morana
 
Security Summit Rome 2011
Security Summit Rome 2011Security Summit Rome 2011
Security Summit Rome 2011Marco Morana
 
Risk Analysis Of Banking Malware Attacks
Risk Analysis Of Banking Malware AttacksRisk Analysis Of Banking Malware Attacks
Risk Analysis Of Banking Malware AttacksMarco Morana
 
Web 2.0 threats, vulnerability analysis,secure web 2.0 application developmen...
Web 2.0 threats, vulnerability analysis,secure web 2.0 application developmen...Web 2.0 threats, vulnerability analysis,secure web 2.0 application developmen...
Web 2.0 threats, vulnerability analysis,secure web 2.0 application developmen...Marco Morana
 
Security Exploit of Business Logic Flaws, Business Logic Attacks
Security Exploit of Business Logic Flaws, Business Logic AttacksSecurity Exploit of Business Logic Flaws, Business Logic Attacks
Security Exploit of Business Logic Flaws, Business Logic AttacksMarco Morana
 
Software Security Initiatives
Software Security InitiativesSoftware Security Initiatives
Software Security InitiativesMarco Morana
 
Business cases for software security
Business cases for software securityBusiness cases for software security
Business cases for software securityMarco Morana
 
Security Compliance Web Application Risk Management
Security Compliance Web Application Risk ManagementSecurity Compliance Web Application Risk Management
Security Compliance Web Application Risk ManagementMarco Morana
 
Web Application Security Testing
Web Application Security TestingWeb Application Security Testing
Web Application Security TestingMarco Morana
 
Owasp Forum Web Services Security
Owasp Forum Web Services SecurityOwasp Forum Web Services Security
Owasp Forum Web Services SecurityMarco Morana
 
Owasp Top 10 And Security Flaw Root Causes
Owasp Top 10 And Security Flaw Root CausesOwasp Top 10 And Security Flaw Root Causes
Owasp Top 10 And Security Flaw Root CausesMarco Morana
 
Software Security Frameworks
Software Security FrameworksSoftware Security Frameworks
Software Security FrameworksMarco Morana
 
Software Open Source, Proprierio, Interoperabilita'
Software Open Source, Proprierio, Interoperabilita'Software Open Source, Proprierio, Interoperabilita'
Software Open Source, Proprierio, Interoperabilita'Marco Morana
 
Progetti Open Source Per La Sicurezza Delle Web Applications
Progetti Open Source Per La Sicurezza Delle Web ApplicationsProgetti Open Source Per La Sicurezza Delle Web Applications
Progetti Open Source Per La Sicurezza Delle Web ApplicationsMarco Morana
 

Mais de Marco Morana (20)

Is talent shortage ws marco morana
Is talent shortage ws marco moranaIs talent shortage ws marco morana
Is talent shortage ws marco morana
 
Isaca conference threat_modeling_marco_morana_short.pdf
Isaca conference threat_modeling_marco_morana_short.pdfIsaca conference threat_modeling_marco_morana_short.pdf
Isaca conference threat_modeling_marco_morana_short.pdf
 
Owasp atlanta-ciso-guidevs1
Owasp atlanta-ciso-guidevs1Owasp atlanta-ciso-guidevs1
Owasp atlanta-ciso-guidevs1
 
Owasp e crime-london-2012-final
Owasp e crime-london-2012-finalOwasp e crime-london-2012-final
Owasp e crime-london-2012-final
 
Security And Privacy Cagliari 2012
Security And Privacy Cagliari 2012Security And Privacy Cagliari 2012
Security And Privacy Cagliari 2012
 
Presentation sso design_security
Presentation sso design_securityPresentation sso design_security
Presentation sso design_security
 
Owasp security summit_2012_milanovs_final
Owasp security summit_2012_milanovs_finalOwasp security summit_2012_milanovs_final
Owasp security summit_2012_milanovs_final
 
Security Summit Rome 2011
Security Summit Rome 2011Security Summit Rome 2011
Security Summit Rome 2011
 
Risk Analysis Of Banking Malware Attacks
Risk Analysis Of Banking Malware AttacksRisk Analysis Of Banking Malware Attacks
Risk Analysis Of Banking Malware Attacks
 
Web 2.0 threats, vulnerability analysis,secure web 2.0 application developmen...
Web 2.0 threats, vulnerability analysis,secure web 2.0 application developmen...Web 2.0 threats, vulnerability analysis,secure web 2.0 application developmen...
Web 2.0 threats, vulnerability analysis,secure web 2.0 application developmen...
 
Security Exploit of Business Logic Flaws, Business Logic Attacks
Security Exploit of Business Logic Flaws, Business Logic AttacksSecurity Exploit of Business Logic Flaws, Business Logic Attacks
Security Exploit of Business Logic Flaws, Business Logic Attacks
 
Software Security Initiatives
Software Security InitiativesSoftware Security Initiatives
Software Security Initiatives
 
Business cases for software security
Business cases for software securityBusiness cases for software security
Business cases for software security
 
Security Compliance Web Application Risk Management
Security Compliance Web Application Risk ManagementSecurity Compliance Web Application Risk Management
Security Compliance Web Application Risk Management
 
Web Application Security Testing
Web Application Security TestingWeb Application Security Testing
Web Application Security Testing
 
Owasp Forum Web Services Security
Owasp Forum Web Services SecurityOwasp Forum Web Services Security
Owasp Forum Web Services Security
 
Owasp Top 10 And Security Flaw Root Causes
Owasp Top 10 And Security Flaw Root CausesOwasp Top 10 And Security Flaw Root Causes
Owasp Top 10 And Security Flaw Root Causes
 
Software Security Frameworks
Software Security FrameworksSoftware Security Frameworks
Software Security Frameworks
 
Software Open Source, Proprierio, Interoperabilita'
Software Open Source, Proprierio, Interoperabilita'Software Open Source, Proprierio, Interoperabilita'
Software Open Source, Proprierio, Interoperabilita'
 
Progetti Open Source Per La Sicurezza Delle Web Applications
Progetti Open Source Per La Sicurezza Delle Web ApplicationsProgetti Open Source Per La Sicurezza Delle Web Applications
Progetti Open Source Per La Sicurezza Delle Web Applications
 

Último

DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
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
 
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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 

Último (20)

DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
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
 
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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 

Encoded Attacks And Countermeasures

  • 1. Copyright 2008 © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP Foundation OWASP http://www.owasp.org Input Validation Vulnerabilities, Encoded Attack Vectors and Mitigations Marco Morana & Scott Nusbaum Cincinnati Chapter
  • 2. OWASP 2 Agenda 1. Input Validation Attacks: Cause, Exploits, Threats 2. Attack Vectors: Definitions, Elements, Types (traditional old and new Web 2.0) 3. Engineering Attack Vectors: Canonical Representation, Encoding, Double Encoding and Filter Evasions 4. Cheat Sheets: XSS, SQL Injection 5. Input Validation Attacks: Encoded Exploit Examples 6. How to find IV vulnerabilities: Web application security Assessments 7. How to protect from IV attack vectors 8. Input Validation Attack Defenses In Practice: Structs Validators, Encoding Rules 9. Input Validation Attack Vectors: Mitigation Strategies 10. Q&A
  • 3. OWASP 3 Input Validation Attacks: Cause, Exploits, Threats Cause: Failure to properly validate data at the entry and exit points of the application Exploit: Injection of malicious input such as scripts, commands, code that can be interpreted by different targets: Browser: XSS, XFS, HTML-Splitting Data repositories: SQL Injection, LDAP injection Server side file processing: XML, XPATH Application/Server/O.S. :File uploads, Buffer Overflow Threats: Phishing, Information Disclosure (e.g. PII), Data Alteration/Destruction, Denial/Degradation Of service, Financial Loss/Fraud, Reputation Loss
  • 4. OWASP 4 Code Injection Attack Example From: www.technicalinfo.net/papers/Phishing.html
  • 5. OWASP 5 SQL Injection Attack Example 3 Attacker Enters Malicious Inputs such as: http://www.bank.com/index.php?id= 1 UNION ALL SELECT creditCardNumber,1,1, FROM CreditCardTable Attacker enters SQL fragments into a web page that uses input in a query 1 Attacker obtain other customers credit card numbers Custom Code Accounts Finance Administration Transactions Communication Knowledge Mgmt E-Commerce Bus.Functions Database 2 Application sends modified query to database such as SELECT Name, Phone, Address FROM Users WHERE Id=1 UNION ALL SELECT creditCardNumber 1,1 FROM CreditCardTable, which executes it From OWASP Testing Guide 2.0 UNION QUERY SQL Injection: http://www.owasp.org/index.php/Testing_for_SQL_Injection
  • 6. OWASP 6 Malicious File Upload Vulnerability Example 1) Malicious user passes the following information in the cmd parameter: cmd=%3B+mkdir+hackerDirectory 2) The parameter from the request is used for command line process String fromRequest = request.getParameter("cmd"); Process process = runtime.exec("cmd.exe /C" + fromRequest); 3) Final command executed is: cmd.exe /C “dir; mkdir hackerDirectory”
  • 7. OWASP 7 Client Side Validation Flaws Example http://www.coolcart.com/jewelrystore.html The price charged for the “Two Stone Feather Ring” is now 99 cents
  • 8. OWASP 8 Attack Vectors Definitions An attack vector is a path or means by which a hacker can gain access to a computer or network server in order to deliver a payload or malicious outcome Attack vectors are routes or methods used to get into computer systems, usually for nefarious purposes. They take advantage of known weak spots to gain entry. Many attack vectors take advantage of the human element in the system, because that's often the weakest link. From SecuritySearch.com Definitions :http://searchsecurity.techtarget.com/dictionary/definition/1005812/attack-vector.html
  • 9. OWASP 9 Understanding Attack Vectors Don't confuse attack vectors with payload Attack vectors: malicious email, attachments, worms, web pages, downloads, deception (aka social engineering), hackers Payloads: viruses, spyware, trojans, malicious scripting/executables Example: The attack vector with a payload consisting in a script to capture sensitive information (e.g. cookie stored on the browser) in an alert http://server/cgi- bin/testcgi.exe?<SCRIPT>alert(“Cookie”+document.cookie)</SC RIPT>
  • 10. OWASP 10 Traditional Vector Based Attack Types Buffer overflows attacks Code injection attack: also known as "code poisoning attack“ examples: Cookie poisoning attack HTML injection, such as HTML injection in IE7 via infected DLL Include file injection attack Server side PHP, ASP injection attacks Schema poisoning attack Script injection (e.g., cross-site scripting) attack Shell injection attack SQL injection attack (also known as SQL code poisoning) XML poisoning attack From: ITtoolbox Wiki http://it.toolbox.com/wiki/index.php/Attack_vector
  • 11. OWASP 11 New Web 2.0 Attack Vectors Cross-site scripting in AJAX XML Poisoning Malicious AJAX code execution RSS Atom Injection WSDL scanning and enumeration Client validation in AJAX routines Web service routing issues Parameter manipulation with SOAP XPATH injection in SOAP message RIA thick client binary vector FromTop 10 Web 2.0 Attack Vectors http://www.net-security.org/article.php?id=949&p=4
  • 12. OWASP 12 The Engineering Of Attack Vectors Discovery: Identify first order injection user input entry points and second-order injection( attack resources directly), fingerprint application server/technology Probe for Common Vulnerabilities: Scanning tools, manual attack vectors (e.g. to reflect script, force exception) Conduct the attacks by exploit vulnerabilities to deliver attack vectors Trial and error analysis to break input validation defenses:  Input=>Output==XSS  Input=>Query (SQL, LDAP) ==(SQL, LDAP) injection  Input=>Malicious Code== Code injection  Input=>XML doc == XML injection  Input=>OS command==OS command injection  Input=> Fixed buffer or format string== overflow
  • 13. OWASP 13 Canonicalization and Encoding Fact: filtering out bad input is not easy as it sounds (i.e. more than just ASCII characters) Canonicalization (c14n): ensuring that all data is represented in a standard common form (i.e. all ways to encode data) URL Encoding Attack Examples:  <and> %3c and %3e (used in XSS)  : %3a (used in XSS with javascript: )  ‘ %27, -- %2D%2D, ; %3B (used in SQL injections)  ../ %2E%2E%2F (used in directory transversal, file upload)  ` %60 (used in command injections)  /0 (null) %00 (used in NULL strings) URL Encoding Tool: Napkin: http://www.0x90.org/releases/napkin/
  • 14. OWASP 14 HTML Encoding And XSS Browsers and servers encoding is carried out automatically Via browser settings (View Menu Encoding you can set UTF-8, UNICODE UTF-7, User defined) Via HTML web pages meta tags you can declare the encoding to be used: <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ...</head> By enforcing encoding on web pages you make sure the browser interprets any special characters as data and markup and non script to be executed for XSS for example: < becomes &lt;  > becomes &gt;  & becomes &amp; " becomes &quot
  • 15. OWASP 15 Double Encoding And Filter Evasion Problem: Attacker can try three potential encodings for back-slash character “” 0x5C( ASCII) %5c (UTF-8), %c0%af(UNICODE UTF-7) Attack vector: http://www.example.com/app ..%c0%af..%c0af../winnt/system32/cmd.exe?/c+dir to perform a dir command Solution: patch to filter all encodings (e.g. MS IIS4 and IIS5) Attacker filter evasion: double encoding (1) hex encode the “” => %5C (2) encode the “%” portion = %25 Yields double encoded as %255c
  • 16. OWASP 16 Attack Vectors And Filter Evasion: XSS The application server side validation filters: http://[server]/[path]/[file].asp?id=70-305zzz <script>alert();</script> Attacker Encodes Javascript with addition of a new STYLE attribute on the element which can contain a Dynamic Property Attacker deliver attack vector that Internet Explorer will execute: http://[server]/[path]/[file].asp?id=70- 305zzz+"+style="background-position- x:expression0028006500760061006C00280061 006C00650072007400280027pwn3d00270029 00290029 From XSS-Focused Attack Surface Reduction http://blogs.msdn.com/dross/archive/2008/03/10/xss-focused-attack-surface-reduction.aspx
  • 17. OWASP 17 Attack Vectors Cheat Sheets: OWASP Cal9000 http://www.digilantesecurity.com/CAL9000/index.html based on Rober Hansen (Rsnake) http://ha.ckers.org/xss.html http://www.owasp.org/index.php/Category:OWASP_CAL9000_Project file:///C:/Citi/OWASP/Encoding/CAL9000/CAL9000/CAL9000.html#top
  • 18. OWASP 18 SQL Injection Cheat Sheet http://ha.ckers.org/sqlinjection/
  • 19. OWASP 19 Input Validation Vulnerabilities: Encoded Attack Vector Exploit Examples
  • 20. OWASP 20 How to Find IV Vulnerabilities: Web Application Security Assessments Automated Vulnerability Scanning Automated Static Code Analysis Manual Penetration Testing Manual Code Review
  • 21. OWASP 21 How to Find Input Validation Flaws: Application Threat Modeling https://www.owasp.org/index.php/Application_Threat_Modeling
  • 22. OWASP 22 How to Find Input Validation Flaws: Secure Architecture Reviews Validation must be performed on every tier and when crossing trust boundaries
  • 23. OWASP 23 How to protect web applications from IV attack vectors  Web Server Mitigations: Apache Web Server Modules (e.g. mod rewrite, mod security), SunONE’s NSAPI, Microsoft’s ISAPI  Source code validators that use regular expressions for input validation/sanitization and output (HTML, URL) encoding  J2EE world the struts framework commons validators  http://www.owasp.org/index.php/Struts  http://www.owasp.org/index.php/Data_Validation_(Code_Review  .NET framework validations implementations for XSS:  http://msdn.microsoft.com/en-us/library/ms998274.aspx  .NET framework validation strategies for SQL:  http://msdn.microsoft.com/en-us/library/ms998271.aspx  Secure APIs Validators/Encoders  .NET Anti XSS Libraries  http://msdn.microsoft.com/en-us/security/aa973814.aspx  OWASP ESAPI, AntiSamy Encoding Libraries  http://www.owasp.org/index.php/ESAPI  http://www.owasp.org/index.php/AntiSamy  http://www.owasp.org/index.php/Category:OWASP_Encoding_Project
  • 24. OWASP 24 Input Validation Attack Defenses Example In Practice: Structs Validators, Encoding Rules
  • 25. OWASP 25 Where to Validate? http://www.secologic.org/downloads/web/070509_secologic-short-guide-to-input-validation.pdf
  • 26. OWASP 26 How to validate Source: Design Guidelines for Secure Web Applications http://msdn.microsoft.com/en-us/library/aa302420.aspx
  • 27. OWASP 27 Accept known good This strategy is also known as "whitelist" or "positive" validation. The idea is that you should check that the data is one of a set of tightly constrained known good values. Any data that doesn't match should be rejected. Data should be: Strongly typed at all times Length checked and fields length minimized Range checked if a numeric Unsigned unless required to be signed Syntax or grammar should be checked prior to first use or inspection If you expect a postcode, validate for a postcode (type, length and syntax): Example: Regex(“^[A-za-z0-9]{16}$”)
  • 28. OWASP 28 Reject Known Bad This strategy, also known as "negative" or "blacklist" validation that is if you don't expect to see characters such as %3f or JavaScript or similar, reject strings containing them. Example: public String removeJavascript(String input) { Pattern p = Pattern.compile("javascript", CASE_INSENSITIVE); p.matcher(input); return (!p.matches()) ? input : ''; } Problem Maintenance ( up to 90 regular expressions, see the CSS Cheat Sheet in the Development Guide 2.0) Subjectible to Filter evasion
  • 29. OWASP 29 Sanitize Eliminate or translate characters (such as to HTML entities or to remove quotes) in an effort to make the input "safe". Like blacklists, this approach requires maintenance and is usually incomplete. Example: Remove special characters: ' " ` ; * % _ =&|*?~<>^()[]{}$nr public String quoteApostrophe(String input) { if (input != null) return input.replaceAll("[']", "&rsquo;"); else return null; }
  • 30. OWASP 30 Include Integrity Checks (Server Side Business Validations) What: Ensure that the data has not been tampered with (e.g. client-server) and is the same as before Where: Integrity checks must be included wherever data passes from a trusted to a less trusted boundary What: The type of integrity control (checksum, HMAC, encryption, digital signature) should be directly related to the risk of the data transiting the trust boundary. Example: The account select option parameter ("payee_id") is read by the code, and compared to an already-known list.  if (account.hasPayee( session.getParameter("payee_id") )) { backend.performTransfer( session.getParameter("payee_id") ); }
  • 31. OWASP 31 Q U E S T I O N S A N S W E R S
  • 32. OWASP 32 Book References References and Further Reading OWASP Guide 2.0: A guide to building secure web applications and web services OWASP Testing Guide v2 OWASP Code Review vs1.0 Mike Andrews, J. A Whittaker: How to break Web Software Mike Shema, Hack Notes; Web Security Tom Gallagher et al, Microsoft Press, Hunting Security Bugs David LeBlanc, Microsoft Press, Writing Secure Code 2nd ed)