<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Increased Visibility</title>
	<atom:link href="http://intellavis.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://intellavis.com/blog</link>
	<description>Ramblings of an Information Security Professional</description>
	<lastBuildDate>Mon, 08 Apr 2013 12:50:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>NoVa OWASP: April 11</title>
		<link>http://intellavis.com/blog/?p=552</link>
		<comments>http://intellavis.com/blog/?p=552#comments</comments>
		<pubDate>Mon, 01 Apr 2013 13:37:46 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://intellavis.com/blog/?p=552</guid>
		<description><![CDATA[The NoVa chapter of OWASP is meeting on 4/11. Topic: Impact of IPv6 On Your Applications.]]></description>
				<content:encoded><![CDATA[<p><img class="alignnone" title="owasp logo" alt="" src="http://farm6.staticflickr.com/5448/7183323993_52da5fcfb7_o.png" width="542" height="100" /></p>
<p>&nbsp;</p>
<p><a href="http://www.meetup.com/OWASP-Northern-Virginia-Chapter/events/112674542/">http://www.meetup.com/OWASP-Northern-Virginia-Chapter/events/112674542/</a></p>
<blockquote><p>With the need to connect over 20 Billion devices by 2020, the IPv4 Internet with its maximum of 4 billion addresses has run out of steam. The impact has been more complexity for networks, operations and applications. In fact, the implementation of Network Address Translation requires all devices between the web user and the web application to add more complex code, which has lead to slower operation and higher cost to develop and manage systems.</p>
<p>IPv4&#8242;s replacement as of June 2012, IPv6, is considered ready for prime time. Today, over 1.5% Internet connect via IPv6 to Google every day. In short, IPv6 is no longer a should, but a must. That is, if you plan on staying in business and connected with your customers. This presentation will discuss:</p>
<ul>
<li>How do you know your customers are using IPv6?</li>
<li>What methods of implementations are available and what are their impacts?</li>
<li>What changes need to be made on your ISP, networks, applications,logging and security to support IPv6?</li>
<li>What are some of the security issues that may arise if not implemented correctly?</li>
</ul>
</blockquote>
<p>Where</p>
<p>LivingSocial<br />
11600 Sunrise Valley Drive, Reston, VA</p>
<p>When<br />
Thursday, April 11, 2013 6:30 PM</p>
]]></content:encoded>
			<wfw:commentRss>http://intellavis.com/blog/?feed=rss2&#038;p=552</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Web Application Vulnerability Management Program</title>
		<link>http://intellavis.com/blog/?p=574</link>
		<comments>http://intellavis.com/blog/?p=574#comments</comments>
		<pubDate>Thu, 21 Feb 2013 14:01:25 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[SBN]]></category>
		<category><![CDATA[Vulnerability Management]]></category>
		<category><![CDATA[Web Application Security]]></category>

		<guid isPermaLink="false">http://intellavis.com/blog/?p=574</guid>
		<description><![CDATA[Continuous web application vulnerability scanning isn't a standard practice. It should be! Here are my thoughts on making it happen.]]></description>
				<content:encoded><![CDATA[<p>Vulnerability management best practices include conducting vulnerability scanning against live, customer facing computer systems on a regular basis. Compliance regimes even mandate these scans. PCI DSS, for example, requires the externally facing systems in the cardholder data network be assessed with an approved scanning vendor (ASV) at least once every three months. Infrastructure vulnerability management has matured to the point where we are doing an OK job continuously scanning infrastructure, but we seem to be ignoring the piece that our customers actually use. This practice should include customer facing web applications!</p>
<p>If you have a software development lifecycle (SDLC) that takes security into account, you likely do an assessment of the application before it goes into production. If it&#8217;s a mature process, you might even be setting security requirements, conducting threat modeling, and have secure coding standards. Once that application is live, the process shouldn&#8217;t stop.</p>
<p>While my own observations may be largely anecdotal, there are two web application security frameworks that track common security practices among organizations with mature software development programs: the <a href="http://bsimm.com/">Building Security in Maturity Model</a>, and OWASP&#8217;s <a href="http://www.opensamm.org/">Software Assurance Maturity Model</a>. Both leave out the concept of continuous web application vulnerability scanning.</p>
<p>What follows are my thoughts about building out a vulnerability management program to include vulnerability scanning of live, customer facing web applications.</p>
<h2>Goals of Continuous Web Application Vulnerability Scanning</h2>
<ul>
<li>Understand web application specific risk exposure and bring that in-line with policies.</li>
<li>Integrate results with development efforts to improve code quality.</li>
</ul>
<h2>Challenges of Web Application Vulnerability Management</h2>
<ul>
<li>Infrastructure fixes tend to have cookie cutter solutions (apply a patch, or change a configuration) versus a full custom software development effort with web applications.</li>
<li>Some applications may no longer be under active development or may not have development environments and deployment procedures.</li>
</ul>
<h2>Web Application Security Frameworks</h2>
<p>Software development has a set of security best practices that entails a variety of activities. Below is the OWASP Open Software Assurance Maturity Model. While the framework leaves continuous web application vulnerability scanning of live applications out as a specific activity, it would fit into two of the high level security practices: security testing and vulnerability management.</p>
<p><img alt="" src="http://intellavis.com/blog/wp-content/uploads/2013/02/022013_1901_ContinuousW1.jpg" /></p>
<h2></h2>
<h2>Vulnerability Management Process</h2>
<p>According to Gartner, vulnerability management follows this cycle: define policy, baseline environment, assess risk, shield against exploitation, mitigate vulnerabilities, and metrics reporting. The following are points specific to web application vulnerability management.</p>
<p><img alt="" src="http://intellavis.com/blog/wp-content/uploads/2013/02/022013_1901_ContinuousW2.png" /></p>
<h3>Policy</h3>
<ul>
<li>Define secure web application policy, standards, and specifications.</li>
<li>Ensure policies for secure software development and risk acceptance exist in your organization.</li>
</ul>
<h3>Baseline</h3>
<p>Define application portfolio and attack surface. Create an inventory.</p>
<ul>
<li>Use an application to track inventory and vulnerabilities; having both is key.</li>
</ul>
<p>Information required for each application:</p>
<ul>
<li>Entry URL</li>
<li>Test Login Credentials</li>
<li>Date/Time most appropriate for scanning</li>
</ul>
<p>Additional Information:</p>
<ul>
<li>Points of Contact – application owner, development team</li>
<li>Defect Tracking System in use</li>
<li>Data Items/Classification (PII, CHD, etc…)</li>
<li>
<div>Priority/Risk</div>
</li>
</ul>
<p>Make sure you communicate to the appropriate teams and key people that you are scanning production applications. Get explicit approval if applicable! A misstep involving knocking over an application no one knew you were looking at early in the process might have disastrous political repercussions.</p>
<h3>Prioritize/Assess</h3>
<p>Use business risk and development effort to prioritize remediation efforts. Involve development teams, and frame the vulnerability as a kind of software defect.</p>
<h3>Shield</h3>
<p>Use custom rules in WAF or web relevant IDS/IPS to temporary block (or at least detect) exploitation attempts.</p>
<h3>Mitigate</h3>
<ul>
<li>Communicate business risk and compliance implications of vulnerabilities.</li>
<li>If commercial off the shelf software (COTS), is there a patch?</li>
<li>Treat web application security vulnerabilities as software defects, and enter the information into the defect tracking system in use.</li>
<li>Work into development schedules as resources are available.</li>
<li>Have a procedure for out-of-cycle releases for serious vulnerabilities.</li>
</ul>
<p><img alt="" src="http://intellavis.com/blog/wp-content/uploads/2013/02/022013_1901_ContinuousW3.jpg" /></p>
<h3>Maintain</h3>
<p>Web applications are dynamic and attacks evolve – this is an ongoing process. Create a schedule for continuous web application vulnerability scanning and follow-up to mitigation efforts.</p>
<h2>Metrics &amp; Reporting</h2>
<ul>
<li>Vulnerabilities: Raw number, number per app</li>
<li>Risk Ratings</li>
<li>Defect correction rate &#8211; Time to Remediation</li>
<li>Security defect density – security defects per lines of code</li>
<li>Risk Density – adds a risk rating to defect density (1 high risk vulnerability per 100 lines of code)</li>
<li>Scan Code Coverage – how much of the application surface is being scanned (authenticated vs. unauthenticated, logic that scanner isn&#8217;t getting beyond, etc…)</li>
<li>
<div>Company Top 5 – like OWASP top 10, but organization specific</div>
<ul>
<li>This could include data from any security incidents</li>
</ul>
</li>
</ul>
<h2>Other Considerations</h2>
<ul>
<li>Provide feedback to development teams – preventing vulnerabilities is much cheaper than fixing them in production.</li>
<li>If you have an SDLC in place, add continuous web application vulnerability scanning to the official process.</li>
<li>If this is your first foray into web application vulnerability scanning in your company, be sure to do an assessment of any new applications before they are exposed to the Internet.</li>
</ul>
<h2>Tools</h2>
<p>There are a lot of web application vulnerability scanners to choose from – some are free and open source. You also need a good way to track issues once you find them. Check out these sources for a good overview of the available tools.</p>
<ul>
<li>Fantastic overview and comparison of both commercial and open source web application vulnerability scanners: <a href="http://sectooladdict.blogspot.com/2011/08/commercial-web-application-scanner.html">http://sectooladdict.blogspot.com/2011/08/commercial-web-application-scanner.html</a></li>
<li>Gartner Magic Quadrant for web application vulnerability scanners: <a href="http://www.gartner.com/technology/reprints.do?id=1-18GM74P&amp;ct=111228&amp;st=sb">http://www.gartner.com/technology/reprints.do?id=1-18GM74P&amp;ct=111228&amp;st=sb</a></li>
<li>Once you find vulnerabilities, you need to track and remediate them. The Denim Group has a tool called Threadfix that both tracks software vulnerabilities and integrates with software defect tools.<a href=" http://www.denimgroup.com/resources-threadfix/index.php"> http://www.denimgroup.com/resources-threadfix/index.php</a></li>
</ul>
<p>&nbsp;</p>
<h2>References</h2>
<ul>
<li><a href="http://www.gartner.com/DisplayDocument?doc_cd=127481">http://www.gartner.com/DisplayDocument?doc_cd=127481</a></li>
<li><a href="http://www.bsimm.com">http://www.bsimm.com</a></li>
<li><a href="http://www.opensamm.org/downloads/SAMM-1.0.pdf">http://www.opensamm.org/downloads/SAMM-1.0.pdf</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://intellavis.com/blog/?feed=rss2&#038;p=574</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ISSA Meeting: February 21</title>
		<link>http://intellavis.com/blog/?p=550</link>
		<comments>http://intellavis.com/blog/?p=550#comments</comments>
		<pubDate>Fri, 01 Feb 2013 20:28:58 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://intellavis.com/blog/?p=550</guid>
		<description><![CDATA[NoVa ISSA Chapter Meeting! Topic: The Beauty of Surveillance. ]]></description>
				<content:encoded><![CDATA[<p><img class="alignnone" alt="" src="http://www.issa-nova.org/images/index_logo.jpg" width="230" height="97" /></p>
<h1>NoVa ISSA Chapter Meeting</h1>
<p><a href="http://www.issa-nova.org/">http://www.issa-nova.org/</a></p>
<p>Where: Oracle Corporation, 1900 Oracle Way, Reston, VA 20190<br />
When: Thursday , February 21st<br />
Time: 5:30</p>
<p><strong><span style="text-decoration: underline;" data-mce-mark="1">The Beauty of Surveillance</span></strong></p>
<p>Network traffic and logs are the backbone of intrusion detection. Through a normal production system deployment, host and network logs capture all kinds of different information that provides insight into past and ongoing security breaches. How do security teams know which attack or infection matters to their organization? What are the different identifiers that might hold a key piece of information into malicious activity? Does a red flag need to be raised on a piece of commodity malware? Let us find out how to use correlation and active intelligence to hasten an investigation and potentially bring a targeted attack to a halt.</p>
]]></content:encoded>
			<wfw:commentRss>http://intellavis.com/blog/?feed=rss2&#038;p=550</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Security MBA: January 7</title>
		<link>http://intellavis.com/blog/?p=452</link>
		<comments>http://intellavis.com/blog/?p=452#comments</comments>
		<pubDate>Wed, 02 Jan 2013 22:17:29 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://intellavis.com/blog/?p=452</guid>
		<description><![CDATA[Come and enjoy some security news while drinking an icy cold refreshment. ]]></description>
				<content:encoded><![CDATA[<p>When: Monday, January 7, 2013 from 5:30 PM to 7:30 PM (EST)</p>
<p>Where: Roosters Wings</p>
<p>3370 Olentangy River Road<br />
Columbus, OH 43202</p>
<p><a href="http://www.eventbrite.com/event/3917647790">http://www.eventbrite.com/event/3917647790</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://intellavis.com/blog/?feed=rss2&#038;p=452</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Integration Security Testing</title>
		<link>http://intellavis.com/blog/?p=560</link>
		<comments>http://intellavis.com/blog/?p=560#comments</comments>
		<pubDate>Wed, 26 Dec 2012 12:00:45 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[SBN]]></category>
		<category><![CDATA[Web Application Security]]></category>

		<guid isPermaLink="false">http://intellavis.com/blog/?p=560</guid>
		<description><![CDATA[A comparison of 4 free and open source web application vulnerability scanners for inclusion in a continuous integration (CI) process for automated security testing.]]></description>
				<content:encoded><![CDATA[<p>This is a comparison of 4 free and open source security scanners for inclusion in a continuous integration (CI) process for automated security testing.</p>
<ul>
<li>OWASP Zed Attack Proxy (ZAP): <a href="https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project">https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project</a></li>
<li>Skipfish: <a href="http://code.google.com/p/skipfish/">http://code.google.com/p/skipfish/</a></li>
<li>WAPITI: <a href="http://wapiti.sourceforge.net/">http://wapiti.sourceforge.net/</a></li>
<li>Web Application Attack and Audit Framework: <a href="http://w3af.sourceforge.net/">http://w3af.sourceforge.net/</a></li>
</ul>
<div>Ultimately, out of the 4, I like W3AF. Here is why -</div>
<div><img title="w3af" src="http://farm9.staticflickr.com/8477/8241655271_bdd92c0157_m.jpg" alt="w3af" width="240" height="73" border="0" /></div>
<h4>Requirements</h4>
<ol>
<li>No UI interaction: the tool either needs to be launched via web service or command line.</li>
<li>Provide some output: the tool should produce a useful report.</li>
<li>Operating system does not matter: the tool can run on Windows or Linux.</li>
</ol>
<h4>Outside Independent Testing</h4>
<p>Research was done to find independent comparisons of web application vulnerability scanners. The following source outlines one such test of over 60 commercial and open source tools.</p>
<p><a href="http://sectooladdict.blogspot.com/2011/08/commercial-web-application-scanner.html">http://sectooladdict.blogspot.com/2011/08/commercial-web-application-scanner.html</a></p>
<p>The tools we are looking at were compared in both cross-site scripting and SQL injecting tests.</p>
<h4>Cross Site Scripting Detection</h4>
<p><img title="xss_compare" src="http://farm9.staticflickr.com/8487/8242709256_f894627a24.jpg" alt="xss_compare" width="500" height="64" border="0" /></p>
<h4>SQL Injection Detection</h4>
<p><img title="sqli_compare" src="http://farm9.staticflickr.com/8486/8242709102_c57ab0c05d.jpg" alt="sqli_compare" width="500" height="59" border="0" /></p>
<h3>WAPITI</h3>
<p>WAPITI was immediately discounted because it appears to be an abandoned project. While outside testing gives it OK marks, it hasn&#8217;t been updated since 2009. It lacks support in basic web application functionality like SSL.</p>
<h3>Skipfish</h3>
<p>Skipfish is stable and the scanner is easy to launch, but the reporting isnít very detailed.</p>
<p>It seems to be an incredibly stable tool and it is very easy to launch. One particular OCLC product caused the other tools I typically use for a first-pass analysis to either fail completely or return bad results. Skipfish ran for 5 days without an issue, and gave me a set of workable results. To launch, itís as easy as choosing a dictionary, and pointing it to the test application.</p>
<p><img title="skipfish_CLI" src="http://farm9.staticflickr.com/8347/8241640227_f9b22b4baf.jpg" alt="skipfish_CLI" width="500" height="34" border="0" /></p>
<p>OWASP has a script for Skipfish Automation &#8211; <a href="https://www.owasp.org/index.php/Automated_Audit_using_SKIPFISH">https://www.owasp.org/index.php/Automated_Audit_using_SKIPFISH</a></p>
<p>The report Skipfish produces is aimed towards the web application security expert. It lists issues and the URL they can be found without providing any detail of their implications or advice on how to fix them. I think, at least at first, you&#8217;d have to do a good deal of research to make the results useful.</p>
<p><img title="skipfish_report" src="http://farm9.staticflickr.com/8203/8241640299_f85a54bbdd.jpg" alt="skipfish_report" width="456" height="210" border="0" /></p>
<h3>Web Application Attack and Audit Framework</h3>
<p>w3af has a variety of plugins to run each security test. When it is launched via command line, you have to select each one individually. I could certainly help in setting up a usable profile of plugins. In the following example, I simply want to spider a site to look for cross site scripting issues.</p>
<p><img title="w3af_CLI" src="http://farm9.staticflickr.com/8481/8242709182_e2cf1cca35.jpg" alt="w3af_CLI" width="500" height="278" border="0" /></p>
<p>OWASP has a guide on automated scanning using w3af, along with some good starting plugins here: <a href="https://www.owasp.org/index.php/Automated_Audit_using_W3AF">https://www.owasp.org/index.php/Automated_Audit_using_W3AF</a></p>
<p>The report is a little more useful than the one from SkipFish. It gives you the vulnerability, the parameters involved, and assigns a severity. It does not, however, give you much in the way of remediation advice.</p>
<p><img style="border: 0px;" title="w3af_report" src="http://farm9.staticflickr.com/8069/8242709226_91b1258e16.jpg" alt="w3af_report" width="500" height="84" border="0" /></p>
<h3>OWASP ZAP</h3>
<p>OWASP&#8217;s Zed Attack Proxy (ZAP) automation is different. It does not work via command line, but uses API calls. Because it is a proxy using API calls, it allows for integration in a regression testing workflow. I think it would take the longest to get this setup as you&#8217;d have to build some logic around the scan flow. This scanner has the least information online on setting up a headless scan (there is a lot on using the UI, but not much on automation). I was able to get ZAP to crash. Its output seems a little more useful than the others as it gives a description and some remediation advice. However, the reporting mechanism seems immature &#8211; the report is long and redundant, flagging the same issue several times.</p>
<p>There is a little information here: <a href="http://code.google.com/p/zaproxy/wiki/FAQhowtousezapapi">http://code.google.com/p/zaproxy/wiki/FAQhowtousezapapi</a></p>
<p>You start the Zed Attack Proxy headless, and it acts as a proxy as you do your other testing. Using a -daemon tell the UI not to start.</p>
<p><img style="border: 0px;" title="ZAP_CLI" src="http://farm9.staticflickr.com/8344/8241640477_e7100370b6.jpg" alt="ZAP_CLI" width="500" height="27" border="0" /></p>
<p>It starts a proxy on port 8080, and I set Firefox to use localhost:8080 as a proxy to all web traffic. Going to <a href="http://zap/">http://zap/</a> in the browser gives you a menu of API options.</p>
<p><img style="border: 0px;" title="ZAP_menu" src="http://farm9.staticflickr.com/8338/8242709316_1fd6ddcf7d.jpg" alt="ZAP_menu" width="459" height="311" border="0" /></p>
<p>With ZAP as a proxy, run all of your other tests. Then, using the API calls, you kick off the ZAP spider and scan.</p>
<ul>
<li>http://zap/XML/ascan/action/spider/?url=http://192.168.1.109/bodgeit</li>
<li>http://zap/XML/ascan/action/scan/?url=http://192.168.1.109/bodgeit</li>
</ul>
<p>You would have to build a little logic around the scan. There is nothing that tells you when a spider or a scan is done besides an XML error telling you a scan is in progress if you try to scan before the spider is finished.</p>
<p>The output looks like this:</p>
<p><img style="border: 0px;" title="ZAP_Report" src="http://farm9.staticflickr.com/8484/8241640621_3193f8da10.jpg" alt="ZAP_Report" width="500" height="159" border="0" /></p>
<h3>Conclusion</h3>
<p>Performing security testing early in the application development process would allow for early detection of vulnerabilities. Fixing application defects early in the process is much cheaper than addressing them once an application is in production. In addition, getting almost immediate feedback on security issues would help raise awareness and education of security issues within the development community.</p>
<p>I recommend w3af for inclusion in a CI environment. It has the best balance of ease of use, vulnerability detection, and meaningful reporting. Also, the w3af project is backed by Rapid7 ñ giving it resources for improvement and continued development.</p>
<p>Skipfish and ZAP are also useful. Although, I feel that Skipfishís report was too lacking and ZAP would be too difficult to setup initially. However, hese obstacles may be easy to overcome with an in depth tools skill set.</p>
]]></content:encoded>
			<wfw:commentRss>http://intellavis.com/blog/?feed=rss2&#038;p=560</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PCI DSS Compliance: A High Level View</title>
		<link>http://intellavis.com/blog/?p=528</link>
		<comments>http://intellavis.com/blog/?p=528#comments</comments>
		<pubDate>Tue, 09 Oct 2012 14:00:31 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Compliance]]></category>
		<category><![CDATA[SBN]]></category>

		<guid isPermaLink="false">http://intellavis.com/blog/?p=528</guid>
		<description><![CDATA[These are my high level notes for completing a self-assessment questionnaire (SAQ) for PCI DSS compliance for an SMB. From figuring out what merchant level you are, to determining scope, to reporting your results to your acquiring bank - here's how to get it done.]]></description>
				<content:encoded><![CDATA[<p><img class="alignleft" src="http://farm9.staticflickr.com/8453/8069193777_5b658f9e75_m.jpg" alt="" width="173" height="102" />I am finishing a PCI audit effort, and want to share some of my notes, resources, and lessons learned along the way. My work was for a level 4 merchant completing a self-assessment questionnaire (SAQ). More about that in a minute; first, let’s go over what the Payment Card Industry (PCI) Data Security Standard (DSS) is at a high level.</p>
<h2>PCI DSS</h2>
<p>The Payment Card Industry Data Security Standard (PCI DSS) is an information security standard for organizations that handle cardholder information for the major debit, credit, prepaid, e-purse, and ATM cards. Defined by the Payment Card Industry Security Standards Council, the standard was created to increase controls around cardholder data to reduce credit card fraud via its exposure. Validation of compliance is done annually — by an external Qualified Security Assessor (QSA) for organizations handling large volumes of transactions, or by Self-Assessment Questionnaire (SAQ) for companies handling smaller volumes.</p>
<p>PCI DSS has 6 main goals, and 12 high level requirements. They are as follows:</p>
<p><img style="border: 0px;" title="PCI-HighLevel" src="http://farm9.staticflickr.com/8181/8066688990_65b25e99eb.jpg" alt="" width="500" height="227" border="0" /></p>
<p>The full standard can be found here: <a href="https://www.pcisecuritystandards.org/documents/pci_dss_v2.pdf">https://www.pcisecuritystandards.org/documents/pci_dss_v2.pdf</a></p>
<h2>Who and When?</h2>
<p>Any organization that accepts payment cards or stores, processes, or transmits credit or debit card data must comply with the PCI DSS. Further, all deadlines for compliance have passed. NOW is the time to be compliant.</p>
<h2>What do I need to do?</h2>
<p>The rest of this post will address this at a high level, specifically for a level 4 merchant. In short, you need to comply with all of the PCI DSS. However, the validation requirements, that is how you prove your compliance, differs based on the following:</p>
<ul>
<li>Merchant or Service Provider status</li>
<li>Transaction volume</li>
<li>Card brand</li>
<li>Method of accepting and interacting with card data</li>
</ul>
<h2>Step 0 &#8211; a: Determine Merchant Level</h2>
<p>A merchant is any entity that accepts payment cards bearing the logos of any of the five members of PCI SSC (American Express, Discover, JCB, MasterCard or Visa) as payment for goods and/or services.</p>
<p>A service provider is a business entity that is not a payment brand, directly involved in the processing, storage, or transmission of cardholder data. This also includes companies that provide services that control or could impact the security of cardholder data. Examples include managed service providers that provide managed firewalls, IDS and other services as well as hosting providers and other entities. Note that a merchant that accepts payment cards as payment for goods and/or services can also be a service provider, if the services sold result in storing, processing, or transmitting cardholder data on behalf of other merchants or service providers. I was not working with a service provider, so any additional information is out of scope.</p>
<p>Your merchant level is based on your volume of transactions, and differ slightly per brand. It largely determines whether you need a qualified security assessor (QSA), or if a self-assessment questionnaire (SAQ) is appropriate.</p>
<p><img style="border: 0px;" title="merchant level" src="http://farm9.staticflickr.com/8030/8066688832_c5c9d14f4e_z.jpg" alt="" width="627" height="360" border="0" /></p>
<h2>Step 0 &#8211; b: Determine Appropriate SAQ</h2>
<p>SAQ high level instructions: <a href="https://www.pcisecuritystandards.org/documents/pci_dss_saq_instr_guide_v2.0.pdf">https://www.pcisecuritystandards.org/documents/pci_dss_saq_instr_guide_v2.0.pdf</a></p>
<p><img style="border: 0px;" title="SAQ options" src="http://farm9.staticflickr.com/8170/8066689082_f1b142477a.jpg" alt="" width="500" height="196" border="0" /></p>
<p>The SAQ D is the most complex, and goes through the PCI DSS in its entirety. If you are unsure which SAQ to go with, D will cover all of your bases. If you want to do a gap assessment before a QSA comes in, I would go through the SAQ D to ensure you’re ready.</p>
<h2>Step 1: Determine PCI Scope</h2>
<p>In short, you need to identify all systems, personnel, and processes involved in the transmission, processing, or storing of cardholder data. It is worth taking your time to ensure this is as accurate as possible. Surprises can and probably will come up, but knowing the scope before diving into the assessment will save time later.</p>
<p>The first step of a PCI DSS compliance effort is to accurately determine the scope of the environment. The scoping process includes identifying all system components that are located within or connected to the cardholder data environment (CDE). The cardholder data environment is comprised of people, processes, and technology that handle cardholder data or sensitive authentication data. System components include network devices (both wired and wireless), servers, and applications.</p>
<ul>
<li>The assessed entity identifies and documents the existence of all cardholder data in their environment. (results may be a diagram or an inventory of cardholder data locations).</li>
<li>Any cardholder data found to be in scope of the PCI DSS assessment is part of the CDE unless such data is deleted or migrated/consolidated into the currently defined CDE.</li>
</ul>
<p>I found it helpful to hold a series of scoping meetings. I did some initial legwork to determine which applications might have credit card data, and then had meetings to go over the architecture of each with the appropriate teams. I did the same with different manual processes for receiving orders and payment collection. After each meeting I created a data flow diagram in Visio. After I had an idea of data flows and application architecture, I constructed a diagram of our CDE.</p>
<ol>
<li>Document the cardholder data flow. Define all of the applications involved as well as which systems actually store cardholder data.
<ul>
<li><a href="http://en.wikipedia.org/wiki/Data_flow_diagram">http://en.wikipedia.org/wiki/Data_flow_diagram </a></li>
</ul>
</li>
<li>Develop a network diagram that documents all of the network devices (routers, firewalls, access points, etc…) and servers attached to the CDE, and how they are architected.
<ul>
<li><a href="http://www.fishnetsecurity.com/6labs/blog/pci-dss-and-network-diagram">http://www.fishnetsecurity.com/6labs/blog/pci-dss-and-network-diagram </a></li>
<li><a href="http://stateofsecurity.com/?p=1875">http://stateofsecurity.com/?p=1875 </a></li>
</ul>
</li>
<li>Ensure you have the entire scope. Scan environment to see if card holder data (CHD) is stored anywhere outside of the CDE.
<ul>
<li><a href="http://www2.cit.cornell.edu/security/tools/">http://www2.cit.cornell.edu/security/tools/</a></li>
<li>Database Searches</li>
</ul>
</li>
</ol>
<h2>Step 2: Assess</h2>
<p>Use the appropriate SAQ to guide the assessment, and appropriate technologies to locate insecure systems.</p>
<p>Resources:</p>
<ul>
<li>PCI DSS v2: <a href="https://www.pcisecuritystandards.org/documents/pci_dss_v2.pdf">https://www.pcisecuritystandards.org/documents/pci_dss_v2.pdf </a></li>
<li>Navigating PCI DSS: <a href="https://www.pcisecuritystandards.org/documents/navigating_dss_v20.pdf">https://www.pcisecuritystandards.org/documents/navigating_dss_v20.pdf </a></li>
<li>Quick Reference: <a href="https://www.pcisecuritystandards.org/documents/PCI%20SSC%20Quick%20Reference%20Guide.pdf">https://www.pcisecuritystandards.org/documents/PCI%20SSC%20Quick%20Reference%20Guide.pdf </a></li>
<li>SAQ Download Page: <a href="https://www.pcisecuritystandards.org/security_standards/documents.php?category=saqs">https://www.pcisecuritystandards.org/security_standards/documents.php?category=saqs </a></li>
</ul>
<p>I held a series of interviews with different teams to go over the section(s) of the SAQ relevant to their job. They were usually quick, between 30 minutes and an hour each. I would start by giving a high level description of PCI DSS. Then I would show them the CDE diagram and make sure they knew that the questions were only relevant to that scope. This is why knowing the scope in advance and having that scope be as small as possible makes this easier – if you know only 3 Windows servers are in scope, it is easier for the IT personnel dealing with those to wrap their head around than talking about their entire environment.</p>
<p>Before each interview I did my homework by reading the appropriate section of the PCI DSS, and PCI’s “Navigating PCI DSS” document so I could best explain the question being asked.</p>
<h2>Step 3: Remediate</h2>
<p>Remediate any non-compliances you find. A big one being, do not store cardholder data unless you need it. Even at this stage, it isn’t too late to simplify processes and get rid of unneeded data. The smaller your scope, the easier your job is. PCI has laid out a prioritized approach to remediation. If you’re early in your compliance efforts, you might find it helpful to break things out in the recommended milestones.</p>
<ul>
<li><a href="https://www.pcisecuritystandards.org/documents/Prioritized_Approach_V2.0.pdf">https://www.pcisecuritystandards.org/documents/Prioritized_Approach_V2.0.pdf </a></li>
<li><a href="https://www.pcisecuritystandards.org/documents/Prioritized_Approach_for_PCI_DSS_v20.xls">https://www.pcisecuritystandards.org/documents/Prioritized_Approach_for_PCI_DSS_v20.xls</a></li>
</ul>
<p><img style="border: 0px;" title="PCI remediation prioritization" src="http://farm9.staticflickr.com/8179/8066688910_dbb0d3a29e.jpg" alt="" width="450" height="384" border="0" /></p>
<h2>Step 4: Report</h2>
<p>Regular reports are required for PCI DSS compliance; these are submitted to the acquiring bank and payment card brands that you do business with. Compile and submit required remediation and validation records (if applicable), and submit compliance reports to the appropriate places.</p>
<p>Complete a passing self assessment questionnaire (SAQ) and attestation of compliance (AOC).</p>
<ul>
<li>SAQ/AOC Download Page: <a href="https://www.pcisecuritystandards.org/security_standards/documents.php?category=saqs">https://www.pcisecuritystandards.org/security_standards/documents.php?category=saqs</a></li>
</ul>
<p>Depending on your acquiring bank’s requirements, you might have to submit your quarterly compliant scan results either once a quarter or annually. No matter what your requirement, you need to run them and show compliant results at least quarterly.</p>
<h2>Other Resources</h2>
<p>PCI Compliance Dashboard (Spreadsheet): <a href="https://community.rapid7.com/docs/DOC-1512">https://community.rapid7.com/docs/DOC-1512</a><br />
Open PCI DSS Scoping Toolkit: <a href="http://itrevolution.com/wp-content/uploads/2012/08/OpenPCIScopingToolkit.pdf">http://itrevolution.com/wp-content/uploads/2012/08/OpenPCIScopingToolkit.pdf</a><br />
PCI Compliance (Amazon Book) <a href="http://www.amazon.com/gp/product/159749948X/ref=as_li_ss_il?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=159749948X&amp;linkCode=as2&amp;tag=increavisibi-20"><img src="http://ws.assoc-amazon.com/widgets/q?_encoding=UTF8&amp;ASIN=159749948X&amp;Format=_SL110_&amp;ID=AsinImage&amp;MarketPlace=US&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=increavisibi-20" alt="" border="0" /></a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=increavisibi-20&amp;l=as2&amp;o=1&amp;a=159749948X" alt="" width="1" height="1" border="0" /></p>
]]></content:encoded>
			<wfw:commentRss>http://intellavis.com/blog/?feed=rss2&#038;p=528</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Derbycon: SQLi Presentation</title>
		<link>http://intellavis.com/blog/?p=498</link>
		<comments>http://intellavis.com/blog/?p=498#comments</comments>
		<pubDate>Mon, 01 Oct 2012 03:04:08 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Web Application Security]]></category>

		<guid isPermaLink="false">http://intellavis.com/blog/?p=498</guid>
		<description><![CDATA[Here is the SQLi presentation I gave at Derbycon.]]></description>
				<content:encoded><![CDATA[<p><img class="alignnone" title="logo" src="https://www.derbycon.com/wp-content/themes/Derbycon2012/logo.png" alt="" width="281" height="46" /></p>
<p>&nbsp;</p>
<p>Here is the presentation I gave at <a href="http://www.derbycon.com/">Derbycon</a>.</p>
<p><iframe src="http://www.slideshare.net/slideshow/embed_code/14532444?hostedIn=slideshare&amp;page=upload" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="476" height="400"></iframe></p>
<p><a href="https://dl.dropbox.com/u/14820738/SQLi.pdf">Download PDF</a>.</p>
<h3></h3>
<p>&nbsp;</p>
<h3>Abstract</h3>
<blockquote><p>This presentation will introduce SQL injection to the new web application hacker. It will walk you through web architectures and vulnerable code examples. You will learn how to set up a penetration testing lab with vulnerable applications, find SQL injection vulnerabilities, and hack them to bits. After you understand the problem, you’ll learn how to prevent them in the first place.</p></blockquote>
<h3><img class="aligncenter" title="LOOK AT THIS!" src="http://farm9.staticflickr.com/8198/8188363036_486c8c00b2_o.jpg" alt="Action Shot" width="390" height="355" /></h3>
<h3>Additional Information and Research (In-Depth Blog Posts)</h3>
<ul>
<li><a href="http://intellavis.com/blog/?p=400">SQL Injection Defined</a></li>
<li><a href="http://intellavis.com/blog/?p=462">Detecting SQL Injection Vulnerabilities</a></li>
</ul>
<p><img class="alignnone" title="Full House!" src="http://farm9.staticflickr.com/8040/8042034336_e89145fab8_n.jpg" alt="" width="239" height="320" /><img class="alignleft" title="Getting Setup" src="http://farm9.staticflickr.com/8449/8042022275_e94317a700_n.jpg" alt="" width="239" height="320" /></p>
]]></content:encoded>
			<wfw:commentRss>http://intellavis.com/blog/?feed=rss2&#038;p=498</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Detecting SQL Injection Vulnerabilities</title>
		<link>http://intellavis.com/blog/?p=462</link>
		<comments>http://intellavis.com/blog/?p=462#comments</comments>
		<pubDate>Mon, 24 Sep 2012 12:20:18 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[SBN]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Web Application Security]]></category>

		<guid isPermaLink="false">http://intellavis.com/blog/?p=462</guid>
		<description><![CDATA[How to detect SQLi vulnerabilities, examples of web application errors that indicate SQLi, and an introduction to web application vulnerability scanners.]]></description>
				<content:encoded><![CDATA[<p>I am giving a Stable Talk at <a href="http://www.derbycon.com/">Derbycon</a> on SQL injection and am making my research and notes available in a series of blog posts. The second – how to detect SQL injection vulnerabilities.</p>
<ul>
<li><a href="http://intellavis.com/blog/?p=400">SQL Injection Defined</a></li>
<li>Detecting SQL Injection Vulnerabilities</li>
</ul>
<h2>Testing by Inference</h2>
<p>SQL injection is an attack technique used to exploit applications by altering back-end SQL statements through manipulating input. Web applications build SQL statements dynamically that contain data provided at runtime by the user or application. If an attacker can control that input and manipulate the data so it is interpreted as code, he may be able to execute code against the back-end database.</p>
<p>When testing web applications, you usually do not have access to its source code and can&#8217;t see the SQL query you are trying to inject code into. You have to perform much of your testing through inference. &#8211; that is, “if I see this, then this is probably happening at the back end.” Our main goal in vulnerability detection is to identify anomalies in the appliction response to determine whether they are generated by a SQL injection vulnerability.</p>
<p>Let’s consider a retail application that’s to display a category of products the user wants to see.</p>
<p>URL:</p>
<blockquote><p>www.MyAwesomeStore.com/buystuff.php?category=balls</p></blockquote>
<p>Without properly handing this input, anything entered as the &#8220;category&#8221; parameter could be entered directly in a SQL query &#8211; that is, under the attacker&#8217;s control.</p>
<p>SQL:</p>
<blockquote><p>SELECT *<br />
FROM products<br />
WHERE category=’<span style="color: #ff2f28;">[attacker’s control]</span>’</p></blockquote>
<h2>Generating an Application Error</h2>
<p><img class="alignright" style="border: 0px;" title="Example Error" src="http://farm9.staticflickr.com/8295/8012335535_4395e97dd8_m.jpg" alt="" width="240" height="166" border="0" /></p>
<p>One way to detect SQL injection vulnerabilities is to insert unexpected characters as input that might change the query in such a way that it breaks. If we enter characters that have a special meaning in SQL and get an application error, we can infer that our input is being used in a vulnerable way in a SQL query. A single quote (‘) marks the beginning or end of data, a semicolon (;) marks the end of a SQL statement, and two dashes (&#8211;) mark a SQL comment &#8211; all of which have the potential to generate errors.</p>
<p>Let&#8217;s use the single quote as an example. If you were to enter the single quote character as input to the application in our example in the URL as a &#8220;category&#8221;, you&#8217;ll be presented with an error. The reason for the error is that the single quote character has been interpreted as a string delimiter. Syntactically, the SQL query executed at runtime is incorrect (it has one too many string delimiters), and therefore the database throws an exception. The character is used in SQL injection attacks to “escape” the developer’s query so that the attacker can the construct his own quires and have them executed.</p>
<p>URL:</p>
<blockquote><p>http://www.MyAwesomeStore.com/buystuff.php?category=attack&#8217;</p></blockquote>
<p>SQL:</p>
<blockquote><p>SELECT *<br />
FROM products<br />
WHERE category=’attack&#8217;’</p></blockquote>
<p>Error:</p>
<blockquote><p>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/myawesomestore.com/buystuff.php on line 12</p></blockquote>
<h2>Examples of SQLi Errors from Different Databases and Languages</h2>
<p>Microsoft SQL Server</p>
<blockquote><p>Server Error in ‘/’ Application. Unclosed quotation mark before the character string ‘attack;’.</p>
<p>Description: An unhanded exception occurred during the execution of the current web request. Please review the stack trace for more information about the error where it originated in the code.</p>
<p>Exception Details: System.Data.SqlClient.SqlException: Unclosed quotation mark before the character string ‘attack;’.</p></blockquote>
<p>MySQL Errors</p>
<blockquote><p>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/myawesomestore.com/buystuff.php on line 12</p>
<p>Error: You have an error in your SQL syntax: check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’’ at line 12</p></blockquote>
<p>Oracle Errors</p>
<blockquote><p>java.sql.SQLException: ORA-00933: SQL command not properly ended at oracle.jdbc.dbaaccess.DBError.throwSqlException(DBError.java:180) at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)</p>
<p>Error: SQLExceptionjava.sql.SQLException: ORA-01756: quoted string not properly terminated</p></blockquote>
<p>PostgreSQL Errors</p>
<blockquote><p>Query failed: ERROR: unterminated quoted string at or near “‘’’”</p></blockquote>
<h2>Other Errors</h2>
<p>If you see the above errors you can be almost certain the application is vulnerable to some kind of SQL injection vulnerability. You could also be presented with a custom, default, or generic error message, or an HTTP 500 error. If while testing a website you discover that the application is responding with such an error, you will need to make sure the error is due to SQL injection. You can test this by inserting meaningful SQL code into the parameter without trigging an application error.</p>
<h2>Manual Testing</h2>
<p>Let&#8217;s see what this looks like in a sample application. Using <a href="http://code.google.com/p/bodgeit/">The BodgeIt Store</a>, a vulnerable web application aimed at people learning to pen test, let&#8217;s inject a single tic (&#8216;) and see what happens.</p>
<blockquote><p>Username: user&#8217;<br />
Password: password</p></blockquote>
<p><img style="border: 0px;" title="Inject SQL" src="http://farm9.staticflickr.com/8441/8004870468_122e3a720c_n.jpg" alt="" width="288" height="273" border="0" /><img style="border: 0px;" title="Application Error" src="http://farm9.staticflickr.com/8454/8004867041_51cb448594_n.jpg" alt="" width="288" height="273" border="0" />Our single quote generated a custom appellation error. Let&#8217;s add some additional meaningful SQL and see  what happens.</p>
<blockquote><p>Username: user&#8217; or &#8217;1&#8242; = &#8217;0<br />
Password: password</p></blockquote>
<p><img class="alignleft" style="border: 0px;" title="BodgeIt Store with Valid SQL" src="http://farm9.staticflickr.com/8306/8012217401_f9171671f9_n.jpg" alt="" width="259" height="249" border="0" /><img class="alignnone" style="border: 0px;" title="BodgeIt Store - No Error" src="http://farm9.staticflickr.com/8030/8012182914_c48f951cfe_n.jpg" alt="" width="259" height="249" border="0" /><br />
With meaningful, syntactically correct SQL, the application error goes away thus validating that we have a SQL injection vulnerability.</p>
<h2>Automated Testing: Browser Plugins</h2>
<p>Browser extensions are particularly helpful because of their convenience – the tool is at your fingertips as you are browsing the web. Being built in to the browser gives them the ability to manipulate what you’re seeing in a UI that’s already familiar.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/sql-inject-me/">SQL Inject Me</a> by Security Compass is a Firefox extension that will run a series of tests against a web form. It opens in a side bar next to the web page you’re viewing and allows you to assess that page with the click of a button.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/tamper-data/">Tamper Data</a> is a Firefox extension that acts as a built in proxy. It allows you to view and modify HTTP headers and post parameters. If you right click on a parameter, it gives you options to modify it with an SQLi test.</p>
<p><img class="alignleft" style="border: 0px;" title="SQL Inject Me" src="http://farm9.staticflickr.com/8309/8012237360_9a7c6b1bd6.jpg" alt="" width="189" height="360" border="0" /><img class="alignnone" style="border: 0px;" title="Tamper Data" src="http://farm9.staticflickr.com/8304/8012281403_6e3ed658bd.jpg" alt="" width="360" height="400" border="0" /></p>
<h2>Automated Testing: Web Application Vulnerability Scanners</h2>
<p>Web application vulnerability scanners communicate with an application through the web front-end in order to identify potential security vulnerabilities and architectural weaknesses. First they spider the application to find each page and input. Then, they fuzz those inputs looking for responses that indicate security issues. This scan can detect issues including SQL injection. I want to highlight a couple free, open source scanners you can start using now.</p>
<p><a href="https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project">OWASP Zed Attack Proxy</a> (ZAP) is an easy to use integrated penetration testing tool for finding vulnerabilities in web applications. ZAP provides automated scanners as well as a set of tools that allow you to find security vulnerabilities manually. It acts as a web proxy that you point your browser to so it can see the traffic going to a site and allows you to spider, scan, fuzz, and attack the application. Here is ZAP finding the same SQLi vulnerability we found manually.</p>
<p><img style="border: 0px;" title="ZAP" src="http://farm9.staticflickr.com/8319/8004595038_299bf63877.jpg" alt="" width="500" height="318" border="0" /></p>
<p>The <a href="http://w3af.sourceforge.net/">Web Application Attack and Audit Framework</a> (w3af) is an open-source web application security scanner and exploitation tool. w3af uses plugins to detect various security issues. After identification, w3af can be used to exploit them to gain access to the remote system. w3af has SQLi plugins that can find the vulnerability in web applications. Here is w3af finding the same SQLi vulnerability we found manually.</p>
<p><img style="border: 0px;" title="w3af" src="http://farm9.staticflickr.com/8180/8004591737_a338953e51.jpg" alt="" width="500" height="344" border="0" /></p>
<p>With all of the vulnerability scanners out there, it’s difficult to pick one worthy of your money. Shay-Chen <a href="http://sectooladdict.blogspot.com/2011/08/commercial-web-application-scanner.html">compared 60 commercial and open source scanners</a> based on a number of criteria. One of the tests included a head to head comparison of SQL Injection results. Here is how those scanners stack up in SQLi vulnerability detection.</p>
<p><img style="border: 0px;" title="Web App Vuln Scanner List" src="http://farm9.staticflickr.com/8182/8004599111_875cf2e880.jpg" alt="" width="436" height="500" border="0" /></p>
<h2>Tools Used</h2>
<p>ZAP &#8211; <a href="http://code.google.com/p/zaproxy/">http://code.google.com/p/zaproxy/</a><br />
w3af &#8211; <a href="http://w3af.sourceforge.net/">http://w3af.sourceforge.net/</a><br />
Mantra &#8211; <a href="http://getmantra.com/">http://getmantra.com/</a><br />
OWASP Broken Web Apps &#8211; <a href="http://code.google.com/p/owaspbwa/">http://code.google.com/p/owaspbwa/</a><br />
Backtrack &#8211; <a href="http://www.backtrack-linux.org/">http://www.backtrack-linux.org/</a><br />
Tamper Data &#8211; <a href="https://addons.mozilla.org/en-US/firefox/addon/tamper-data/">https://addons.mozilla.org/en-US/firefox/addon/tamper-data/</a><br />
SQL Inject Me &#8211; <a href="https://addons.mozilla.org/en-US/firefox/addon/sql-inject-me/">https://addons.mozilla.org/en-US/firefox/addon/sql-inject-me/</a><br />
The BodgeIt Store &#8211; <a href="http://code.google.com/p/bodgeit/">http://code.google.com/p/bodgeit/</a><br />
Damn Vulnerable Web Application &#8211; <a href="http://www.dvwa.co.uk/">http://www.dvwa.co.uk/</a></p>
<h2>Sources</h2>
<p><a href="https://www.owasp.org/index.php/Testing_for_SQL_Injection_(OWASP-DV-005)">https://www.owasp.org/index.php/Testing_for_SQL_Injection_(OWASP-DV-005)</a><br />
<a href="http://sectooladdict.blogspot.com/2011/08/commercial-web-application-scanner.html">http://sectooladdict.blogspot.com/2011/08/commercial-web-application-scanner.html</a><br />
SQL Injection Attacks and Defense (Amazon) &#8211; <a href="http://www.amazon.com/gp/product/1597499633/ref=as_li_ss_il?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1597499633&amp;linkCode=as2&amp;tag=increavisibi-20"><img src="http://ws.assoc-amazon.com/widgets/q?_encoding=UTF8&amp;ASIN=1597499633&amp;Format=_SL110_&amp;ID=AsinImage&amp;MarketPlace=US&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=increavisibi-20" alt="" border="0" /></a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=increavisibi-20&amp;l=as2&amp;o=1&amp;a=1597499633" alt="" width="1" height="1" border="0" /></p>
]]></content:encoded>
			<wfw:commentRss>http://intellavis.com/blog/?feed=rss2&#038;p=462</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Injection Defined</title>
		<link>http://intellavis.com/blog/?p=400</link>
		<comments>http://intellavis.com/blog/?p=400#comments</comments>
		<pubDate>Mon, 10 Sep 2012 13:00:06 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[SBN]]></category>
		<category><![CDATA[Web Application Security]]></category>

		<guid isPermaLink="false">http://intellavis.com/blog/?p=400</guid>
		<description><![CDATA[What SQL injection is, implications of SQLi, how prolific the issue is, and a few real world examples of SQLi attacks.]]></description>
				<content:encoded><![CDATA[<p><img class="alignleft" style="border: 0px;" title="sql_injection" src="http://farm9.staticflickr.com/8432/7877206530_97b8e4682d_m.jpg" alt="sql_injection" width="192" height="144" border="0" /> I am giving a Stable Talk at <a href="http://www.derbycon.com/">Derbycon</a> on SQL injection and am making my research and notes available in a series of blog posts. The first &#8211; what is SQL injection?</p>
<p>SQL, or <a href="http://en.wikipedia.org/wiki/SQL">structured query language</a>, is a special purpose programming language designed for managing data in relational database management systems. It can be used to query, operate, and administer database systems such as MySQL, Microsoft SQL Server, and Oracle. These database systems are commonly used to provide backend functionality to many types of web applications.</p>
<p>In support of web applications, user supplied data is often used to dynamically build SQL statements that interact directly with a database. A SQL injection attack is an attack aimed at subverting the original intent of the application by submitting an attacker supplied SQL statement directly to the backend database.</p>
<p>Before I explain SQL injection further, let me describe how a basic web three tired web application might work.</p>
<h2>Web Application Basics</h2>
<p>Modern web applications provide compelling user experiences. They usually consist of a back-end database with web pages that contain server-side script written in a programming language that is capable of extracting specific information from a database depending on interactions with the user. A database driven application commonly has three tiers: presentation, logic, and storage.</p>
<ul>
<li><strong>Presentation Tier</strong>: This tier displays information. It is typically a web browser, such as Internet Explorer, Safari, or Firefox.</li>
<li><strong>Logic Tier</strong>: This tier controls the application’s functionality by performing detailed processing. It is usually a programming language such as C#, ASP, .NET, PHP, or JSP.</li>
<li><strong>Storage Tier</strong>: This tier stores and retrieves information. It is usually a database such as Microsoft SQL Server, MySQL, or Oracle.</li>
</ul>
<p><img class="alignnone" style="border: 0px;" title="WebApplicationTier" src="http://farm8.staticflickr.com/7275/7869440540_8e2e5a793c.jpg" alt="WebApplicationTier" width="500" height="113" border="0" /></p>
<p>A user opens his web browser and connects to a website using the hypertext transfer protocol (http). The web server that resides in the logic tier loads a script from the file system and passes it through its scripting engine, where it is executed. The script opens a connection to the data tier and executes a SQL statement against he database. The database returns the data, which is passed to the scripting engine within the logic tier. The logic tier then implements any application or business logic rules before returning a web page in HTML format to the presentation tier. The user’s web browser renders the HTML and presents the user with a graphical user interface.</p>
<h2>SQL Injection</h2>
<p>A SQL injection attack involves the alteration of SQL statements that are used within a web application through the use of attacker supplied data. The primary form of SQL injection consists of direct insertion of code into parameters that are concatenated with SQL commands and executed.</p>
<p>Insufficient input validation and improper construction of SQL statements  in web applications can leave them vulnerable to SQL injection attacks. If an attacker can control the input that is sent to a SQL query and manipulate that input so that the data is interpreted as a code instead of as data, the attacker may be able to execute the code on the back-end database. Any procedure in the logic tier that constructs SQL statement could potentially be vulnerable.</p>
<h2>Example</h2>
<p>Let’s consider a vulnerable web application login form and login.php script:</p>
<p>Form</p>
<p style="text-align: center;"><img class="aligncenter" title="blank login" src="http://farm9.staticflickr.com/8448/7889629944_44162148dc_m.jpg" alt="" width="240" height="104" /></p>
<blockquote><p>&lt;form action=login.php method=post&gt;<br />
Username: &lt;input type=text name=username /&gt;<br />
Password: &lt;input type=password name=password /&gt;<br />
&lt;input type=submit value=Login&gt; &lt;/form&gt;</p></blockquote>
<p>login.php</p>
<blockquote><p>//connect to database<br />
$conn = mysql_connect(“localhost”, “username”, “password”);<br />
//build sql statement<br />
$query = “SELECT userid FROM AppUsers WHERE user= ‘$_POST[“username”]’ “ .<br />
“AND password = ‘$_POST[“password”]’ “ ;<br />
//run query<br />
$result = mysql_query($query);<br />
//ensure a user was returned<br />
$numrows = mysql_num_rows($result);<br />
if ($numrows != 0){<br />
header(“Location: admin.php”);<br />
}else{<br />
die(‘Incorrect username or password.’)<br />
}</p></blockquote>
<p style="text-align: center;"><img class="aligncenter" title="login with password" src="http://farm9.staticflickr.com/8042/7889630034_a2da6eb354_m.jpg" alt="" width="240" height="110" /></p>
<p>If you login with the username “jsmith” and the password “kitteh” the application builds this SQL statement:</p>
<blockquote><p>SELECT userid<br />
FROM AppUsers<br />
WHERE user = ‘jsmith’ AND password = ‘kitteh’ ;</p></blockquote>
<p>In this case, as long as there is a record with the correct username and password, one row will be returned. Since the login script is looking for a query that returns any amount of rows other than 0, the login is successful.</p>
<p style="text-align: center;"><img class="aligncenter" title="login with SQL" src="http://farm9.staticflickr.com/8456/7889674272_2fb3838349_n.jpg" alt="" width="320" height="89" /></p>
<p>But, if you inject simple SQL code with logic that results to true into the password field, such as “anything’ OR ‘1’ = ‘1” with the user “jsmith”, the application builds this SQL statement:</p>
<blockquote><p>SELECT userid<br />
FROM AppUsers<br />
WHERE user = ‘jsmith’ AND password = ‘anything’ OR ‘1’ = ‘1’ ;</p></blockquote>
<p>In this case, we changed the condition to something that will always be true, and all of the rows are returned. The number of rows is something other than 0, so the login is successful. This SQL injection attack allowed us to bypass the application’s authentication mechanism.</p>
<h2>Impact of SQL Injection</h2>
<p>As the example shows, SQL injection can allow us to bypass the authentication of a web application. It can also lead to accessing more data in the database that you have authorization to, changing or deleting that data, or even running arbitrary code on the database server potentially completely compromising it.</p>
<ul>
<li><strong>Authentication Bypass</strong>: This attack allows an attacker to log on to an application without supplying a valid username and password.</li>
<li><strong>Information Disclosure</strong>: This attack allows an attacker to obtain sensitive information that is contained in a database.</li>
<li><strong>Alter Data</strong>: This attack involves the alteration of the contents of a database. This can be used to deface a web page. It can also be used to insert malicious content, like JavaScript malware.</li>
<li><strong>Delete Data</strong>: This attack allows an attacker to delete information with the intent to cause harm or delete log or audit information that is contained in a database.</li>
<li><strong>Remote Command Execution</strong>: Performing command execution through a database can allow an attacker to compromise the host operating system. These attacks often leverage an existing, predefined stored procedure for host operating system command execution.</li>
</ul>
<h2>How Prolific is the Issue?</h2>
<p>According to the Web Application Security Consortium’s <a href="http://projects.webappsec.org/w/page/13246995/Web-Hacking-Incident-Database">Web Hacking Incident Database</a>, SQL injection is the most exploited website vulnerability.</p>
<div><img class="aligncenter" style="border: 0px;" title="webhackingDB" src="http://farm9.staticflickr.com/8291/7869487664_8fffaee0fc.jpg" alt="webhackingDB" width="500" height="354" border="0" /></div>
<p style="text-align: left;">While the latest <a href="https://www.whitehatsec.com/assets/WPstats_summer12_12th.pdf">WhiteHat Security Statistics Report</a> agrees, it also ranks the SQL injection in the top 10 vulnerabilities asserting that 11% of websites found on the web are vulnerable.</p>
<p style="text-align: center;"><img class="aligncenter" style="border: 0px;" title="WhiteHatBreakdown" src="http://farm9.staticflickr.com/8284/7869436904_72989c1d97.jpg" alt="WhiteHatBreakdown" width="500" height="259" border="0" /></p>
<div>
<h2>Real World Examples</h2>
<h4>Albert Gonzolez Steals Millions of Credit Card Numbers</h4>
<p>Albert Gonzalez was involved in some of the highest profile, largest credit card thefts in recent history. From 2005 through 2007 he helped steal more than 170 million credit and debit card numbers. He has since had three federal indictments and is serving 20 years in a federal prison. He was responsible for the credit card breaches at TJ Maxx (94 million credit cards), BJ’s Wholesale Club, Boston Market, Barnes and Noble, Sport’s Authority, Forever 21, DSW (1.4 million credit cards), OfficeMax, Heartland Payment Systems (100 million credit cards), and Hannaford Brothers (4.6 million credit cards).</p>
<p>SQL injection was in Albert’s toolkit. In the case of the largest breach, Heartland Payment Systems, SQL injection was used as the entry point. SQLi was used to put malware on backend systems, launching packet sniffers that allowed him to steal credit card data.</p>
<p><a href="http://www.nytimes.com/2010/11/14/magazine/14Hacker-t.html?pagewanted=all&amp;_moc.semityn.www">http://www.nytimes.com/2010/11/14/magazine/14Hacker-t.html?pagewanted=all&amp;_moc.semityn.www</a></p>
<h4>The Asprox Botnet</h4>
<p>2008 saw the advent of the SQL injection worm as a means to spread malware. This method combines a number of attack methodologies. While the ultimate targets are users’ computers, SQL injection is used to insert malicious JavaScript links into a vulnerable website’s database. The Asprox botnet is one of the more well known examples of this attack. The number of exploited web pages is estimated at 500,000.</p>
<p style="text-align: center;"><img class="aligncenter" title="Asprox Spreading" src="http://farm9.staticflickr.com/8041/7934350774_09fa52a0fc.jpg" alt="" width="300" height="213" /></p>
<p>This attack starts with an infecting computer. The malcode uses Google to search for sites vulnerable to SQL injection. It then uses SQL injection to add JavaScript to the end of data elements already in the database. When a user visits this website, the JavaScript is loaded in his browser and infects his computer. This infected computer can start the process over again. The goal is generally to build a botnet, like Asprox, capable of making the botnet owner money by doing things like sending spam.</p>
<p><a href="http://www.isti.tu-berlin.de/fileadmin/fg214/Papers/ravi-asprox.pdf">http://www.isti.tu-berlin.de/fileadmin/fg214/Papers/ravi-asprox.pdf</a></p>
<h4>Anonymous Attacks HBGary</h4>
<p>Aaron Barr, CEO of the federal security contractor HBGary, talked smack on anonymous. He claimed to use social media techniques to infiltrate them, and was planning on selling their identities to the FBI. In February 2011, Anonymous used SQL injection to hack into hbgaryfederal.com&#8217;s custom web content management system. HBGary&#8217;s servers were broken into and its e-mails were pillaged and published to the world. HBGary no longer exists; part was sold to ManTech, and another part defunct.</p>
<p><a href="http://arstechnica.com/tech-policy/2011/02/anonymous-speaks-the-inside-story-of-the-hbgary-hack/">http://arstechnica.com/tech-policy/2011/02/anonymous-speaks-the-inside-story-of-the-hbgary-hack/</a></p>
<h2>Sources</h2>
<p><a href="http://en.wikipedia.org/wiki/SQL">http://en.wikipedia.org/wiki/SQL</a><br />
<a href="https://www.owasp.org/index.php/SQL_Injection">https://www.owasp.org/index.php/SQL_Injection</a> <a href="http://www.cisco.com/web/about/security/intelligence/sql_injection.html">http://www.cisco.com/web/about/security/intelligence/sql_injection.html</a> <a href="http://projects.webappsec.org/w/page/13246995/Web-Hacking-Incident-Database">http://projects.webappsec.org/w/page/13246995/Web-Hacking-Incident-Database</a> <a href="https://www.whitehatsec.com/assets/WPstats_summer12_12th.pdf">https://www.whitehatsec.com/assets/WPstats_summer12_12th.pdf</a></p>
<p>SQL Injection Attacks and Defense (Amazon) &#8211; <a href="http://www.amazon.com/gp/product/1597499633/ref=as_li_ss_il?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1597499633&amp;linkCode=as2&amp;tag=increavisibi-20"><img src="http://ws.assoc-amazon.com/widgets/q?_encoding=UTF8&amp;ASIN=1597499633&amp;Format=_SL110_&amp;ID=AsinImage&amp;MarketPlace=US&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=increavisibi-20" alt="" border="0" /></a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=increavisibi-20&amp;l=as2&amp;o=1&amp;a=1597499633" alt="" width="1" height="1" border="0" /></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://intellavis.com/blog/?feed=rss2&#038;p=400</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Derbycon: Sept 27 &#8211; 30</title>
		<link>http://intellavis.com/blog/?p=390</link>
		<comments>http://intellavis.com/blog/?p=390#comments</comments>
		<pubDate>Sat, 01 Sep 2012 19:15:19 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://intellavis.com/blog/?p=390</guid>
		<description><![CDATA[DerbyCon 2.0 will be held September 27-30th, 2012 in Louisville.]]></description>
				<content:encoded><![CDATA[<p><img class="alignnone" title="logo" src="https://www.derbycon.com/wp-content/themes/Derbycon2012/logo.png" alt="" width="281" height="46" /></p>
<blockquote><p> &#8221;Welcome to DerbyCon 2.0 – “The Reunion”. This is the place where security professionals from all over the world come to hang out. DerbyCon 2.0 will be held September 27-30th, 2012. DerbyCon 2011 pulled in over 1,100 people with an amazing speaker lineup and a family-like feel. We’ve listened to your feedback and plan on making this conference even better. Our goal is to keep it around the same size and maintain a close-knit conference where we all come together to learn and share ideas.&#8221;</p></blockquote>
<p><a href="https://www.derbycon.com/">https://www.derbycon.com/</a></p>
<p>Check out the schedule; I&#8217;m presenting in the Stable Talks track!<br />
<a href="https://www.derbycon.com/schedule/">https://www.derbycon.com/schedule/</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://intellavis.com/blog/?feed=rss2&#038;p=390</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
