<?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=Harish+s+s</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=Harish+s+s"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/Harish_s_s"/>
		<updated>2026-04-27T19:45:38Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37390</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37390"/>
				<updated>2008-08-27T17:11:31Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: /* Basic Encoding */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8).&lt;br /&gt;
&lt;br /&gt;
Character encoding has another use or rather misuse. It is being commonly used for encoding malicious injection strings in order to obfuscate and thus bypass input validation filters or take advantage of the browser’s functionality of rendering an encoding scheme.&lt;br /&gt;
&lt;br /&gt;
== Input Encoding – Filter Evasion ==&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
In other words, an encoded injection works because even though an input filter might not recognize or filter an encoded attack, the browser correctly interprets it while rendering the web page.&lt;br /&gt;
&lt;br /&gt;
== Output Encoding – Server &amp;amp; Browser Consensus ==&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; or through HTML META tag (“META HTTP-EQUIV”), as shown below:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters.&lt;br /&gt;
Note: The content type mentioned in the HTTP header has precedence over the META tag declaration.&lt;br /&gt;
&lt;br /&gt;
CERT describes it here as follows:&lt;br /&gt;
&lt;br /&gt;
''Many web pages leave the character encoding (&amp;quot;charset&amp;quot; parameter in HTTP) undefined. In earlier versions of HTML and HTTP, the character encoding was supposed to default to ISO-8859-1 if it wasn't defined. In fact, many browsers had a different default, so it was not possible to rely on the default being ISO-8859-1. HTML version 4 legitimizes this - if the character encoding isn't specified, any character encoding can be used.&lt;br /&gt;
&lt;br /&gt;
If the web server doesn't specify which character encoding is in use, it can't tell which characters are special. Web pages with unspecified character encoding work most of the time because most character sets assign the same characters to byte values below 128. But which of the values above 128 are special? Some 16-bit character-encoding schemes have additional multi-byte representations for special characters such as &amp;quot;&amp;lt;&amp;quot;. Some browsers recognize this alternative encoding and act on it. This is &amp;quot;correct&amp;quot; behavior, but it makes attacks using malicious scripts much harder to prevent. The server simply doesn't know which byte sequences represent the special characters''&lt;br /&gt;
&lt;br /&gt;
Therefore in the event of not receiving the character encoding information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page (server) and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected.&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot ;XSS&amp;amp;quot ;)&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34 ;XSS&amp;amp;#34 ;)&amp;gt; (Numeric reference)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
Hex, short for Hexadecimal, is a base 16 numbering system i.e it has 16 different values from 0 to 9 and A to F to represent various characters. Hex encoding is another form of obfuscation that is, sometimes, used to bypass input validation filters. For instance, hex encoded version of the string &lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert('XSS')&amp;gt; is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=%6A%61%76%61%73%63%72%69%70%74%3A%61%6C%65%72%74%28%27%58%53%53%27%29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A variation of the above string is given below. Can be used in case ‘%’ is being filtered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;amp;#x6A&amp;amp;#x61&amp;amp;#x76&amp;amp;#x61&amp;amp;#x73&amp;amp;#x63&amp;amp;#x72&amp;amp;#x69&amp;amp;#x70&amp;amp;#x74&amp;amp;#x3A&amp;amp;#x61&amp;amp;#x6C&amp;amp;#x65&amp;amp;#x72&amp;amp;#x74&amp;amp;#x28&amp;amp;#x27&amp;amp;#x58&amp;amp;#x53&amp;amp;#x53&amp;amp;#x27&amp;amp;#x29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are other encoding schemes like Base64 and Octal as well that may be used for obfuscation. Although, every encoding scheme may not work every time, a bit of trial and error coupled with intelligent manipulations would definitely reveal the loophole in a weakly built input validation filter.&lt;br /&gt;
&lt;br /&gt;
==== UTF-7 Encoding ====&lt;br /&gt;
&lt;br /&gt;
UTF-7 encoding of &amp;lt;SCRIPT&amp;gt;alert(‘XSS’);&amp;lt;/SCRIPT&amp;gt; is as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;+ADw-SCRIPT+AD4-alert('XSS');+ADw-/SCRIPT+AD4-&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the above script to work, the browser has to interpret the web page as encoded in UTF-7.&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
Variable-width encoding is another type of character encoding scheme that uses codes of varying lengths to encode characters. Multi-Byte Encoding is a type of variable-width encoding that uses varying number of bytes to represent a character.&lt;br /&gt;
Multibyte encoding is primarily used to encode characters that belong to a large character set e.g. Chinese, Japanese and Korean. &lt;br /&gt;
&lt;br /&gt;
Multibyte encoding has been used in the past to bypass standard input validation functions and carry out cross site scripting and sql injection attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
http://ha.ckers.org/xss.html&lt;br /&gt;
&lt;br /&gt;
http://www.cert.org/tech_tips/malicious_code_mitigation.html&lt;br /&gt;
&lt;br /&gt;
http://www.w3schools.com/HTML/html_entities.asp&lt;br /&gt;
&lt;br /&gt;
http://www.iss.net/security_center/advice/Intrusions/2000639/default.htm&lt;br /&gt;
&lt;br /&gt;
http://searchsecurity.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid14_gci1212217_tax299989,00.html&lt;br /&gt;
&lt;br /&gt;
http://www.joelonsoftware.com/articles/Unicode.html&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37389</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37389"/>
				<updated>2008-08-27T17:10:38Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: /* Basic Encoding */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8).&lt;br /&gt;
&lt;br /&gt;
Character encoding has another use or rather misuse. It is being commonly used for encoding malicious injection strings in order to obfuscate and thus bypass input validation filters or take advantage of the browser’s functionality of rendering an encoding scheme.&lt;br /&gt;
&lt;br /&gt;
== Input Encoding – Filter Evasion ==&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
In other words, an encoded injection works because even though an input filter might not recognize or filter an encoded attack, the browser correctly interprets it while rendering the web page.&lt;br /&gt;
&lt;br /&gt;
== Output Encoding – Server &amp;amp; Browser Consensus ==&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; or through HTML META tag (“META HTTP-EQUIV”), as shown below:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters.&lt;br /&gt;
Note: The content type mentioned in the HTTP header has precedence over the META tag declaration.&lt;br /&gt;
&lt;br /&gt;
CERT describes it here as follows:&lt;br /&gt;
&lt;br /&gt;
''Many web pages leave the character encoding (&amp;quot;charset&amp;quot; parameter in HTTP) undefined. In earlier versions of HTML and HTTP, the character encoding was supposed to default to ISO-8859-1 if it wasn't defined. In fact, many browsers had a different default, so it was not possible to rely on the default being ISO-8859-1. HTML version 4 legitimizes this - if the character encoding isn't specified, any character encoding can be used.&lt;br /&gt;
&lt;br /&gt;
If the web server doesn't specify which character encoding is in use, it can't tell which characters are special. Web pages with unspecified character encoding work most of the time because most character sets assign the same characters to byte values below 128. But which of the values above 128 are special? Some 16-bit character-encoding schemes have additional multi-byte representations for special characters such as &amp;quot;&amp;lt;&amp;quot;. Some browsers recognize this alternative encoding and act on it. This is &amp;quot;correct&amp;quot; behavior, but it makes attacks using malicious scripts much harder to prevent. The server simply doesn't know which byte sequences represent the special characters''&lt;br /&gt;
&lt;br /&gt;
Therefore in the event of not receiving the character encoding information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page (server) and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected.&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot ;XSS&amp;amp;quot ;)&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34;XSS&amp;amp;#34;)&amp;gt; (Numeric reference)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
Hex, short for Hexadecimal, is a base 16 numbering system i.e it has 16 different values from 0 to 9 and A to F to represent various characters. Hex encoding is another form of obfuscation that is, sometimes, used to bypass input validation filters. For instance, hex encoded version of the string &lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert('XSS')&amp;gt; is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=%6A%61%76%61%73%63%72%69%70%74%3A%61%6C%65%72%74%28%27%58%53%53%27%29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A variation of the above string is given below. Can be used in case ‘%’ is being filtered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;amp;#x6A&amp;amp;#x61&amp;amp;#x76&amp;amp;#x61&amp;amp;#x73&amp;amp;#x63&amp;amp;#x72&amp;amp;#x69&amp;amp;#x70&amp;amp;#x74&amp;amp;#x3A&amp;amp;#x61&amp;amp;#x6C&amp;amp;#x65&amp;amp;#x72&amp;amp;#x74&amp;amp;#x28&amp;amp;#x27&amp;amp;#x58&amp;amp;#x53&amp;amp;#x53&amp;amp;#x27&amp;amp;#x29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are other encoding schemes like Base64 and Octal as well that may be used for obfuscation. Although, every encoding scheme may not work every time, a bit of trial and error coupled with intelligent manipulations would definitely reveal the loophole in a weakly built input validation filter.&lt;br /&gt;
&lt;br /&gt;
==== UTF-7 Encoding ====&lt;br /&gt;
&lt;br /&gt;
UTF-7 encoding of &amp;lt;SCRIPT&amp;gt;alert(‘XSS’);&amp;lt;/SCRIPT&amp;gt; is as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;+ADw-SCRIPT+AD4-alert('XSS');+ADw-/SCRIPT+AD4-&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the above script to work, the browser has to interpret the web page as encoded in UTF-7.&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
Variable-width encoding is another type of character encoding scheme that uses codes of varying lengths to encode characters. Multi-Byte Encoding is a type of variable-width encoding that uses varying number of bytes to represent a character.&lt;br /&gt;
Multibyte encoding is primarily used to encode characters that belong to a large character set e.g. Chinese, Japanese and Korean. &lt;br /&gt;
&lt;br /&gt;
Multibyte encoding has been used in the past to bypass standard input validation functions and carry out cross site scripting and sql injection attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
http://ha.ckers.org/xss.html&lt;br /&gt;
&lt;br /&gt;
http://www.cert.org/tech_tips/malicious_code_mitigation.html&lt;br /&gt;
&lt;br /&gt;
http://www.w3schools.com/HTML/html_entities.asp&lt;br /&gt;
&lt;br /&gt;
http://www.iss.net/security_center/advice/Intrusions/2000639/default.htm&lt;br /&gt;
&lt;br /&gt;
http://searchsecurity.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid14_gci1212217_tax299989,00.html&lt;br /&gt;
&lt;br /&gt;
http://www.joelonsoftware.com/articles/Unicode.html&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37388</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37388"/>
				<updated>2008-08-27T17:09:51Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: /* Basic Encoding */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8).&lt;br /&gt;
