SlideShare una empresa de Scribd logo
1 de 10
Descargar para leer sin conexión
*Introduction...........................................................................................................................................
*Cross Site Scripting Attacks.................................................................................................................
*Prevention............................................................................................................................................
*Conclusion............................................................................................................................................
Name: Daisuke Dan
Website:TheHackersBay.org
Twitter: @TheHackersBay
XSS stands for Cross-Site-Scripting. It is basically an attack, that is used to execute HTML and
Javascript on the web-page. This attack can be done by submitting queries into text-boxes, or even
into the URL. The results come back reading the text as HTML, so it executes the scripts instead of
displaying them in plain text.
Many people treat an XSS vulnerability as a low to medium risk vulnerability, when in reality it is a
damaging attack that can lead to your users (and you) being compromised.
XSS attacks are becoming a big problem and are going to become an extremely big problem if
people do not educate them selves about XSS attacks and vulnerabilities, XSS vulnerabilities have
been found in all sorts of websites including fbi.gov, yahoo.com, ebay.com and many other popular
and important websites, a lot of administrators fail to pay attention to XSS attacks because they
either don't know much about them or they do not see them as a threat, an XSS vulnerability when
exploited by a skilled attacker or even a novice can be a very powerful attack. This paper details
XSS attacks and hopes to educate you on what they are, how attackers use them and of course
how you can prevent them from happening.
Overview:
Cross-site scripting (XSS) is a type of vulnerability commonly found in web applications. This
vulnerability makes it possible for attackers to inject malicious code (e.g. JavaScript programs) into
victim’s web browser. Using this malicious code, the attackers can steal the victim’s credentials,
such as cookies. The access control policies (i.e., the same origin policy) employed by the browser
to protect those credentials can be bypassed by exploiting the XSS vulnerability. Vulnerabilities of
this kind can potentially lead to large-scale attacks.
- HTML
HTML is sort of like a programming language. The distinctions between a programming language,
and HTML, are not too far apart. They are both languages, that are used to create attributes, and
events. HTML is a markup language, which is used mostly to create websites. HTML stands for
Hyper-Text Markup Language. You can use HTML to create forms, buttons, and other stuff that can
be used in a webpage. I highly doubt you will ever encounter a website that does not contain even a
slight amount of HTML.
- JavaScript
Now, first, let's get one thing straight. There is a HUGE difference between JAVA and JAVASCRIPT.
Java, is a language that ressembles to C++, it can be used in games, and applications. Javascript is
sort of similar to HTML, but definitely different in many ways. Javascript isn't used NEARLY as much
in Webpages than HTML is. Javascript is used, more in applications outside of webpages. Like
PDFs. Javascript can be an incredibly useful language along with HTML. They are both fairly simple
to learn, and are very dynamic.
The Cross Site scripting is one of the problem that has plagued a lot of websites. As a web
developer, it is important to understand what is cross site scripting and how can we safeguard our
site from such attacks.
Now the question would be how can a person inject scripts on a running page. This can easily be
done using all the various ways a website is collecting inputs. Cross site scripting can be performed
by passing scripts in form of:
*TextBox
*Cookies
*Query Strings
*Web application variables
*Session variables
What can you do with Xss Attacks?
*Attackers inject JavaScript, ActiveX, or HTML, into a vulnerable application, exploiting XSS holes.
*The browser processes the injected code as if it were legitimate content of the web page - with the
corresponding security permissions.
*Many attack could exploit flaws or vulnerabilities due to bad programming.
*Pillage of settings and user sensitive information.
Possible Attacks?
*Phishing: Criminal fraudulent process of attempting to acquire sensitive information such as
usernames, passwords and credit card details, by masque rading as a trustworthy entity in an
electronic communication or as a business or individual.
*Cookie Stealing: Cookie is used to manage sessions in browsers. Each person logged in gets a
unique cookie, it is like a key to the site.
*Account hijacking: Term used when malware infiltrates a system without the consent and performs
tasks set by its creator in addition to (or instead of) the system's normal duties.
*Changing of user settings: A scammer could take information about web sites administrator in order
to access to sensitive data or modifying user settings.
Basic types of XSS Attacks?
STORED XSS:
In the “STORED XSS” (persistent XSS),an attacker can inject the malicious code into the page
persistently and that means the code will be STORED in the server. And this code will be STORED
in the page which will show to the visitors later on. If the visitor goes to the page which is embedded
with XSS attacking code, the code will execute on the visitor‟s computer. Hackers usually post
these codes into the article in the forum or blog in order to let other users to read in the future and
attack more them.
Compared with “REFLECTED XSS”, this type of XSS does more serious harm. If the “STORED
XSS” vulnerability is successfully exploited by hackers, it will persistently attack the users until
administrator remove this vulnerability.
Example of Stored XSS: guestbook.php
Then page guestbook.php lists all entries returned by the previous function, without sanitizing the
content of the comments. It is only applied to the names (see function h() in the next section):
[---------------------------------------CODE---------------------------------------]
<?php
if ($guestbook)
{
foreach ($guestbook as $guest)
{
?>
<p class="comment"><?= $guest[" XSS SCRIPT "] ?></p>
<p> - by <?=h( $guest["name"] ) ?> </p>
<?php
} ?>
[---------------------------------------END CODE---------------------------------------]
REFLECTED XSS:
The “REFLECTED XSS” (non-persistent) is a temporary attack. Because the code cannot be
injected into the server, it just lets the server use the injected malicious code to immediately
generate a page and then, send this temporary page‟s URL to anyone that the attacker wants to
attack. If the user clicks this URL, the malicious code in this temporary page will execute. Because
this attack is based on user‟s trigging, this type of vulnerability was called REFLECTED XSS. There
fore, it is more difficult to be used unless the hacker can work hard on the URL and convince the
user to trigger the dangerous URL. So the hacker finds few methods to make the URL look like a
trusted Website‟s URL. First of all, hackers can encode the URL into Hex value or other type of
code in order that the URL looks more true and reliable. Therefore, the userthinks that there is no
virus command inside and clicks that. Google is a famous and reliable website. If Google has the
REFLECTED XSS, the hacker can inject malicious code into the URL and encode the URL. There
are many tools on the Internet which can provide the service of encoding the code from ASCII to
decimal ASCII, hexadecimal or other types. After finishing encoding the URL, the hacker will send
this URL to trick the user into clicking and also using some tricks which can attract the user to click.
In addition, later on, this thesis will give details of URL Encoding.
Example:
http://exploitsdownload.com/search?q="'">'">'"><script>alert('Daisuke_Dan')</script>
DOM-Based XSS:
The DOM-based XSS attack is another type of XSS vulnerability which is commonly used by
hackers as well. What is DOM-based XSS? First of all, we need to know what DOM is. DOM is
short for Document Object Model and it is a platform and language - neutral interface which is using
scripting or program to modify the content, update the date, structure and style of documents. It is
widely used in HTML and XML in Web 2.0. DOM in HTML can generate a tree - structure of HTML
documents. However, DOM allows the scripting or program to change the HTML or XML document,
the HTML or XML document can be modified by a hackers scripting or program. DOM-based XSS
uses DOM's vulnerability to make the XSS come true. This type of XSS vulnerability is totally
different from the REFLECTED or STORED XSS attack and it does not inject malicious code into a
page. So, it is the problem of the insecure DOM object which can be controlled by the client side in
the web page or application. For this reason, hackers can let the attack payload execute in the
DOM environment to attack the Victim side.
The following snippets of HTML demonstrate how to safely render untrusted data in a variety of
different contexts.
Safe HTML Attributes include: align, alink, alt, bgcolor, border, cellpadding, cellspacing, class, color,
cols, colspan, coords, dir, face, height, hspace, ismap, lang, marginheight, marginwidth, multiple,
nohref, noresize, noshade, nowrap, ref, rel, rev, rows, rowspan, scrolling, shape, span, summary,
tabindex, title, usemap, valign, value, vlink, vspace, width.
Sanitize the input, all user submitted input anywhere in an application must be treated as hostile
and filtered. This should be done by the application code, but can also be performed by a web
application firewall (WAF) such as mod_security. The most effective way to prevent this is to do
both, use well coded applications and have a WAF or filtering as a second line of defense.
A common initial preventative to viral infection is a network level firewall. As HTTP/HTTPS protocols
are afforded unfettered access through common firewall configurations, these firewall barriers are
ineffectual. A potential remedy to this is an application firewall with the appropriate XSS virus
signatures. Whilst unlikely, the most obvious way to prevent XSS viruses is to remove XSS
vulnerabilities from web applications.
Conclusion?
Cross-site scripting (XSS) is one of the most frequent vulnerabilities found in modern web
applications. Never-theless, many service providers are either not willing or not able to provide
sufficient protection to their users. This paper proposes a novel, client-side solution to this problem.
By modifying the popular Firefox web browser, we are able to dynamically track the flow of sensitive
values (e.g., user cookies) on the client side. Whenever such a sensitive value is aboutto be
transferredto a third party(i.e., the adversary), the user is given the possibility to stop the
connection. To censure protection against more subtle types of XSS attacks that try to leak
information through non-dynamic control dependencies,we additionallyemploy an auxiliary, efficient
static analysis, where necessary. With this combination of dynamic and static techniques, we are
able to protect the user against XSS attacks in a reliable and efficient way. To validate our concepts,
we automatically tested the enhanced browser on more than one million web pages by means of a
crawler that is capable of interpreting JavaScript code. The results of this large-scale evaluation
demonstrate that only a small number of false positives is generated, and that our underlying
concepts are feasible in practice.

Más contenido relacionado

La actualidad más candente

Cross site scripting
Cross site scriptingCross site scripting
Cross site scriptingkinish kumar
 
Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Nabin Dutta
 
Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar
Cross site scripting (xss) attacks issues and defense - by sandeep kumbharCross site scripting (xss) attacks issues and defense - by sandeep kumbhar
Cross site scripting (xss) attacks issues and defense - by sandeep kumbharSandeep Kumbhar
 
Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)Daniel Tumser
 
