<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Squarespace Site Server v5.11.5 (http://www.squarespace.com/) on Fri, 03 Sep 2010 12:51:12 GMT--><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>Blog</title><link>http://www.packetninjas.net/blog/</link><description></description><lastBuildDate>Wed, 05 May 2010 04:10:47 +0000</lastBuildDate><copyright></copyright><language>en-US</language><generator>Squarespace Site Server v5.11.5 (http://www.squarespace.com/)</generator><item><title>Basic Web Application Security for Managers &amp; QA - Part 1</title><category>Blackbox Testing</category><category>Cross Site Scripting</category><category>Daniel Clemens</category><category>General Exceptions</category><category>Generic Information Security</category><category>Input Validation</category><category>Manual Testing</category><category>Output Validation</category><category>Packetninjas</category><category>Penetration Testing</category><category>Sql Injection</category><category>Web Application Security</category><dc:creator>Packetninjas Admin</dc:creator><pubDate>Tue, 26 Jan 2010 23:24:37 +0000</pubDate><link>http://www.packetninjas.net/blog/2010/1/26/basic-web-application-security-for-managers-qa-part-1.html</link><guid isPermaLink="false">430476:4892980:6438867</guid><description><![CDATA[<div id="_mcePaste"><strong>Introduction &amp; Target Audience&nbsp;</strong></div>
<div id="_mcePaste"><span> </span>Recently, I was approached by a client who wanted to know more information on how they could map out vulnerabilities&nbsp;within their applications as the applications were built along side the yearly review we provide for them. My initial thoughts&nbsp;gravitated to talking more about a more robust SDLC (<a href="http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle" target="_blank">Software Development Life Cylce)</a> process as well as providing information to the client on how to identify basic flaws within their web application and externally facing infrastructure.&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div id="_mcePaste"><span> </span>In this blog post I hope to present some basic information behind the v00d00 magic of web application testing&nbsp;(or application testing in general) to an audience which most likely consists&nbsp;of quality assurance professionals, internal audit, or even managers who may want more information on how they themselves could build in a very generic testing process to identify very generic vulnerabilities within their web applications.&nbsp;Most of the work which lies before you really hinges upon a few basic pieces of information coupled with a mix of out of the box thinking and practice.&nbsp;</div>
<div id="_mcePaste"><span> </span></div>
<div id="_mcePaste"></div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>What we will cover follows:</div>
<div><ol>
<li>The mindset and baselining. &nbsp;</li>
<li>The Basics in Web Applications</li>
<li>Basic Exceptions</li>
</ol></div>
<div id="_mcePaste"><span> </span></div>
<div id="_mcePaste"></div>
<div>&nbsp;</div>
<div><strong>Mindset ....</strong></div>
<div id="_mcePaste"><span> </span>Just like putting your game face on, or putting on war paint for a crazy adventure you will want to really put yourself into the mindset of&nbsp;a hunter looking for its prey. Along your hunt you will need the courage and perseverance to hunt your prey. The prey, Implementation bugs<em> (input validation specifically) </em>within&nbsp;your companies web application.</div>
<div></div>
<div></div>
<div>Before beginning on your journey remember every part of the application is at your disposal and you want to think about&nbsp;how you can use it for your intended purposes not entirely the intended purposes set forth by the developers. &nbsp;You will baseline normal activity in preparation for discovering abnormal activity (<em>exceptions</em>).&nbsp;</div>
<div id="_mcePaste"><span> </span></div>
<div id="_mcePaste"></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div><strong>A bit of background on Web Applications</strong></div>
<div id="_mcePaste"><span> </span>Remember the webserver is really just a glorified file server, which acts as a presentation&nbsp;</div>
<div id="_mcePaste"><span> </span>to the end user *(you, your browser etc).&nbsp;</div>
<div>Web applications process input from the client in two common forms.</div>
<div>Those forms are known as HTTP <strong>GET</strong> and <strong>POST</strong> operations.&nbsp;</div>
<div id="_mcePaste"></div>
<div>&nbsp;</div>
<div>A GET request basically asks the webserver to retrieve certain information from the webserver, while a POST operation pushes information into a web application.&nbsp;Information within a webpage (application) can be dynamically rendered based on information within a GET or a POST request.</div>
<div id="_mcePaste"><span> </span></div>
<div id="_mcePaste"></div>
<div>A GET request might look like the following:</div>
<div id="_mcePaste"><span> </span></div>
<blockquote>
<div id="_mcePaste"><span> </span><strong>GET</strong> /MyCalendarapplication/AddMeeting.asp<strong>?day=1</strong><strong>&amp;time=noon</strong></div>
</blockquote>
<div id="_mcePaste"><span> </span></div>
<div id="_mcePaste"></div>
<div>Traditionally information is requested through your web browser to the server. (You won't see the actual GET portion), but within your&nbsp;web browser you will see http://www.yoursite.com/MyCalendarapplication/<strong>AddMeeting.asp?day=1&amp;time=noon</strong></div>
<div id="_mcePaste"><span> </span></div>
<div id="_mcePaste"><span> </span>Based on the information passed to this portion of the application certain events can transpire on the application based on information&nbsp;passed to variables.&nbsp;</div>
<div id="_mcePaste"><span> </span></div>
<div id="_mcePaste"></div>
<div></div>
<div><strong>Eg:</strong> /AddMeeting.asp?<strong>day=1</strong><strong>&amp;time=noon</strong></div>
<div id="_mcePaste"><span> </span>AddMeeting.asp = the server side script.&nbsp;</div>
<div id="_mcePaste"><span> </span>day=1&amp;time=noon are variables in which the server side application respond to depending on what information is passed. (Variables signified by the <strong>&amp;</strong> character)&nbsp;</div>
<div id="_mcePaste"><span> </span></div>
<div id="_mcePaste"></div>
<div></div>
<div>&nbsp;</div>
<div>The same is true for POST operations, when variables are passed within a POST request to an application <em>(<strong>*</strong>Note POST requests usually occur when submitting forms etc)</em></div>
<div id="_mcePaste"><span> </span>variables will hold information sent back to the application.</div>
<div id="_mcePaste"><span> </span>&nbsp;</div>
<div id="_mcePaste"><span> </span></div>
<div id="_mcePaste"><span> </span>Your initial goal should be to walk through your application to identify the static content (<em>eg html, css, jpg's</em>) versus the dynamic application like content.&nbsp;<em>(Eg. Php,asp,aspx,cgi )</em></div>
<div id="_mcePaste"><span> </span></div>
<div id="_mcePaste"><span> </span>Your secondary goal will be to map out all the information which is passed to the application, and in which manner (whether it is through a GET or a POST method.)</div>
<div></div>
<div></div>
<div id="_mcePaste"><span> </span></div>
<div id="_mcePaste"></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div><strong>Basic things to integrate into your QA Process (Vulnerability Discovery)</strong></div>
<div id="_mcePaste"><span> </span></div>
<div id="_mcePaste"><span> </span></div>
<div id="_mcePaste"><span> </span>Application information is generally held within a database, in which the application is talking with. By manipulating the input and or output you can&nbsp;discover vulnerabilities which affect the end user's browser security as well as information which is passed to the backend database.&nbsp;</div>
<div></div>
<div>&nbsp;</div>
<div>Once you have mapped out the application, server side script, or form from the static content (html), you will want to start pushing in information into each&nbsp;variable seeing what type of input validation is being performed on the application and how the server responds to this input.&nbsp;</div>
<div id="_mcePaste"></div>
<div><span style="font-family: Courier, Arial, Helvetica, sans-serif; color: #101010;"><span style="white-space: pre-wrap; font-size: x-small;"><br /></span></span></div>
<div>In your scenario , I will assume that you are doing this on a non-production box, so lets assume that verbose error messages are enabled.&nbsp;In this case any bad information you give to the application should present you with an error as to why you triggered an exception.&nbsp;</div>
<div>&nbsp;</div>
<div id="_mcePaste"></div>
<div>Placing bad characters in variables is useful in triggering bugs.&nbsp;</div>
<div id="_mcePaste"><span> </span></div>
<div>&nbsp;</div>
<div id="_mcePaste"><span> </span>By placing characters and words like:</div>
<blockquote>
<div id="_mcePaste"><span> </span>'</div>
<div id="_mcePaste"><span> </span>)</div>
<div id="_mcePaste"><span> </span>(</div>
<div id="_mcePaste"><span> </span>)</div>
<div id="_mcePaste"><span> </span>;</div>
<div id="_mcePaste"><span> </span>%</div>
<div id="_mcePaste"><span> </span>|</div>
<div id="_mcePaste"><span> </span>&amp;SQL=select</div>
<div id="_mcePaste"><span> </span>*</div>
<div id="_mcePaste"><span> </span>order by</div>
<div id="_mcePaste"><span> </span>having 1 = 1&nbsp;</div>
<div id="_mcePaste"><span> </span>or 1 = 1</div>
<div id="_mcePaste"><span> </span>""</div>
<div id="_mcePaste"><span> </span>||</div>
<div id="_mcePaste"><span> </span>&lt;script</div>
<div id="_mcePaste"><span> </span>&lt;script&gt;alert('aa')&lt;/script&gt;</div>
<div id="_mcePaste"><span> </span>@@version</div>
<div id="_mcePaste"><span> </span>@@</div>
<div id="_mcePaste"><span> </span>* If the application is anticipating an integer, pass text, and vice versa. If the application is assuming you pass 10 characters, pass 4,000 (get wild and crazy).</div>
</blockquote>
<div>&nbsp;</div>
<div id="_mcePaste"><span> </span></div>
<div id="_mcePaste"><span> </span>By passing this type of information a user can trigger bugs within the application , thus aiding in discovering generic bugs and or security problems within the application.&nbsp;When verbose error messages are encountered please see if the error messages are Application errors or Database errors.&nbsp;Regardless of what type of errors are being thrown this is where you want to question your developers on the type of input and output validation that is being performed.</div>
<div>&nbsp;</div>
<div></div>
<div></div>
<div></div>
<div>But how and why? Why would the input above cause exceptions and how would I pass or append these characters into the web application?</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>The how is pretty simple. Since your webapplication is passing arguments which interact with a backend database you can influence how queries are performed on the backend database, thus influencing how information is presented back to the end user or what information gets requested on the database.&nbsp;</div>
<div>&nbsp;</div>
<div></div>
<div>Now for the how can I do this....</div>
<div></div>
<div>By passing extra information to the form mentioned above:</div>
<div>/AddMeeting.asp?<strong>day=@@version</strong><strong>&amp;time=';SELECT user --&nbsp;</strong></div>
<div>&nbsp;</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>The above request is basically saying:</div>
<div>To the day variable pass the global variable within the backend database @@version, by working on the assumption that at the end of the select statement on the database query will give you information held within a global variable.&nbsp;</div>
<div>&nbsp;</div>
<div></div>
<div></div>
<div>The second variable &amp;time, says ' (add in more sql), end our current query by placing a ';' character, followed by asking the database to perform another query, followed by ending that query.&nbsp;</div>
<div></div>
<div>If you don't get exceptions don't worry, but you could find some interesting things.&nbsp;</div>
<div>&nbsp;</div>
<div></div>
<div></div>
<div id="_mcePaste"><span> </span></div>
<div id="_mcePaste"></div>
<div></div>
<div></div>
<div></div>
<div><strong>A bit of validation</strong></div>
<div id="_mcePaste"></div>
<div id="_mcePaste"></div>
<div></div>
<div>If you have found some exceptions you may want to know more about the exploitability of those bugs.&nbsp;</div>
<div>Taking your testing a bit further the questions you want to start asking yourself include:</div>
<div id="_mcePaste"><span> </span>1) Where am I landing in a SQL query on the backend database given the ODBC/Database error I am getting?</div>
<div id="_mcePaste"><span> </span>2) What could I get to render within the browser, can I put any other HTML entities (HTML Characters) within the input placed into the application which may be&nbsp;</div>
<div id="_mcePaste"><span> </span> &nbsp; rendered back to the end user or application administrator?</div>
<div>&nbsp;</div>
<div></div>
<div id="_mcePaste"></div>
<div id="_mcePaste"></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div><strong>Further Reading</strong></div>
<div id="_mcePaste"><span> </span>&nbsp;</div>
<div id="_mcePaste"><span> </span> Moving away from the basics to a deeper understanding you may want to read the following links and start reading some of the following books.&nbsp;</div>
<div id="_mcePaste"><ol>
<div>&nbsp;</div>
<li>You may want to look into some basic proxies to route traffic to a web application (parosproxy (http://www.parosproxy.org) is free and useful).</li>
<li>Check out more information at OWASP http://www.owasp.org. A good list of application vulnerability classes are outlined as well as remediation steps and triggering information.&nbsp;</li>
<div>&nbsp;</div>
<li>Input Validation and parameterized queries http://aspnet101.com/tutorials.aspx?id=1 can help prevent sql injection and other classes of vulnerabilities.&nbsp;</li>
</ol></div>
<div id="_mcePaste"></div>
<div id="_mcePaste"><strong>Wrapping it up....</strong></div>
<div id="_mcePaste">Hopefully you are now armed with some basic information on how to identify basic vulnerabilities within your web application as well as places you can search for more information&nbsp;on web application security while gaining more peace of mind. While only basic information has been shared in this article we hope this can spur on a desire to search&nbsp;a deeper understanding of web application bugs and input validation within applications in general. Within the next article I will outline vulnerability classes and proxies as well as more technical error messages detailing bug identification and vulnerability validation.&nbsp;</div>
<div></div>
<div>&nbsp;</div>
<div>Thanks,</div>
<div>Daniel Clemens</div>
<div id="_mcePaste"><span> </span></div>
<p>&nbsp;</p>]]></description><wfw:commentRss>http://www.packetninjas.net/blog/rss-comments-entry-6438867.xml</wfw:commentRss></item><item><title>December BHSec Meeting</title><dc:creator>Packetninjas Admin</dc:creator><pubDate>Tue, 15 Dec 2009 08:00:24 +0000</pubDate><link>http://www.packetninjas.net/blog/2009/12/15/december-bhsec-meeting.html</link><guid isPermaLink="false">430476:4892980:6066946</guid><description><![CDATA[<p>The december BHSec meeting will be hosted at the Wildwood Starbucks location at 9:00AM.&nbsp;</p>
<p>More information can be found @ http://bhsec.packetninjas.net</p>
<p>Cheers,</p>
<p>Daniel Clemens</p>]]></description><wfw:commentRss>http://www.packetninjas.net/blog/rss-comments-entry-6066946.xml</wfw:commentRss></item><item><title>BIND Dynamic Update DoS, Exploit Circulates</title><category>0day</category><category>Current Events</category><category>Exploitation</category><category>Incident Response</category><category>Vulns</category><dc:creator>Packetninjas Admin</dc:creator><pubDate>Tue, 28 Jul 2009 09:30:37 +0000</pubDate><link>http://www.packetninjas.net/blog/2009/7/28/bind-dynamic-update-dos-exploit-circulates.html</link><guid isPermaLink="false">430476:4892980:5370502</guid><description><![CDATA[<p></p>]]></description><wfw:commentRss>http://www.packetninjas.net/blog/rss-comments-entry-5370502.xml</wfw:commentRss></item><item><title>Meet other Information Security Professionals @ BHSec !!</title><category>Current Events</category><dc:creator>Packetninjas Admin</dc:creator><pubDate>Wed, 08 Jul 2009 15:17:55 +0000</pubDate><link>http://www.packetninjas.net/blog/2009/7/8/meet-other-information-security-professionals-bhsec.html</link><guid isPermaLink="false">430476:4892980:5370513</guid><description><![CDATA[<p></p>]]></description><wfw:commentRss>http://www.packetninjas.net/blog/rss-comments-entry-5370513.xml</wfw:commentRss></item><item><title>Five Provinces in China crippled due to simple DDoS Attack</title><category>Current Events</category><dc:creator>Packetninjas Admin</dc:creator><pubDate>Sat, 23 May 2009 18:22:16 +0000</pubDate><link>http://www.packetninjas.net/blog/2009/5/23/five-provinces-in-china-crippled-due-to-simple-ddos-attack.html</link><guid isPermaLink="false">430476:4892980:5370524</guid><description><![CDATA[<p></p>]]></description><wfw:commentRss>http://www.packetninjas.net/blog/rss-comments-entry-5370524.xml</wfw:commentRss></item><item><title>Forensic Notes: NTFS RW+ on OSX</title><category>Forensics</category><dc:creator>Packetninjas Admin</dc:creator><pubDate>Thu, 14 May 2009 03:21:29 +0000</pubDate><link>http://www.packetninjas.net/blog/2009/5/14/forensic-notes-ntfs-rw-on-osx.html</link><guid isPermaLink="false">430476:4892980:5370557</guid><description><![CDATA[<p></p>]]></description><wfw:commentRss>http://www.packetninjas.net/blog/rss-comments-entry-5370557.xml</wfw:commentRss></item><item><title>Analyst Notes - Zeus/WSNPoem/Prg Intrusion Detection Rule</title><category>Current Events</category><category>IDS</category><category>Spam</category><dc:creator>Packetninjas Admin</dc:creator><pubDate>Tue, 05 May 2009 05:20:09 +0000</pubDate><link>http://www.packetninjas.net/blog/2009/5/5/analyst-notes-zeuswsnpoemprg-intrusion-detection-rule.html</link><guid isPermaLink="false">430476:4892980:5370558</guid><description><![CDATA[<p></p>]]></description><wfw:commentRss>http://www.packetninjas.net/blog/rss-comments-entry-5370558.xml</wfw:commentRss></item><item><title>Design flaws in Internet Explorer 8 "Hacking Intranets through assumptions/defaults in Internet Explorer"</title><category>Exploitation</category><category>Penetration Testing</category><category>Phish</category><category>Vulns</category><dc:creator>Packetninjas Admin</dc:creator><pubDate>Wed, 08 Apr 2009 02:36:29 +0000</pubDate><link>http://www.packetninjas.net/blog/2009/4/8/design-flaws-in-internet-explorer-8-hacking-intranets-throug.html</link><guid isPermaLink="false">430476:4892980:5370560</guid><description><![CDATA[<p></p>]]></description><wfw:commentRss>http://www.packetninjas.net/blog/rss-comments-entry-5370560.xml</wfw:commentRss></item><item><title>Microsoft Power Point 0day</title><category>0day</category><category>Current Events</category><category>Incident Response</category><category>Malware</category><dc:creator>Packetninjas Admin</dc:creator><pubDate>Fri, 03 Apr 2009 03:10:25 +0000</pubDate><link>http://www.packetninjas.net/blog/2009/4/3/microsoft-power-point-0day.html</link><guid isPermaLink="false">430476:4892980:5370503</guid><description><![CDATA[<p></p>]]></description><wfw:commentRss>http://www.packetninjas.net/blog/rss-comments-entry-5370503.xml</wfw:commentRss></item><item><title>New version of LophtCrack!</title><category>Current Events</category><dc:creator>Packetninjas Admin</dc:creator><pubDate>Tue, 03 Mar 2009 00:03:09 +0000</pubDate><link>http://www.packetninjas.net/blog/2009/3/3/new-version-of-lophtcrack.html</link><guid isPermaLink="false">430476:4892980:5370505</guid><description><![CDATA[<p></p>]]></description><wfw:commentRss>http://www.packetninjas.net/blog/rss-comments-entry-5370505.xml</wfw:commentRss></item></channel></rss>