&lt;br /&gt;
Character encoding has another use or rather misuse. It is being commonly used for encoding malicious injection strings in order to obfuscate and thus bypass input validation filters or take advantage of the browser’s functionality of rendering an encoding scheme.&lt;br /&gt;
&lt;br /&gt;
== Input Encoding – Filter Evasion ==&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
In other words, an encoded injection works because even though an input filter might not recognize or filter an encoded attack, the browser correctly interprets it while rendering the web page.&lt;br /&gt;
&lt;br /&gt;
== Output Encoding – Server &amp;amp; Browser Consensus ==&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; or through HTML META tag (“META HTTP-EQUIV”), as shown below:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters.&lt;br /&gt;
Note: The content type mentioned in the HTTP header has precedence over the META tag declaration.&lt;br /&gt;
&lt;br /&gt;
CERT describes it here as follows:&lt;br /&gt;
&lt;br /&gt;
''Many web pages leave the character encoding (&amp;quot;charset&amp;quot; parameter in HTTP) undefined. In earlier versions of HTML and HTTP, the character encoding was supposed to default to ISO-8859-1 if it wasn't defined. In fact, many browsers had a different default, so it was not possible to rely on the default being ISO-8859-1. HTML version 4 legitimizes this - if the character encoding isn't specified, any character encoding can be used.&lt;br /&gt;
&lt;br /&gt;
If the web server doesn't specify which character encoding is in use, it can't tell which characters are special. Web pages with unspecified character encoding work most of the time because most character sets assign the same characters to byte values below 128. But which of the values above 128 are special? Some 16-bit character-encoding schemes have additional multi-byte representations for special characters such as &amp;quot;&amp;lt;&amp;quot;. Some browsers recognize this alternative encoding and act on it. This is &amp;quot;correct&amp;quot; behavior, but it makes attacks using malicious scripts much harder to prevent. The server simply doesn't know which byte sequences represent the special characters''&lt;br /&gt;
&lt;br /&gt;
Therefore in the event of not receiving the character encoding information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page (server) and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected.&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34;XSS&amp;amp;#34;)&amp;gt; (Numeric reference)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
Hex, short for Hexadecimal, is a base 16 numbering system i.e it has 16 different values from 0 to 9 and A to F to represent various characters. Hex encoding is another form of obfuscation that is, sometimes, used to bypass input validation filters. For instance, hex encoded version of the string &lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert('XSS')&amp;gt; is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=%6A%61%76%61%73%63%72%69%70%74%3A%61%6C%65%72%74%28%27%58%53%53%27%29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A variation of the above string is given below. Can be used in case ‘%’ is being filtered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;amp;#x6A&amp;amp;#x61&amp;amp;#x76&amp;amp;#x61&amp;amp;#x73&amp;amp;#x63&amp;amp;#x72&amp;amp;#x69&amp;amp;#x70&amp;amp;#x74&amp;amp;#x3A&amp;amp;#x61&amp;amp;#x6C&amp;amp;#x65&amp;amp;#x72&amp;amp;#x74&amp;amp;#x28&amp;amp;#x27&amp;amp;#x58&amp;amp;#x53&amp;amp;#x53&amp;amp;#x27&amp;amp;#x29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are other encoding schemes like Base64 and Octal as well that may be used for obfuscation. Although, every encoding scheme may not work every time, a bit of trial and error coupled with intelligent manipulations would definitely reveal the loophole in a weakly built input validation filter.&lt;br /&gt;
&lt;br /&gt;
==== UTF-7 Encoding ====&lt;br /&gt;
&lt;br /&gt;
UTF-7 encoding of &amp;lt;SCRIPT&amp;gt;alert(‘XSS’);&amp;lt;/SCRIPT&amp;gt; is as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;+ADw-SCRIPT+AD4-alert('XSS');+ADw-/SCRIPT+AD4-&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the above script to work, the browser has to interpret the web page as encoded in UTF-7.&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
Variable-width encoding is another type of character encoding scheme that uses codes of varying lengths to encode characters. Multi-Byte Encoding is a type of variable-width encoding that uses varying number of bytes to represent a character.&lt;br /&gt;
Multibyte encoding is primarily used to encode characters that belong to a large character set e.g. Chinese, Japanese and Korean. &lt;br /&gt;
&lt;br /&gt;
Multibyte encoding has been used in the past to bypass standard input validation functions and carry out cross site scripting and sql injection attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
http://ha.ckers.org/xss.html&lt;br /&gt;
&lt;br /&gt;
http://www.cert.org/tech_tips/malicious_code_mitigation.html&lt;br /&gt;
&lt;br /&gt;
http://www.w3schools.com/HTML/html_entities.asp&lt;br /&gt;
&lt;br /&gt;
http://www.iss.net/security_center/advice/Intrusions/2000639/default.htm&lt;br /&gt;
&lt;br /&gt;
http://searchsecurity.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid14_gci1212217_tax299989,00.html&lt;br /&gt;
&lt;br /&gt;
http://www.joelonsoftware.com/articles/Unicode.html&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37387</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37387"/>
				<updated>2008-08-27T17:05:44Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: /* Basic Encoding */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8).&lt;br /&gt;
&lt;br /&gt;
Character encoding has another use or rather misuse. It is being commonly used for encoding malicious injection strings in order to obfuscate and thus bypass input validation filters or take advantage of the browser’s functionality of rendering an encoding scheme.&lt;br /&gt;
&lt;br /&gt;
== Input Encoding – Filter Evasion ==&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
In other words, an encoded injection works because even though an input filter might not recognize or filter an encoded attack, the browser correctly interprets it while rendering the web page.&lt;br /&gt;
&lt;br /&gt;
== Output Encoding – Server &amp;amp; Browser Consensus ==&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; or through HTML META tag (“META HTTP-EQUIV”), as shown below:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters.&lt;br /&gt;
Note: The content type mentioned in the HTTP header has precedence over the META tag declaration.&lt;br /&gt;
&lt;br /&gt;
CERT describes it here as follows:&lt;br /&gt;
&lt;br /&gt;
''Many web pages leave the character encoding (&amp;quot;charset&amp;quot; parameter in HTTP) undefined. In earlier versions of HTML and HTTP, the character encoding was supposed to default to ISO-8859-1 if it wasn't defined. In fact, many browsers had a different default, so it was not possible to rely on the default being ISO-8859-1. HTML version 4 legitimizes this - if the character encoding isn't specified, any character encoding can be used.&lt;br /&gt;
&lt;br /&gt;
If the web server doesn't specify which character encoding is in use, it can't tell which characters are special. Web pages with unspecified character encoding work most of the time because most character sets assign the same characters to byte values below 128. But which of the values above 128 are special? Some 16-bit character-encoding schemes have additional multi-byte representations for special characters such as &amp;quot;&amp;lt;&amp;quot;. Some browsers recognize this alternative encoding and act on it. This is &amp;quot;correct&amp;quot; behavior, but it makes attacks using malicious scripts much harder to prevent. The server simply doesn't know which byte sequences represent the special characters''&lt;br /&gt;
&lt;br /&gt;
Therefore in the event of not receiving the character encoding information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page (server) and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected.&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34;XSS&amp;amp;#34;)&amp;gt; (Numeric reference)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
Hex, short for Hexadecimal, is a base 16 numbering system i.e it has 16 different values from 0 to 9 and A to F to represent various characters. Hex encoding is another form of obfuscation that is, sometimes, used to bypass input validation filters. For instance, hex encoded version of the string &lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert('XSS')&amp;gt; is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=%6A%61%76%61%73%63%72%69%70%74%3A%61%6C%65%72%74%28%27%58%53%53%27%29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A variation of the above string is given below. Can be used in case ‘%’ is being filtered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;amp;#x6A&amp;amp;#x61&amp;amp;#x76&amp;amp;#x61&amp;amp;#x73&amp;amp;#x63&amp;amp;#x72&amp;amp;#x69&amp;amp;#x70&amp;amp;#x74&amp;amp;#x3A&amp;amp;#x61&amp;amp;#x6C&amp;amp;#x65&amp;amp;#x72&amp;amp;#x74&amp;amp;#x28&amp;amp;#x27&amp;amp;#x58&amp;amp;#x53&amp;amp;#x53&amp;amp;#x27&amp;amp;#x29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are other encoding schemes like Base64 and Octal as well that may be used for obfuscation. Although, every encoding scheme may not work every time, a bit of trial and error coupled with intelligent manipulations would definitely reveal the loophole in a weakly built input validation filter.&lt;br /&gt;
&lt;br /&gt;
==== UTF-7 Encoding ====&lt;br /&gt;
&lt;br /&gt;
UTF-7 encoding of &amp;lt;SCRIPT&amp;gt;alert(‘XSS’);&amp;lt;/SCRIPT&amp;gt; is as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;+ADw-SCRIPT+AD4-alert('XSS');+ADw-/SCRIPT+AD4-&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the above script to work, the browser has to interpret the web page as encoded in UTF-7.&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
Variable-width encoding is another type of character encoding scheme that uses codes of varying lengths to encode characters. Multi-Byte Encoding is a type of variable-width encoding that uses varying number of bytes to represent a character.&lt;br /&gt;
Multibyte encoding is primarily used to encode characters that belong to a large character set e.g. Chinese, Japanese and Korean. &lt;br /&gt;
&lt;br /&gt;
Multibyte encoding has been used in the past to bypass standard input validation functions and carry out cross site scripting and sql injection attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
http://ha.ckers.org/xss.html&lt;br /&gt;
&lt;br /&gt;
http://www.cert.org/tech_tips/malicious_code_mitigation.html&lt;br /&gt;
&lt;br /&gt;
http://www.w3schools.com/HTML/html_entities.asp&lt;br /&gt;
&lt;br /&gt;
http://www.iss.net/security_center/advice/Intrusions/2000639/default.htm&lt;br /&gt;
&lt;br /&gt;
http://searchsecurity.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid14_gci1212217_tax299989,00.html&lt;br /&gt;
&lt;br /&gt;
http://www.joelonsoftware.com/articles/Unicode.html&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37386</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37386"/>
				<updated>2008-08-27T17:01:33Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: /* Basic Encoding */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8).&lt;br /&gt;