XSS- an application security vulnerability
XSS-   an application security vulnerabilityXSS-   an application security vulnerability
XSS- an application security vulnerabilitySoumyasanto Sen
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)Ritesh Gupta
 
Cross Site Scripting: Prevention and Detection(XSS)
Cross Site Scripting: Prevention and Detection(XSS)Cross Site Scripting: Prevention and Detection(XSS)
Cross Site Scripting: Prevention and Detection(XSS)Aman Singh
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)Manish Kumar
 
XSS - Do you know EVERYTHING?
XSS - Do you know EVERYTHING?XSS - Do you know EVERYTHING?
XSS - Do you know EVERYTHING?Yurii Bilyk
 
A8 cross site request forgery (csrf) it 6873 presentation
A8 cross site request forgery (csrf)   it 6873 presentationA8 cross site request forgery (csrf)   it 6873 presentation
A8 cross site request forgery (csrf) it 6873 presentationAlbena Asenova-Belal
 
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
 
Cross Site Request Forgery
Cross Site Request ForgeryCross Site Request Forgery
Cross Site Request ForgeryTony Bibbs
 
The OWASP Zed Attack Proxy
The OWASP Zed Attack ProxyThe OWASP Zed Attack Proxy
The OWASP Zed Attack ProxyAditya Gupta
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Amit Tyagi
 

