Commonly the attacker's code is written in the Javascript language,
but other scripting languages are also used, e.g.,
VBScript. Attackers typically leverage these vulnerabilities to install
key loggers, steal victim cookies, perform clipboard theft, and change
the content of the page (e.g., download links).
One of the primary difficulties in preventing XSS vulnerabilities is proper character encoding. In some cases, the web server or the web application could not be filtering some encodings of characters, so, for example, the web application might filter out "<script>", but might not filter %3cscript%3e which simply includes another encoding of tags.
How to Test?
2.Analyze each input vector to detect vulnerabilities: To detect an XSS Vulnerability tester should use input Data from phrase 1 to make the browser trigger response that manifests vulnerability.Testing data can also be generated by fuzzer.
3.From the result in previous phase analyze if the web-browser response has a realistic impact on web application's security . This involves examining the web page HTML and searching for test input. The tester identifies any special characters that were not properly encoded, replaced or filtered out.
As demonstrated in previous blog , i was able to get session id and user id as proper data sanitization was not done.
This indicates a XSS vulnerability and an attacker can execute any malicious code of his choice.
Gray Box Testing
In gray box testing, the pen-tester has partial knowledge of the application. In this case, information regarding user input, input validation controls, and how the user input is rendered back to the user might be known by the pen-tester.
Few Tools that can be used for the purpose :-
XSS Proxy , Rat Proxy
One of the primary difficulties in preventing XSS vulnerabilities is proper character encoding. In some cases, the web server or the web application could not be filtering some encodings of characters, so, for example, the web application might filter out "<script>", but might not filter %3cscript%3e which simply includes another encoding of tags.
How to Test?
Black Box Testing :This includes three phrases:
1. Detect Input Vectors. For each page tester must determine all the web-application's user based variables and ways to input them - including HTTP parameters, POST data ,hidden form field value and predefined radio or selection values2.Analyze each input vector to detect vulnerabilities: To detect an XSS Vulnerability tester should use input Data from phrase 1 to make the browser trigger response that manifests vulnerability.Testing data can also be generated by fuzzer.
3.From the result in previous phase analyze if the web-browser response has a realistic impact on web application's security . This involves examining the web page HTML and searching for test input. The tester identifies any special characters that were not properly encoded, replaced or filtered out.
As demonstrated in previous blog , i was able to get session id and user id as proper data sanitization was not done.
This indicates a XSS vulnerability and an attacker can execute any malicious code of his choice.
Gray Box Testing
In gray box testing, the pen-tester has partial knowledge of the application. In this case, information regarding user input, input validation controls, and how the user input is rendered back to the user might be known by the pen-tester.
Few Tools that can be used for the purpose :-
XSS Proxy , Rat Proxy