&lt;br /&gt;
Character encoding has another use or rather misuse. It is being commonly used for encoding malicious injection strings in order to obfuscate and thus bypass input validation filters or take advantage of the browser’s functionality of rendering an encoding scheme.&lt;br /&gt;
&lt;br /&gt;
== Input Encoding – Filter Evasion ==&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
In other words, an encoded injection works because even though an input filter might not recognize or filter an encoded attack, the browser correctly interprets it while rendering the web page.&lt;br /&gt;
&lt;br /&gt;
== Output Encoding – Server &amp;amp; Browser Consensus ==&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; or through HTML META tag (“META HTTP-EQUIV”), as shown below:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters.&lt;br /&gt;
Note: The content type mentioned in the HTTP header has precedence over the META tag declaration.&lt;br /&gt;
&lt;br /&gt;
CERT describes it here as follows:&lt;br /&gt;
&lt;br /&gt;
''Many web pages leave the character encoding (&amp;quot;charset&amp;quot; parameter in HTTP) undefined. In earlier versions of HTML and HTTP, the character encoding was supposed to default to ISO-8859-1 if it wasn't defined. In fact, many browsers had a different default, so it was not possible to rely on the default being ISO-8859-1. HTML version 4 legitimizes this - if the character encoding isn't specified, any character encoding can be used.&lt;br /&gt;
&lt;br /&gt;
If the web server doesn't specify which character encoding is in use, it can't tell which characters are special. Web pages with unspecified character encoding work most of the time because most character sets assign the same characters to byte values below 128. But which of the values above 128 are special? Some 16-bit character-encoding schemes have additional multi-byte representations for special characters such as &amp;quot;&amp;lt;&amp;quot;. Some browsers recognize this alternative encoding and act on it. This is &amp;quot;correct&amp;quot; behavior, but it makes attacks using malicious scripts much harder to prevent. The server simply doesn't know which byte sequences represent the special characters''&lt;br /&gt;
&lt;br /&gt;
Therefore in the event of not receiving the character encoding information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page (server) and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected.&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34;XSS&amp;amp;#34;)&amp;gt; (Numeric reference)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
Hex, short for Hexadecimal, is a base 16 numbering system i.e it has 16 different values from 0 to 9 and A to F to represent various characters. Hex encoding is another form of obfuscation that is, sometimes, used to bypass input validation filters. For instance, hex encoded version of the string &lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert('XSS')&amp;gt; is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=%6A%61%76%61%73%63%72%69%70%74%3A%61%6C%65%72%74%28%27%58%53%53%27%29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A variation of the above string is given below. Can be used in case ‘%’ is being filtered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;amp;#x6A&amp;amp;#x61&amp;amp;#x76&amp;amp;#x61&amp;amp;#x73&amp;amp;#x63&amp;amp;#x72&amp;amp;#x69&amp;amp;#x70&amp;amp;#x74&amp;amp;#x3A&amp;amp;#x61&amp;amp;#x6C&amp;amp;#x65&amp;amp;#x72&amp;amp;#x74&amp;amp;#x28&amp;amp;#x27&amp;amp;#x58&amp;amp;#x53&amp;amp;#x53&amp;amp;#x27&amp;amp;#x29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are other encoding schemes like Base64 and Octal as well that may be used for obfuscation. Although, every encoding scheme may not work every time, a bit of trial and error coupled with intelligent manipulations would definitely reveal the loophole in a weakly built input validation filter.&lt;br /&gt;
&lt;br /&gt;
==== UTF-7 Encoding ====&lt;br /&gt;
&lt;br /&gt;
UTF-7 encoding of &amp;lt;SCRIPT&amp;gt;alert(‘XSS’);&amp;lt;/SCRIPT&amp;gt; is as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;+ADw-SCRIPT+AD4-alert('XSS');+ADw-/SCRIPT+AD4-&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the above script to work, the browser has to interpret the web page as encoded in UTF-7.&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
Variable-width encoding is another type of character encoding scheme that uses codes of varying lengths to encode characters. Multi-Byte Encoding is a type of variable-width encoding that uses varying number of bytes to represent a character.&lt;br /&gt;
Multibyte encoding is primarily used to encode characters that belong to a large character set e.g. Chinese, Japanese and Korean. &lt;br /&gt;
&lt;br /&gt;
Multibyte encoding has been used in the past to bypass standard input validation functions and carry out cross site scripting and sql injection attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
http://ha.ckers.org/xss.html&lt;br /&gt;
&lt;br /&gt;
http://www.cert.org/tech_tips/malicious_code_mitigation.html&lt;br /&gt;
&lt;br /&gt;
http://www.w3schools.com/HTML/html_entities.asp&lt;br /&gt;
&lt;br /&gt;
http://www.iss.net/security_center/advice/Intrusions/2000639/default.htm&lt;br /&gt;
&lt;br /&gt;
http://searchsecurity.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid14_gci1212217_tax299989,00.html&lt;br /&gt;
&lt;br /&gt;
http://www.joelonsoftware.com/articles/Unicode.html&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37385</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37385"/>
				<updated>2008-08-27T17:00:40Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: /* Basic Encoding */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8).&lt;br /&gt;
&lt;br /&gt;
Character encoding has another use or rather misuse. It is being commonly used for encoding malicious injection strings in order to obfuscate and thus bypass input validation filters or take advantage of the browser’s functionality of rendering an encoding scheme.&lt;br /&gt;
&lt;br /&gt;
== Input Encoding – Filter Evasion ==&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
In other words, an encoded injection works because even though an input filter might not recognize or filter an encoded attack, the browser correctly interprets it while rendering the web page.&lt;br /&gt;
&lt;br /&gt;
== Output Encoding – Server &amp;amp; Browser Consensus ==&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; or through HTML META tag (“META HTTP-EQUIV”), as shown below:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters.&lt;br /&gt;
Note: The content type mentioned in the HTTP header has precedence over the META tag declaration.&lt;br /&gt;
&lt;br /&gt;
CERT describes it here as follows:&lt;br /&gt;
&lt;br /&gt;
''Many web pages leave the character encoding (&amp;quot;charset&amp;quot; parameter in HTTP) undefined. In earlier versions of HTML and HTTP, the character encoding was supposed to default to ISO-8859-1 if it wasn't defined. In fact, many browsers had a different default, so it was not possible to rely on the default being ISO-8859-1. HTML version 4 legitimizes this - if the character encoding isn't specified, any character encoding can be used.&lt;br /&gt;
&lt;br /&gt;
If the web server doesn't specify which character encoding is in use, it can't tell which characters are special. Web pages with unspecified character encoding work most of the time because most character sets assign the same characters to byte values below 128. But which of the values above 128 are special? Some 16-bit character-encoding schemes have additional multi-byte representations for special characters such as &amp;quot;&amp;lt;&amp;quot;. Some browsers recognize this alternative encoding and act on it. This is &amp;quot;correct&amp;quot; behavior, but it makes attacks using malicious scripts much harder to prevent. The server simply doesn't know which byte sequences represent the special characters''&lt;br /&gt;
&lt;br /&gt;
Therefore in the event of not receiving the character encoding information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page (server) and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected.&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34;XSS&amp;amp;#34;)&amp;gt; (Numeric reference)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
Hex, short for Hexadecimal, is a base 16 numbering system i.e it has 16 different values from 0 to 9 and A to F to represent various characters. Hex encoding is another form of obfuscation that is, sometimes, used to bypass input validation filters. For instance, hex encoded version of the string &lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert('XSS')&amp;gt; is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=%6A%61%76%61%73%63%72%69%70%74%3A%61%6C%65%72%74%28%27%58%53%53%27%29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A variation of the above string is given below. Can be used in case ‘%’ is being filtered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;amp;#x6A&amp;amp;#x61&amp;amp;#x76&amp;amp;#x61&amp;amp;#x73&amp;amp;#x63&amp;amp;#x72&amp;amp;#x69&amp;amp;#x70&amp;amp;#x74&amp;amp;#x3A&amp;amp;#x61&amp;amp;#x6C&amp;amp;#x65&amp;amp;#x72&amp;amp;#x74&amp;amp;#x28&amp;amp;#x27&amp;amp;#x58&amp;amp;#x53&amp;amp;#x53&amp;amp;#x27&amp;amp;#x29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are other encoding schemes like Base64 and Octal as well that may be used for obfuscation. Although, every encoding scheme may not work every time, a bit of trial and error coupled with intelligent manipulations would definitely reveal the loophole in a weakly built input validation filter.&lt;br /&gt;
&lt;br /&gt;
==== UTF-7 Encoding ====&lt;br /&gt;
&lt;br /&gt;
UTF-7 encoding of &amp;lt;SCRIPT&amp;gt;alert(‘XSS’);&amp;lt;/SCRIPT&amp;gt; is as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;+ADw-SCRIPT+AD4-alert('XSS');+ADw-/SCRIPT+AD4-&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the above script to work, the browser has to interpret the web page as encoded in UTF-7.&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
Variable-width encoding is another type of character encoding scheme that uses codes of varying lengths to encode characters. Multi-Byte Encoding is a type of variable-width encoding that uses varying number of bytes to represent a character.&lt;br /&gt;
Multibyte encoding is primarily used to encode characters that belong to a large character set e.g. Chinese, Japanese and Korean. &lt;br /&gt;
&lt;br /&gt;
Multibyte encoding has been used in the past to bypass standard input validation functions and carry out cross site scripting and sql injection attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
http://ha.ckers.org/xss.html&lt;br /&gt;
&lt;br /&gt;
http://www.cert.org/tech_tips/malicious_code_mitigation.html&lt;br /&gt;
&lt;br /&gt;
http://www.w3schools.com/HTML/html_entities.asp&lt;br /&gt;
&lt;br /&gt;
http://www.iss.net/security_center/advice/Intrusions/2000639/default.htm&lt;br /&gt;
&lt;br /&gt;
http://searchsecurity.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid14_gci1212217_tax299989,00.html&lt;br /&gt;
&lt;br /&gt;
http://www.joelonsoftware.com/articles/Unicode.html&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37384</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37384"/>
				<updated>2008-08-27T16:52:10Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: /* Basic Encoding */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8).&lt;br /&gt;