La actualidad más candente (20)

Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 
Xss attack
Xss attackXss attack
Xss attack
 
Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Cross Site Scripting(XSS)
Cross Site Scripting(XSS)
 
Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar
Cross site scripting (xss) attacks issues and defense - by sandeep kumbharCross site scripting (xss) attacks issues and defense - by sandeep kumbhar
Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar
 
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- an application security vulnerability
XSS-   an application security vulnerabilityXSS-   an application security vulnerability
XSS- an application security vulnerability
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)
 
Cross Site Scripting: Prevention and Detection(XSS)
Cross Site Scripting: Prevention and Detection(XSS)Cross Site Scripting: Prevention and Detection(XSS)
Cross Site Scripting: Prevention and Detection(XSS)
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)
 
XSS - Do you know EVERYTHING?
XSS - Do you know EVERYTHING?XSS - Do you know EVERYTHING?
XSS - Do you know EVERYTHING?
 
A8 cross site request forgery (csrf) it 6873 presentation
A8 cross site request forgery (csrf)   it 6873 presentationA8 cross site request forgery (csrf)   it 6873 presentation
A8 cross site request forgery (csrf) it 6873 presentation
 
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
 
Cross Site Request Forgery
Cross Site Request ForgeryCross Site Request Forgery
Cross Site Request Forgery
 
Deep dive into ssrf
Deep dive into ssrfDeep dive into ssrf
Deep dive into ssrf
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 
The OWASP Zed Attack Proxy
The OWASP Zed Attack ProxyThe OWASP Zed Attack Proxy
The OWASP Zed Attack Proxy
 
How to identify and prevent SQL injection
How to identify and prevent SQL injection  How to identify and prevent SQL injection
How to identify and prevent SQL injection
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)
 
SSRF exploit the trust relationship
SSRF exploit the trust relationshipSSRF exploit the trust relationship
SSRF exploit the trust relationship
 

Destacado

Tracing out Cross Site Scripting Vulnerabilities in Modern Scripts
Tracing out Cross Site Scripting Vulnerabilities in Modern ScriptsTracing out Cross Site Scripting Vulnerabilities in Modern Scripts
Tracing out Cross Site Scripting Vulnerabilities in Modern ScriptsEswar Publications
 
How to think like a startup
How to think like a startupHow to think like a startup
How to think like a startupLoic Le Meur
 
Teaching Students with Emojis, Emoticons, & Textspeak
Teaching Students with Emojis, Emoticons, & TextspeakTeaching Students with Emojis, Emoticons, & Textspeak
Teaching Students with Emojis, Emoticons, & TextspeakShelly Sanchez Terrell
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerLuminary Labs
 

Destacado (6)

Tracing out Cross Site Scripting Vulnerabilities in Modern Scripts
Tracing out Cross Site Scripting Vulnerabilities in Modern ScriptsTracing out Cross Site Scripting Vulnerabilities in Modern Scripts
Tracing out Cross Site Scripting Vulnerabilities in Modern Scripts
 
Cross site scripting XSS
Cross site scripting XSSCross site scripting XSS
Cross site scripting XSS
 
Inaugural Addresses
Inaugural AddressesInaugural Addresses
Inaugural Addresses
 
How to think like a startup
How to think like a startupHow to think like a startup
How to think like a startup
 
Teaching Students with Emojis, Emoticons, & Textspeak
Teaching Students with Emojis, Emoticons, & TextspeakTeaching Students with Emojis, Emoticons, & Textspeak
Teaching Students with Emojis, Emoticons, & Textspeak
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 

Similar a The Cross Site Scripting Guide

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
 
xss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdfxss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdfyashvirsingh48
 
Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )Irfad Imtiaz
 
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...IRJET Journal
 
Xss 101 by-sai-shanthan
Xss 101 by-sai-shanthanXss 101 by-sai-shanthan
Xss 101 by-sai-shanthanRaghunath G
 
