<?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>Web Development is my life &#187; Instances</title>
	<atom:link href="http://www.acidrazor.com/blog/tag/instances/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.acidrazor.com/blog</link>
	<description>a resource of everything I know about Web Development or related technology including some articles I find interesting</description>
	<lastBuildDate>Tue, 17 Nov 2009 09:55:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How to find + stop SQL injection attacks</title>
		<link>http://www.acidrazor.com/blog/how-to-find-stop-sql-injection-attacks/</link>
		<comments>http://www.acidrazor.com/blog/how-to-find-stop-sql-injection-attacks/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 16:08:35 +0000</pubDate>
		<dc:creator>AcidRaZor</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Classic ASP]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[IIS 6.0]]></category>
		<category><![CDATA[Programming 101]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Attacker]]></category>
		<category><![CDATA[Attempt]]></category>
		<category><![CDATA[Bot]]></category>
		<category><![CDATA[Brute Force Approach]]></category>
		<category><![CDATA[Centralized Database]]></category>
		<category><![CDATA[Database Connection]]></category>
		<category><![CDATA[Database Structure]]></category>
		<category><![CDATA[Database User]]></category>
		<category><![CDATA[Db Access]]></category>
		<category><![CDATA[Instances]]></category>
		<category><![CDATA[Isapi Filter]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Privileges]]></category>
		<category><![CDATA[Queries]]></category>
		<category><![CDATA[Sorts]]></category>
		<category><![CDATA[Sql Injection]]></category>
		<category><![CDATA[Urls]]></category>
		<category><![CDATA[Variety]]></category>
		<category><![CDATA[Virus]]></category>

		<guid isPermaLink="false">http://www.acidrazor.com/blog/?p=90</guid>
		<description><![CDATA[There’s a lot of stuff out there about SQL injection attacks, but there’s not much that will help you figure out how to stop these attacks from occurring.
First, let’s talk about what a SQL Injection Attack really is. Some people think it’s a virus of sorts, that is “inside your site.” Not the case. These [...]]]></description>
			<content:encoded><![CDATA[<p>There’s a lot of stuff out there about SQL injection attacks, but there’s not much that will help you figure out how to stop these attacks from occurring.</p>
<p>First, let’s talk about what a SQL Injection Attack really is. Some people think it’s a virus of sorts, that is “inside your site.” Not the case. These are bot attacks by other virus infected computers. They simply use a brute force approach of scanning URLs that take POST/GET inputs and attempt to send their own data to them.</p>
<p>So, how do you track these down and stop them?  For web sites powered by Microsoft’s IIS, here are our suggestions:</p>
<ol>
<li><strong>Look at your IIS logs<br />
</strong>Try searching for the word “DECLARE” or “EXECUTE.” If you’ve been hit by an attack, these will more than likely show up in your IIS logs — at least for any attack that was attempted using “GET” posts. If you do find any instances of “DECLARE” or “EXECUTE” these are the pages to start with.</li>
<li><strong>Use centralized database connection handling<br />
</strong>Simple, make a centralized file (e.g. connection.asp if you are using ASP<a href="http://www.sqlcleanup.com/connection.txt" target="_blank"></a>) that handles all of your DB access. This way, it’s easier to make sure that you are SQL encoding your pages. You can easily search queries for “DECLARE” and “EXECUTE” and stop the attacks dead in their tracks.</li>
<li><strong>Implement a site wide solution<br />
</strong>If you are running your own server, we highly recommend ISAPI_Rewrite from HeliconTech (<a href="http://www.helicontech.com/isapi_rewrite">http://www.helicontech.com/isapi_rewrite</a>). This is an ISAPI filter that allows you to do a variety of things, including scan URL data. This will stop 99% of attacks without changing ANY code on your site!\</li>
<li>Never use &#8220;sa&#8221; as your database user, create a user for the database you&#8217;re working from and then remove privileges to read the master dbo. This prevents the attacker from &#8220;sniffing&#8221; your database structure, however, these attacks have evolved so that sanitized stored procedure based attacks happen even with these types of security in place. See http://www.ngssoftware.com/papers/more_advanced_sql_injection.pdf for more information on this and other ideas in preventing SQL Injection attacks.</li>
</ol>
<p>If you&#8217;ve ever been scratching your head wondering where the leak in your programming is (or have taken over a project from someone else) then the best way to determine through which page the attack happened is by checking out the IIS logs.</p>
<p>There are many scripts available to clean up, but the best tip is to backup hourly, and to follow best practices (some of which I highlighted here). Good luck</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acidrazor.com/blog/how-to-find-stop-sql-injection-attacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a Linked Server in SQL 2005 express to connect to Excel</title>
		<link>http://www.acidrazor.com/blog/using-a-linked-server-in-sql-2005-express-to-connect-to-excel/</link>
		<comments>http://www.acidrazor.com/blog/using-a-linked-server-in-sql-2005-express-to-connect-to-excel/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 07:06:10 +0000</pubDate>
		<dc:creator>AcidRaZor</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Alias]]></category>
		<category><![CDATA[Collate]]></category>
		<category><![CDATA[Data Source]]></category>
		<category><![CDATA[Excel Microsoft]]></category>
		<category><![CDATA[Excel Spreadsheets]]></category>
		<category><![CDATA[Excel Sql]]></category>
		<category><![CDATA[Exec]]></category>
		<category><![CDATA[Express]]></category>
		<category><![CDATA[Instances]]></category>
		<category><![CDATA[Jet Oledb]]></category>
		<category><![CDATA[Language Differences]]></category>
		<category><![CDATA[Little Gem]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Microsoft Jet]]></category>
		<category><![CDATA[Relational Database]]></category>
		<category><![CDATA[Server Data]]></category>
		<category><![CDATA[Sp Addlinkedserver]]></category>
		<category><![CDATA[Sql Example]]></category>
		<category><![CDATA[Sql Statement]]></category>

		<guid isPermaLink="false">http://www.acidrazor.com/blog/?p=58</guid>
		<description><![CDATA[I&#8217;m quite frustrated when it comes to the DTS options lacking in SQL 2005 Express, especially when it comes to importing excel spreadsheets into a table so I can reference it easy within a T-SQL statement to import data into my already existing relational database.
Eventually I found a little gem that seemed to work:

1
2
3
4
5
6
7
8
9
EXEC SP_ADDLINKEDSERVER [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m quite frustrated when it comes to the DTS options lacking in SQL 2005 Express, especially when it comes to importing excel spreadsheets into a table so I can reference it easy within a T-SQL statement to import data into my already existing relational database.</p>
<p>Eventually I found a little gem that seemed to work:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">EXEC</span> <span style="color: #AF0000;">SP_ADDLINKEDSERVER</span> <span style="color: #FF0000;">'EXCEL2'</span>,
	<span style="color: #FF0000;">'Excel'</span>,
	<span style="color: #FF0000;">'Microsoft.Jet.OLEDB.4.0'</span>,
	<span style="color: #FF0000;">'D:<span style="color: #000099; font-weight: bold;">\d</span>ata.xls'</span>,
	<span style="color: #808080;">NULL</span>,
	<span style="color: #FF0000;">'Excel 8.0'</span>,
	<span style="color: #808080;">NULL</span>
&nbsp;
<span style="color: #0000FF;">SELECT</span> <span style="color: #808080;">*</span> <span style="color: #0000FF;">FROM</span> excel2...<span style="color: #202020;">a</span>$ <span style="color: #0000FF;">WHERE</span> <span style="color: #808080;">&#91;</span>Whatever <span style="color: #0000FF;">COLUMN</span><span style="color: #808080;">&#93;</span> <span style="color: #0000FF;">IS</span> null</pre></td></tr></table></div>

<p>Effectively you alias the excel document as a linked sql server (in this example, excel2). You only have to do this once. Once it&#8217;s setup it works until you de-link the server alias (or you move the data source)</p>
<p>This helped me tremendously in getting data and querying it with T-SQL without having to import it like I&#8217;m used to with DTS. You might want to be on the look-out for language differences between the two, but a simple COLLATE DATABASE DEFAULT should do the trick in most instances when inner join&#8217;ing or comparing two different server data.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acidrazor.com/blog/using-a-linked-server-in-sql-2005-express-to-connect-to-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