&lt;br /&gt;
Character encoding has another use or rather misuse. It is being commonly used for encoding malicious injection strings in order to obfuscate and thus bypass input validation filters or take advantage of the browser’s functionality of rendering an encoding scheme.&lt;br /&gt;
&lt;br /&gt;
== Input Encoding – Filter Evasion ==&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
In other words, an encoded injection works because even though an input filter might not recognize or filter an encoded attack, the browser correctly interprets it while rendering the web page.&lt;br /&gt;
&lt;br /&gt;
== Output Encoding – Server &amp;amp; Browser Consensus ==&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; or through HTML META tag (“META HTTP-EQUIV”), as shown below:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters.&lt;br /&gt;
Note: The content type mentioned in the HTTP header has precedence over the META tag declaration.&lt;br /&gt;
&lt;br /&gt;
CERT describes it here as follows:&lt;br /&gt;
&lt;br /&gt;
''Many web pages leave the character encoding (&amp;quot;charset&amp;quot; parameter in HTTP) undefined. In earlier versions of HTML and HTTP, the character encoding was supposed to default to ISO-8859-1 if it wasn't defined. In fact, many browsers had a different default, so it was not possible to rely on the default being ISO-8859-1. HTML version 4 legitimizes this - if the character encoding isn't specified, any character encoding can be used.&lt;br /&gt;
&lt;br /&gt;
If the web server doesn't specify which character encoding is in use, it can't tell which characters are special. Web pages with unspecified character encoding work most of the time because most character sets assign the same characters to byte values below 128. But which of the values above 128 are special? Some 16-bit character-encoding schemes have additional multi-byte representations for special characters such as &amp;quot;&amp;lt;&amp;quot;. Some browsers recognize this alternative encoding and act on it. This is &amp;quot;correct&amp;quot; behavior, but it makes attacks using malicious scripts much harder to prevent. The server simply doesn't know which byte sequences represent the special characters''&lt;br /&gt;
&lt;br /&gt;
Therefore in the event of not receiving the character encoding information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page (server) and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected.&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34;XSS&amp;amp;#34;)&amp;gt; (Numeric reference)&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
Hex, short for Hexadecimal, is a base 16 numbering system i.e it has 16 different values from 0 to 9 and A to F to represent various characters. Hex encoding is another form of obfuscation that is, sometimes, used to bypass input validation filters. For instance, hex encoded version of the string &lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert('XSS')&amp;gt; is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=%6A%61%76%61%73%63%72%69%70%74%3A%61%6C%65%72%74%28%27%58%53%53%27%29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A variation of the above string is given below. Can be used in case ‘%’ is being filtered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;amp;#x6A&amp;amp;#x61&amp;amp;#x76&amp;amp;#x61&amp;amp;#x73&amp;amp;#x63&amp;amp;#x72&amp;amp;#x69&amp;amp;#x70&amp;amp;#x74&amp;amp;#x3A&amp;amp;#x61&amp;amp;#x6C&amp;amp;#x65&amp;amp;#x72&amp;amp;#x74&amp;amp;#x28&amp;amp;#x27&amp;amp;#x58&amp;amp;#x53&amp;amp;#x53&amp;amp;#x27&amp;amp;#x29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are other encoding schemes like Base64 and Octal as well that may be used for obfuscation. Although, every encoding scheme may not work every time, a bit of trial and error coupled with intelligent manipulations would definitely reveal the loophole in a weakly built input validation filter.&lt;br /&gt;
&lt;br /&gt;
==== UTF-7 Encoding ====&lt;br /&gt;
&lt;br /&gt;
UTF-7 encoding of &amp;lt;SCRIPT&amp;gt;alert(‘XSS’);&amp;lt;/SCRIPT&amp;gt; is as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;+ADw-SCRIPT+AD4-alert('XSS');+ADw-/SCRIPT+AD4-&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the above script to work, the browser has to interpret the web page as encoded in UTF-7.&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
Variable-width encoding is another type of character encoding scheme that uses codes of varying lengths to encode characters. Multi-Byte Encoding is a type of variable-width encoding that uses varying number of bytes to represent a character.&lt;br /&gt;
Multibyte encoding is primarily used to encode characters that belong to a large character set e.g. Chinese, Japanese and Korean. &lt;br /&gt;
&lt;br /&gt;
Multibyte encoding has been used in the past to bypass standard input validation functions and carry out cross site scripting and sql injection attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
http://ha.ckers.org/xss.html&lt;br /&gt;
&lt;br /&gt;
http://www.cert.org/tech_tips/malicious_code_mitigation.html&lt;br /&gt;
&lt;br /&gt;
http://www.w3schools.com/HTML/html_entities.asp&lt;br /&gt;
&lt;br /&gt;
http://www.iss.net/security_center/advice/Intrusions/2000639/default.htm&lt;br /&gt;
&lt;br /&gt;
http://searchsecurity.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid14_gci1212217_tax299989,00.html&lt;br /&gt;
&lt;br /&gt;
http://www.joelonsoftware.com/articles/Unicode.html&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37383</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37383"/>
				<updated>2008-08-27T16:51:30Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: /* Basic Encoding */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8).&lt;br /&gt;