Understanding dom based xss
Understanding dom based xssUnderstanding dom based xss
Understanding dom based xssPotato
 
Rich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeRich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeJeremiah Grossman
 
logout.php Session Data after Logout Username Email . $_.docx
logout.php Session Data after Logout  Username  Email  . $_.docxlogout.php Session Data after Logout  Username  Email  . $_.docx
logout.php Session Data after Logout Username Email . $_.docxsmile790243
 
.NET Security Topics
.NET Security Topics.NET Security Topics
.NET Security TopicsShawn Gorrell
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encodingEoin Keary
 
Web application attacks
Web application attacksWeb application attacks
Web application attackshruth
 
Cm7 secure code_training_1day_xss
Cm7 secure code_training_1day_xssCm7 secure code_training_1day_xss
Cm7 secure code_training_1day_xssdcervigni
 
Secure Code Warrior - Cross site scripting
Secure Code Warrior - Cross site scriptingSecure Code Warrior - Cross site scripting
Secure Code Warrior - Cross site scriptingSecure Code Warrior
 

Similar a The Cross Site Scripting Guide (20)

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 )
 
XSS.pdf
XSS.pdfXSS.pdf
XSS.pdf
 
XSS.pdf
XSS.pdfXSS.pdf
XSS.pdf
 
xss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdfxss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdf
 
Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )
 
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
 
Xss 101 by-sai-shanthan
Xss 101 by-sai-shanthanXss 101 by-sai-shanthan
Xss 101 by-sai-shanthan
 
Xss 101
Xss 101Xss 101
Xss 101
 
Understanding dom based xss
Understanding dom based xssUnderstanding dom based xss
Understanding dom based xss
 
Complete xss walkthrough
Complete xss walkthroughComplete xss walkthrough
Complete xss walkthrough
 
Rich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeRich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safe
 
logout.php Session Data after Logout Username Email . $_.docx
logout.php Session Data after Logout  Username  Email  . $_.docxlogout.php Session Data after Logout  Username  Email  . $_.docx
logout.php Session Data after Logout Username Email . $_.docx
 
.NET Security Topics
.NET Security Topics.NET Security Topics
.NET Security Topics
 
4.Xss
4.Xss4.Xss
4.Xss
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encoding
 
Web application attacks
Web application attacksWeb application attacks
Web application attacks
 
SeanRobertsThesis
SeanRobertsThesisSeanRobertsThesis
SeanRobertsThesis
 
Xssandcsrf
XssandcsrfXssandcsrf
Xssandcsrf
 
Cm7 secure code_training_1day_xss
Cm7 secure code_training_1day_xssCm7 secure code_training_1day_xss
Cm7 secure code_training_1day_xss
 
Secure Code Warrior - Cross site scripting
Secure Code Warrior - Cross site scriptingSecure Code Warrior - Cross site scripting
Secure Code Warrior - Cross site scripting
 

Último

GENUINE EscoRtS,Call Girls IN South Delhi Locanto TM''| +91-8377087607
GENUINE EscoRtS,Call Girls IN South Delhi Locanto TM''| +91-8377087607GENUINE EscoRtS,Call Girls IN South Delhi Locanto TM''| +91-8377087607
GENUINE EscoRtS,Call Girls IN South Delhi Locanto TM''| +91-8377087607dollysharma2066
 
VIP Ramnagar Call Girls, Ramnagar escorts Girls 📞 8617697112
VIP Ramnagar Call Girls, Ramnagar escorts Girls 📞 8617697112VIP Ramnagar Call Girls, Ramnagar escorts Girls 📞 8617697112
VIP Ramnagar Call Girls, Ramnagar escorts Girls 📞 8617697112Nitya salvi
 
DELHI NCR —@9711106444 Call Girls In Majnu Ka Tilla (MT)| Delhi
DELHI NCR —@9711106444 Call Girls In Majnu Ka Tilla (MT)| DelhiDELHI NCR —@9711106444 Call Girls In Majnu Ka Tilla (MT)| Delhi
DELHI NCR —@9711106444 Call Girls In Majnu Ka Tilla (MT)| Delhidelhimunirka444
 
Moradabad Call Girls - 📞 8617697112 🔝 Top Class Call Girls Service Available
Moradabad Call Girls - 📞 8617697112 🔝 Top Class Call Girls Service AvailableMoradabad Call Girls - 📞 8617697112 🔝 Top Class Call Girls Service Available
Moradabad Call Girls - 📞 8617697112 🔝 Top Class Call Girls Service AvailableNitya salvi
 
❤️Call girls in Chandigarh ☎️8264406502☎️ Call Girl service in Chandigarh☎️ C...
❤️Call girls in Chandigarh ☎️8264406502☎️ Call Girl service in Chandigarh☎️ C...❤️Call girls in Chandigarh ☎️8264406502☎️ Call Girl service in Chandigarh☎️ C...
❤️Call girls in Chandigarh ☎️8264406502☎️ Call Girl service in Chandigarh☎️ C...Sheetaleventcompany
 
