<?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>SQL Server with Mr. Denny &#187; Exploit</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/sql-server/tag/exploit/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/sql-server</link>
	<description></description>
	<lastBuildDate>Wed, 19 Jun 2013 19:39:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Sensitive Data Must Be Encrypted</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/sensitive-data-must-be-encrypted/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/sensitive-data-must-be-encrypted/#comments</comments>
		<pubDate>Thu, 02 Aug 2012 16:00:00 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[Data Encryption]]></category>
		<category><![CDATA[Data Loss]]></category>
		<category><![CDATA[Data Security]]></category>
		<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[Database Design]]></category>
		<category><![CDATA[Database security]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[Exploit]]></category>
		<category><![CDATA[Hashing]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/?p=2148</guid>
		<description><![CDATA[The title of this post pretty much says it all.  If you store sensitive data in a database you have to work under the assumption that someone is going to try and break into the system and steal that data.  Thinking otherwise simply isn’t responsible as the developer and/or administrator of the system.  By not [...]]]></description>
				<content:encoded><![CDATA[<p>The title of this post pretty much says it all.  If you store sensitive data in a database you have to work under the assumption that someone is going to try and break into the system and steal that data.  Thinking otherwise simply isn’t responsible as the developer and/or administrator of the system.  By not encrypting your sensitive data, such as users logins and passwords you could easily enough end up like <a href="https://d33ds.co/archive/yahoo-disclosure.txt">Yahoo! did on July 11, 2012</a> with the usernames and passwords of all of the customers of a service being posted on the Internet for all to see.</p>
<p>Not only was this breach a major embarrassment for Yahoo! but it is a potential nightmare for their customers.  If those customers (there were a few hundred thousand in the list) use the same email address and password on other websites they’ve now had the username and password for those other services leaked as well.</p>
<p>Now I know that best practice for Internet security says that every website should have a different password, but for the bulk of Internet users this simply isn’t going to happen.  Among IT professionals the percentage of people that actually use a different password for each website is probably pretty close to zero.  I know that I personally use dozens of different websites a month, and for most people that it probably pretty normal between banks, credit card companies, Facebook, Twitter, work sites, Gmail, etc. that quickly gets up to dozens or hundreds of passwords which need to be remembered.  There are plenty of password vault type applications, but general Internet users aren’t going to be using them.  As IT professionals we need to remember that we are dealing with the general public and the general public isn’t going to know that they need to do this, no matter how many times we talk about it within the IT field.</p>
<p>One reason that there is lots of unencrypted data out there is that converting older applications from using plain text data to encrypted data is pretty hard to do.  There are lots of places within the application which need to be touched and there are possibly lots of different applications which need to be updated all at once.  Then there is the possibility of needing to take an outage to do the actual data change.  When it comes down to is biting the bullet and taking the outage and making the change.  It is well worth it to take the outage and encrypt all the data now, rather than have to worry about a data breach later.</p>
<p>There are lots of techniques which you can use to do this data encryption, to many to list in a single blog post so look for blog posts from me later on how to handle this change.  There are also plenty of consultants, including <a href="http://www.mrdenny.com">myself</a>, who are happy to help with projects like this.</p>
<p>Denny</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/sensitive-data-must-be-encrypted/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why is SQL Injection still a problem?</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/why-is-sql-injection-still-a-problem/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/why-is-sql-injection-still-a-problem/#comments</comments>
		<pubDate>Mon, 30 Jul 2012 16:00:00 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[Data Loss]]></category>
		<category><![CDATA[Data Security]]></category>
		<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[Database security]]></category>
		<category><![CDATA[Exploit]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/?p=2146</guid>
		<description><![CDATA[SQL Injection is probably the most popular attack vector for hackers when they attempt to break into databases.  The reason for this is that it is so easy for an attacker to gain access to the system, and typically to get pretty high level permissions to a database engine so that they can then export [...]]]></description>
				<content:encoded><![CDATA[<p>SQL Injection is probably the most popular attack vector for hackers when they attempt to break into databases.  The reason for this is that it is so easy for an attacker to gain access to the system, and typically to get pretty high level permissions to a database engine so that they can then export some of all of the data from the database engine.</p>
<p>The really sad thing about this is that it is very easy for software developers to protect against SQL Injection attacks.  The way that software developers protect the application from SQL Injection is by using parameterized queries instead of the older, and usually easier technique of simply building the database query using variables in the software code.</p>
<p>One of the reasons that I that I think that SQL Injection is just a big problem is thanks to the separation of duties that we have at most companies.  The reason that I say this is because the software developers that build the applications never have to deal with the cleanup from the SQL Injection attack.  Many developers, probably because they don’t work all that closely with database administrators, see SQL Injection as a SQL Server problem not an application problem.  This thinking would be wrong, as the only way to prevent SQL Injection problems is to protect the data at the application layer by using coding best practices like using parameterized queries like that shown below, taken from Chapter 8 of my book <a href="http://www.securingsqlserver.com">Securing SQL Server</a> (this sample is for VB.NET, the book includes examples in C# as well as VB.NET).</p>
<blockquote><p>Private Sub MySub()<br />
Dim Connection As SqlConnection<br />
Dim Results As DataSet<br />
Dim SQLda As SqlDataAdapter<br />
Dim SQLcmd As SqlCommand<br />
SQLcmd = New SqlCommand<br />
SQLcmd.CommandText = &#8220;sp_help_job&#8221;<br />
SQLcmd.CommandType = CommandType.StoredProcedure<br />
SQLcmd.Parameters.Add(&#8220;job_name&#8221;, SqlDbType.VarChar, 50)<br />
SQLcmd.Parameters.Item(&#8220;job_name&#8221;).Value = &#8220;test&#8221;<br />
Connection = New SqlConnection(&#8220;Data Source=localhost;Initial Catalog=msdb;Integrated Security=SSPI;&#8221;)<br />
Using Connection<br />
Connection.Open()<br />
SQLcmd.Connection = Connection<br />
SQLda = New SqlDataAdapter(SQLcmd)<br />
Results = New DataSet()<br />
SQLda.Fill(Results)<br />
End Using<br />
‘Do something with the results from the Results variable here.<br />
SQLcmd.Dispose()<br />
SQLda.Dispose()<br />
Results.Dispose()<br />
Connection.Close()<br />
Connection.Dispose()<br />
End Sub</p></blockquote>
<p>Now I freely admin that coding the .NET code this way is harder than using Dynamic SQL which is shown below.</p>
<blockquote><p>Private Sub MySub()<br />
Dim Connection As SqlConnection<br />
Dim Results As DataSet<br />
Dim SQLda As SqlDataAdapter<br />
Dim SQLcmd As SqlCommand<br />
SQLcmd = New SqlCommand<br />
SQLcmd.CommandText = &#8220;exec sp_help_job @job_name=&#8217;&#8221; + MyVBNetVariableWithTheJobName + &#8220;&#8216;&#8221;<br />
SQLcmd.CommandType = CommandType.Text;<br />
Connection = New SqlConnection(&#8220;Data Source=localhost;Initial Catalog=msdb;Integrated Security=SSPI;&#8221;)<br />
Using Connection<br />
Connection.Open()<br />
SQLcmd.Connection = Connection<br />
SQLda = New SqlDataAdapter(SQLcmd)<br />
Results = New DataSet()<br />
SQLda.Fill(Results)<br />
End Using<br />
‘Do something with the results from the Results variable here.<br />
SQLcmd.Dispose()<br />
SQLda.Dispose()<br />
Results.Dispose()<br />
Connection.Close()<br />
Connection.Dispose()<br />
End Sub</p></blockquote>
<p>The problem that I have with application developers taking the easy, shorter way out is that their job isn’t to take the easy way out.  Their job is to build the application securing and robustly, not in such a way that the application is as easy as possible to write.  This problem can probably be traced back to the specifications which were written for the application which probably don’t mention security at all anywhere in the specification from the business unit.  Because security isn’t a primary concern for the business unit it is left as an afterthought, an afterthought which is typically ignored until after there has been a breech.</p>
<p>Another reason that I think that SQL Injection is a problem is that we trust that our users wouldn’t want to do anything to hurt our applications or their data as they have a vested interest in keeping the system working correctly.  And this is true to some extent.  However when you publish an application on the public Internet not only will you customers be using it, but others will be attempting to hit the forms within the application.  Because of this, we can’t trust any input that the application user passes in.  Even if the value that is passed in is from a hidden field, or has been validated by the front end. If the value hasn’t been validated by the back end, and properly scrubbed then it shouldn’t be trusted.  And the only way to fully validate and scrub the value is to use the parameterized query technique which I showed above, no other technique no matter how clever will be as successful.</p>
<p>I’ve been working in the IT space for about 15 years now, and I’ve worked on dozens of application development projects over the years at companies large and small, and I can’t recall a single application design specification which included security of the data as a component of the application development.  As the production DBA for companies I’ve forced the issue when I would find problems early enough in the development cycle, but often I wouldn’t find out about the application that was being built until it was time to deploy the application to production.  At this point it is to late to make the kinds of major changes which need to be made, and because security doesn’t add value to the application or to the business unit security isn’t given the developer or QA resources which are needed to make the changes needed to properly secure the data from potential attackers.</p>
<p>I urge everyone that reads this, developers and administrators alike, to look at how applications within your environment connection to the database engine (it doesn’t matter what database engine you use, they can all be broken into via SQL Injection, and yes MySQL is included in this) and if dynamic SQL is being used, and isn’t being properly parameterized talk to upper management about this problem.  Explain to them that while this won’t be something which adds features to the application and won’t necessarily add value to the business, this is something which absolutely needs to be resolved.</p>
<p>Suffering from a SQL Injection breach will have a negative impact on the company, and the IT department in several ways.  From the company side of things customers will loose confidence in the company, which means that they will stop purchasing your product or using your service.  This means that the company will make less money.</p>
<p>Internally the business unit will loose faith in the IT staff as they can’t properly secure their applications from attackers.  The business unit will then loose faith in the developers as the IT staff explains that the only way to protect 100% against this sort of attack is to fix the application which means lots of time (possibly hundreds or thousands of man hours) just fixing database access code and not adding functionally into the application.  The business unit will then assume that the developers aren’t good developers and may request that new developers be brought in, that the application development be outsourced, or that a third party application be purchased.  All of which mean that you and/or your coworkers could easily be out on the street looking for more work.</p>
<p>If you are working on a new development project and security isn’t included in the specification push to have it added.  Yes it will slow the delivery of the application down, but it will remove the risk of a data breach, or worse than that a total network breach (where the attacker is able to get into the company network and take control of internal resources like domain controllers, file servers, etc.) which would be a major disaster  to any company no matter how large or small.</p>
<p>I hope that you take this to heart and fix any applications in your environment which have SQL Injection issues so that we can all stop reading about these data breaches which are coming all to often.</p>
<p>Denny</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/why-is-sql-injection-still-a-problem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>sp_replwritetovarbin Heap Overflow Code Exploit Code In The Wild, Works By Using Our Good Friend SQL Injection</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/sp_replwritetovarbin-heap-overflow-code-exploit-code-in-the-wild-works-by-using-our-good-friend-sql-injection/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/sp_replwritetovarbin-heap-overflow-code-exploit-code-in-the-wild-works-by-using-our-good-friend-sql-injection/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 23:30:06 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[Denis Gobo]]></category>
		<category><![CDATA[Exploit]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/sp_replwritetovarbin-heap-overflow-code-exploit-code-in-the-wild-works-by-using-our-good-friend-sql-injection/</guid>
		<description><![CDATA[For those living under a rock there is a new SQL exploit in the wild. Dennis did an excellent write up of it already so I&#8217;ll refer you do &#60;. for his entry and save myself the time of writing what has already been written. Denny]]></description>
				<content:encoded><![CDATA[<p>For those living under a rock there is a new SQL exploit in the wild.</p>
<p>Dennis did an excellent write <a href="http://blogs.lessthandot.com/index.php?p=268" target="_blank">up of it already</a> so I&#8217;ll refer you do &lt;. for his entry and save myself the time of writing what has already been written.</p>
<p>Denny</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/sp_replwritetovarbin-heap-overflow-code-exploit-code-in-the-wild-works-by-using-our-good-friend-sql-injection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