&lt;br /&gt;
Character encoding has another use or rather misuse. It is being commonly used for encoding malicious injection strings in order to obfuscate and thus bypass input validation filters or take advantage of the browser’s functionality of rendering an encoding scheme.&lt;br /&gt;
&lt;br /&gt;
== Input Encoding – Filter Evasion ==&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
In other words, an encoded injection works because even though an input filter might not recognize or filter an encoded attack, the browser correctly interprets it while rendering the web page.&lt;br /&gt;
&lt;br /&gt;
== Output Encoding – Server &amp;amp; Browser Consensus ==&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; or through HTML META tag (“META HTTP-EQUIV”), as shown below:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters.&lt;br /&gt;
Note: The content type mentioned in the HTTP header has precedence over the META tag declaration.&lt;br /&gt;
&lt;br /&gt;
CERT describes it here as follows:&lt;br /&gt;
&lt;br /&gt;
''Many web pages leave the character encoding (&amp;quot;charset&amp;quot; parameter in HTTP) undefined. In earlier versions of HTML and HTTP, the character encoding was supposed to default to ISO-8859-1 if it wasn't defined. In fact, many browsers had a different default, so it was not possible to rely on the default being ISO-8859-1. HTML version 4 legitimizes this - if the character encoding isn't specified, any character encoding can be used.&lt;br /&gt;
&lt;br /&gt;
If the web server doesn't specify which character encoding is in use, it can't tell which characters are special. Web pages with unspecified character encoding work most of the time because most character sets assign the same characters to byte values below 128. But which of the values above 128 are special? Some 16-bit character-encoding schemes have additional multi-byte representations for special characters such as &amp;quot;&amp;lt;&amp;quot;. Some browsers recognize this alternative encoding and act on it. This is &amp;quot;correct&amp;quot; behavior, but it makes attacks using malicious scripts much harder to prevent. The server simply doesn't know which byte sequences represent the special characters''&lt;br /&gt;
&lt;br /&gt;
Therefore in the event of not receiving the character encoding information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page (server) and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected.&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34;XSS&amp;amp;#34;)&amp;gt; (Numeric reference)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
Hex, short for Hexadecimal, is a base 16 numbering system i.e it has 16 different values from 0 to 9 and A to F to represent various characters. Hex encoding is another form of obfuscation that is, sometimes, used to bypass input validation filters. For instance, hex encoded version of the string &lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert('XSS')&amp;gt; is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=%6A%61%76%61%73%63%72%69%70%74%3A%61%6C%65%72%74%28%27%58%53%53%27%29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A variation of the above string is given below. Can be used in case ‘%’ is being filtered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;amp;#x6A&amp;amp;#x61&amp;amp;#x76&amp;amp;#x61&amp;amp;#x73&amp;amp;#x63&amp;amp;#x72&amp;amp;#x69&amp;amp;#x70&amp;amp;#x74&amp;amp;#x3A&amp;amp;#x61&amp;amp;#x6C&amp;amp;#x65&amp;amp;#x72&amp;amp;#x74&amp;amp;#x28&amp;amp;#x27&amp;amp;#x58&amp;amp;#x53&amp;amp;#x53&amp;amp;#x27&amp;amp;#x29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are other encoding schemes like Base64 and Octal as well that may be used for obfuscation. Although, every encoding scheme may not work every time, a bit of trial and error coupled with intelligent manipulations would definitely reveal the loophole in a weakly built input validation filter.&lt;br /&gt;
&lt;br /&gt;
==== UTF-7 Encoding ====&lt;br /&gt;
&lt;br /&gt;
UTF-7 encoding of &amp;lt;SCRIPT&amp;gt;alert(‘XSS’);&amp;lt;/SCRIPT&amp;gt; is as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;+ADw-SCRIPT+AD4-alert('XSS');+ADw-/SCRIPT+AD4-&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the above script to work, the browser has to interpret the web page as encoded in UTF-7.&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
Variable-width encoding is another type of character encoding scheme that uses codes of varying lengths to encode characters. Multi-Byte Encoding is a type of variable-width encoding that uses varying number of bytes to represent a character.&lt;br /&gt;
Multibyte encoding is primarily used to encode characters that belong to a large character set e.g. Chinese, Japanese and Korean. &lt;br /&gt;
&lt;br /&gt;
Multibyte encoding has been used in the past to bypass standard input validation functions and carry out cross site scripting and sql injection attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
http://ha.ckers.org/xss.html&lt;br /&gt;
&lt;br /&gt;
http://www.cert.org/tech_tips/malicious_code_mitigation.html&lt;br /&gt;
&lt;br /&gt;
http://www.w3schools.com/HTML/html_entities.asp&lt;br /&gt;
&lt;br /&gt;
http://www.iss.net/security_center/advice/Intrusions/2000639/default.htm&lt;br /&gt;
&lt;br /&gt;
http://searchsecurity.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid14_gci1212217_tax299989,00.html&lt;br /&gt;
&lt;br /&gt;
http://www.joelonsoftware.com/articles/Unicode.html&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37382</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37382"/>
				<updated>2008-08-27T16:50:30Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8).&lt;br /&gt;
&lt;br /&gt;
Character encoding has another use or rather misuse. It is being commonly used for encoding malicious injection strings in order to obfuscate and thus bypass input validation filters or take advantage of the browser’s functionality of rendering an encoding scheme.&lt;br /&gt;
&lt;br /&gt;
== Input Encoding – Filter Evasion ==&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
In other words, an encoded injection works because even though an input filter might not recognize or filter an encoded attack, the browser correctly interprets it while rendering the web page.&lt;br /&gt;
&lt;br /&gt;
== Output Encoding – Server &amp;amp; Browser Consensus ==&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; or through HTML META tag (“META HTTP-EQUIV”), as shown below:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters.&lt;br /&gt;
Note: The content type mentioned in the HTTP header has precedence over the META tag declaration.&lt;br /&gt;
&lt;br /&gt;
CERT describes it here as follows:&lt;br /&gt;
&lt;br /&gt;
''Many web pages leave the character encoding (&amp;quot;charset&amp;quot; parameter in HTTP) undefined. In earlier versions of HTML and HTTP, the character encoding was supposed to default to ISO-8859-1 if it wasn't defined. In fact, many browsers had a different default, so it was not possible to rely on the default being ISO-8859-1. HTML version 4 legitimizes this - if the character encoding isn't specified, any character encoding can be used.&lt;br /&gt;
&lt;br /&gt;
If the web server doesn't specify which character encoding is in use, it can't tell which characters are special. Web pages with unspecified character encoding work most of the time because most character sets assign the same characters to byte values below 128. But which of the values above 128 are special? Some 16-bit character-encoding schemes have additional multi-byte representations for special characters such as &amp;quot;&amp;lt;&amp;quot;. Some browsers recognize this alternative encoding and act on it. This is &amp;quot;correct&amp;quot; behavior, but it makes attacks using malicious scripts much harder to prevent. The server simply doesn't know which byte sequences represent the special characters''&lt;br /&gt;
&lt;br /&gt;
Therefore in the event of not receiving the character encoding information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page (server) and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected.&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34;XSS&amp;amp;#34;)&amp;gt; (Numeric reference)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
Hex, short for Hexadecimal, is a base 16 numbering system i.e it has 16 different values from 0 to 9 and A to F to represent various characters. Hex encoding is another form of obfuscation that is, sometimes, used to bypass input validation filters. For instance, hex encoded version of the string &lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert('XSS')&amp;gt; is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=%6A%61%76%61%73%63%72%69%70%74%3A%61%6C%65%72%74%28%27%58%53%53%27%29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A variation of the above string is given below. Can be used in case ‘%’ is being filtered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;amp;#x6A&amp;amp;#x61&amp;amp;#x76&amp;amp;#x61&amp;amp;#x73&amp;amp;#x63&amp;amp;#x72&amp;amp;#x69&amp;amp;#x70&amp;amp;#x74&amp;amp;#x3A&amp;amp;#x61&amp;amp;#x6C&amp;amp;#x65&amp;amp;#x72&amp;amp;#x74&amp;amp;#x28&amp;amp;#x27&amp;amp;#x58&amp;amp;#x53&amp;amp;#x53&amp;amp;#x27&amp;amp;#x29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are other encoding schemes like Base64 and Octal as well that may be used for obfuscation. Although, every encoding scheme may not work every time, a bit of trial and error coupled with intelligent manipulations would definitely reveal the loophole in a weakly built input validation filter.&lt;br /&gt;
&lt;br /&gt;
==== UTF-7 Encoding ====&lt;br /&gt;
&lt;br /&gt;
UTF-7 encoding of &amp;lt;SCRIPT&amp;gt;alert(‘XSS’);&amp;lt;/SCRIPT&amp;gt; is as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;+ADw-SCRIPT+AD4-alert('XSS');+ADw-/SCRIPT+AD4-&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the above script to work, the browser has to interpret the web page as encoded in UTF-7.&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
Variable-width encoding is another type of character encoding scheme that uses codes of varying lengths to encode characters. Multi-Byte Encoding is a type of variable-width encoding that uses varying number of bytes to represent a character.&lt;br /&gt;
Multibyte encoding is primarily used to encode characters that belong to a large character set e.g. Chinese, Japanese and Korean. &lt;br /&gt;
&lt;br /&gt;
Multibyte encoding has been used in the past to bypass standard input validation functions and carry out cross site scripting and sql injection attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
http://ha.ckers.org/xss.html&lt;br /&gt;
&lt;br /&gt;
http://www.cert.org/tech_tips/malicious_code_mitigation.html&lt;br /&gt;
&lt;br /&gt;
http://www.w3schools.com/HTML/html_entities.asp&lt;br /&gt;
&lt;br /&gt;
http://www.iss.net/security_center/advice/Intrusions/2000639/default.htm&lt;br /&gt;
&lt;br /&gt;
http://searchsecurity.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid14_gci1212217_tax299989,00.html&lt;br /&gt;
&lt;br /&gt;
http://www.joelonsoftware.com/articles/Unicode.html&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37381</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37381"/>
				<updated>2008-08-27T16:44:58Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8).&lt;br /&gt;