FULL NIGHT — 9999894380 Call Girls In Delhi Cantt | Delhi
FULL NIGHT — 9999894380 Call Girls In Delhi Cantt | DelhiFULL NIGHT — 9999894380 Call Girls In Delhi Cantt | Delhi
FULL NIGHT — 9999894380 Call Girls In Delhi Cantt | DelhiSaketCallGirlsCallUs
 
Storyboard short: Ferrarius Tries to Sing
Storyboard short: Ferrarius Tries to SingStoryboard short: Ferrarius Tries to Sing
Storyboard short: Ferrarius Tries to SingLyneSun
 
Completed Event Presentation for Huma 1305
Completed Event Presentation for Huma 1305Completed Event Presentation for Huma 1305
Completed Event Presentation for Huma 1305jazlynjacobs51
 
FULL NIGHT — 9999894380 Call Girls In Uttam Nagar | Delhi
FULL NIGHT — 9999894380 Call Girls In Uttam Nagar | DelhiFULL NIGHT — 9999894380 Call Girls In Uttam Nagar | Delhi
FULL NIGHT — 9999894380 Call Girls In Uttam Nagar | DelhiSaketCallGirlsCallUs
 
THE ARTS OF THE PHILIPPINE BALLET PRESN
THE ARTS OF  THE PHILIPPINE BALLET PRESNTHE ARTS OF  THE PHILIPPINE BALLET PRESN
THE ARTS OF THE PHILIPPINE BALLET PRESNAlvinFerdinandAceCas
 
Bobbie goods coloring book 81 pag_240127_163802.pdf
Bobbie goods coloring book 81 pag_240127_163802.pdfBobbie goods coloring book 81 pag_240127_163802.pdf
Bobbie goods coloring book 81 pag_240127_163802.pdfMARIBEL442158
 
FULL NIGHT — 9999894380 Call Girls In Shivaji Enclave | Delhi
FULL NIGHT — 9999894380 Call Girls In Shivaji Enclave | DelhiFULL NIGHT — 9999894380 Call Girls In Shivaji Enclave | Delhi
FULL NIGHT — 9999894380 Call Girls In Shivaji Enclave | DelhiSaketCallGirlsCallUs
 
FULL NIGHT — 9999894380 Call Girls In Najafgarh | Delhi
FULL NIGHT — 9999894380 Call Girls In Najafgarh | DelhiFULL NIGHT — 9999894380 Call Girls In Najafgarh | Delhi
FULL NIGHT — 9999894380 Call Girls In Najafgarh | DelhiSaketCallGirlsCallUs
 
Museum of fine arts Lauren Simpson…………..
Museum of fine arts Lauren Simpson…………..Museum of fine arts Lauren Simpson…………..
Museum of fine arts Lauren Simpson…………..mvxpw22gfc
 
❤Personal Whatsapp Srinagar Srinagar Call Girls 8617697112 💦✅.
❤Personal Whatsapp Srinagar Srinagar Call Girls 8617697112 💦✅.❤Personal Whatsapp Srinagar Srinagar Call Girls 8617697112 💦✅.
❤Personal Whatsapp Srinagar Srinagar Call Girls 8617697112 💦✅.Nitya salvi
 
Sirmaur Call Girls Book Now 8617697112 Top Class Pondicherry Escort Service A...
Sirmaur Call Girls Book Now 8617697112 Top Class Pondicherry Escort Service A...Sirmaur Call Girls Book Now 8617697112 Top Class Pondicherry Escort Service A...
Sirmaur Call Girls Book Now 8617697112 Top Class Pondicherry Escort Service A...Nitya salvi
 
FULL NIGHT — 9999894380 Call Girls In Saket | Delhi
FULL NIGHT — 9999894380 Call Girls In Saket | DelhiFULL NIGHT — 9999894380 Call Girls In Saket | Delhi
FULL NIGHT — 9999894380 Call Girls In Saket | DelhiSaketCallGirlsCallUs
 
FULL NIGHT — 9999894380 Call Girls In Delhi | Delhi
FULL NIGHT — 9999894380 Call Girls In Delhi | DelhiFULL NIGHT — 9999894380 Call Girls In Delhi | Delhi
FULL NIGHT — 9999894380 Call Girls In Delhi | DelhiSaketCallGirlsCallUs
 
Barasat call girls 📞 8617697112 At Low Cost Cash Payment Booking
Barasat call girls 📞 8617697112 At Low Cost Cash Payment BookingBarasat call girls 📞 8617697112 At Low Cost Cash Payment Booking
Barasat call girls 📞 8617697112 At Low Cost Cash Payment BookingNitya salvi
 

Último (20)

GENUINE EscoRtS,Call Girls IN South Delhi Locanto TM''| +91-8377087607
GENUINE EscoRtS,Call Girls IN South Delhi Locanto TM''| +91-8377087607GENUINE EscoRtS,Call Girls IN South Delhi Locanto TM''| +91-8377087607
GENUINE EscoRtS,Call Girls IN South Delhi Locanto TM''| +91-8377087607
 
VIP Ramnagar Call Girls, Ramnagar escorts Girls 📞 8617697112
VIP Ramnagar Call Girls, Ramnagar escorts Girls 📞 8617697112VIP Ramnagar Call Girls, Ramnagar escorts Girls 📞 8617697112
VIP Ramnagar Call Girls, Ramnagar escorts Girls 📞 8617697112
 