&lt;br /&gt;
Character encoding has another use or rather misuse. It is being commonly used for encoding malicious injection strings in order to obfuscate and thus bypass input validation filters or take advantage of the browser’s functionality of rendering an encoding scheme.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
== Input Encoding – Filter Evasion ==&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
In other words, an encoded injection works because even though an input filter might not recognize or filter an encoded attack, the browser correctly interprets it while rendering the web page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Output Encoding – Server &amp;amp; Browser Consensus ==&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; or through HTML META tag (“META HTTP-EQUIV”), as shown below:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters.&lt;br /&gt;
Note: The content type mentioned in the HTTP header has precedence over the META tag declaration.&lt;br /&gt;
&lt;br /&gt;
CERT describes it here as follows:&lt;br /&gt;
&lt;br /&gt;
''Many web pages leave the character encoding (&amp;quot;charset&amp;quot; parameter in HTTP) undefined. In earlier versions of HTML and HTTP, the character encoding was supposed to default to ISO-8859-1 if it wasn't defined. In fact, many browsers had a different default, so it was not possible to rely on the default being ISO-8859-1. HTML version 4 legitimizes this - if the character encoding isn't specified, any character encoding can be used.&lt;br /&gt;
&lt;br /&gt;
If the web server doesn't specify which character encoding is in use, it can't tell which characters are special. Web pages with unspecified character encoding work most of the time because most character sets assign the same characters to byte values below 128. But which of the values above 128 are special? Some 16-bit character-encoding schemes have additional multi-byte representations for special characters such as &amp;quot;&amp;lt;&amp;quot;. Some browsers recognize this alternative encoding and act on it. This is &amp;quot;correct&amp;quot; behavior, but it makes attacks using malicious scripts much harder to prevent. The server simply doesn't know which byte sequences represent the special characters''&lt;br /&gt;
&lt;br /&gt;
Therefore in the event of not receiving the character encoding information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page (server) and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34;XSS&amp;amp;#34;)&amp;gt; (Numeric reference)&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
Hex, short for Hexadecimal, is a base 16 numbering system i.e it has 16 different values from 0 to 9 and A to F to represent various characters. Hex encoding is another form of obfuscation that is, sometimes, used to bypass input validation filters. For instance, hex encoded version of the string &lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert('XSS')&amp;gt; is&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=%6A%61%76%61%73%63%72%69%70%74%3A%61%6C%65%72%74%28%27%58%53%53%27%29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A variation of the above string is given below. Can be used in case ‘%’ is being filtered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;amp;#x6A&amp;amp;#x61&amp;amp;#x76&amp;amp;#x61&amp;amp;#x73&amp;amp;#x63&amp;amp;#x72&amp;amp;#x69&amp;amp;#x70&amp;amp;#x74&amp;amp;#x3A&amp;amp;#x61&amp;amp;#x6C&amp;amp;#x65&amp;amp;#x72&amp;amp;#x74&amp;amp;#x28&amp;amp;#x27&amp;amp;#x58&amp;amp;#x53&amp;amp;#x53&amp;amp;#x27&amp;amp;#x29&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are other encoding schemes like Base64 and Octal as well that may be used for obfuscation. Although, every encoding scheme may not work every time, a bit of trial and error coupled with intelligent manipulations would definitely reveal the loophole in a weakly built input validation filter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== UTF-7 Encoding ====&lt;br /&gt;
&lt;br /&gt;
UTF-7 encoding of &amp;lt;SCRIPT&amp;gt;alert(‘XSS’);&amp;lt;/SCRIPT&amp;gt; is as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;+ADw-SCRIPT+AD4-alert('XSS');+ADw-/SCRIPT+AD4-&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the above script to work, the browser has to interpret the web page as encoded in UTF-7.&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
Variable-width encoding is another type of character encoding scheme that uses codes of varying lengths to encode characters. Multi-Byte Encoding is a type of variable-width encoding that uses varying number of bytes to represent a character.&lt;br /&gt;
Multibyte encoding is primarily used to encode characters that belong to a large character set e.g. Chinese, Japanese and Korean. &lt;br /&gt;
&lt;br /&gt;
Multibyte encoding has been used in the past to bypass standard input validation functions and carry out cross site scripting and sql injection attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
http://ha.ckers.org/xss.html&lt;br /&gt;
http://www.cert.org/tech_tips/malicious_code_mitigation.html&lt;br /&gt;
http://www.w3schools.com/HTML/html_entities.asp&lt;br /&gt;
http://www.iss.net/security_center/advice/Intrusions/2000639/default.htm&lt;br /&gt;
http://searchsecurity.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid14_gci1212217_tax299989,00.html&lt;br /&gt;
http://www.joelonsoftware.com/articles/Unicode.html&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37363</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37363"/>
				<updated>2008-08-27T14:00:37Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: /* Output Encoding – Server &amp;amp; Browser Consensus */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8).&lt;br /&gt;
&lt;br /&gt;
Character encoding has another use or rather misuse. It is being commonly used for encoding malicious injection strings in order to obfuscate and thus bypass input validation filters or take advantage of the browser’s functionality of rendering an encoding scheme.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
== Input Encoding – Filter Evasion ==&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
In other words, an encoded injection works because even though an input filter might not recognize or filter an encoded attack, the browser correctly interprets it while rendering the web page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Output Encoding – Server &amp;amp; Browser Consensus ==&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 or through HTML META tag (“META HTTP-EQUIV”), as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters. &lt;br /&gt;
&lt;br /&gt;
However, in the event of not receiving this information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected. This behavior of the browser is sometimes exploited to bypass output encoding mechanisms i.e HTML entities encoding (&amp;amp;lt; for ‘&amp;lt;’, &amp;amp;gt; for ‘&amp;gt;’).&lt;br /&gt;
&lt;br /&gt;
== Various Encodings ==&lt;br /&gt;
&lt;br /&gt;
Consider the following scenarios that better illustrate the idea of filter bypass using character encoding&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34;XSS&amp;amp;#34;)&amp;gt; (Numeric reference)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== US-ASCII Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== UTF 8 Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37362</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=37362"/>
				<updated>2008-08-27T13:41:08Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8).&lt;br /&gt;
&lt;br /&gt;
Character encoding has another use or rather misuse. It is being commonly used for encoding malicious injection strings in order to obfuscate and thus bypass input validation filters or take advantage of the browser’s functionality of rendering an encoding scheme.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
== Input Encoding – Filter Evasion ==&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
In other words, an encoded injection works because even though an input filter might not recognize or filter an encoded attack, the browser correctly interprets it while rendering the web page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Output Encoding – Server &amp;amp; Browser Consensus ==&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 or through HTML META tag (“META HTTP-EQUIV”), as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters. &lt;br /&gt;
&lt;br /&gt;
However, in the event of not receiving this information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected. This behavior of the browser is sometimes exploited to bypass output encoding mechanisms i.e HTML entities encoding (&amp;amp;lt; for ‘&amp;lt;’, &amp;amp;gt; for ‘&amp;gt;’).&lt;br /&gt;
&lt;br /&gt;
== Various Encodings ==&lt;br /&gt;
&lt;br /&gt;
Consider the following scenarios that better illustrate the idea of filter bypass using character encoding&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34;XSS&amp;amp;#34;)&amp;gt; (Numeric reference)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== US-ASCII Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== UTF 8 Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v3_Table_of_Contents&amp;diff=37353</id>
		<title>OWASP Testing Guide v3 Table of Contents</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v3_Table_of_Contents&amp;diff=37353"/>
				<updated>2008-08-27T04:34:03Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