DELHI NCR —@9711106444 Call Girls In Majnu Ka Tilla (MT)| Delhi
DELHI NCR —@9711106444 Call Girls In Majnu Ka Tilla (MT)| DelhiDELHI NCR —@9711106444 Call Girls In Majnu Ka Tilla (MT)| Delhi
DELHI NCR —@9711106444 Call Girls In Majnu Ka Tilla (MT)| Delhi
 
Moradabad Call Girls - 📞 8617697112 🔝 Top Class Call Girls Service Available
Moradabad Call Girls - 📞 8617697112 🔝 Top Class Call Girls Service AvailableMoradabad Call Girls - 📞 8617697112 🔝 Top Class Call Girls Service Available
Moradabad Call Girls - 📞 8617697112 🔝 Top Class Call Girls Service Available
 
❤️Call girls in Chandigarh ☎️8264406502☎️ Call Girl service in Chandigarh☎️ C...
❤️Call girls in Chandigarh ☎️8264406502☎️ Call Girl service in Chandigarh☎️ C...❤️Call girls in Chandigarh ☎️8264406502☎️ Call Girl service in Chandigarh☎️ C...
❤️Call girls in Chandigarh ☎️8264406502☎️ Call Girl service in Chandigarh☎️ C...
 
FULL NIGHT — 9999894380 Call Girls In Delhi Cantt | Delhi
FULL NIGHT — 9999894380 Call Girls In Delhi Cantt | DelhiFULL NIGHT — 9999894380 Call Girls In Delhi Cantt | Delhi
FULL NIGHT — 9999894380 Call Girls In Delhi Cantt | Delhi
 
Storyboard short: Ferrarius Tries to Sing
Storyboard short: Ferrarius Tries to SingStoryboard short: Ferrarius Tries to Sing
Storyboard short: Ferrarius Tries to Sing
 
Completed Event Presentation for Huma 1305
Completed Event Presentation for Huma 1305Completed Event Presentation for Huma 1305
Completed Event Presentation for Huma 1305
 
FULL NIGHT — 9999894380 Call Girls In Uttam Nagar | Delhi
FULL NIGHT — 9999894380 Call Girls In Uttam Nagar | DelhiFULL NIGHT — 9999894380 Call Girls In Uttam Nagar | Delhi
FULL NIGHT — 9999894380 Call Girls In Uttam Nagar | Delhi
 
THE ARTS OF THE PHILIPPINE BALLET PRESN
THE ARTS OF  THE PHILIPPINE BALLET PRESNTHE ARTS OF  THE PHILIPPINE BALLET PRESN
THE ARTS OF THE PHILIPPINE BALLET PRESN
 
Bobbie goods coloring book 81 pag_240127_163802.pdf
Bobbie goods coloring book 81 pag_240127_163802.pdfBobbie goods coloring book 81 pag_240127_163802.pdf
Bobbie goods coloring book 81 pag_240127_163802.pdf
 
FULL NIGHT — 9999894380 Call Girls In Shivaji Enclave | Delhi
FULL NIGHT — 9999894380 Call Girls In Shivaji Enclave | DelhiFULL NIGHT — 9999894380 Call Girls In Shivaji Enclave | Delhi
FULL NIGHT — 9999894380 Call Girls In Shivaji Enclave | Delhi
 
FULL NIGHT — 9999894380 Call Girls In Najafgarh | Delhi
FULL NIGHT — 9999894380 Call Girls In Najafgarh | DelhiFULL NIGHT — 9999894380 Call Girls In Najafgarh | Delhi
FULL NIGHT — 9999894380 Call Girls In Najafgarh | Delhi
 
Museum of fine arts Lauren Simpson…………..
Museum of fine arts Lauren Simpson…………..Museum of fine arts Lauren Simpson…………..
Museum of fine arts Lauren Simpson…………..
 
❤Personal Whatsapp Srinagar Srinagar Call Girls 8617697112 💦✅.
❤Personal Whatsapp Srinagar Srinagar Call Girls 8617697112 💦✅.❤Personal Whatsapp Srinagar Srinagar Call Girls 8617697112 💦✅.
❤Personal Whatsapp Srinagar Srinagar Call Girls 8617697112 💦✅.
 
Sirmaur Call Girls Book Now 8617697112 Top Class Pondicherry Escort Service A...
Sirmaur Call Girls Book Now 8617697112 Top Class Pondicherry Escort Service A...Sirmaur Call Girls Book Now 8617697112 Top Class Pondicherry Escort Service A...
Sirmaur Call Girls Book Now 8617697112 Top Class Pondicherry Escort Service A...
 
FULL NIGHT — 9999894380 Call Girls In Saket | Delhi
FULL NIGHT — 9999894380 Call Girls In Saket | DelhiFULL NIGHT — 9999894380 Call Girls In Saket | Delhi
FULL NIGHT — 9999894380 Call Girls In Saket | Delhi
 
FULL NIGHT — 9999894380 Call Girls In Delhi | Delhi
FULL NIGHT — 9999894380 Call Girls In Delhi | DelhiFULL NIGHT — 9999894380 Call Girls In Delhi | Delhi
FULL NIGHT — 9999894380 Call Girls In Delhi | Delhi
 