This is the draft of table of content of the New Testing Guide.&lt;br /&gt;
You can download the stable version [http://www.owasp.org/index.php/Image:OWASP_Testing_Guide_v2_pdf.zip here] &lt;br /&gt;
&lt;br /&gt;
Back to the OWASP Testing Guide Project:&lt;br /&gt;
http://www.owasp.org/index.php/OWASP_Testing_Project&lt;br /&gt;
&lt;br /&gt;
 Testing Guide v3 (draft)&lt;br /&gt;
 Updated: 25th August 2008&lt;br /&gt;
 (new)--&amp;gt; new articles, (toimp)--&amp;gt; needs to improve or to review, (xxx%) --&amp;gt; current state of the article&lt;br /&gt;
&lt;br /&gt;
'''T A B L E    o f    C O N T E N T S'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==[[Testing Guide Foreword|(toimp)Foreword by OWASP Chair]]==&lt;br /&gt;
&lt;br /&gt;
==[[Testing Guide Frontispiece |(toimp: M.Meucci)1. Frontispiece]]==&lt;br /&gt;
&lt;br /&gt;
'''[[Testing Guide Frontispiece|(toimp: M.Meucci)1.1 About the OWASP Testing Guide Project]]'''&lt;br /&gt;
&lt;br /&gt;
'''[[About The Open Web Application Security Project|1.2 About The Open Web Application Security Project]]'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[Testing Guide Introduction|2. Introduction]]==&lt;br /&gt;
&lt;br /&gt;
'''2.1 The OWASP Testing Project'''&lt;br /&gt;
&lt;br /&gt;
'''2.2 Principles of Testing'''&lt;br /&gt;
&lt;br /&gt;
'''2.3 Testing Techniques Explained''' &lt;br /&gt;
&lt;br /&gt;
(new: M. Morana 100%) 2.4 [https://www.owasp.org/index.php/Testing_Guide_Introduction#Security_Requirements_Test_Derivation Security requirements test derivation],[https://www.owasp.org/index.php/Testing_Guide_Introduction#Functional_and_Non_Functional_Test_Requirements functional and non functional test requirements], and [https://www.owasp.org/index.php/Testing_Guide_Introduction#Test_Cases_Through_Use_and_Misuse_Cases test cases through use and misuse cases]&lt;br /&gt;
&lt;br /&gt;
(new: M. Morana 100%) 2.4.1 [https://www.owasp.org/index.php/Testing_Guide_Introduction#Security_Tests_Integrated_in_Developers_and_Testers_Workflow Security tests integrated in developers and testers workflows]&lt;br /&gt;
&lt;br /&gt;
(new: M. Morana 100%) 2.4.2 [https://www.owasp.org/index.php/Testing_Guide_Introduction#Developers.27_Security_Tests Developers' security tests: unit tests and component level tests]&lt;br /&gt;
&lt;br /&gt;
(new: M. Morana 100%) 2.4.3 [https://www.owasp.org/index.php/Testing_Guide_Introduction#Functional_Testers.27_Security_Tests Functional testers' security tests: integrated system tests, tests in UAT, and production environment]&lt;br /&gt;
&lt;br /&gt;
(new: M. Morana 100%) 2.5 [https://www.owasp.org/index.php/Testing_Guide_Introduction#Security_Test_Data_Analysis_and_Reporting Security test data analysis and reporting: root cause identification and business/role case test data reporting]&lt;br /&gt;
&lt;br /&gt;
==[[The OWASP Testing Framework|3. The OWASP Testing Framework]]==&lt;br /&gt;
&lt;br /&gt;
'''3.1. Overview'''&lt;br /&gt;
&lt;br /&gt;
'''3.2. Phase 1: Before Development Begins '''&lt;br /&gt;
&lt;br /&gt;
'''3.3. Phase 2: During Definition and Design'''&lt;br /&gt;
&lt;br /&gt;
'''3.4. Phase 3: During Development'''&lt;br /&gt;
&lt;br /&gt;
'''3.5. Phase 4: During Deployment'''&lt;br /&gt;
&lt;br /&gt;
'''3.6. Phase 5: Maintenance and Operations'''&lt;br /&gt;
&lt;br /&gt;
'''3.7. A Typical SDLC Testing Workflow '''&lt;br /&gt;
&lt;br /&gt;
==[[Web Application Penetration Testing |4. (M.Meucci) Web Application Penetration Testing ]]==&lt;br /&gt;
&lt;br /&gt;
[[Testing: Introduction and objectives|'''4.1 Introduction and Objectives''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing Checklist| (new: M.Meucci - 100% ) 4.1.1 Testing Checklist]]&lt;br /&gt;
&lt;br /&gt;
[[Testing: Information Gathering|'''4.2 Information Gathering''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing: Spiders Robots and Crawlers|(C.Heinrich)4.2.1 Spiders, Robots and Crawlers]]&lt;br /&gt;
&lt;br /&gt;
[[Testing: Search engine discovery|(C.Heinrich)4.2.2 Search Engine Discovery/Reconnaissance]]&lt;br /&gt;
&lt;br /&gt;
[[Testing: Identify application entry points| (new: K.Horvath - 100%) 4.2.3 Identify application entry points]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Web Application Fingerprint|4.2.4 Testing for Web Application Fingerprint]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Application Discovery|4.2.5 Application Discovery]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Error Code|4.2.6 Analysis of Error Codes]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for configuration management|''' (new) 4.3 Configuration Management Testing''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing for SSL-TLS| 4.3.1 SSL/TLS Testing (SSL Version, Algorithms, Key length, Digital Cert. Validity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Testing for DB Listener|4.3.2 DB Listener Testing]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for infrastructure configuration management| (new) 4.3.3 Infrastructure Configuration Management Testing]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for application configuration management|4.3.4 Application Configuration Management Testing]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for file extensions handling|4.3.5 Testing for File Extensions Handling]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for old_file|4.3.6 Old, Backup and Unreferenced Files]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Admin Interfaces|(imp: A. Goodman - 100%) 4.3.7 Infrastructure and Application Admin Interfaces]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for HTTP Methods and XST| (imp: A. van der Stock - 100%)4.3.8 Testing for HTTP Methods and XST]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for business logic|'''(K.Horvath - 100%) 4.4 Business Logic Testing''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing for authentication|'''(M.Meucci - 100%) 4.5 Authentication Testing''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing for credentials transport|(new: G.Ingrosso - 100%) 4.5.1 Credentials transport over an encrypted channel]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for user enumeration|(new: M.Meucci, M.Mella - 90%) 4.5.2 Testing for user enumeration]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Default or Guessable User Account|(K.Horvath - 100% - adam updated) 4.5.3 Testing for Guessable (Dictionary) User Account]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Brute Force|4.5.4 Brute Force Testing]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Bypassing Authentication Schema|4.5.5 Testing for bypassing authentication schema]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Vulnerable Remember Password and Pwd Reset|4.5.6 Testing for vulnerable remember &lt;br /&gt;
password and pwd reset]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Logout and Browser Cache Management|4.5.7 Testing for Logout and Browser Cache Management Testing]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Captcha|(new: P.Luptak - 100% ) 4.5.8 Testing for CAPTCHA]]&lt;br /&gt;
&lt;br /&gt;
[[Testing Multiple Factors Authentication| (new: G.Fedon - 100%) 4.5.9 Testing Multiple Factors Authentication]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Race Conditions| (new: A. Goodman - 100%) 4.5.10 Testing for Race Conditions]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Authorization|'''(new: M.Meucci - 100%) 4.6 Authorization testing''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Path Traversal|(new) 4.6.1 Testing for path traversal]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Bypassing Authorization Schema|(new: M.Meucci - 100%)4.6.2 Testing for bypassing authorization schema]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Privilege escalation|(new: Cecil Su, M.Meucci - 100%)4.6.3 Testing for Privilege Escalation]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Session Management|'''4.7 Session Management Testing''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Session_Management_Schema|(new: M.Meucci - 100%) 4.7.1 Testing for Session Management Schema]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for cookies attributes| (new: K.Horvath - 100%) 4.7.2 Testing for Cookies attributes]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Session Fixation| (M.Meucci - 100% (updated by adam)) 4.7.3 Testing for Session Fixation]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Exposed Session Variables|4.7.4 Testing for Exposed Session Variables ]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for CSRF|4.7.5 Testing for CSRF]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for HTTP Exploit|4.7.6 Testing for HTTP Exploit ]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Data Validation|'''4.8 Data Validation Testing''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Reflected Cross site scripting|(new: A. Coronel -100%)4.8.1 Testing for Reflected Cross Site Scripting]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Stored Cross site scripting|(new: R. Suggi Liverani - 100%)4.8.2 Testing for Stored Cross Site Scripting]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for DOM-based Cross site scripting|(new: A.Agarwwal, Kuza55 - 80%) 4.8.3 Testing for DOM based Cross Site Scripting]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Cross site flashing|(new: A.Agarwwal, S.Di Paola - 0%)4.8.4 Testing for Cross Site Flashing]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for SQL Injection| 4.8.5 Testing for SQL Injection ]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Oracle|4.8.5.1 Oracle Testing ]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for MySQL|4.8.5.2 MySQL Testing ]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for SQL Server|4.8.5.3 SQL Server Testing]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for MS Access|(new:A.Parata - 100%) 4.8.5.4 MS Access Testing]]&lt;br /&gt;
&lt;br /&gt;
[[OWASP_Backend_Security_Project_Testing_PostgreSQL|4.8.5.5 (new: D.Bellucci 100% from OWASP BSP) Testing PostgreSQL]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for LDAP Injection|4.8.6 Testing for LDAP Injection]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for ORM Injection|4.8.7 Testing for ORM Injection]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for XML Injection|4.8.8 Testing for XML Injection]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for SSI Injection|4.8.9 Testing for SSI Injection]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for XPath Injection|4.8.10 Testing for XPath Injection]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for IMAP/SMTP Injection|4.8.11 IMAP/SMTP Injection]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Code Injection|4.8.12 Testing for Code Injection]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Command Injection|4.8.13 Testing for Command Injection]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Buffer Overflow|4.8.14 Testing for Buffer overflow]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Heap Overflow|4.8.14.1 Testing for Heap overflow]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Stack Overflow|4.8.14.2 Testing for Stack overflow]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Format String|4.8.14.3 Testing for Format string]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Incubated Vulnerability|4.8.15 Testing for incubated vulnerabilities]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Denial of Service|'''4.9 Testing for Denial of Service''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing for SQL Wildcard Attacks|(new: F.Mavituna - 100%) 4.9.1 Testing for SQL Wildcard Attacks]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for DoS Locking Customer Accounts|4.9.2 Testing for DoS Locking Customer Accounts]]	&lt;br /&gt;
&lt;br /&gt;
[[Testing for DoS Buffer Overflows|4.9.3 Testing for DoS Buffer Overflows]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for DoS User Specified Object Allocation|4.9.4 Testing for DoS User Specified Object Allocation]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for User Input as a Loop Counter|4.9.5 Testing for User Input as a Loop Counter]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Writing User Provided Data to Disk|4.9.6 Testing for Writing User Provided Data to Disk]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for DoS Failure to Release Resources|4.9.7 Testing for DoS Failure to Release Resources]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Storing too Much Data in Session|4.9.8 Testing for Storing too Much Data in Session]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Web Services|(toimp: M.Meucci -100%) '''4.10 Web Services Testing''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing: WS Information Gathering|(new: M.Meucci -100%) 4.10.1 WS Information Gathering]]&lt;br /&gt;
&lt;br /&gt;
[[Testing WSDL|(new: M.Meucci -100%) 4.10.2 Testing WSDL]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for XML Structural|(toimp: M.Meucci -100%)4.10.3 XML Structural Testing ]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for XML Content-Level|4.10.4 XML Content-level Testing ]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for WS HTTP GET parameters/REST attacks|4.10.5 HTTP GET parameters/REST Testing ]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Naughty SOAP Attachments|4.10.6 Naughty SOAP attachments ]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for WS Replay|4.10.7 Replay Testing ]]&lt;br /&gt;
&lt;br /&gt;
[[Testing_for_AJAX:_introduction|'''4.11 AJAX Testing''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing for AJAX Vulnerabilities|4.11.1 AJAX Vulnerabilities]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for AJAX|4.11.2 How to test AJAX]]&lt;br /&gt;
&lt;br /&gt;
==[[Writing Reports: value the real risk |(toimp: Mat)5. Writing Reports: value the real risk ]]==&lt;br /&gt;
&lt;br /&gt;
[[How to value the real risk |5.1 How to value the real risk]]&lt;br /&gt;
&lt;br /&gt;
[[How to write the report of the testing |5.2 How to write the report of the testing]]&lt;br /&gt;
&lt;br /&gt;
==[[Appendix A: Testing Tools |Appendix A: Testing Tools ]]==&lt;br /&gt;
&lt;br /&gt;
* Black Box Testing Tools&lt;br /&gt;
* Source Code Analyzers&lt;br /&gt;
* Other Tools&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[OWASP Testing Guide Appendix B: Suggested Reading | Appendix B: Suggested Reading]]==&lt;br /&gt;
* Whitepapers&lt;br /&gt;
* Books&lt;br /&gt;
* Useful Websites&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[OWASP Testing Guide Appendix C: Fuzz Vectors | Appendix C: Fuzz Vectors]]==&lt;br /&gt;
&lt;br /&gt;
* Fuzz Categories&lt;br /&gt;
** Recursive fuzzing&lt;br /&gt;
** Replasive fuzzing&lt;br /&gt;
* Cross Site Scripting (XSS)&lt;br /&gt;
* Buffer Overflows and Format String Errors&lt;br /&gt;
** Buffer Overflows (BFO)&lt;br /&gt;
** Format String Errors (FSE)&lt;br /&gt;
** Integer Overflows (INT)&lt;br /&gt;
* SQL Injection&lt;br /&gt;
** Passive SQL Injection (SQP)&lt;br /&gt;
** Active SQL Injection (SQI)&lt;br /&gt;
* LDAP Injection&lt;br /&gt;
* XPATH Injection&lt;br /&gt;
&lt;br /&gt;
==[[OWASP Testing Guide Appendix D: Encoded Injection | (new: Harish Sureddy.)Appendix D: Encoded Injection]]==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Testing Project]]&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=32598</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=32598"/>
				<updated>2008-06-28T12:15:53Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8)&lt;br /&gt;
&lt;br /&gt;
Character encoding can be used in different ways to attack a web application:&lt;br /&gt;
 &lt;br /&gt;
== Case 1 ==&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
== Case 2 ==&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 or through HTML META tag (“META HTTP-EQUIV”), as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters. &lt;br /&gt;
&lt;br /&gt;
However, in the event of not receiving this information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected. This behavior of the browser is sometimes exploited to bypass output encoding mechanisms i.e HTML entities encoding (&amp;amp;lt; for ‘&amp;lt;’, &amp;amp;gt; for ‘&amp;gt;’).&lt;br /&gt;
&lt;br /&gt;
== Various Encodings ==&lt;br /&gt;
&lt;br /&gt;
Consider the following scenarios that better illustrate the idea of filter bypass using character encoding&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34;XSS&amp;amp;#34;)&amp;gt; (Numeric reference)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== US-ASCII Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== UTF 8 Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=32597</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=32597"/>
				<updated>2008-06-28T12:15:24Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: /* Case 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8)&lt;br /&gt;
&lt;br /&gt;
Character encoding can be used in different ways to attack a web application:&lt;br /&gt;
 &lt;br /&gt;
== Case 1 ==&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
== Case 2 ==&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 or through HTML META tag (“META HTTP-EQUIV”), as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters. &lt;br /&gt;
&lt;br /&gt;
However, in the event of not receiving this information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected. This behavior of the browser is sometimes exploited to bypass output encoding mechanisms i.e HTML entities encoding (&amp;amp;lt; for ‘&amp;lt;’, &amp;amp;gt; for ‘&amp;gt;’).&lt;br /&gt;
&lt;br /&gt;
== Various Encodings ==&lt;br /&gt;
&lt;br /&gt;
Consider the following scenarios that better illustrate the idea of filter bypass using character encoding&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34;XSS&amp;amp;#34;)&amp;gt; (Numeric reference)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== US-ASCII Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== UTF 8 Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== References ====&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=32596</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=32596"/>
				<updated>2008-06-28T12:13:55Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: /* Case 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8)&lt;br /&gt;
&lt;br /&gt;
Character encoding can be used in different ways to attack a web application:&lt;br /&gt;
 &lt;br /&gt;
=== Case 1 ===&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
==== Case 2 ====&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 or through HTML META tag (“META HTTP-EQUIV”), as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters. &lt;br /&gt;
&lt;br /&gt;
However, in the event of not receiving this information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected. This behavior of the browser is sometimes exploited to bypass output encoding mechanisms i.e HTML entities encoding (&amp;amp;lt; for ‘&amp;lt;’, &amp;amp;gt; for ‘&amp;gt;’).&lt;br /&gt;
&lt;br /&gt;
Consider the following scenarios that better illustrate the idea of filter bypass using character encoding&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34;XSS&amp;amp;#34;)&amp;gt; (Numeric reference)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== US-ASCII Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== UTF 8 Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== References ====&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=32595</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=32595"/>
				<updated>2008-06-28T12:13:11Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8)&lt;br /&gt;
&lt;br /&gt;
Character encoding can be used in different ways to attack a web application:&lt;br /&gt;
 &lt;br /&gt;
==== Case 1 ====&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
==== Case 2 ====&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 or through HTML META tag (“META HTTP-EQUIV”), as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters. &lt;br /&gt;
&lt;br /&gt;
However, in the event of not receiving this information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected. This behavior of the browser is sometimes exploited to bypass output encoding mechanisms i.e HTML entities encoding (&amp;amp;lt; for ‘&amp;lt;’, &amp;amp;gt; for ‘&amp;gt;’).&lt;br /&gt;
&lt;br /&gt;
Consider the following scenarios that better illustrate the idea of filter bypass using character encoding&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34;XSS&amp;amp;#34;)&amp;gt; (Numeric reference)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== US-ASCII Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== UTF 8 Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== References ====&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=32594</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=32594"/>
				<updated>2008-06-28T12:08:36Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Background ===&lt;br /&gt;
&lt;br /&gt;
Character Encoding is primarily used to represent characters, numbers and other symbols in a format that is suitable for a computer to understand, store, and render data. It is, in simple terms, the conversion of bytes into characters - characters belonging to different languages like English, Chinese, Greek or any other known language. A common and one of the early character encoding schemes is ASCII (American Standard Code for Information Interchange) that initially, used 7 bit coded characters. Today, the most common encoding scheme used is Unicode (UTF 8)&lt;br /&gt;
&lt;br /&gt;
Character encoding can be used in different ways to attack a web application:&lt;br /&gt;
 &lt;br /&gt;
==== Case 1 ====&lt;br /&gt;
&lt;br /&gt;
Web applications usually employ different types of input filtering mechanisms to limit the input that can be submitted by its users. If these input filters are not implemented sufficiently well, it is possible to slip a character or two through these filters. For instance, a / can be represented as 2F (hex) in ASCII, while the same character (/) is encoded as C0 AF in Unicode (2 byte sequence). Therefore, it is important for the input filtering control to be aware of the encoding scheme used. If the filter is found to be detecting UTF 8 encoded injections a different encoding scheme may be employed to bypass the filter.&lt;br /&gt;
&lt;br /&gt;
==== Case 2 ====&lt;br /&gt;
&lt;br /&gt;
Web browsers, in order to coherently display a web page, are required to be aware of the encoding scheme used. Ideally, this information should be provided to the browser through HTTP headers (“Content-Type”) as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Content-Type: text/html; charset=UTF-8&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 or through HTML META tag (“META HTTP-EQUIV”), as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;META http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=ISO-8859-1&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is through these character encoding declarations that the browser understands which set of characters to use when converting bytes to characters. &lt;br /&gt;
&lt;br /&gt;
However, in the event of not receiving this information from the server, the browser either attempts to ‘guess’ the encoding scheme or reverts to a default scheme. In some cases, the user explicitly sets the default encoding in the browser to a different scheme. Any such mismatch in the encoding scheme used by the web page and the browser may cause the browser to interpret the page in a manner that is unintended or unexpected. This behavior of the browser is sometimes exploited to bypass output encoding mechanisms i.e HTML entities encoding (&amp;amp;lt; for ‘&amp;lt;’, &amp;amp;gt; for ‘&amp;gt;’).&lt;br /&gt;
&lt;br /&gt;
Consider the following scenarios that better illustrate the idea of filter bypass using character encoding&lt;br /&gt;
&lt;br /&gt;
==== Encoded Injections ====&lt;br /&gt;
&lt;br /&gt;
All the scenarios given below form only a subset of the various ways obfuscation can be achieved in order to bypass input filters. Also, the success of encoded injections depends on the browser in use. For e.g US-ASCII encoded injections were previously successful only in IE browser but not in Firefox. Therefore, it may be noted that encoded injections, to a large extent, are browser dependent.&lt;br /&gt;
&lt;br /&gt;
==== Basic Encoding ====&lt;br /&gt;
&lt;br /&gt;
Consider a basic input validation filter that protects against injection of single quote character. In this case the following injection would easily bypass this filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String.fromCharCode Javascript function takes the given Unicode values and returns the corresponding string. This is one of the most basic forms of encoded injections. Another vector that can be used to bypass this filter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IMG SRC=javascript:alert(&amp;amp;#34;XSS&amp;amp;#34;)&amp;gt; (Numeric reference)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above uses HTML Entities to construct the injection string. HTML Entities encoding is used to display characters that have a special meaning in HTML. For instance, ‘&amp;gt;’ works as a closing bracket for a HTML tag. In order to actually display this character on the web page HTML character entities should be inserted in the page source. The injections mentioned above are one way of encoding. There are numerous other ways in which a string can be encoded (obfuscated) in order to bypass the above filter.&lt;br /&gt;
&lt;br /&gt;
==== Hex Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== US-ASCII Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== UTF 8 Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== Multi-byte Encoding ====&lt;br /&gt;
&lt;br /&gt;
==== References ====&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=30048</id>
		<title>OWASP Testing Guide Appendix D: Encoded Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_D:_Encoded_Injection&amp;diff=30048"/>
				<updated>2008-05-30T06:28:32Z</updated>
		
		<summary type="html">&lt;p&gt;Harish s s: New page: Character Encoding&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Character Encoding&lt;/div&gt;</summary>
		<author><name>Harish s s</name></author>	</entry>

	</feed>