Barasat call girls 📞 8617697112 At Low Cost Cash Payment Booking
Barasat call girls 📞 8617697112 At Low Cost Cash Payment BookingBarasat call girls 📞 8617697112 At Low Cost Cash Payment Booking
Barasat call girls 📞 8617697112 At Low Cost Cash Payment Booking
 
(INDIRA) Call Girl Dehradun Call Now 8617697112 Dehradun Escorts 24x7
(INDIRA) Call Girl Dehradun Call Now 8617697112 Dehradun Escorts 24x7(INDIRA) Call Girl Dehradun Call Now 8617697112 Dehradun Escorts 24x7
(INDIRA) Call Girl Dehradun Call Now 8617697112 Dehradun Escorts 24x7
 

The Cross Site Scripting Guide

  • 1. *Introduction........................................................................................................................................... *Cross Site Scripting Attacks................................................................................................................. *Prevention............................................................................................................................................ *Conclusion............................................................................................................................................ Name: Daisuke Dan Website:TheHackersBay.org Twitter: @TheHackersBay
  • 2.
  • 3. XSS stands for Cross-Site-Scripting. It is basically an attack, that is used to execute HTML and Javascript on the web-page. This attack can be done by submitting queries into text-boxes, or even into the URL. The results come back reading the text as HTML, so it executes the scripts instead of displaying them in plain text. Many people treat an XSS vulnerability as a low to medium risk vulnerability, when in reality it is a damaging attack that can lead to your users (and you) being compromised. XSS attacks are becoming a big problem and are going to become an extremely big problem if people do not educate them selves about XSS attacks and vulnerabilities, XSS vulnerabilities have been found in all sorts of websites including fbi.gov, yahoo.com, ebay.com and many other popular and important websites, a lot of administrators fail to pay attention to XSS attacks because they either don't know much about them or they do not see them as a threat, an XSS vulnerability when exploited by a skilled attacker or even a novice can be a very powerful attack. This paper details XSS attacks and hopes to educate you on what they are, how attackers use them and of course how you can prevent them from happening. Overview: Cross-site scripting (XSS) is a type of vulnerability commonly found in web applications. This vulnerability makes it possible for attackers to inject malicious code (e.g. JavaScript programs) into victim’s web browser. Using this malicious code, the attackers can steal the victim’s credentials, such as cookies. The access control policies (i.e., the same origin policy) employed by the browser to protect those credentials can be bypassed by exploiting the XSS vulnerability. Vulnerabilities of this kind can potentially lead to large-scale attacks. - HTML HTML is sort of like a programming language. The distinctions between a programming language, and HTML, are not too far apart. They are both languages, that are used to create attributes, and events. HTML is a markup language, which is used mostly to create websites. HTML stands for Hyper-Text Markup Language. You can use HTML to create forms, buttons, and other stuff that can be used in a webpage. I highly doubt you will ever encounter a website that does not contain even a slight amount of HTML. - JavaScript Now, first, let's get one thing straight. There is a HUGE difference between JAVA and JAVASCRIPT. Java, is a language that ressembles to C++, it can be used in games, and applications. Javascript is sort of similar to HTML, but definitely different in many ways. Javascript isn't used NEARLY as much in Webpages than HTML is. Javascript is used, more in applications outside of webpages. Like PDFs. Javascript can be an incredibly useful language along with HTML. They are both fairly simple to learn, and are very dynamic.
  • 4.
  • 5. The Cross Site scripting is one of the problem that has plagued a lot of websites. As a web developer, it is important to understand what is cross site scripting and how can we safeguard our site from such attacks. Now the question would be how can a person inject scripts on a running page. This can easily be done using all the various ways a website is collecting inputs. Cross site scripting can be performed by passing scripts in form of: *TextBox *Cookies *Query Strings *Web application variables *Session variables What can you do with Xss Attacks? *Attackers inject JavaScript, ActiveX, or HTML, into a vulnerable application, exploiting XSS holes. *The browser processes the injected code as if it were legitimate content of the web page - with the corresponding security permissions. *Many attack could exploit flaws or vulnerabilities due to bad programming. *Pillage of settings and user sensitive information. Possible Attacks? *Phishing: Criminal fraudulent process of attempting to acquire sensitive information such as usernames, passwords and credit card details, by masque rading as a trustworthy entity in an electronic communication or as a business or individual. *Cookie Stealing: Cookie is used to manage sessions in browsers. Each person logged in gets a unique cookie, it is like a key to the site. *Account hijacking: Term used when malware infiltrates a system without the consent and performs tasks set by its creator in addition to (or instead of) the system's normal duties. *Changing of user settings: A scammer could take information about web sites administrator in order to access to sensitive data or modifying user settings. Basic types of XSS Attacks? STORED XSS: In the “STORED XSS” (persistent XSS),an attacker can inject the malicious code into the page persistently and that means the code will be STORED in the server. And this code will be STORED in the page which will show to the visitors later on. If the visitor goes to the page which is embedded with XSS attacking code, the code will execute on the visitor‟s computer. Hackers usually post these codes into the article in the forum or blog in order to let other users to read in the future and attack more them. Compared with “REFLECTED XSS”, this type of XSS does more serious harm. If the “STORED XSS” vulnerability is successfully exploited by hackers, it will persistently attack the users until administrator remove this vulnerability.
  • 6. Example of Stored XSS: guestbook.php Then page guestbook.php lists all entries returned by the previous function, without sanitizing the content of the comments. It is only applied to the names (see function h() in the next section): [---------------------------------------CODE---------------------------------------] <?php if ($guestbook) { foreach ($guestbook as $guest) { ?> <p class="comment"><?= $guest[" XSS SCRIPT "] ?></p> <p> - by <?=h( $guest["name"] ) ?> </p> <?php } ?> [---------------------------------------END CODE---------------------------------------]
  • 7. REFLECTED XSS: The “REFLECTED XSS” (non-persistent) is a temporary attack. Because the code cannot be injected into the server, it just lets the server use the injected malicious code to immediately generate a page and then, send this temporary page‟s URL to anyone that the attacker wants to attack. If the user clicks this URL, the malicious code in this temporary page will execute. Because this attack is based on user‟s trigging, this type of vulnerability was called REFLECTED XSS. There fore, it is more difficult to be used unless the hacker can work hard on the URL and convince the user to trigger the dangerous URL. So the hacker finds few methods to make the URL look like a trusted Website‟s URL. First of all, hackers can encode the URL into Hex value or other type of code in order that the URL looks more true and reliable. Therefore, the userthinks that there is no virus command inside and clicks that. Google is a famous and reliable website. If Google has the REFLECTED XSS, the hacker can inject malicious code into the URL and encode the URL. There are many tools on the Internet which can provide the service of encoding the code from ASCII to decimal ASCII, hexadecimal or other types. After finishing encoding the URL, the hacker will send this URL to trick the user into clicking and also using some tricks which can attract the user to click. In addition, later on, this thesis will give details of URL Encoding. Example: http://exploitsdownload.com/search?q="'">'">'"><script>alert('Daisuke_Dan')</script>
  • 8. DOM-Based XSS: The DOM-based XSS attack is another type of XSS vulnerability which is commonly used by hackers as well. What is DOM-based XSS? First of all, we need to know what DOM is. DOM is short for Document Object Model and it is a platform and language - neutral interface which is using scripting or program to modify the content, update the date, structure and style of documents. It is widely used in HTML and XML in Web 2.0. DOM in HTML can generate a tree - structure of HTML documents. However, DOM allows the scripting or program to change the HTML or XML document, the HTML or XML document can be modified by a hackers scripting or program. DOM-based XSS uses DOM's vulnerability to make the XSS come true. This type of XSS vulnerability is totally different from the REFLECTED or STORED XSS attack and it does not inject malicious code into a page. So, it is the problem of the insecure DOM object which can be controlled by the client side in the web page or application. For this reason, hackers can let the attack payload execute in the DOM environment to attack the Victim side.
  • 9. The following snippets of HTML demonstrate how to safely render untrusted data in a variety of different contexts.
  • 10. Safe HTML Attributes include: align, alink, alt, bgcolor, border, cellpadding, cellspacing, class, color, cols, colspan, coords, dir, face, height, hspace, ismap, lang, marginheight, marginwidth, multiple, nohref, noresize, noshade, nowrap, ref, rel, rev, rows, rowspan, scrolling, shape, span, summary, tabindex, title, usemap, valign, value, vlink, vspace, width. Sanitize the input, all user submitted input anywhere in an application must be treated as hostile and filtered. This should be done by the application code, but can also be performed by a web application firewall (WAF) such as mod_security. The most effective way to prevent this is to do both, use well coded applications and have a WAF or filtering as a second line of defense. A common initial preventative to viral infection is a network level firewall. As HTTP/HTTPS protocols are afforded unfettered access through common firewall configurations, these firewall barriers are ineffectual. A potential remedy to this is an application firewall with the appropriate XSS virus signatures. Whilst unlikely, the most obvious way to prevent XSS viruses is to remove XSS vulnerabilities from web applications. Conclusion? Cross-site scripting (XSS) is one of the most frequent vulnerabilities found in modern web applications. Never-theless, many service providers are either not willing or not able to provide sufficient protection to their users. This paper proposes a novel, client-side solution to this problem. By modifying the popular Firefox web browser, we are able to dynamically track the flow of sensitive values (e.g., user cookies) on the client side. Whenever such a sensitive value is aboutto be transferredto a third party(i.e., the adversary), the user is given the possibility to stop the connection. To censure protection against more subtle types of XSS attacks that try to leak information through non-dynamic control dependencies,we additionallyemploy an auxiliary, efficient static analysis, where necessary. With this combination of dynamic and static techniques, we are able to protect the user against XSS attacks in a reliable and efficient way. To validate our concepts, we automatically tested the enhanced browser on more than one million web pages by means of a crawler that is capable of interpreting JavaScript code. The results of this large-scale evaluation demonstrate that only a small number of false positives is generated, and that our underlying concepts are feasible in practice.